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

Interface: HPLADC

Interface to the hardware ADC. Allows binding of virtual ports to physical hardware ports (useful for platform independence).

Components providing this interface:
tos.platform.avrmote.HPLADCC

Components requiring this interface:
tos.system.ADCM

Commands

Events

Commands - Details

init

result_t init(void)

Initialize the ADC.
Returns: SUCCESS always.

setSamplingRate

result_t setSamplingRate(uint8_t rate)

Sets the ADC sampling rate in terms of clock ticks.
Returns: SUCCESS always.

bindPort

result_t bindPort(uint8_t port, uint8_t adcPort)

Bind a virtual port number to an actual ADC data port.
Returns: FAIL if virtual port out of range, SUCCESS otherwise.

samplePort

result_t samplePort(uint8_t port)

Request a single data sample on a port.
Returns: SUCCESS always.

sampleAgain

result_t sampleAgain(void)

Sample the most recently sampled port again.
Returns: SUCCESS alway s.

sampleStop

result_t sampleStop(void)

Stop sampling. Return to an idle mode.
Returns: SUCCESS always.

Events - Details

dataReady

result_t dataReady(uint16_t data)

Signaled when a data ready is ready.
Returns: SUCCESS always.