Labs
File System Labs
GPIO (General Purpose Input Output)
root@board:~# dmesg | grep -i gpio
root@board:~# ls /sys/class/gpio/
root@board:~# ls /sys/class/gpio/gpio13
root@board:~# echo 13 > /sys/class/gpio/export
root@board:~# ls /sys/class/gpio/gpio13
active_low direction drive edge power subsystem uevent value
root@board:~# echo in > /sys/class/gpio/gpio13/direction
root@board:~# echo out > /sys/class/gpio/gpio13/direction
root@board:~# echo 1 > /sys/class/gpio/gpio13/value
root@board:~# cat /sys/class/gpio/gpio13/value
root@board:~# echo 0 > /sys/class/gpio/gpio13/value
root@board:~# cat /sys/class/gpio/gpio13/value
I2C (Inter-IC)
root@board:~# dmesg | grep -i i2c
root@board:~# ls /sys/class/i2c-dev/
i2c-0 i2c-1 i2c-2 i2c-3 i2c-4 i2c-5 i2c-6 i2c-7
root@board:~# i2cdetect -y -r <Bus>
root@board:~# i2cdump -f -y <Bus> <0xAddress>
Last updated