PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros
pdm_definitions.h File Reference
#include <board/board.h>
#include <pbl/drivers/mic.h>
#include <pbl/kernel/mutex.h>
#include <pbl/util/circular_buffer.h>
#include <stdbool.h>
#include <stdint.h>

Data Structures

struct  MicDevice
 nRF5 PDM microphone device. More...
 

Macros

#define PDM_BUFFER_SIZE_SAMPLES   (320)
 Samples per PDM DMA buffer.
 
#define PDM_BUFFER_COUNT   (2)
 Number of PDM DMA buffers.
 
#define PDM_GAIN_DEFAULT   (NRF_PDM_GAIN_DEFAULT)
 Default PDM gain.
 
#define CIRCULAR_BUF_SIZE_MS   (320)
 Preferred length of the queue between DMA and the data handler, in milliseconds.
 
#define CIRCULAR_BUF_SIZE_SAMPLES   ((MIC_SAMPLE_RATE * CIRCULAR_BUF_SIZE_MS) / 1000)
 Preferred queue length, in samples.
 
#define CIRCULAR_BUF_SIZE_BYTES   (CIRCULAR_BUF_SIZE_SAMPLES * sizeof(int16_t))
 Preferred queue size, in bytes.
 
#define CIRCULAR_BUF_MIN_SIZE_MS   (128)
 Minimum queue length, in milliseconds, accepted when the heap is too fragmented for the preferred one.
 
#define CIRCULAR_BUF_MIN_SIZE_SAMPLES   ((MIC_SAMPLE_RATE * CIRCULAR_BUF_MIN_SIZE_MS) / 1000)
 Minimum queue length, in samples.
 
#define CIRCULAR_BUF_MIN_SIZE_BYTES   (CIRCULAR_BUF_MIN_SIZE_SAMPLES * sizeof(int16_t))
 Minimum queue size, in bytes.
 
#define CIRCULAR_BUF_STEP_MS   (32)
 Queue shrink per allocation retry, in milliseconds.
 
#define CIRCULAR_BUF_STEP_SAMPLES   ((MIC_SAMPLE_RATE * CIRCULAR_BUF_STEP_MS) / 1000)
 Queue shrink per allocation retry, in samples.
 
#define CIRCULAR_BUF_STEP_BYTES   (CIRCULAR_BUF_STEP_SAMPLES * sizeof(int16_t))
 Queue shrink per allocation retry, in bytes.