237 #ifndef ti_drivers_pdm_PDMCC26XX__include
238 #define ti_drivers_pdm_PDMCC26XX__include
248 #define ti_sysbios_family_arm_m3_Hwi__nolocalnames
250 #include <ti/sysbios/knl/Semaphore.h>
252 #include <ti/sysbios/family/arm/m3/Hwi.h>
260 #define PDM_TASK_STACK_SIZE 400
264 #define PDM_NUM_OF_CHANNELS 2
269 #define PDM_BLOCK_SIZE_IN_SAMPLES 64
273 #define PDM_BUFFER_SIZE_IN_BLOCKS 3
276 #define PCM_COMPRESSION_RATE 4
282 #define PCM_METADATA_SIZE 4
287 #define PDM_SAMPLE_SIZE 16 // 24
289 #define PCM_SAMPLE_SIZE 16 // Only 16 bits supported for now
293 #define PDM_NUMBER_OF_PINS 1 // Only one pin to control microphone power
298 #define PDM_EVT_BLK_RDY Event_Id_00
301 #define PDM_EVT_START Event_Id_01
304 #define PDM_EVT_BLK_ERROR Event_Id_02
307 #define PDM_EVT_CLOSE Event_Id_03
313 #define PDM_DECIMATION_STARTUP_DELAY_IN_SAMPLES 32
317 #define PDM_ROLLBACK_OPEN 1 << 0
319 #define PDM_ROLLBACK_ACTIVE_PCM_BUFFER 1 << 1
321 #define PDM_ROLLBACK_I2S_DRIVER 1 << 2
323 #define PDM_ROLLBACK_PIN 1 << 3
328 #define PDMCC26XX_COMPR_ITER_OUTPUT_SIZE 16
330 #define PDMCC26XX_CPY_ITER_OUTPUT_SIZE 64
340 #if (defined PDM_SAMPLE_SIZE) && (PDM_SAMPLE_SIZE == 24)
341 typedef __packed
struct {
342 uint8_t pdmSampleLsb;
343 uint16_t pdmSampleMsb;
345 #elif (defined PDM_SAMPLE_SIZE) && (PDM_SAMPLE_SIZE == 16)
348 #error Unsupported PDM samples size (16 or 24)
351 #if (defined PCM_SAMPLE_SIZE) && (PCM_SAMPLE_SIZE == 16)
354 #error Unsupported PCM samples size (16)
375 typedef void *(*PDMCC26XX_MallocFxn)(
size_t memSize);
558 ti_sysbios_family_arm_m3_Hwi_Struct
hwi;
668 #undef ti_sysbios_family_arm_m3_Hwi__nolocalnames
uint8_t PIN_Id
Pin identifier data type.
Definition: PIN.h:557
void PDMCC26XX_close(PDMCC26XX_Handle handle)
Function to close a given CC26XX PDM peripheral specified by the PDM handle.
PDMCC26XX_Gain
Predefined gain settings.
Definition: PDMCC26XX.h:448
PDMCC26XX_Gain micGain
Definition: PDMCC26XX.h:542
PDMCC26XX_pcmBuffer * buffer
Definition: PDMCC26XX.h:490
bool useDefaultFilter
Definition: PDMCC26XX.h:506
PDMCC26XX_Handle PDMCC26XX_open(PDMCC26XX_Params *params)
Function to initialize the CC26XX PDM peripheral specified by the particular handle. The parameter specifies which mode the PDM will operate.
struct PDMCC26XX_Config PDMCC26XX_Config
The PDMCC26XX_Config structure contains a set of pointers used to characterize the PDMCC26XX driver i...
bool PDMCC26XX_startStream(PDMCC26XX_Handle handle)
Function to start streaming PDM data.
A PDMCC26XX_StreamNotification data structure is used with PDMCC26XX_CallbackFxn(). Provides notification about available buffers and potential errors.
Definition: PDMCC26XX.h:462
void * arg
Definition: PDMCC26XX.h:463
void *(* PDMCC26XX_MallocFxn)(size_t memSize)
PDMCC26XX_MallocFxn is a function pointer for the malloc function to be used by the driver...
Definition: PDMCC26XX.h:375
Definition: PDMCC26XX.h:432
struct PDMCC26XX_StreamNotification PDMCC26XX_StreamNotification
A PDMCC26XX_StreamNotification data structure is used with PDMCC26XX_CallbackFxn(). Provides notification about available buffers and potential errors.
bool applyCompression
Definition: PDMCC26XX.h:544
int16_t pcmSample_t
Definition: PDMCC26XX.h:352
Power manager interface for CC26XX.
struct PDMCC26XX_Object PDMCC26XX_Object
PDMCC26XX Object.
PDMCC26XX_MallocFxn mallocFxn
Definition: PDMCC26XX.h:550
PIN_Handle pinHandle
Definition: PDMCC26XX.h:563
bool PDMCC26XX_stopStream(PDMCC26XX_Handle handle)
Function to stop streaming PDM data.
int taskPriority
Definition: PDMCC26XX.h:411
const PDMCC26XX_Config PDMCC26XX_config[]
PDMCC26XX_CallbackFxn callbackFxn
Definition: PDMCC26XX.h:535
PCM buffer pointed to in a PDMCC26XX_BufferRequest.
Definition: PDMCC26XX.h:365
struct PDMCC26XX_HWAttrs PDMCC26XX_HWAttrs
PDMCC26XX Hardware attributes.
struct PDMCC26XX_Params PDMCC26XX_Params
PDMCC26XX Parameters are used to with the PDMCC26XX_open() call. Default values for these parameters ...
Definition: PDMCC26XX.h:424
bool PDMCC26XX_requestBuffer(PDMCC26XX_Handle handle, PDMCC26XX_BufferRequest *bufferRequest)
Function for requesting buffer.
Semaphore_Struct blockComplete
Definition: PDMCC26XX.h:559
Definition: PDMCC26XX.h:452
void PDMCC26XX_init(PDMCC26XX_Handle handle)
PDM CC26XX initialization.
int32_t * decimationFilter
Definition: PDMCC26XX.h:509
struct PDMCC26XX_Config * PDMCC26XX_Handle
A handle that is returned from a PDMCC26XX_open() call.
Definition: PDMCC26XX.h:417
Definition: PDMCC26XX.h:430
PDMCC26XX_metaData metaData
Definition: PDMCC26XX.h:366
PDMCC26XX_StreamNotification * streamNotification
Definition: PDMCC26XX.h:554
void const * hwAttrs
Definition: PDMCC26XX.h:395
bool micPowerActiveHigh
Definition: PDMCC26XX.h:543
Definition: PDMCC26XX.h:454
uint16_t pdmSample_t
Definition: PDMCC26XX.h:346
bool micPowerActiveHigh
Definition: PDMCC26XX.h:513
A PDMCC26XX_BufferRequest data structure is used with PDMCC26XX_requestBuffer().
Definition: PDMCC26XX.h:489
Definition: PDMCC26XX.h:425
PDMCC26XX Parameters are used to with the PDMCC26XX_open() call. Default values for these parameters ...
Definition: PDMCC26XX.h:503
uint16_t retBufSizeInBytes
Definition: PDMCC26XX.h:519
uint32_t startupDelayWithClockInSamples
Definition: PDMCC26XX.h:546
Definition: PDMCC26XX.h:451
Definition: PDMCC26XX.h:450
uint32_t startupDelayWithClockInSamples
Definition: PDMCC26XX.h:516
The PDMCC26XX_Config structure contains a set of pointers used to characterize the PDMCC26XX driver i...
Definition: PDMCC26XX.h:390
uint16_t retBufSizeInBytes
Definition: PDMCC26XX.h:549
Definition: PDMCC26XX.h:449
Definition: PDMCC26XX.h:433
void * object
Definition: PDMCC26XX.h:392
underlying data structure for type PIN_State
Definition: PIN.h:687
void(* PDMCC26XX_CallbackFxn)(PDMCC26XX_Handle handle, PDMCC26XX_StreamNotification *streamNotification)
The definition of a callback function used when buffers are ready.
Definition: PDMCC26XX.h:472
Definition: PDMCC26XX.h:423
PDMCC26XX_Status status
Definition: PDMCC26XX.h:493
PDMCC26XX_MallocFxn mallocFxn
Definition: PDMCC26XX.h:522
PIN_Id micPower
Definition: PDMCC26XX.h:409
PDMCC26XX_Status status
Definition: PDMCC26XX.h:464
bool useDefaultFilter
Definition: PDMCC26XX.h:536
bool isOpen
Definition: PDMCC26XX.h:565
PDMCC26XX_FreeFxn freeFxn
Definition: PDMCC26XX.h:523
PDMCC26XX Object.
Definition: PDMCC26XX.h:533
PDMCC26XX_Status
Status codes that are set by the PDM driver.
Definition: PDMCC26XX.h:422
int32_t * decimationFilter
Definition: PDMCC26XX.h:539
struct PDMCC26XX_BufferRequest PDMCC26XX_BufferRequest
A PDMCC26XX_BufferRequest data structure is used with PDMCC26XX_requestBuffer().
Definition: PDMCC26XX.h:453
PIN_State pinState
Definition: PDMCC26XX.h:562
bool applyCompression
Definition: PDMCC26XX.h:514
PDMCC26XX_FreeFxn freeFxn
Definition: PDMCC26XX.h:551
uintptr_t custom
Definition: PDMCC26XX.h:524
Generic PIN & GPIO driver.
void(* PDMCC26XX_FreeFxn)(void *ptr, size_t memSize)
PDMCC26XX_FreeFxn is a function pointer for the free function to be used by the driver. This is needed for memory clean up, if something goes wrong.
Definition: PDMCC26XX.h:383
PDMCC26XX Hardware attributes.
Definition: PDMCC26XX.h:407
PDMCC26XX_Gain micGain
Definition: PDMCC26XX.h:512
ti_sysbios_family_arm_m3_Hwi_Struct hwi
Definition: PDMCC26XX.h:558
Definition: PDMCC26XX.h:429
bool bStreamStarted
Definition: PDMCC26XX.h:555
PDMCC26XX_CallbackFxn callbackFxn
Definition: PDMCC26XX.h:505