T113 设备IO的配置
vim kernel/linux-5.4/arch/arm/boot/dts/rp-t113.dts
=========================
PG1 (output): 6*32+1 = 193
echo 193 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio193/direction
echo 1 > /sys/class/gpio/gpio193/value
echo 0 > /sys/class/gpio/gpio193/direction
=========================
PD22 (output): 3*32+22 = 118
echo 118 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio118/direction
echo 1 > /sys/class/gpio/gpio118/value
echo 0 > /sys/class/gpio/gpio118/value
PWM (背光控制)
init (/etc/init.d/rcS)
echo 6 > /sys/class/pwm/pwmchip0/export
echo 0 > /sys/class/pwm/pwmchip0/pwm6/enable
echo 1000000 > /sys/class/pwm/pwmchip0/pwm6/period
echo 1000000 > /sys/class/pwm/pwmchip0/pwm6/duty_cycle
echo 1 > /sys/class/pwm/pwmchip0/pwm6/enable
------------------------------------------
echo 100000 > /sys/class/pwm/pwmchip0/pwm6/duty_cycle (10%亮度)
echo 400000 > /sys/class/pwm/pwmchip0/pwm6/duty_cycle (40%亮度)
echo 1000000 > /sys/class/pwm/pwmchip0/pwm6/duty_cycle (100%亮度)
阅读(679) | 评论(0) | 转发(0) |