|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.motorola.oem.hapi.GpioInterruptConfig
public class GpioInterruptConfig
Encapsulates all GPIO interrupt relevant data: notification type, debounce time and listener.In order to configure
GpioInput
to receive interrupt event, one must get GpioInterruptConfig
object through GpioInput
's GpioInput.enableInterrupt(com.motorola.oem.hapi.GpioInterruptConfig)
method.
setNotificationType(int)
method.DEBOUNCE_NORMAL
, unless new one will be configured
through the setDebounce(int)
method.enableDebounce(boolean)
.GpioInterruptListener
object to handle events is mandatory.
Field Summary | |
---|---|
static int |
DEBOUNCE_FAST
A static final variable to specify DEBOUNCE_FAST type. |
static int |
DEBOUNCE_NORMAL
A static final variable to specify DEBOUNCE_NORMAL type. |
static int |
NOTIFICATION_TYPE_BOTH_EDGES
A static final variable to specify both edges notification type. |
static int |
NOTIFICATION_TYPE_HIGH_TO_LOW
A static final variable to specify high to low notification type. |
static int |
NOTIFICATION_TYPE_LOW_TO_HIGH
A static final variable to specify low to high notification type. |
Constructor Summary | |
---|---|
GpioInterruptConfig(GpioInterruptListener listener)
Constructs a new GpioInterruptConfig with the listener specified. |
Method Summary | |
---|---|
void |
enableDebounce(boolean isEnabled)
Enables debounce feature. |
int |
getDebounce()
Gets Debounce type member. |
int |
getNotificationType()
Gets notificationType member. |
boolean |
isDebounceEnabled()
Check Debounce status |
void |
setDebounce(int debounceType)
Configures debounce time (in milliseconds) in case debounce option is enabled. |
void |
setGpioInterruptListener(GpioInterruptListener listener)
Reconfigures existing listener. |
void |
setNotificationType(int notificationType)
Sets notificationType member. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NOTIFICATION_TYPE_LOW_TO_HIGH
public static final int NOTIFICATION_TYPE_HIGH_TO_LOW
public static final int NOTIFICATION_TYPE_BOTH_EDGES
public static final int DEBOUNCE_NORMAL
public static final int DEBOUNCE_FAST
Constructor Detail |
---|
public GpioInterruptConfig(GpioInterruptListener listener)
listener
- GpioListenerMethod Detail |
---|
public void setNotificationType(int notificationType)
notificationType
- Notification type to trigger interrupt NOTIFICATION_TYPE_BOTH_EDGES
,
NOTIFICATION_TYPE_HIGH_TO_LOW
, NOTIFICATION_TYPE_LOW_TO_HIGH
.public int getNotificationType()
NOTIFICATION_TYPE_BOTH_EDGES
,
NOTIFICATION_TYPE_HIGH_TO_LOW
, NOTIFICATION_TYPE_LOW_TO_HIGH
..public void setGpioInterruptListener(GpioInterruptListener listener)
GpioInterruptConfig(com.motorola.oem.hapi.GpioInterruptListener)
in a sequence of interrupt enabling with the same object but different listeners.
listener
- External object for receiving interrupt eventspublic void enableDebounce(boolean isEnabled)
isEnabled
- boolean value to indicate enable/disable valuespublic void setDebounce(int debounceType) throws GpioException
debounceType
- The debounce type to use on interrupt
DEBOUNCE_NORMAL
- 40 ms with 9 debounce samples
DEBOUNCE_FAST
- 10 ms with 3 debounce samples
GpioException
- Calling setDebounce with illegal debounce type. Error code - OEMException.ILLEGAL_PARAM_ERROR
public int getDebounce()
DEBOUNCE_NORMAL
- 40 ms with 9 debounce samples.
DEBOUNCE_FAST
- 10 ms with 3 debounce samples.public boolean isDebounceEnabled()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |