com.sentilla.system
Interface InterruptPin

All Superinterfaces:
Action, DigitalPin
All Known Implementing Classes:
Button, InterruptPin

public interface InterruptPin
extends DigitalPin

An object representation for interrupt functionality present on microcontroller input/output devices.

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.

See Also:
InterruptPinDriver

Field Summary
 
Fields inherited from interface com.sentilla.system.Action
DONE, ERROR, IDLE, PENDING
 
Method Summary
 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 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
 

Method Detail

edge

void edge(boolean onFalling,
          boolean onRising)
Blocks until the pin state changes on an interrupt edge. Set both 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.

Parameters:
onFalling - true if the function should return control after a falling edge is detected
onRising - true if the function should return control after a falling edge is detected

setEdge

InterruptPin setEdge(boolean onFalling,
                     boolean onRising)
Asynchronous interface to set the conditions for detection. Must be initiated with the submit function.

Parameters:
onFalling - true if the function should return control after a falling edge is detected
onRising - true if the function should return control after a falling edge is detected
Returns:
Instance of InterruptPin that is set

isRisingEdge

boolean isRisingEdge()
Check the condition of the last event. Returns true if the last event was caused by a rising edge condition.

Returns:
true if the edge was rising

getEdgeTime

int getEdgeTime()
Get the time of the last event

Returns:
the system's local time in milliseconds at the last event


Copyright © 2007 Sentilla Corporation. All Rights Reserved.