Sun SPOT API
Green Release  


com.sun.spot.sensorboard.io
Class OutputPin

java.lang.Object
  extended by com.sun.spot.sensorboard.io.OutputPin
All Implemented Interfaces:
IDriver, IOutputPin

public class OutputPin
extends Object
implements IOutputPin, IDriver

Accessor object for output only GPIO pins.


Constructor Summary
OutputPin(PinDescriptor idx, IGPIOController cntrl)
           
 
Method Summary
 PinDescriptor getIndex()
           
 boolean getState()
           
 String name()
          An identifying name for the driver (e.g.
 void setHigh()
          set value of pin to high
 void setHigh(boolean high)
          set value of pin
 void setLow()
          set value of pin to low
 void setUp()
          Activate or reactivate the driver (after a deep sleep or when another driver refused to deep sleep).
 boolean tearDown()
          Deactivate the driver (usually in preparation for deep sleep).
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputPin

public OutputPin(PinDescriptor idx,
                 IGPIOController cntrl)
Method Detail

setHigh

public void setHigh()
set value of pin to high

Specified by:
setHigh in interface IOutputPin

setLow

public void setLow()
set value of pin to low

Specified by:
setLow in interface IOutputPin

setHigh

public void setHigh(boolean high)
set value of pin

Specified by:
setHigh in interface IOutputPin
Parameters:
high - if true then pin is set to high

getIndex

public PinDescriptor getIndex()
Returns:
PinDescriptor for this output

name

public String name()
Description copied from interface: IDriver
An identifying name for the driver (e.g. "AIC" for the AIC driver).

Specified by:
name in interface IDriver
Returns:
The driver name

getState

public boolean getState()
Returns:
current state of this pin

setUp

public void setUp()
Description copied from interface: IDriver
Activate or reactivate the driver (after a deep sleep or when another driver refused to deep sleep). The driver should claim all the resources it needs from other drivers and reinitialize its hardware. It should also restore any state saved before tearDown.

Specified by:
setUp in interface IDriver

tearDown

public boolean tearDown()
Description copied from interface: IDriver
Deactivate the driver (usually in preparation for deep sleep). The driver should store any important state and release all resources it has claimed from other drivers.

Specified by:
tearDown in interface IDriver
Returns:
True if the driver is able to deactivate, false if it cannot deactivate (e.g. due to being busy with a data transfer). If any driver returns false, no deep sleep occurs and all other drivers will be reactivated.

Sun SPOT API
Green Release  


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