Command-line client
With the manager running the user can run gpiocli to control GPIOs by
asking the gpio-manager to act on their behalf.
Examples
Detect chips in the system:
$ gpiocli detect
gpiochip0 [INT34C6:00] (463 lines)
Request a set of lines:
Note
gpiocli exits immediately but the state of the lines is retained because it’s the gpio-manager that requested them.
$ gpiocli request --output foo=active
request0
Previous invocation printed out the name of the request by which the caller can refer to it later. All active requests can also be inspected at any time:
$ gpiocli requests
request0 (gpiochip1) Offsets: [5]
Print the information about the requested line using the information above:
$ gpiocli info --chip=gpiochip1 5
gpiochip1 5: "foo" [used,consumer="gpiocli request",managed="request0",output,push-pull]
Change the value of the line:
$ gpiocli set foo=inactive
Read it back:
$ gpiocli get foo
"foo"=inactive
We can even reconfigure it to input and enable edge-detection:
$ gpiocli reconfigure --input --both-edges request0
And wait for edge events:
$ gpiocli monitor cos
21763952894920 rising "foo"
And finally release the request:
$ gpiocli release request0
Note
For more information please refer to the output of gpiocli --help as
well as gpiocli <command> --help which prints detailed info on every
available command.
Note
Users can talk to gpio-manager using any D-Bus library available and are not limited to the provided client.