public interface GpioService
| Modifier and Type | Method and Description |
|---|---|
void |
configureIoDirection(java.util.BitSet set)
Configure the GPIO direction of all GPIO addresses.
|
void |
configureWriteMask(java.util.BitSet set)
Configure a bitmask to use on future
configureIoDirection(BitSet) or writeAll(BitSet) calls. |
java.lang.String |
getDeviceVersion()
Get the device version information.
|
java.lang.String |
getId()
Get the ID of the device.
|
boolean |
read(int address)
Get the value of the GPIO address as a binary value.
|
java.util.BitSet |
readAll()
Read the value of all GPIO addresses.
|
int |
readAnalog(int address)
Get the analog value of the GPIO address.
|
void |
set(int address,
boolean value)
Set the value of the GPIO address as a binary value.
|
void |
setId(java.lang.String id)
Set the ID of the device.
|
void |
writeAll(java.util.BitSet values)
Set the value of all GPIO addresses on enabled/disabled based on a
BitSet. |
java.lang.String getDeviceVersion()
throws java.io.IOException
java.io.IOException - if a communication error occursjava.lang.String getId()
throws java.io.IOException
java.io.IOException - if a communication error occursvoid setId(java.lang.String id)
throws java.io.IOException
id - the ID to set: an 8-character stringjava.io.IOException - if a communication error occursboolean read(int address)
throws java.io.IOException
address - the address, starting from 0, of the GPIO to getjava.io.IOException - if a communication error occursint readAnalog(int address)
throws java.io.IOException
address - the addressjava.io.IOException - if a communication error occursjava.util.BitSet readAll()
throws java.io.IOException
java.io.IOException - if a communication error occursvoid set(int address,
boolean value)
throws java.io.IOException
address - the address, starting from 0, of the GPIO to getvalue - true if the GPIO is on, otherwise falsejava.io.IOException - if a communication error occursvoid writeAll(java.util.BitSet values)
throws java.io.IOException
BitSet.values - the value to set, with bit positions representing GPIO addressesjava.io.IOException - if a communication error occursvoid configureWriteMask(java.util.BitSet set)
throws java.io.IOException
configureIoDirection(BitSet) or writeAll(BitSet) calls.set - the GPIO addresses to enable for future operations, using bit
positionsjava.io.IOException - if a communication error occursvoid configureIoDirection(java.util.BitSet set)
throws java.io.IOException
If a bit is enabled that means the coreponsing GPIO address should be configured as the input direction, otherwise as output.
set - the GPIO addresses to configure as input, using bit positionsjava.io.IOException - if a communication error occurs