Core2 for AWS IoT EduKit BSP  1.4.0
Microphone

The Microphone library provides convenience functions to initialize and de-initialize the SPM1423 microphone with preset parameters. The microphone cannot be accessed at the same time as the speaker since they both share a common pin (GPIO0).

Circuit Block Diagram for the SPM1423 microphone

To enable this hardware feature using KConfig, use the command pio run --environment core2foraws --target menuconfig from within the root of the project directory in your PlatformIO terminal window and go to the menu Component Config --> Core2 for AWS hardware enable to set the features you want to enable.

Example

The following example initializes the SPM1423 microphone, and then reads 1Kb of sound with the microphone using the ESP-IDF i2s_read function.

static int8_t i2s_readraw_buf[1024];
size_t bytesread;
i2s_read(MIC_I2S_NUMBER, (char*)i2s_readraw_buf, 1024, &bytesread, pdMS_TO_TICKS(100));
void Microphone_Init()
Initializes the microphone over I2S.
Definition: microphone.c:10
#define MIC_I2S_NUMBER
Microphone I2S port number.
Definition: microphone.h:12

Preprocessor Macros

Functions