sysfs pwm接口是否使用硬件pwm?

Is the sysfs pwm interface using hardware pwm?

我遵循了this answer to enable PWM on my Beaglebone Black, but I wasn't sure if that method is using the PRU to do hardware PWM or if it's toggling the pin in software? I see other references to /sys/class/pwm/ehrpwm (e.g. here),我更有信心是硬件 PWM,但我不确定如何启用该接口。

总结一下我是如何启用 PWM 的:

echo am33xx_pwm > /sys/devices/bone_capemgr.9/slots
echo cape-universal > /sys/devices/bone_capemgr.9/slots
config-pin P8.13 pwm
echo 6 > /sys/class/pwm/export
echo 1 > /sys/class/pwm/pwm6/run
echo 50000 > /sys/class/pwm/pwm6/period_ns
echo 50000 > /sys/class/pwm/pwm6/duty_ns

谢谢!

是的,那是使用硬件 PWM 模块 - am33xx_pwm 覆盖启用所有不同的 PWM 子系统(eHRPWM、eCAP),然后 PWM 内核驱动程序为正在配置的引脚配置相应的 PWM 模块。