249 #ifndef ti_drivers_pdm_PDMCC26XX__include
250 #define ti_drivers_pdm_PDMCC26XX__include
260 #define ti_sysbios_family_arm_m3_Hwi__nolocalnames
262 #include <ti/sysbios/knl/Semaphore.h>
264 #include <ti/sysbios/family/arm/m3/Hwi.h>
272 #define PDM_TASK_STACK_SIZE 500
276 #define PDM_NUM_OF_CHANNELS 2
281 #define PDM_BLOCK_SIZE_IN_SAMPLES 64
285 #define PDM_BUFFER_SIZE_IN_BLOCKS 3
288 #define PCM_COMPRESSION_RATE 4
294 #define PCM_METADATA_SIZE 4
299 #define PDM_SAMPLE_SIZE 16 // 24
301 #define PCM_SAMPLE_SIZE 16 // Only 16 bits supported for now
305 #define PDM_NUMBER_OF_PINS 1 // Only one pin to control microphone power
310 #define PDM_EVT_BLK_RDY Event_Id_00
313 #define PDM_EVT_START Event_Id_01
316 #define PDM_EVT_BLK_ERROR Event_Id_02
319 #define PDM_EVT_CLOSE Event_Id_03
325 #define PDM_DECIMATION_STARTUP_DELAY_IN_SAMPLES 32
329 #define PDM_ROLLBACK_OPEN 1 << 0
331 #define PDM_ROLLBACK_ACTIVE_PCM_BUFFER 1 << 1
333 #define PDM_ROLLBACK_I2S_DRIVER 1 << 2
335 #define PDM_ROLLBACK_PIN 1 << 3
340 #define PDMCC26XX_COMPR_ITER_OUTPUT_SIZE 16
342 #define PDMCC26XX_CPY_ITER_OUTPUT_SIZE 64
352 #if (defined PDM_SAMPLE_SIZE) && (PDM_SAMPLE_SIZE == 24)
353 typedef __packed
struct {
354 uint8_t pdmSampleLsb;
355 uint16_t pdmSampleMsb;
357 #elif (defined PDM_SAMPLE_SIZE) && (PDM_SAMPLE_SIZE == 16)
360 #error Unsupported PDM samples size (16 or 24)
363 #if (defined PCM_SAMPLE_SIZE) && (PCM_SAMPLE_SIZE == 16)
366 #error Unsupported PCM samples size (16)
387 typedef void *(*PDMCC26XX_MallocFxn)(
size_t memSize);
570 ti_sysbios_family_arm_m3_Hwi_Struct
hwi;
680 #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:460
PDMCC26XX_Gain micGain
Definition: PDMCC26XX.h:554
PDMCC26XX_pcmBuffer * buffer
Definition: PDMCC26XX.h:502
bool useDefaultFilter
Definition: PDMCC26XX.h:518
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:474
void * arg
Definition: PDMCC26XX.h:475
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:387
Definition: PDMCC26XX.h:444
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:556
int16_t pcmSample_t
Definition: PDMCC26XX.h:364
Power manager interface for CC26XX.
struct PDMCC26XX_Object PDMCC26XX_Object
PDMCC26XX Object.
PDMCC26XX_MallocFxn mallocFxn
Definition: PDMCC26XX.h:562
PIN_Handle pinHandle
Definition: PDMCC26XX.h:575
bool PDMCC26XX_stopStream(PDMCC26XX_Handle handle)
Function to stop streaming PDM data.
int taskPriority
Definition: PDMCC26XX.h:423
const PDMCC26XX_Config PDMCC26XX_config[]
PDMCC26XX_CallbackFxn callbackFxn
Definition: PDMCC26XX.h:547
PCM buffer pointed to in a PDMCC26XX_BufferRequest.
Definition: PDMCC26XX.h:377
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:436
bool PDMCC26XX_requestBuffer(PDMCC26XX_Handle handle, PDMCC26XX_BufferRequest *bufferRequest)
Function for requesting buffer.
Semaphore_Struct blockComplete
Definition: PDMCC26XX.h:571
Definition: PDMCC26XX.h:464
void PDMCC26XX_init(PDMCC26XX_Handle handle)
PDM CC26XX initialization.
int32_t * decimationFilter
Definition: PDMCC26XX.h:521
struct PDMCC26XX_Config * PDMCC26XX_Handle
A handle that is returned from a PDMCC26XX_open() call.
Definition: PDMCC26XX.h:429
Definition: PDMCC26XX.h:442
PDMCC26XX_metaData metaData
Definition: PDMCC26XX.h:378
PDMCC26XX_StreamNotification * streamNotification
Definition: PDMCC26XX.h:566
void const * hwAttrs
Definition: PDMCC26XX.h:407
bool micPowerActiveHigh
Definition: PDMCC26XX.h:555
Definition: PDMCC26XX.h:466
uint16_t pdmSample_t
Definition: PDMCC26XX.h:358
bool micPowerActiveHigh
Definition: PDMCC26XX.h:525
A PDMCC26XX_BufferRequest data structure is used with PDMCC26XX_requestBuffer().
Definition: PDMCC26XX.h:501
Definition: PDMCC26XX.h:437
PDMCC26XX Parameters are used to with the PDMCC26XX_open() call. Default values for these parameters ...
Definition: PDMCC26XX.h:515
uint16_t retBufSizeInBytes
Definition: PDMCC26XX.h:531
uint32_t startupDelayWithClockInSamples
Definition: PDMCC26XX.h:558
Definition: PDMCC26XX.h:463
Definition: PDMCC26XX.h:462
uint32_t startupDelayWithClockInSamples
Definition: PDMCC26XX.h:528
The PDMCC26XX_Config structure contains a set of pointers used to characterize the PDMCC26XX driver i...
Definition: PDMCC26XX.h:402
uint16_t retBufSizeInBytes
Definition: PDMCC26XX.h:561
Definition: PDMCC26XX.h:461
Definition: PDMCC26XX.h:445
void * object
Definition: PDMCC26XX.h:404
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:484
Definition: PDMCC26XX.h:435
PDMCC26XX_Status status
Definition: PDMCC26XX.h:505
PDMCC26XX_MallocFxn mallocFxn
Definition: PDMCC26XX.h:534
PIN_Id micPower
Definition: PDMCC26XX.h:421
PDMCC26XX_Status status
Definition: PDMCC26XX.h:476
bool useDefaultFilter
Definition: PDMCC26XX.h:548
bool isOpen
Definition: PDMCC26XX.h:577
PDMCC26XX_FreeFxn freeFxn
Definition: PDMCC26XX.h:535
PDMCC26XX Object.
Definition: PDMCC26XX.h:545
PDMCC26XX_Status
Status codes that are set by the PDM driver.
Definition: PDMCC26XX.h:434
int32_t * decimationFilter
Definition: PDMCC26XX.h:551
struct PDMCC26XX_BufferRequest PDMCC26XX_BufferRequest
A PDMCC26XX_BufferRequest data structure is used with PDMCC26XX_requestBuffer().
Definition: PDMCC26XX.h:465
PIN_State pinState
Definition: PDMCC26XX.h:574
bool applyCompression
Definition: PDMCC26XX.h:526
PDMCC26XX_FreeFxn freeFxn
Definition: PDMCC26XX.h:563
uintptr_t custom
Definition: PDMCC26XX.h:536
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:395
PDMCC26XX Hardware attributes.
Definition: PDMCC26XX.h:419
PDMCC26XX_Gain micGain
Definition: PDMCC26XX.h:524
ti_sysbios_family_arm_m3_Hwi_Struct hwi
Definition: PDMCC26XX.h:570
Definition: PDMCC26XX.h:441
bool bStreamStarted
Definition: PDMCC26XX.h:567
PDMCC26XX_CallbackFxn callbackFxn
Definition: PDMCC26XX.h:517