Sun SPOT API
Green Release  


com.sun.spot.sensorboard.io
Class IOPin

java.lang.Object
  extended by com.sun.spot.sensorboard.io.IOPin
All Implemented Interfaces:
IInputPin, IIOPin, IOutputPin

public class IOPin
extends Object
implements IIOPin


Constructor Summary
IOPin(PinDescriptor idx, IGPIOController cntrl)
           
 
Method Summary
 PinDescriptor getIndex()
           
 boolean isHigh()
           
 boolean isLow()
           
 boolean isOutput()
          Ask if this pin is an output.
 void setAsOutput(boolean b)
           
 void setHigh()
          Sets pin output high
 void setHigh(boolean high)
           
 void setLow()
          Sets pin output low
 void waitForChange()
          Blocks the caller waiting for a change.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOPin

public IOPin(PinDescriptor idx,
             IGPIOController cntrl)
Method Detail

setHigh

public void setHigh()
Description copied from interface: IOutputPin
Sets pin output high

Specified by:
setHigh in interface IOutputPin

setLow

public void setLow()
Description copied from interface: IOutputPin
Sets pin output low

Specified by:
setLow in interface IOutputPin

setHigh

public void setHigh(boolean high)
Specified by:
setHigh in interface IOutputPin
Parameters:
high - boolean. If true, output is set high, otherwise output is set low.

isLow

public boolean isLow()
Specified by:
isLow in interface IInputPin
Returns:
true if the input bit is low.

isHigh

public boolean isHigh()
Specified by:
isHigh in interface IInputPin
Returns:
true if the input bit is high.

waitForChange

public void waitForChange()
Description copied from interface: IInputPin
Blocks the caller waiting for a change.

Specified by:
waitForChange in interface IInputPin

isOutput

public boolean isOutput()
Description copied from interface: IIOPin
Ask if this pin is an output. Pins are initially inputs. Note that it is possible to query the current pin setting of an output pin using isHigh() and isLow().

Specified by:
isOutput in interface IIOPin
Returns:
true if this pin is currently set to be an output

setAsOutput

public void setAsOutput(boolean b)
Specified by:
setAsOutput in interface IIOPin
Parameters:
b - if b is true the pin becomes an output, if false it becomes an input

getIndex

public PinDescriptor getIndex()

Sun SPOT API
Green Release  


Copyright © 2006 Sun Microsystems, Inc. All Rights Reserved.