通过内存映射读取GPIO已有详细记录。但是通过设备树表读取它们会是什么? 我们以SAMA5D3x评估板为例。 sys下的设备树如下所示:
root@sama5d3xek:/sys# find . -name gpio
./devices/soc0/ahb/ahb:apb/ahb:apb:pinctrl@fffff200/fffffa00.gpio/gpio
./devices/soc0/ahb/ahb:apb/ahb:apb:pinctrl@fffff200/fffff600.gpio/gpio
./devices/soc0/ahb/ahb:apb/ahb:apb:pinctrl@fffff200/fffff800.gpio/gpio
./devices/soc0/ahb/ahb:apb/ahb:apb:pinctrl@fffff200/fffff200.gpio/gpio
./devices/soc0/ahb/ahb:apb/ahb:apb:pinctrl@fffff200/fffff400.gpio/gpio
./class/gpio
./kernel/debug/gpio
例如:
任何想法怎么做?