|
板载的GPIO3_20,应该是3*32+20=116吗?
无论是通过自己写驱动,导出设置IO电平,还是通过/sys/class/gpio操作,均不能让他点亮.
已知GPIO模式是通用GPIO了.相应控制寄存器是0x0001000E,其中E就是GPIO的复用.
什么时候创龙才有代码高亮啊.下面是尝试记录:
root@am57xx-evm:~# devmem2 0x4a003534
/dev/mem opened.
Memory mapped at address 0xb6f15000.
Read at address 0x4A003534 (0xb6f15534): 0x0001000E
root@am57xx-evm:~# insmod leds.ko
[ 34.862678] my_leds test init
[ 34.865672] my_leds major = 244
root@am57xx-evm:~# echo 1 > /dev/my_leds
[ 43.262784] gpio set
root@am57xx-evm:~# echo 0 > /dev/my_leds
[ 47.122718] gpio rst
root@am57xx-evm:~# rmmod leds
[ 57.017296] my_leds test remove
root@am57xx-evm:~# cd /sys/class/gpio/
root@am57xx-evm:/sys/class/gpio# echo 116 > export
root@am57xx-evm:/sys/class/gpio# cd gpio116
root@am57xx-evm:/sys/class/gpio/gpio116# echo out > direction
root@am57xx-evm:/sys/class/gpio/gpio116# echo 1 > value
root@am57xx-evm:/sys/class/gpio/gpio116# echo 0 > value
|
|