|
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.sensorboard.hardware.SimpleSPIControlledIOChip com.sun.spot.sensorboard.hardware.ADT7411
public class ADT7411
Class implementing SPI access to the ADT7411 a-to-d converter. It extends SimpleSPIControlledIOChip and provides a constructor that initialises the device. This initialised ADT7411 object can then be used by the classes derived from AbstractADT7411RangeInput to communicate with the device.
Field Summary | |
---|---|
static int |
SPI_CONFIG
How the SPI needs to be configured for ADT7411 |
Constructor Summary | |
---|---|
ADT7411(ISPI spi)
Constructor that initialises the device. |
|
ADT7411(ISPI spi,
boolean init)
Constructor that maybe initialises the device. |
Method Summary | |
---|---|
boolean |
areThresholdEventsEnabled(int pin)
Return whether threshold events are enabled or disabled. |
int |
checkInterrupts()
Check if any interrupts have occurred. |
void |
enableThresholdEvents(int pin,
boolean enable)
Enable or disable threshold events. |
String |
getDriverName()
Routine to return this driver's name. |
int |
getHighThreshold(int pin)
Return the current high threshold value for this scalar input. |
int |
getLowThreshold(int pin)
Return the current low threshold value for this scalar input. |
byte |
read(byte addr)
Read a byte from the ADC. |
int |
readPin(int idx)
Read the current value of one of the inputs to the ADC. |
void |
setAveraging(boolean val)
Set the global averaging bit of the ADC, if set to true then the part will internally sample 16 times before setting the average value, if false that behaviour is turned off. |
void |
setThresholdValues(int pin,
int low,
int high)
Set the low and high threshold values for this scalar input. |
void |
setUp()
Driver routine called to initialize the ADT7411 when powering up the sensor board. |
void |
shutDown()
Notify the driver that the VM is about to exit. |
boolean |
tearDown()
Driver routine called before powering down sensor board (for deep sleep). |
void |
write(byte addr,
byte value)
Write a byte to the ADC. |
Methods inherited from class com.sun.spot.sensorboard.hardware.SimpleSPIControlledIOChip |
---|
claimedPins, claimPin, getSPI |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sun.spot.sensorboard.hardware.ISPIControlledIOChip |
---|
claimedPins, claimPin, getSPI |
Field Detail |
---|
public static final int SPI_CONFIG
Constructor Detail |
---|
public ADT7411(ISPI spi)
spi
- ISPI to be used to access the devicepublic ADT7411(ISPI spi, boolean init)
spi
- ISPI to be used to access the deviceinit
- if true then initialize the deviceMethod Detail |
---|
public void setUp()
setUp
in interface IDriver
public boolean tearDown()
tearDown
in interface IDriver
public void setAveraging(boolean val)
val
- if true set averaging onpublic byte read(byte addr)
read
in interface IADT7411
addr
- address to be read
public void write(byte addr, byte value)
write
in interface IADT7411
addr
- address to writevalue
- to be writtenpublic int readPin(int idx)
idx
- number of pin to read.
public void setThresholdValues(int pin, int low, int high)
pin
- pin to be monitored.low
- the new low threshold value.high
- the new high threshold value.public int getHighThreshold(int pin)
pin
- pin to be read
public int getLowThreshold(int pin)
pin
- pin to be read
public void enableThresholdEvents(int pin, boolean enable)
pin
- pin to be monitored.enable
- if true then listeners will be notified if the scalar input
reading goes above the high threshold or below the low threshold.public boolean areThresholdEventsEnabled(int pin)
pin
- pin to be read
public int checkInterrupts()
public String getDriverName()
getDriverName
in interface IDriver
public void shutDown()
IDriver
shutDown
in interface IDriver
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |