mraa
2.0.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, java.lang.Runnable runnable) |
Result | isrExit () |
Result | mode (Mode mode) |
Result | dir (Dir dir) |
Dir | readDir () |
int | read () |
Result | write (int value) |
Result | useMmap (boolean enable) |
int | getPin (boolean raw) |
int | getPin () |
Result | inputMode (InputMode mode) |
Result | outputMode (OutputMode mode) |
Gpio | ( | int | pin, |
boolean | owner, | ||
boolean | raw | ||
) |
Instantiates 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. |
Gpio | ( | int | pin | ) |
Gpio Constructor, takes a pointer to the GPIO context and initialises the GPIO class
gpio_context | void * to GPIO context |
Set the edge mode for ISR
mode | The edge mode to set |
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 immediately but only when it is out of it's critical section
Result outputMode | ( | OutputMode | mode | ) |
Dir readDir | ( | ) |
Result useMmap | ( | boolean | enable | ) |
Result write | ( | int | value | ) |