public class GPIOManager
extends java.lang.Object
This manager allows applications to create GPIO
objects.
Unless noted, all GPIO API methods require the com.digi.android.permission.GPIO
permission. If your application does not have this permission it will not
have access to any GPIO service feature.
GPIO
Constructor | Description |
---|---|
GPIOManager(android.content.Context context) |
Class constructor.
|
Modifier and Type | Method | Description |
---|---|---|
GPIO |
createGPIO(int portIndex,
int pinIndex,
GPIOMode mode) |
Creates and returns a new object of type GPIO with the given GPIO port
number, pin offset, and desired working mode.
|
GPIO |
createGPIO(int kernelNumber,
GPIOMode mode) |
Creates and returns a
GPIO object with the given kernel GPIO
number and desired working mode. |
public GPIOManager(android.content.Context context)
Instantiates a new GPIOManager
for the given application.
context
- Context of the application.public GPIO createGPIO(int kernelNumber, GPIOMode mode) throws GPIOException
GPIO
object with the given kernel GPIO
number and desired working mode.kernelNumber
- Kernel number of the GPIO to be created.mode
- The desired GPIO working mode.GPIOException
- If there is an error creating the GPIO.java.lang.IllegalArgumentException
- If kernelNumber < 0
.java.lang.NullPointerException
- If mode == null
.GPIO
,
GPIOMode.INPUT
,
GPIOMode.INTERRUPT_EDGE_BOTH
,
GPIOMode.INTERRUPT_EDGE_FALLING
,
GPIOMode.INTERRUPT_EDGE_RISING
,
GPIOMode.OUTPUT_HIGH
,
GPIOMode.OUTPUT_LOW
public GPIO createGPIO(int portIndex, int pinIndex, GPIOMode mode) throws GPIOException
portIndex
- GPIO base port index.pinIndex
- GPIO pin index.mode
- The desired GPIO working mode.GPIOException
- If there is an error creating the GPIO.java.lang.IllegalArgumentException
- If portIndex < 0
or
if pinIndex < 0
.java.lang.NullPointerException
- If mode == null
.GPIO
,
GPIOMode.INPUT
,
GPIOMode.INTERRUPT_EDGE_BOTH
,
GPIOMode.INTERRUPT_EDGE_FALLING
,
GPIOMode.INTERRUPT_EDGE_RISING
,
GPIOMode.OUTPUT_HIGH
,
GPIOMode.OUTPUT_LOW