Gpio provides high level access to GPIO pins through the Linux
See Gpio chapter for details.
Close this port.
Register an interrupt handler to listen for GPIO output changes. The
modeshould be one of the strings "rising", "falling" or "both" to indicate which edge(s) the ISR is to be triggered on. Invoke the given callback function when a change occurs. This method will block listening until close is called.
timeoutis non-null, then
callbackwill be invoked at every duration of
timeoutregardless of whether a state change occurred. If
timeoutis null, this method blocks until a state change is detected.
Note that after calling
listen, you will receive an initial callback with the state of the pin. This prevents the race condition between getting the initial state of the pin and turning on interrupts.
Open a GPIO port with given pin and direction, where
Read the current value of the pin.
Write the given value to the GPIO. The GPIO should be configured as an output. Valid values are
0for logic low, or
1for logic high. Other non-zero values will result in logic high being output. Returns this.