Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Functions | |
void | initMic (gpio_num_t gpio) |
Initialize the ADC which continuously samples the microphone. | |
void | startMic (void) |
Start sampling the microphone's ADC. | |
uint32_t | loopMic (uint16_t *outSamples, uint32_t outSamplesMax) |
Attempt to read a block of 12-bit samples from the ADC in continuous mode. This may return fewer than expected samples (or zero samples) if the task rate is faster than the sampling rate. | |
void | stopMic (void) |
Stop sampling the microphone's ADC. | |
void | deinitMic (void) |
Deinitialize the ADC which continuously samples the microphone. | |
void initMic | ( | gpio_num_t | gpio | ) |
Initialize the ADC which continuously samples the microphone.
This does not start sampling, so startMic() must be called afterwards.
gpio | The GPIO the microphone is attached to |
void startMic | ( | void | ) |
Start sampling the microphone's ADC.
uint32_t loopMic | ( | uint16_t * | outSamples, |
uint32_t | outSamplesMax ) |
Attempt to read a block of 12-bit samples from the ADC in continuous mode. This may return fewer than expected samples (or zero samples) if the task rate is faster than the sampling rate.
[out] | outSamples | A pointer to write 12-bit samples from the ADC |
[in] | outSamplesMax | The maximum number of samples that can be written to outSamples |
void stopMic | ( | void | ) |
Stop sampling the microphone's ADC.
void deinitMic | ( | void | ) |
Deinitialize the ADC which continuously samples the microphone.