com.sentilla.platform.tmote
Class Adc<Q extends javax.measure.quantity.Quantity>

java.lang.Object
  extended by com.sentilla.platform.tmote.Action
      extended by com.sentilla.platform.tmote.Adc<Q>
All Implemented Interfaces:
MultipleSensor, Action, Sensor<Q>
Direct Known Subclasses:
AccelerationSensor, McuTemperature, McuVoltage, ParSensorDriver.ParSensor, TsrSensorDriver.TsrSensor, VoltageAdc

public abstract class Adc<Q extends javax.measure.quantity.Quantity>
extends Action
implements Sensor<Q>, MultipleSensor

Private: for Sentilla internal use only.


Field Summary
protected  byte[] adcports
           
protected  short numPortsToRead
           
static byte PORT_A0
           
static byte PORT_A1
           
static byte PORT_A2
           
static byte PORT_A3
           
static byte PORT_A4
           
static byte PORT_A5
           
static byte PORT_A6
           
static byte PORT_A7
           
static byte PORT_AVCC_DIV_2
           
static byte PORT_TEMPERATURE
           
static byte PORT_VEREFP
           
static byte PORT_VREFM_DIV_VEREFM
           
protected  byte refvolt
           
static byte REFVOLT_1_5
           
static byte REFVOLT_2_5
           
protected  int[] voltages
           
 
Fields inherited from class com.sentilla.platform.tmote.Action
actionAuto, actionId, actionState, isolateOwner
 
Fields inherited from interface com.sentilla.system.Action
DONE, ERROR, IDLE, PENDING
 
Constructor Summary
protected Adc(byte adcport, byte refvolt)
           
 
Method Summary
abstract  javax.measure.Measurable<Q> getResult()
          Asynchronous interface to get the result of the last sensor read operation.
 double getVoltage()
           
 javax.measure.Measurable<Q> read()
          Read a new measurement and return the result.
 void readMultipleRaw(int[] buffer, byte[] adcports)
          Read new set of raw measurements and return the result.
 Sensor<Q> setRead()
          Asynchronous interface to set up a read operation on a sensor.
 
Methods inherited from class com.sentilla.platform.tmote.Action
block, block, cancel, getActionState, initAction, isDone, lookup, submit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sentilla.system.Action
block, block, cancel, getActionState, isDone, submit
 

Field Detail

REFVOLT_1_5

public static final byte REFVOLT_1_5
See Also:
Constant Field Values

REFVOLT_2_5

public static final byte REFVOLT_2_5
See Also:
Constant Field Values

PORT_A0

public static final byte PORT_A0
See Also:
Constant Field Values

PORT_A1

public static final byte PORT_A1
See Also:
Constant Field Values

PORT_A2

public static final byte PORT_A2
See Also:
Constant Field Values

PORT_A3

public static final byte PORT_A3
See Also:
Constant Field Values

PORT_A4

public static final byte PORT_A4
See Also:
Constant Field Values

PORT_A5

public static final byte PORT_A5
See Also:
Constant Field Values

PORT_A6

public static final byte PORT_A6
See Also:
Constant Field Values

PORT_A7

public static final byte PORT_A7
See Also:
Constant Field Values

PORT_VEREFP

public static final byte PORT_VEREFP
See Also:
Constant Field Values

PORT_VREFM_DIV_VEREFM

public static final byte PORT_VREFM_DIV_VEREFM
See Also:
Constant Field Values

PORT_TEMPERATURE

public static final byte PORT_TEMPERATURE
See Also:
Constant Field Values

PORT_AVCC_DIV_2

public static final byte PORT_AVCC_DIV_2
See Also:
Constant Field Values

refvolt

protected byte refvolt

numPortsToRead

protected short numPortsToRead

adcports

protected byte[] adcports

voltages

protected int[] voltages
Constructor Detail

Adc

protected Adc(byte adcport,
              byte refvolt)
Method Detail

getVoltage

public double getVoltage()

read

public javax.measure.Measurable<Q> read()
Description copied from interface: Sensor
Read a new measurement and return the result.

After reading a sensor, be sure to read its value using Measureable.doubleValue(unit), where unit defines the resulting unit for the reading (such as SI.Celsius for a temperature reading).

Specified by:
read in interface Sensor<Q extends javax.measure.quantity.Quantity>
Returns:
Sensor measurement of type Q.

readMultipleRaw

public void readMultipleRaw(int[] buffer,
                            byte[] adcports)
Description copied from interface: MultipleSensor
Read new set of raw measurements and return the result.

Specified by:
readMultipleRaw in interface MultipleSensor
Parameters:
buffer - is the array of int receiving the returned raw values of the ADC.
adcports - is the array of ports to read from

setRead

public Sensor<Q> setRead()
Description copied from interface: Sensor
Asynchronous interface to set up a read operation on a sensor. Use the submit() function to initiating the sensor reading.

Specified by:
setRead in interface Sensor<Q extends javax.measure.quantity.Quantity>
Returns:
The instance of Sensor that is set to read its sensor

getResult

public abstract javax.measure.Measurable<Q> getResult()
Description copied from interface: Sensor
Asynchronous interface to get the result of the last sensor read operation.

Specified by:
getResult in interface Sensor<Q extends javax.measure.quantity.Quantity>
Returns:
Sensor measurement of type Q.


Copyright © 2007 Sentilla Corporation. All Rights Reserved.