Sun SPOT API
Green Release  


com.sun.spot.sensorboard.capabilities
Interface IGPIOController

All Known Subinterfaces:
IDemoBoard
All Known Implementing Classes:
EDemoBoard

public interface IGPIOController

Controller interface of a GPIO controller. This interface should be able to deal with pins of types input, output and a superset that can be switched dynamically from one to the other.

Author:
arshan

Method Summary
 IInputPin bindInputPin(PinDescriptor pidx)
          register an input only pin and return the accessor object for it
 IIOPin bindIOPin(PinDescriptor pidx)
          register an input/output pin and return the accessor object for it
 IOutputPin bindOutputPin(PinDescriptor pidx)
          register an output only pin and return the accessor object for it
 boolean getPinValue(PinDescriptor pidx)
          get the current value of the pin, this can be called on both outputs and inputs, if the pin is not a scalar type the return value will by either 0 or 1
 void setPinDirection(PinDescriptor pidx, boolean output)
          set the pin direction, if output > 0 its set to an output if output == 0 its set to an input.
 void setPinValue(PinDescriptor pidx, boolean value)
          Ask the controller to set the pin value.
 

Method Detail

bindOutputPin

IOutputPin bindOutputPin(PinDescriptor pidx)
register an output only pin and return the accessor object for it

Parameters:
pidx - pin to access
Returns:
accessor object

bindInputPin

IInputPin bindInputPin(PinDescriptor pidx)
register an input only pin and return the accessor object for it

Parameters:
pidx - pin to access
Returns:
accessor object

bindIOPin

IIOPin bindIOPin(PinDescriptor pidx)
register an input/output pin and return the accessor object for it

Parameters:
pidx - pin to access
Returns:
accessor object

setPinValue

void setPinValue(PinDescriptor pidx,
                 boolean value)
Ask the controller to set the pin value.

Parameters:
pidx - pin to set value of
value - binary value

getPinValue

boolean getPinValue(PinDescriptor pidx)
get the current value of the pin, this can be called on both outputs and inputs, if the pin is not a scalar type the return value will by either 0 or 1


setPinDirection

void setPinDirection(PinDescriptor pidx,
                     boolean output)
set the pin direction, if output > 0 its set to an output if output == 0 its set to an input.


Sun SPOT API
Green Release  


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