GPIO driver: register all pintypes as generic /dev/gpioN

This commit is contained in:
Jari van Ewijk
2021-12-09 20:05:20 +01:00
committed by Xiang Xiao
parent efc949bceb
commit 2e47ef32cf
9 changed files with 142 additions and 96 deletions
@@ -57,15 +57,15 @@ GPIO9 as an interrupt pin.
At the nsh, we can turn the outputs on and off with the following::
nsh> gpio -o 1 /dev/gpout0
nsh> gpio -o 1 /dev/gpout1
nsh> gpio -o 1 /dev/gpio0
nsh> gpio -o 1 /dev/gpio1
nsh> gpio -o 0 /dev/gpout0
nsh> gpio -o 0 /dev/gpout1
nsh> gpio -o 0 /dev/gpio0
nsh> gpio -o 0 /dev/gpio1
We can use the interrupt pin to send a signal when the interrupt fires::
nsh> gpio -w 14 /dev/gpint2
nsh> gpio -w 14 /dev/gpio2
The pin is configured as a rising edge interrupt, so after issuing the
above command, connect it to 3.3V.
@@ -102,12 +102,12 @@ This is a test for the GPIO driver. It includes the 3 LEDs and one, arbitrary, G
For this example, GPIO22 was used.
At the nsh, we can turn LEDs on and off with the following::
nsh> gpio -o 1 /dev/gpout0
nsh> gpio -o 0 /dev/gpout1
nsh> gpio -o 1 /dev/gpio0
nsh> gpio -o 0 /dev/gpio0
We can use the interrupt pin to send a signal when the interrupt fires::
nsh> gpio -w 14 /dev/gpint0
nsh> gpio -w 14 /dev/gpio2
The pin is configured to as a rising edge interrupt, so after issuing the
above command, connect it to 3.3V.