君正X1000 PWM4蜂鸣器该如何调试?
我kernel配置如下:
Device Drivers --->
Input device support --->
* Miscellaneous devices --->
* PWM beeper support (NEW)
->Device Drivers
-> Pulse-Width Modulation (PWM) Support (PWM [=y])
--- Pulse-Width Modulation (PWM) Support
* JZPWM support for LED or Beeper drivers
* JZ PWM driver
*** JZ PWM function pinselect ***
* GPIO Port pwm0
* GPIO Port pwm4
应用上需要什么操作?大神们方便帮忙看下,非常感谢!
离线
后来一搜, 这位网友讲得非常详细
君正X系列开发11---pwm配置、分析
https://blog.csdn.net/cyf15238622067/article/details/80215345
如果pwm驱动蜂鸣器,配置
Device Drivers --->
Input device support --->
[ *] Miscellaneous devices --->< * > PWM beeper support (NEW)
操作如下:
#
# echo timer > /sys/class/leds/leds_pwm4/trigger
# echo none > /sys/class/leds/leds_pwm4/trigger
# echo 255 > /sys/class/leds/leds_pwm4/trigger
sh: write error: Invalid argument
# echo 255 > /sys/class/leds/leds_pwm4/brightness
# echo 0 > /sys/class/leds/leds_pwm4/brightness
# echo 255 > /sys/class/leds/leds_pwm4/brightness
# echo 0 > /sys/class/leds/leds_pwm4/brightness
# echo 255 > /sys/class/leds/leds_pwm4/brightness# echo 0 > /sys/class/leds/leds_pwm4/brightness
离线