|
DCT Lightfoot v3 API specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.dctl.hardware.gpio.GPIO
GPIO handler class. This attaches to a particular GPIO port and allows bits to be set/read
| Constructor Summary | |
GPIO(char port)
Create a GPIO instance |
|
GPIO(char port,
int mask)
Create a GPIO instance using a port and mask |
|
| Method Summary | |
boolean |
getBit()
Get the bit - only useful if only one bit is specified in the mask |
int |
getBit(int bit)
Get a bit |
int |
getBits()
Get all the bits |
int |
getDirection()
Get the direction for the port |
boolean |
getInput(int bit)
Get the input state for a bit |
void |
setBit(boolean value)
Set the bit - only useful if only one bit is specified in the mask |
void |
setBit(int bit,
int value)
Set a bit |
void |
setBits(int bits)
Set all the bits |
void |
setDirection(int direction)
Set the direction for the port |
void |
setInput()
Set the bit to be input - only useful if only one bit is valid in the mask |
void |
setInput(int bit,
boolean state)
Set the input state for a bit |
void |
setOutput()
Set the bit to be output - only useful if only one bit is valid in the mask |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GPIO(char port,
int mask)
throws IllegalArgumentException,
SystemException
port - The port as a letter from 'A' to 'F'mask - The mask to use
IllegalArgumentException - if the port does not exist
SystemException - if there is an error in the operation
public GPIO(char port)
throws IllegalArgumentException,
SystemException
port - The port as a letter from 'A' to 'F'
IllegalArgumentException - if the port does not exist
SystemException - if there is an error in the operation| Method Detail |
public void setInput(int bit,
boolean state)
throws SystemException
bit - The bit to set the input state forstate - True for input, false for output
SystemException - if there is an error in the operation
public void setInput()
throws SystemException
SystemException - if there is an error in the operation
public void setOutput()
throws SystemException
SystemException - if there is an error in the operation
public void setDirection(int direction)
throws SystemException
direction - The direction, a bit set to 1 indicates input otherwise output
SystemException - if there is an error in the operation
public boolean getInput(int bit)
throws SystemException
bit - The bit to get the input state for
SystemException - if there is an error in the operation
public int getDirection()
throws SystemException
SystemException - if there is an error in the operation
public void setBit(int bit,
int value)
throws SystemException
bit - The bit to setvalue - The value
SystemException - if there is an error in the operation
public void setBits(int bits)
throws SystemException
bits - The bits to set
SystemException - if there is an error in the operation
public void setBit(boolean value)
throws SystemException
value - true to set the bit, false to clear it
SystemException - if there is an error
public int getBit(int bit)
throws SystemException
bit - The bit to get
SystemException - if there is an error in the operation
public int getBits()
throws SystemException
SystemException - if there is an error in the operation
public boolean getBit()
throws SystemException
SystemException
|
DCT Lightfoot v3 API specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||