|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sentilla.platform.tmote.Action
com.sentilla.platform.tmote.DigitalPin
com.sentilla.platform.tmote.InterruptPin
public class InterruptPin
Creates an action for interruptable single pins of digital input/output on the tmote platform.
Valid interrupt pins on the tmote platform are 0x10-0x17 (Port 1.0 through Port 1.7) and 0x20-0x27 (Port 2.0 through Port 2.7).
The action verb edge
completes upon the
satification of the triggering condition for a particular unit of
digital I/O. Similarly the setter setEdge
enables
the conditions that qualify a digital I/O interrrupt action for
caching. The getter getEdgeTime
provides a marker of
when I/O triggering conditions were satisfied. The getter
isRisingEdge
is a predicate returning the state of the
specific I/O unit.
InterruptPinDriver
Field Summary |
---|
Fields inherited from class com.sentilla.platform.tmote.DigitalPin |
---|
digitalPinCmd, digitalPinId, digitalPinPortmask, digitalPinTime, digitalPinValue, EDGE_CHANGE, EDGE_FALLING, EDGE_RISING, GET_PORT, GET_VALUE, SET_PORT, SET_VALUE |
Fields inherited from class com.sentilla.platform.tmote.Action |
---|
actionAuto, actionId, actionState, isolateOwner |
Fields inherited from interface com.sentilla.system.Action |
---|
DONE, ERROR, IDLE, PENDING |
Constructor Summary | |
---|---|
InterruptPin(int id)
Create an object to capture interrupt events from a digital input/output pin. |
Method Summary | |
---|---|
protected boolean |
checkId(int id)
Checks that the Id is within bounds for this platform. |
void |
edge(boolean onFalling,
boolean onRising)
Blocks until the pin state changes on an interrupt edge. |
int |
getEdgeTime()
Get the time of the last event |
boolean |
isRisingEdge()
Check the condition of the last event. |
InterruptPin |
setEdge(boolean onFalling,
boolean onRising)
Asynchronous interface to set the conditions for detection. |
Methods inherited from class com.sentilla.platform.tmote.DigitalPin |
---|
getId, getTime, getValue, read, read, readPort, setId, setRead, setWrite, write, write, writePort |
Methods inherited from class com.sentilla.platform.tmote.Action |
---|
block, block, cancel, getActionState, initAction, isDone, lookup, submit |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sentilla.system.DigitalPin |
---|
getId, getTime, getValue, read, setRead, setWrite, write, writePort |
Methods inherited from interface com.sentilla.system.Action |
---|
block, block, cancel, getActionState, isDone, submit |
Constructor Detail |
---|
public InterruptPin(int id)
id is specified by port and pin value in hex. For example, Port 2, Pin 3 is represented by id 0x23.
id
- The interrupt pin identifier
IllegalArgumentException
- when the given id does not exist on the tmote platformMethod Detail |
---|
protected boolean checkId(int id)
DigitalPin
checkId
in class DigitalPin
id
- Pin identity to check
public void edge(boolean onFalling, boolean onRising)
InterruptPin
onFalling
and onRising
to true
to trigger on any edge change.
Note: If both onFalling
and onRising
are set to
false
, the edge()
function will never return.
edge
in interface InterruptPin
onFalling
- true if the function should return control after a falling edge is detectedonRising
- true if the function should return control after a falling edge is detectedpublic InterruptPin setEdge(boolean onFalling, boolean onRising)
InterruptPin
submit
function.
setEdge
in interface InterruptPin
onFalling
- true if the function should return control after a falling edge is detectedonRising
- true if the function should return control after a falling edge is detected
public boolean isRisingEdge()
InterruptPin
true
if the last event was caused by a rising edge condition.
isRisingEdge
in interface InterruptPin
public int getEdgeTime()
InterruptPin
getEdgeTime
in interface InterruptPin
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |