If you are using Debian Buster 10 install gpiod by typing these commands:
sudo apt update
sudo apt install gpiod
Six command-line tools are available:
* gpiodetect - list all gpiochips present on the system, their names, labels
and number of GPIO lines
* gpioinfo - list all lines of specified gpiochips, their names, consumers,
direction, active state and additional flags
* gpioget - read values of specified GPIO lines
* gpioset - set values of specified GPIO lines, potentially keep the lines
exported and wait until timeout, user input or signal
* gpiofind - find the gpiochip name and line offset given the line name
* gpiomon - wait for events on GPIO lines, specify which events to watch,
how many events to process before exiting or if the events
should be reported to the console
sudo gpiodetect
gpiochip0 [fc038000.pinctrl] (128 lines)
sudo gpioinfo fc038000.pinctrl
line 0: "PA0" unused input active-high
line 1: "PA1" unused input active-high
line 2: "PA2" unused input active-high
line 3: "PA3" unused input active-high
line 4: "PA4" unused input active-high
...
line 123: "PD27" unused input active-high
line 124: "PD28" unused input active-high
line 125: "PD29" unused input active-high
line 126: "PD30" unused input active-high
line 127: "PD31" unused input active-high
sudo gpiofind "PA24"
reply -> gpiochip0 24
sudo gpioget gpiochip0 24
reply -> 1
wire PA24 to GND and try again:
sudo gpioget gpiochip0 24
reply -> 0
sudo gpioget --active-low gpiochip0 24 25
reply -> 1 1
sudo gpioset gpiochip0 24=1
sudo gpioset --mode=wait `gpiofind "PA24"`=1
sudo gpioset --mode=time --sec=1 gpiochip0 34=0
sudo gpiomon --num-events=3 --rising-edge gpiochip0 24
reply --> event: RISING EDGE offset: 3 timestamp: [ 1151.814356387]
reply --> event: RISING EDGE offset: 3 timestamp: [ 1151.815449803]
reply --> event: RISING EDGE offset: 3 timestamp: [ 1152.091556803]
sudo gpiomon --format="%e %o %s %n" --falling-edge gpiochip0 24
reply --> 0 25 1156 615459801
sudo gpiomon --num-events=1 --silent `gpiofind "PA24"`
sudo gpiomon --silent --num-events=1 gpiochip0 24 25 31