Interface: moteiv.tos.platform.msp430.adc.MSP430ADC12Multiple
interface MSP430ADC12MultipleCommands
command result_t bind(MSP430ADC12Settings_t settings)
command msp430ADCresult_t getData(uint16_t *buf, uint16_t length, uint16_t jiffies)
command msp430ADCresult_t getDataRepeat(uint16_t *buf, uint8_t length, uint16_t jiffies)
command result_t reserve(uint16_t *buf, uint16_t length, uint16_t jiffies)
command result_t reserveRepeat(uint16_t *buf, uint16_t length, uint16_t jiffies)
command void resumeSampling()
command msp430ADCresult_t startSampling(uint16_t jiffies)
command result_t unreserve()
Events
event uint16_t *dataReady(uint16_t *buf, uint16_t length)
Commands - Details
bind
command result_t bind(MSP430ADC12Settings_t settings)
- Returns:
-
FAIL if interface parameter is out of bounds or
conversion in progress for this interface, SUCCESS otherwise
getData
command msp430ADCresult_t getData(uint16_t *buf, uint16_t length, uint16_t jiffies)
- 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.
-
jiffies
- TimerA clock ticks between the single conversions
of the series. Ignored if reserve
was called successfully
before, because then those settings are applicable.
- Returns:
-
MSP430ADC12_FAIL the adc is busy
MSP430ADC12_SUCCESS successfully triggered conversion
MSP430ADC12_DELAYED conversion starts as soon as VREF becomes stable.
getDataRepeat
command msp430ADCresult_t getDataRepeat(uint16_t *buf, uint8_t length, uint16_t jiffies)
- Parameters:
-
buf
- Buffer to store the conversion results.
-
length
- The size of the buffer and number of conversions,
must be <= 16
- Returns:
-
MSP430ADC12_FAIL the adc is busy
MSP430ADC12_SUCCESS successfully triggered conversion
MSP430ADC12_DELAYED conversion starts as soon as VREF becomes stable.
pauseSampling
command void pauseSampling()
reserve
command result_t reserve(uint16_t *buf, uint16_t length, uint16_t jiffies)
- Returns:
-
SUCCESS reservation successful
FAIL otherwise
reserveRepeat
command result_t reserveRepeat(uint16_t *buf, uint16_t length, uint16_t jiffies)
resumeSampling
command void resumeSampling()
startSampling
command msp430ADCresult_t startSampling(uint16_t jiffies)
stopSampling
command void stopSampling()
unreserve
command result_t unreserve()
- Returns:
-
SUCCESS un-reservation successful
FAIL no reservation active
Events - Details
dataReady
event uint16_t *dataReady(uint16_t *buf, uint16_t length)
- Parameters:
-
buf
- Buffer address of conversion results, it is
identical to the buf
passed to
getData
or getDataRepeat
.
In each word the lower 12 bits are the actual
result and the upper 4 bits are zero.
-
length
- The size of the buffer and number of conversions,
it is identical to the length
passed to
getData
or getDataRepeat
.
- Returns:
-
Points to the buffer where to store the next
sequence of conversions. The buffer must be of size
length
, it can, of course, be identical to
buf
(then the previous results will be
overwritten).
A return value of 0 (nullpointer) will stop repeat mode, so
that no further conversions are performed.