[英]Linux enable pca9685 in sysfs
I would like to enable a PCA9685
as a PWM
in /sys/class/pwm/
.我想在
/sys/class/pwm/
启用PCA9685
作为PWM
。
The Platform is a Raspberry Pi 2
and the chip is connected to /dev/i2c-1
.平台是
Raspberry Pi 2
,芯片连接到/dev/i2c-1
。
I find the chip with i2c-detect
, but i don't know how do I enable this driver: http://lxr.free-electrons.com/source/drivers/pwm/pwm-pca9685.c .我找到了带有
i2c-detect
的芯片,但我不知道如何启用此驱动程序: http : //lxr.free-electrons.com/source/drivers/pwm/pwm-pca9685.c 。 I also found this but it doesn't tell me how to configure sysfs
to use this driver: https://www.kernel.org/doc/Documentation/pwm.txt .我也发现了这个,但它没有告诉我如何
configure sysfs
来使用这个驱动程序: https : //www.kernel.org/doc/Documentation/pwm.txt 。
You need to enable CONFIG_PWM_PCA9685
in your .config
file of your linux-kernel
.您需要在
linux-kernel
.config
文件中启用CONFIG_PWM_PCA9685
。 By default, CONFIG_PWM_PCA9685 is not set
and you need to enable it as CONFIG_PWM_PCA9685=y
if you want to build it as a part of kernel image, or as CONFIG_PWM_PCA9685=m
if you want to build it as a LKM
.默认情况下,
CONFIG_PWM_PCA9685 is not set
,如果要将其构建为内核映像的一部分,则需要将其启用为CONFIG_PWM_PCA9685=y
如果要将其构建为LKM
, CONFIG_PWM_PCA9685 is not set
需要将其启用为CONFIG_PWM_PCA9685=m
。
Also make sure that CONFIG_SYSFS
is enabled
in your .config
.还要确保
CONFIG_SYSFS
在您的.config
enabled
。 If CONFIG_SYSFS
is enabled in your kernel configuration, a simple sysfs
interface is provided to use the PWMs
from userspace.如果在内核配置中启用了
CONFIG_SYSFS
,则会提供一个简单的sysfs
接口来使用来自用户空间的PWMs
。 It is exposed at /sys/class/pwm/
.它暴露在
/sys/class/pwm/
。 Each probed PWM controller/chip
will be exported as pwmchipN
, where N
is the base of the PWM chip
.每个探测到的
PWM controller/chip
将作为pwmchipN
导出,其中N
是PWM chip
的基数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.