Apps     Components     Interfaces     All Files     Source Tree     source: tos.interfaces.ADC.nc

Interface: ADC

Analog to Digital Converter Interface.

Defines the functions provided by any ADC
Modified: 6/25/02
Author: Jason Hill
  David Gay
  Philip Levis

Components providing this interface:
tos.lib.Attributes.AttrAccel
tos.lib.Attributes.AttrPhoto
tos.lib.Attributes.AttrTemp
tos.lib.Attributes.AttrVoltage
tos.sensorboards.micasb.Accel
tos.sensorboards.micasb.Mag
tos.sensorboards.micasb.MicC
tos.sensorboards.micasb.Photo
tos.sensorboards.micasb.PhotoTemp
tos.sensorboards.micasb.PhotoTempM
tos.sensorboards.micasb.Temp
tos.system.ADCC
tos.system.ADCM
tos.system.Voltage

Components requiring this interface:
tos.lib.Attributes.AttrAccelM
tos.lib.Attributes.AttrMagM
tos.lib.Attributes.AttrMicM
tos.lib.Attributes.AttrPhotoM
tos.lib.Attributes.AttrTempM
tos.lib.Attributes.AttrVoltageM
tos.sensorboards.micasb.PhotoTempM

Commands

Events

Commands - Details

getData

result_t getData(void)

Initiates an ADC conversion on a given port.
Returns: SUCCESS if the ADC is free and available to accept the request

getContinuousData

result_t getContinuousData(void)

Initiates a series of ADC conversions. Each return from dataReady() initiates the next conversion.
Returns: SUCCESS if the ADC is free and available to accept the request

Events - Details

dataReady

result_t dataReady(uint16_t data)

Indicates a sample has been recorded by the ADC as the result of a getData() command.

Parameters:

data - a 2 byte unsigned data value sampled by the ADC.

Returns: SUCCESS if ready for the next conversion in continuous mode. if not in continuous mode, the return code is ignored.