mraa
0.9.0
Low Level Skeleton Library for Communication on GNU/Linux platforms
|
This file defines the gpio interface for libmraa
Public Member Functions | |
synchronized void | delete () |
Gpio (int pin, boolean owner, boolean raw) | |
Gpio (int pin, boolean owner) | |
Gpio (int pin) | |
Result | edge (Edge mode) |
Result | isr (Edge mode, IsrCallback cb) |
Result | isrExit () |
Result | mode (Mode mode) |
Result | dir (Dir dir) |
int | read () |
Result | write (int value) |
Result | useMmap (boolean enable) |
int | getPin (boolean raw) |
int | getPin () |
Gpio | ( | int | pin, |
boolean | owner, | ||
boolean | raw | ||
) |
Instanciates a Gpio object
pin | pin number to use |
owner | (optional) Set pin owner, default behaviour is to 'own' the pin if we exported it. This means we will close it on destruct. Otherwise it will get left open. This is only valid in sysfs use cases |
raw | (optional) Raw pins will use gpiolibs pin numbering from the kernel module. Note that you will not get any muxers set up for you so this may not always work as expected. |
int getPin | ( | boolean | raw | ) |
Get pin number of Gpio. If raw param is True will return the number as used within sysfs. Invalid will return -1.
raw | (optional) get the raw gpio number. |
Result isrExit | ( | ) |
Exits callback - this call will not kill the isr thread immediatly but only when it is out of it's critical section
Result useMmap | ( | boolean | enable | ) |
Result write | ( | int | value | ) |