|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.spot.peripheral.PIOPin
public class PIOPin
A PIOPin is a convenient way of manipulating an individual PIO pin. It's maybe not as efficient as going direct to the PIO but it's simpler. The normal way of using PIOPin is: 1. Create a PIOPin or get one from Spot.getInstance().getSpotPins() 2. Claim the pin 3. Open it for input or output 4. Set it high or low
Field Summary | |
---|---|
static int |
IO
multiplex option that puts the pin under control of the PIO (this is the default for PIOPins) |
int |
multiplex
The multiplex selection for this pin |
static int |
PERIPHERAL_A
multiplex option that puts the pin under control of PERIPHERAL A |
static int |
PERIPHERAL_B
multiplex option that puts the pin under control of PERIPHERAL B |
int |
pin
The PIO pin mask for this pin |
IAT91_PIO |
pio
The PIO for this pin |
Constructor Summary | |
---|---|
PIOPin(IAT91_PIO pio,
int pin)
Create a PIOPin that's controlled by a PIO |
|
PIOPin(IAT91_PIO pio,
int pin,
int multiplex)
|
Method Summary | |
---|---|
void |
claim()
Attempt to claim this pin |
void |
disableIrq()
Disable pin change interrupts on this pin |
void |
enableIrq()
Enable pin change interrupts on this pin |
boolean |
isHigh()
|
boolean |
isLow()
|
void |
openForInput()
Open this pin for input |
void |
openForOutput()
Open this pin for output |
void |
release()
Release the claim on this pin |
void |
setHigh()
Set this pin high |
void |
setLow()
Set this pin low |
void |
setState(boolean state)
Set this pin to the specified state |
String |
toString()
Returns a string representation of the object. |
void |
waitForIrq()
Wait for a pin change interrupt on this pin |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int IO
public static final int PERIPHERAL_A
public static final int PERIPHERAL_B
public int pin
public IAT91_PIO pio
public int multiplex
Constructor Detail |
---|
public PIOPin(IAT91_PIO pio, int pin, int multiplex)
pio
- the PIO that controls this pinpin
- the pin mask (i.e. only one bit set)multiplex
- the multiplex optionpublic PIOPin(IAT91_PIO pio, int pin)
pio
- the PIO that controls this pinpin
- the pin maskMethod Detail |
---|
public void claim()
public void release()
public void openForOutput()
public void openForInput()
public void setState(boolean state)
state
- if true set to high, else lowpublic void setHigh()
public void setLow()
public boolean isHigh()
public boolean isLow()
public void enableIrq()
public void waitForIrq() throws InterruptedException
InterruptedException
public void disableIrq()
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString
in class Object
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |