4. GPIO Operations
This section provides commands to configure GPIO:
4.1. Configuring GPIO
1. To configure GPIO, perform the following:
Execute the following command to configure GPIO44:
cd /sys/class/gpio
echo 44 > export
2. Locate to the GPIO44 directory:
cd gpio44
Note:
In this command,
44
represents the Sys number of the pin. For more information, see
3. Configure the direction of GPIO44 as in:
echo in > direction
4. Alternatively, configure the direction of GPIO44 as out:
echo out > direction
5. Configure the voltage level of GPIO44 as high:
echo 1 > value
Tip:
You can use an oscilloscope to check the voltage level.
6. Configure the voltage level of GPIO44 as low:
echo 0 > value
Tip:
You can use an oscilloscope to check the voltage level.
7. Connect the
3.3V Power
pin with the GPIO44, and check the voltage level of GPIO44:
cat value
8. Connect the
GND
pin with the GPIO44, and check the voltage level of GPIO44:
cat value
15
© 2018-2022 StarFive Technology
All rights reserved
StarFive