GPIO Pins Control - HummingBoard Pulse/Mate & i.MX8M Plus SOM
===================================================
# Export GPIO XX
===================================================
XX=<GPIO-Linux-Number>
echo ${XX} > /sys/class/gpio/export
# Set GPIO pin Direction Output/Input
===================================================
# 1- Output ->
===================================================
echo "out" > /sys/class/gpio/gpio${XX}/direction
# Set the output value
# High
echo 1 > /sys/class/gpio/gpio${XX}/value
# or LOW
echo 0 > /sys/class/gpio/gpio${XX}/value
===================================================
# 2- Input ->
===================================================
echo "in" > /sys/class/gpio/gpio${XX}/direction
# Get the input value
cat /sys/class/gpio/gpio${XX}/value
===================================================
# Unexport GPIO XX
===================================================
echo ${XX} > /sys/class/gpio/unexport

PreviousGetting started with HUMMINGBOARD 8P EDGE AINextGPIO Pins Control - HummingBoard Ripple/Pulse & i.MX8M Mini SOM
Last updated