public final class GPIOPinConfig extends Object implements DeviceConfig, DeviceConfig.HardwareAddressing
DeviceConfig.HardwareAddressing
Modifier and Type | Field and Description |
---|---|
static int |
DIR_BOTH_INIT_INPUT
Bidirectional pin direction with initial input direction.
|
static int |
DIR_BOTH_INIT_OUTPUT
Bidirectional pin direction with initial output direction.
|
static int |
DIR_INPUT_ONLY
Input pin direction.
|
static int |
DIR_OUTPUT_ONLY
Output pin direction.
|
static int |
MODE_INPUT_PULL_DOWN
Input pull-down drive mode.
|
static int |
MODE_INPUT_PULL_UP
Input pull-up drive mode.
|
static int |
MODE_OUTPUT_OPEN_DRAIN
Output open-drain drive mode.
|
static int |
MODE_OUTPUT_PUSH_PULL
Output push-pull drive mode.
|
static int |
TRIGGER_BOTH_EDGES
Rising edge trigger.
|
static int |
TRIGGER_BOTH_LEVELS
Both levels trigger.
|
static int |
TRIGGER_FALLING_EDGE
Falling edge trigger.
|
static int |
TRIGGER_HIGH_LEVEL
High level trigger.
|
static int |
TRIGGER_LOW_LEVEL
Low level trigger.
|
static int |
TRIGGER_NONE
No interrupt trigger.
|
static int |
TRIGGER_RISING_EDGE
Rising edge trigger.
|
DEFAULT, UNASSIGNED
Constructor and Description |
---|
GPIOPinConfig(int controllerNumber,
int pinNumber,
int direction,
int mode,
int trigger,
boolean initValue) |
GPIOPinConfig(String controllerName,
int pinNumber,
int direction,
int mode,
int trigger,
boolean initValue) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Checks two
GPIOPinConfig objects for equality. |
String |
getControllerName()
Gets the configured controller name (such as its device file name on UNIX systems).
|
int |
getControllerNumber()
Gets the configured controller number for the pin.
|
int |
getDirection()
Gets the configured pin direction.
|
int |
getDriveMode()
Gets the configured pin drive mode.
|
boolean |
getInitValue()
Gets the configured initial value of the pin, if configured for output.
|
int |
getPinNumber()
Gets the configured pin number.
|
int |
getTrigger()
Gets the configured initial pin interrupt trigger.
|
public static final int DIR_BOTH_INIT_INPUT
public static final int DIR_BOTH_INIT_OUTPUT
public static final int DIR_INPUT_ONLY
public static final int DIR_OUTPUT_ONLY
public static final int MODE_INPUT_PULL_DOWN
This bit flag can be bitwise-combined (OR) with other drive mode bit flags.
public static final int MODE_INPUT_PULL_UP
This bit flag can be bitwise-combined (OR) with other drive mode bit flags.
public static final int MODE_OUTPUT_OPEN_DRAIN
This bit flag can be bitwise-combined (OR) with other drive mode bit flags.
public static final int MODE_OUTPUT_PUSH_PULL
This bit flag can be bitwise-combined (OR) with other drive mode bit flags.
public static final int TRIGGER_BOTH_EDGES
public static final int TRIGGER_BOTH_LEVELS
public static final int TRIGGER_FALLING_EDGE
public static final int TRIGGER_HIGH_LEVEL
public static final int TRIGGER_LOW_LEVEL
public static final int TRIGGER_NONE
public static final int TRIGGER_RISING_EDGE
public GPIOPinConfig(int controllerNumber, int pinNumber, int direction, int mode, int trigger, boolean initValue)
public GPIOPinConfig(String controllerName, int pinNumber, int direction, int mode, int trigger, boolean initValue)
public int getDirection()
DIR_INPUT_ONLY
, DIR_OUTPUT_ONLY
,
DIR_BOTH_INIT_INPUT
, DIR_BOTH_INIT_OUTPUT
.public int getDriveMode()
UNASSIGNED
or a bitwise OR of at least one of :
MODE_INPUT_PULL_UP
, MODE_INPUT_PULL_DOWN
,
MODE_OUTPUT_PUSH_PULL
, MODE_OUTPUT_OPEN_DRAIN
.public boolean getInitValue()
false
if configured for input.public int getPinNumber()
UNASSIGNED
.public int getControllerNumber()
getControllerNumber
in interface DeviceConfig.HardwareAddressing
UNASSIGNED
.public String getControllerName()
getControllerName
in interface DeviceConfig.HardwareAddressing
null
.public int getTrigger()
TRIGGER_NONE
,
TRIGGER_FALLING_EDGE
, TRIGGER_RISING_EDGE
,
TRIGGER_BOTH_EDGES
, TRIGGER_HIGH_LEVEL
, TRIGGER_LOW_LEVEL
,
TRIGGER_BOTH_LEVELS
.public boolean equals(Object obj)
GPIOPinConfig
objects for equality.equals
in class Object
obj
- the object to test for equality with this object.true
if obj
is a GPIOPinConfig
and has the same hardware
addressing information and configuration parameter values as this
GPIOPinConfig
object; false
otherwise.Boolean.hashCode()
,
Hashtable