SunSPOT API V3.0


com.sun.spot.peripheral
Interface IAT91_PIO

All Known Implementing Classes:
AbstractAT91_PIO, ProxyAT91_PIO

public interface IAT91_PIO

Interface to the AT91 Parallel I/O Controller.

Author:
Syntropy

Field Summary
static int CLEAR_OUT
          In calls to write(int, int), causes the selected pins to be set to 0.
static int INPUT
          In calls to open(int, int), defines the selected pins to be inputs.
static int OUTPUT
          In calls to open(int, int), defines the selected pins to be outputs.
static int PIOA
          Symbols identifying the four PIOs
static int PIOB
           
static int PIOC
           
static int PIOD
           
static int SENSE_BIT
          A single bit that can be used to test against
static int SET_OUT
          In calls to write(int, int), causes the selected pins to be set to 1.
 
Method Summary
 int available()
          Return the mask of available pins.
 void claim(int mask, int drive)
          Lay claim to certain PIO pins.
 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)
 void disableIrq(int irq)
          Disable PIO interrupts for the specified pin
 void enableGlitchFilter(int mask)
          Enable glitch filters for the specified pin(s)
 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
 void release(int mask)
          Release claim to certain PIO pins
 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
 

Field Detail

PIOA

static final int PIOA
Symbols identifying the four PIOs

See Also:
Constant Field Values

PIOB

static final int PIOB
See Also:
Constant Field Values

PIOC

static final int PIOC
See Also:
Constant Field Values

PIOD

static final int PIOD
See Also:
Constant Field Values

SENSE_BIT

static final int SENSE_BIT
A single bit that can be used to test against

See Also:
Constant Field Values

OUTPUT

static final int OUTPUT
In calls to open(int, int), defines the selected pins to be outputs.

See Also:
Constant Field Values

INPUT

static final int INPUT
In calls to open(int, int), defines the selected pins to be inputs.

See Also:
Constant Field Values

SET_OUT

static final int SET_OUT
In calls to write(int, int), causes the selected pins to be set to 1.

See Also:
Constant Field Values

CLEAR_OUT

static final int CLEAR_OUT
In calls to write(int, int), causes the selected pins to be set to 0.

See Also:
Constant Field Values
Method Detail

available

int available()
Return the mask of available pins. An available pin can be claimed.

Returns:
mask

claim

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

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

claim

void claim(int mask,
           int drive,
           boolean claimForPeriphA)
Lay claim to certain PIO pins.

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

void release(int mask)
Release claim to certain PIO pins

Parameters:
mask - released pins

open

void open(int mask,
          int config)
Configure the direction of selected pins.

Parameters:
mask - The pins to be configured
config - Indicates whether these pins are to be input (INPUT) or output (OUTPUT)

write

void write(int mask,
           int state)
Set the state of selected output pins

Parameters:
mask - The pins to be set or cleared
state - Indicates whether these pins are to be set (SET_OUT) or cleared (CLEAR_OUT)

read

int read()
Read the instantaneous state of the pio pins

Returns:
The current state as a 32 bit mask

enableGlitchFilter

void enableGlitchFilter(int mask)
Enable glitch filters for the specified pin(s)

Parameters:
mask - the pio pin mask

disableGlitchFilter

void disableGlitchFilter(int mask)
Disable glitch filters for the specified pin(s)

Parameters:
mask - the pio pin mask

enableIrq

void enableIrq(int mask)
Enable PIO interrupts for the specified pin

Parameters:
mask - the pio pin mask

waitForIrq

void waitForIrq(int irq)
                throws InterruptedException
Wait for the specified PIO pin to generate an interrupt. On exit, the pin is masked so that it will not generate another interrupt.

Parameters:
irq - A mask with a single bit set indicating the interrupt awaited
Throws:
InterruptedException

disableIrq

void disableIrq(int irq)
Disable PIO interrupts for the specified pin

Parameters:
irq - A mask with a single bit set indicating the interrupt

getBaseAddress

int getBaseAddress()
Get the base address of this PIO

Returns:
the base address

getDriverName

String getDriverName()
Returns:
the name of this PIO

SunSPOT API V3.0


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