The gpio interface


#1

gpio allows access to a specific GPIO pin. The interface is restricted because it provides privileged access to GPIO hardware.

Auto-connect: no
Attributes:

  • number (slot): GPIO pin number to export and expose to consuming snaps

Snaps that want to consume a gpio device simply plugs: [ gpio ] and the gpio device to connect is specified during interface connection. Available gpio devices for the system can be seen with snap interfaces. Once connected, the consuming snap can use the device via /sys/class/gpio/gpioN where N is the pin number specified by the connected slot.

ⓘ This is a snap interface. See Interface management and Supported interfaces for further details on how interfaces are used.