8#ifndef _PICO_PDM_MICROPHONE_H_
9#define _PICO_PDM_MICROPHONE_H_
11#include "hardware/pio.h"
13typedef void (*pdm_samples_ready_handler_t)(void);
15struct pdm_microphone_config {
21 uint sample_buffer_size;
24int pdm_microphone_init(
const struct pdm_microphone_config* config);
25void pdm_microphone_deinit();
27int pdm_microphone_start();
28void pdm_microphone_stop();
30void pdm_microphone_set_samples_ready_handler(pdm_samples_ready_handler_t handler);
31void pdm_microphone_set_filter_max_volume(uint8_t max_volume);
32void pdm_microphone_set_filter_gain(uint8_t gain);
33void pdm_microphone_set_filter_volume(uint16_t volume);
35int pdm_microphone_read(int16_t* buffer,
size_t samples);