Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Abstraction for digital microphones. More...
Data Structures | |
struct | pdm_io_cfg |
struct | pcm_stream_cfg |
struct | pdm_chan_cfg |
struct | dmic_cfg |
Enumerations | |
enum | dmic_state { DMIC_STATE_UNINIT , DMIC_STATE_INITIALIZED , DMIC_STATE_CONFIGURED , DMIC_STATE_ACTIVE , DMIC_STATE_PAUSED } |
enum | dmic_trigger { DMIC_TRIGGER_STOP , DMIC_TRIGGER_START , DMIC_TRIGGER_PAUSE , DMIC_TRIGGER_RELEASE , DMIC_TRIGGER_RESET } |
enum | pdm_lr { PDM_CHAN_LEFT , PDM_CHAN_RIGHT } |
Functions | |
static uint32_t | dmic_build_channel_map (uint8_t channel, uint8_t pdm, enum pdm_lr lr) |
static void | dmic_parse_channel_map (uint32_t channel_map_lo, uint32_t channel_map_hi, uint8_t channel, uint8_t *pdm, enum pdm_lr *lr) |
static uint32_t | dmic_build_clk_skew_map (uint8_t pdm, uint8_t skew) |
static int | dmic_configure (const struct device *dev, struct dmic_cfg *cfg) |
static int | dmic_trigger (const struct device *dev, enum dmic_trigger cmd) |
static int | dmic_read (const struct device *dev, uint8_t stream, void **buffer, size_t *size, int32_t timeout) |
Abstraction for digital microphones.
enum dmic_state |
#include <include/audio/dmic.h>
DMIC driver states
Enumerator | |
---|---|
DMIC_STATE_UNINIT | |
DMIC_STATE_INITIALIZED | |
DMIC_STATE_CONFIGURED | |
DMIC_STATE_ACTIVE | |
DMIC_STATE_PAUSED |
enum dmic_trigger |
#include <include/audio/dmic.h>
DMIC driver trigger commands
Enumerator | |
---|---|
DMIC_TRIGGER_STOP | |
DMIC_TRIGGER_START | |
DMIC_TRIGGER_PAUSE | |
DMIC_TRIGGER_RELEASE | |
DMIC_TRIGGER_RESET |
enum pdm_lr |
|
inlinestatic |
#include <include/audio/dmic.h>
Build the channel map to populate struct pdm_chan_cfg
Returns the map of PDM controller and LEFT/RIGHT channel shifted to the bit position corresponding to the input logical channel value
channel | The logical channel number |
pdm | The PDM hardware controller number |
lr | LEFT/RIGHT channel within the chosen PDM hardware controller |
#include <include/audio/dmic.h>
Build a bit map of clock skew values for each PDM channel
Returns the bit-map of clock skew value shifted to the bit position corresponding to the input PDM controller value
pdm | The PDM hardware controller number |
skew | The skew to apply for the clock output from the PDM controller |
#include <include/audio/dmic.h>
Configure the DMIC driver and controller(s)
Configures the DMIC driver device according to the number of channels, channel mapping, PDM I/O configuration, PCM stream configuration, etc.
dev | Pointer to the device structure for DMIC driver instance |
cfg | Pointer to the structure containing the DMIC configuration |
|
inlinestatic |
#include <include/audio/dmic.h>
Helper function to parse the channel map in pdm_chan_cfg
Returns the PDM controller and LEFT/RIGHT channel corresponding to the channel map and the logical channel provided as input
channel_map_lo | Lower order/significant bits of the channel map |
channel_map_hi | Higher order/significant bits of the channel map |
channel | The logical channel number |
pdm | Pointer to the PDM hardware controller number |
lr | Pointer to the LEFT/RIGHT channel within the PDM controller |
|
inlinestatic |
#include <include/audio/dmic.h>
Read received decimated PCM data stream
Optionally waits for audio to be received and provides the received audio buffer from the requested stream
dev | Pointer to the device structure for DMIC driver instance |
stream | Stream identifier |
buffer | Pointer to the received buffer address |
size | Pointer to the received buffer size |
timeout | Timeout in milliseconds to wait in case audio is not yet received, or SYS_FOREVER_MS |
|
inlinestatic |
#include <include/audio/dmic.h>
Send a command to the DMIC driver
Sends a command to the driver to perform a specific action
dev | Pointer to the device structure for DMIC driver instance |
cmd | The command to be sent to the driver instance |