Swadge ESP32-S2
APIs to develop for the Magfest Swadge
Toggle main menu visibility
Loading...
Searching...
No Matches
hdw-mic.h
Go to the documentation of this file.
1
65
66
#ifndef _HDW_MIC_H_
67
#define _HDW_MIC_H_
68
69
//==============================================================================
70
// Includes
71
//==============================================================================
72
73
#include <stdint.h>
74
75
#include <soc/gpio_num.h>
76
77
//==============================================================================
78
// Defines
79
//==============================================================================
80
82
#define ADC_READ_LEN 512
83
84
#define MAX_MIC_GAIN 7
85
86
#define ADC_SAMPLE_RATE_HZ 8000
87
88
//==============================================================================
89
// Function Prototypes
90
//==============================================================================
91
92
void
initMic
(gpio_num_t gpio);
93
void
startMic
(
void
);
94
uint32_t
loopMic
(uint16_t* outSamples, uint32_t outSamplesMax);
95
void
stopMic
(
void
);
96
void
deinitMic
(
void
);
97
void
powerDownMic
(
void
);
98
void
powerUpMic
(
void
);
99
100
#endif
deinitMic
void deinitMic(void)
Deinitialize the ADC which continuously samples the microphone.
Definition
hdw-mic.c:85
initMic
void initMic(gpio_num_t gpio)
Initialize the ADC which continuously samples the microphone.
Definition
hdw-mic.c:26
loopMic
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...
Definition
hdw-mic.c:131
startMic
void startMic(void)
Start sampling the microphone's ADC.
Definition
hdw-mic.c:114
powerUpMic
void powerUpMic(void)
Power up the ADC (microphone).
Definition
hdw-mic.c:106
stopMic
void stopMic(void)
Stop sampling the microphone's ADC.
Definition
hdw-mic.c:161
powerDownMic
void powerDownMic(void)
Power down the ADC (microphone).
Definition
hdw-mic.c:98
components
hdw-mic
include
hdw-mic.h
Generated by
1.17.0