Interface: moteiv.tos.platform.msp430.adc.ADCMultiple
interface ADCMultipleCommands
command adcresult_t getData(uint16_t *buf, uint16_t length)
command adcresult_t getDataContinuous(uint16_t *buf, uint16_t length)
command adcresult_t reserve(uint16_t *buf, uint16_t length)
command adcresult_t reserveContinuous(uint16_t *buf, uint16_t length)
command adcresult_t unreserve()
Events
event uint16_t *dataReady(adcresult_t result, uint16_t *buf, uint16_t length)
Commands - Details
getData
command adcresult_t getData(uint16_t *buf, uint16_t length)
- Parameters:
-
buf
- Buffer to store the conversion results. Ignored
if reserve
was called successfully before,
because then those settings are applicable.
-
length
- The size of the buffer and number of conversions.
Ignored if reserve
was called successfully before,
because then those settings are applicable.
- Returns:
-
ADC_SUCCESS if the ADC is free and available
to accept the request, error code otherwise (see ADCHIL.h).
getDataContinuous
command adcresult_t getDataContinuous(uint16_t *buf, uint16_t length)
- Parameters:
-
buf
- Buffer to store the conversion results. Ignored
if reserveContinuous
was called successfully before,
because then those settings are applicable.
-
length
- The size of the buffer and number of conversions.
Ignored if reserveContinuous
was called successfully before,
because then those settings are applicable.
- Returns:
-
ADC_SUCCESS if the ADC is free and available
to accept the request, error code otherwise (see ADCHIL.h).
reserve
command adcresult_t reserve(uint16_t *buf, uint16_t length)
- Returns:
-
ADC_SUCCESS if reservation was successful,
error code otherwise (see ADCHIL.h).
reserveContinuous
command adcresult_t reserveContinuous(uint16_t *buf, uint16_t length)
- Returns:
-
ADC_SUCCESS if reservation was successful,
error code otherwise (see ADCHIL.h).
unreserve
command adcresult_t unreserve()
- Returns:
-
ADC_SUCCESS if reservation was cancelled successfully,
error code otherwise (see ADCHIL.h).
Events - Details
dataReady
event uint16_t *dataReady(adcresult_t result, uint16_t *buf, uint16_t length)
- Parameters:
-
result
- ADC_SUCCESS if the conversions were performed
successfully and the results are valid, error code
otherwise (see ADCHIL.h).
-
buf
- The address of the conversion results, identical
to buf passed to getData
or
reserveContinuous
.
-
length
- Size of the buffer, identical to length passed to
getData
or reserveContinuous
.
- Returns:
-
0 (nullpointer) stops further conversions in continuous mode,
otherwise the pointer points to a buffer of the same length
where the next conversion results are to be stored in continuous mode
(ignored if not in continuous mode).