Interface: moteiv.tos.sensorboards.invent.Microphone
interface Microphone
Interface for sampling data from a microphone.
- Author:
-
Joe Polastre, Moteiv Corporation <info@moteiv.com>
Commands
command result_t repeatStart(void *addr, uint16_t length)
command result_t start(void *addr, uint16_t length, uint16_t freq, bool repeat)
command result_t stop()
Events
event void done(void *addr, uint16_t length)
event result_t repeat(void *addr, uint16_t length)
Commands - Details
repeatStart
command result_t repeatStart(void *addr, uint16_t length)
- Parameters:
-
addr
- New address for the next set of samples
-
length
- number of samples to acquire
- Returns:
-
SUCCESS if the new settings are accepted
start
command result_t start(void *addr, uint16_t length, uint16_t freq, bool repeat)
- Parameters:
-
addr
- Memory address of first sample
-
length
- The length of the audio sample
-
freq
- Time between samples in microseconds
-
repeat
- TRUE to repeat the transfer and ask for the next buffer,
FALSE to only take 'length' samples and then stop
- Returns:
-
SUCCESS if the playback can begin immediately
stop
command result_t stop()
- Returns:
-
SUCCESS if playback is halted (a done() event will be signalled),
FAIL if no sample is playing or if it cannot be halted.
Events - Details
done
event void done(void *addr, uint16_t length)
- Parameters:
-
addr
- Address of the audio sample
-
length
- Length of the audio sample
-
freq
- Frequency of the recorded audio sample (in us)
repeat
event result_t repeat(void *addr, uint16_t length)