SunSPOT API V3.0


com.sun.spot.peripheral
Class AbstractAT91_PIO

java.lang.Object
  extended by com.sun.spot.peripheral.AbstractAT91_PIO
All Implemented Interfaces:
IAT91_PIO
Direct Known Subclasses:
ProxyAT91_PIO

public abstract class AbstractAT91_PIO
extends Object
implements IAT91_PIO

AbstractAT91_PIO

See Also:
IAT91_PIO

Field Summary
protected  Address baseAddress
           
protected static int PIO_CODR
           
protected static int PIO_IFDR
           
protected static int PIO_IFER
           
protected static int PIO_ODR
           
protected static int PIO_OER
           
protected static int PIO_PDSR
           
protected static int PIO_SODR
           
protected  int pioSelector
           
 
Fields inherited from interface com.sun.spot.peripheral.IAT91_PIO
CLEAR_OUT, INPUT, OUTPUT, PIOA, PIOB, PIOC, PIOD, SENSE_BIT, SET_OUT
 
Constructor Summary
protected AbstractAT91_PIO(int pioSelector)
           
 
Method Summary
abstract  int available()
          Return the mask of available pins.
protected abstract  void checkOwned(int mask)
           
 void claim(int mask, int drive)
          Lay claim to certain PIO pins
abstract  void claim(int mask, int drive, boolean claimForPeriphA)
          Lay claim to certain PIO pins.
 void disableGlitchFilter(int mask)
          Disable glitch filters for the specified pin(s)
abstract  void disableIrq(int irq)
          Disable PIO interrupts for the specified pin
 void enableGlitchFilter(int mask)
          Enable glitch filters for the specified pin(s)
abstract  void enableIrq(int mask)
          Enable PIO interrupts for the specified pin
 int getBaseAddress()
          Get the base address of this PIO
 String getDriverName()
           
 void open(int mask, int config)
          Configure the direction of selected pins.
 int read()
          Read the instantaneous state of the pio pins
abstract  void release(int mask)
          Release claim to certain PIO pins
abstract  void waitForIrq(int irq)
          Wait for the specified PIO pin to generate an interrupt.
 void write(int mask, int state)
          Set the state of selected output pins
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PIO_OER

protected static final int PIO_OER
See Also:
Constant Field Values

PIO_ODR

protected static final int PIO_ODR
See Also:
Constant Field Values

PIO_IFER

protected static final int PIO_IFER
See Also:
Constant Field Values

PIO_IFDR

protected static final int PIO_IFDR
See Also:
Constant Field Values

PIO_SODR

protected static final int PIO_SODR
See Also:
Constant Field Values

PIO_CODR

protected static final int PIO_CODR
See Also:
Constant Field Values

PIO_PDSR

protected static final int PIO_PDSR
See Also:
Constant Field Values

baseAddress

protected Address baseAddress

pioSelector

protected int pioSelector
Constructor Detail

AbstractAT91_PIO

protected AbstractAT91_PIO(int pioSelector)
Method Detail

write

public void write(int mask,
                  int state)
Description copied from interface: IAT91_PIO
Set the state of selected output pins

Specified by:
write in interface IAT91_PIO
Parameters:
mask -
state -

open

public void open(int mask,
                 int config)
Description copied from interface: IAT91_PIO
Configure the direction of selected pins.

Specified by:
open in interface IAT91_PIO
Parameters:
mask -
config -

read

public int read()
Description copied from interface: IAT91_PIO
Read the instantaneous state of the pio pins

Specified by:
read in interface IAT91_PIO
Returns:
The current state as a 32 bit mask

getBaseAddress

public int getBaseAddress()
Description copied from interface: IAT91_PIO
Get the base address of this PIO

Specified by:
getBaseAddress in interface IAT91_PIO
Returns:
the base address

enableGlitchFilter

public void enableGlitchFilter(int mask)
Description copied from interface: IAT91_PIO
Enable glitch filters for the specified pin(s)

Specified by:
enableGlitchFilter in interface IAT91_PIO
Parameters:
mask - the pio pin mask

disableGlitchFilter

public void disableGlitchFilter(int mask)
Description copied from interface: IAT91_PIO
Disable glitch filters for the specified pin(s)

Specified by:
disableGlitchFilter in interface IAT91_PIO
Parameters:
mask - the pio pin mask

claim

public void claim(int mask,
                  int drive)
Lay claim to certain PIO pins

Specified by:
claim in interface IAT91_PIO
Parameters:
mask - - claimed pins
drive - - bits set to 1 for pins to be controlled by PIO. Bits set to 0 default to peripheral A.

getDriverName

public String getDriverName()
Specified by:
getDriverName in interface IAT91_PIO
Returns:
the name of this PIO

available

public abstract int available()
Description copied from interface: IAT91_PIO
Return the mask of available pins. An available pin can be claimed.

Specified by:
available in interface IAT91_PIO
Returns:
mask

claim

public abstract void claim(int mask,
                           int drive,
                           boolean claimForPeriphA)
Description copied from interface: IAT91_PIO
Lay claim to certain PIO pins.

Specified by:
claim in interface IAT91_PIO
Parameters:
mask - claimed pins
drive - bits set to 1 for pins to be controlled by PIO
claimForPeriphA - if true assign undriven pins to peripheral A; if false to peripheral B

release

public abstract void release(int mask)
Description copied from interface: IAT91_PIO
Release claim to certain PIO pins

Specified by:
release in interface IAT91_PIO
Parameters:
mask - released pins

disableIrq

public abstract void disableIrq(int irq)
Description copied from interface: IAT91_PIO
Disable PIO interrupts for the specified pin

Specified by:
disableIrq in interface IAT91_PIO
Parameters:
irq - A mask with a single bit set indicating the interrupt

enableIrq

public abstract void enableIrq(int mask)
Description copied from interface: IAT91_PIO
Enable PIO interrupts for the specified pin

Specified by:
enableIrq in interface IAT91_PIO
Parameters:
mask - the pio pin mask

waitForIrq

public abstract void waitForIrq(int irq)
                         throws InterruptedException
Description copied from interface: IAT91_PIO
Wait for the specified PIO pin to generate an interrupt. On exit, the pin is masked so that it will not generate another interrupt.

Specified by:
waitForIrq in interface IAT91_PIO
Parameters:
irq - A mask with a single bit set indicating the interrupt awaited
Throws:
InterruptedException

checkOwned

protected abstract void checkOwned(int mask)

SunSPOT API V3.0


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