Photonicat GPIO扩展说明: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
[[image:Gpio_pins_pic.jpg|500px]] | [[image:Gpio_pins_pic.jpg|500px]] | ||
==gpio control (linux user space)== | |||
<pre> | |||
:/ # ls /sys/class/gpio/ | |||
export gpiochip128 gpiochip32 gpiochip64 unexport | |||
gpiochip0 gpiochip255 gpiochip500 gpiochip96 | |||
:/ # echo 157 > /sys/class/gpio/export | |||
:/ # ls /sys/class/gpio/ | |||
export gpiochip0 gpiochip255 gpiochip500 gpiochip96 | |||
gpio157 gpiochip128 gpiochip32 gpiochip64 unexport | |||
:/ # ls /sys/class/gpio/gpio157 | |||
active_low device direction edge power subsystem uevent value | |||
:/ # cat /sys/class/gpio/gpio157/direction | |||
in | |||
:/ # cat /sys/class/gpio/gpio157/value | |||
0 | |||
</pre> |
Latest revision as of 12:55, 25 October 2023
Photonicat 的PCBA上提供了一些可扩展的GPIO或 UART, I2C, USB, PWM, IR, 其他功能口,可以用于扩展其他爱好者433Mhz模块或其他应用。
gpio control (linux user space)
:/ # ls /sys/class/gpio/ export gpiochip128 gpiochip32 gpiochip64 unexport gpiochip0 gpiochip255 gpiochip500 gpiochip96 :/ # echo 157 > /sys/class/gpio/export :/ # ls /sys/class/gpio/ export gpiochip0 gpiochip255 gpiochip500 gpiochip96 gpio157 gpiochip128 gpiochip32 gpiochip64 unexport :/ # ls /sys/class/gpio/gpio157 active_low device direction edge power subsystem uevent value :/ # cat /sys/class/gpio/gpio157/direction in :/ # cat /sys/class/gpio/gpio157/value 0