Interface: tos.interfaces.ADC

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

Commands
command result_t getContinuousData() Initiates a series of ADC conversions.
command result_t getData() Initiates an ADC conversion on a given port.

Events
event result_t dataReady(uint16_t data) Indicates a sample has been recorded by the ADC as the result of a getData() command.

Commands - Details

getContinuousData

command result_t getContinuousData()

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

getData

command result_t getData()

Initiates an ADC conversion on a given port.

Returns:
SUCCESS if the ADC is free and available to accept the request

Events - Details

dataReady

event 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.