|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.motorola.oem.hapi.GpioInterruptConfig com.motorola.oem.hapi.GpioCounterConfig
public class GpioCounterConfig
The class encapsulates all Gpio Counter relevant configuration data.Gpio Counter feature that commands the device to count interrupts, and notify
GpioCounterListener
by reaching a predefined number of interrupts, defined in GpioCounterExpiryValue
.GpioInput
to receive counter event, this instance of GpioInput must get GpioCounterConfig
object through GpioInput
's GpioInput.enableCounter(com.motorola.oem.hapi.GpioCounterConfig)
method.
Counter type (COUNTER_TYPE_CYCLICAL
or COUNTER_TYPE_ONE_SHOT
) and counter expiry value configurationCOUNTER_TYPE_CYCLICAL
, unless a another is configured by
accessing setGpioCounterType(int)
method.setGpioCounterExpiryValue(int)
method.GpioCounterListener
object to handle events is mandatory. GpioCounterListener.onCounterExpired(int)
.
Field Summary | |
---|---|
static int |
COUNTER_TYPE_CYCLICAL
A static final variable specifying COUNTER_TYPE_CYCLICAL . |
static int |
COUNTER_TYPE_ONE_SHOT
A static final variable specifying COUNTER_TYPE_ONE_SHOT. |
static int |
COUNTER_TYPE_UNDEFINED
A static final variable specifying COUNTER_TYPE_UNDEFINED. |
Fields inherited from class com.motorola.oem.hapi.GpioInterruptConfig |
---|
DEBOUNCE_FAST, DEBOUNCE_NORMAL, NOTIFICATION_TYPE_BOTH_EDGES, NOTIFICATION_TYPE_HIGH_TO_LOW, NOTIFICATION_TYPE_LOW_TO_HIGH |
Constructor Summary | |
---|---|
GpioCounterConfig(GpioCounterListener listener)
Constructs a new GpioCounterConfig with the listener specified. |
Method Summary | |
---|---|
int |
getGpioCounterExpiryValue()
Gets GpioCounterExpiryValue member. |
int |
getGpioCounterType()
Gets GpioCounterType member. |
void |
setGpioCounterExpiryValue(int counterExpiryValue)
Sets GpioCounterExpiryValue member. |
void |
setGpioCounterListener(GpioCounterListener listener)
Reconfigures an existing listener. |
void |
setGpioCounterType(int counterType)
Sets GpioCounterType member. |
Methods inherited from class com.motorola.oem.hapi.GpioInterruptConfig |
---|
enableDebounce, getDebounce, getNotificationType, isDebounceEnabled, setDebounce, setGpioInterruptListener, setNotificationType |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int COUNTER_TYPE_UNDEFINED
public static final int COUNTER_TYPE_CYCLICAL
public static final int COUNTER_TYPE_ONE_SHOT
Constructor Detail |
---|
public GpioCounterConfig(GpioCounterListener listener)
listener
- GpioCounterListenerMethod Detail |
---|
public void setGpioCounterListener(GpioCounterListener listener)
GpioCounterConfig
in a sequence of counter enabling, with the same object but different listeners.
listener
- External object to receive counter eventspublic void setGpioCounterExpiryValue(int counterExpiryValue) throws GpioException
counterExpiryValue
- Counter expiry value; Legal range 1 - 2^31-1
GpioException
- Calling setGpioCounterExpiryValue with illegal parameters. Error code - OEMException.ILLEGAL_PARAM_ERROR
public int getGpioCounterExpiryValue()
public void setGpioCounterType(int counterType) throws GpioException
counterType
- Counter types: COUNTER_TYPE_CYCLICAL
,COUNTER_TYPE_ONE_SHOT
GpioException
- Calling setGpioCounterType with illegal parameters. Error code - OEMException.ILLEGAL_PARAM_ERROR
public int getGpioCounterType()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |