GPIOD User Guide¶
This document lists the common gpiod commands for Quectel Pi M1/L1. The checked board uses libgpiod v1.6.3, so this page uses v1 syntax.
Install and Check¶
sudo apt update
sudo apt install -y gpiod
gpiodetect --version
gpiodetect
gpioinfo
Command |
Purpose |
|---|---|
|
View GPIO controllers |
|
View GPIO line status and usage/ownership |
|
Read input state |
|
Set output state |
|
Monitor edge events |
Controller Example¶
gpiochip0 [400000.pinctrl] (114 lines)
gpiochip1 [1c40000.qcom,spmi:qcom,pm6125@0] (9 lines)
gpiochip2 [soc:spf_core_platform:lpi_pinct] (19 lines)
Common Commands¶
# Show main controller lines
gpioinfo /dev/gpiochip0
# Read line 36 on gpiochip0
gpioget gpiochip0 36
# Drive high for 5 seconds
gpioset --mode=time --sec=5 gpiochip0 36=1
# Monitor rising edge events
gpiomon --rising-edge gpiochip0 36
Version Difference¶
Function |
Current M1 v1 Syntax |
Syntax That May Appear in Newer Materials |
|---|---|---|
Read |
|
|
Output hold |
|
|
Rising-edge monitoring |
|
|
Notes¶
GPIO line offset is not the physical header pin number.
Do not control lines marked with
[used]or an existing consumer.After
gpiosetexits, output state may return to default; do not rely on residual level.