Macros | Enumerations | Functions
Wm8960_adapter

Macros

#define HAL_CODEC_HANDLER_SIZE   (WM8960_I2C_HANDLER_SIZE + 4)
 codec handler size More...
 

Enumerations

enum  _codec_type { kCODEC_WM8960 }
 codec type More...
 

Functions

status_t HAL_CODEC_Deinit (void *handle)
 Codec de-initilization. More...
 
status_t HAL_CODEC_Init (void *handle, void *config)
 Codec initilization. More...
 
status_t HAL_CODEC_ModuleControl (void *handle, uint32_t cmd, uint32_t data)
 codec module control. More...
 
status_t HAL_CODEC_SetFormat (void *handle, uint32_t mclk, uint32_t sampleRate, uint32_t bitWidth)
 set audio data format. More...
 
status_t HAL_CODEC_SetMute (void *handle, uint32_t playChannel, bool isMute)
 set audio codec module mute. More...
 
status_t HAL_CODEC_SetPlay (void *handle, uint32_t playSource)
 codec set play source. More...
 
status_t HAL_CODEC_SetPower (void *handle, uint32_t module, bool powerOn)
 set audio codec module power. More...
 
status_t HAL_CODEC_SetRecord (void *handle, uint32_t recordSource)
 codec set record source. More...
 
status_t HAL_CODEC_SetRecordChannel (void *handle, uint32_t leftRecordChannel, uint32_t rightRecordChannel)
 codec set record channel. More...
 
status_t HAL_CODEC_SetVolume (void *handle, uint32_t playChannel, uint32_t volume)
 set audio codec module volume. More...
 

Detailed Description

Macro Definition Documentation

◆ HAL_CODEC_HANDLER_SIZE

#define HAL_CODEC_HANDLER_SIZE   (WM8960_I2C_HANDLER_SIZE + 4)

codec handler size

Definition at line 22 of file fsl_codec_adapter.h.

Enumeration Type Documentation

◆ _codec_type

codec type

Enumerator
kCODEC_WM8960 

wm8960

Definition at line 24 of file fsl_codec_adapter.h.

Function Documentation

◆ HAL_CODEC_Deinit()

status_t HAL_CODEC_Deinit ( void *  handle)

Codec de-initilization.

Parameters
handlecodec handle.
Returns
kStatus_Success is success, else de-initial failed.

brief Codec de-initilization.

param handle codec handle. return kStatus_Success is success, else de-initial failed.

Definition at line 102 of file fsl_codec_adapter.c.

◆ HAL_CODEC_Init()

status_t HAL_CODEC_Init ( void *  handle,
void *  config 
)

Codec initilization.

Parameters
handlecodec handle.
configcodec configuration.
Returns
kStatus_Success is success, else initial failed.

brief Codec initilization.

param handle codec handle. param config codec configuration. return kStatus_Success is success, else initial failed.

Definition at line 81 of file fsl_codec_adapter.c.

◆ HAL_CODEC_ModuleControl()

status_t HAL_CODEC_ModuleControl ( void *  handle,
uint32_t  cmd,
uint32_t  data 
)

codec module control.

This function is used for codec module control, support switch digital interface cmd, can be expand to support codec module specific feature

Parameters
handlecodec handle.
cmdmodule control cmd, reference _codec_module_ctrl_cmd.
datavalue to write, when cmd is kCODEC_ModuleRecordSourceChannel, the data should be a value combine of channel and source, please reference macro CODEC_MODULE_RECORD_SOURCE_CHANNEL(source, LP, LN, RP, RN), reference codec specific driver for detail configurations.
Returns
kStatus_Success is success, else configure failed.

brief codec module control.

param handle codec handle. param cmd module control cmd, reference _codec_module_ctrl_cmd. param data value to write, when cmd is kCODEC_ModuleRecordSourceChannel, the data should be a value combine of channel and source, please reference macro CODEC_MODULE_RECORD_SOURCE_CHANNEL(source, LP, LN, RP, RN), reference codec specific driver for detail configurations. return kStatus_Success is success, else configure failed.

Definition at line 254 of file fsl_codec_adapter.c.

◆ HAL_CODEC_SetFormat()

status_t HAL_CODEC_SetFormat ( void *  handle,
uint32_t  mclk,
uint32_t  sampleRate,
uint32_t  bitWidth 
)

set audio data format.

Parameters
handlecodec handle.
mclkmaster clock frequency in HZ.
sampleRatesample rate in HZ.
bitWidthbit width.
Returns
kStatus_Success is success, else configure failed.

brief set audio data format.

param handle codec handle. param mclk master clock frequency in HZ. param sampleRate sample rate in HZ. param bitWidth bit width. return kStatus_Success is success, else configure failed.

Definition at line 118 of file fsl_codec_adapter.c.

◆ HAL_CODEC_SetMute()

status_t HAL_CODEC_SetMute ( void *  handle,
uint32_t  playChannel,
bool  isMute 
)

set audio codec module mute.

Parameters
handlecodec handle.
playChannelaudio codec play channel, can be a value or combine value of _codec_play_channel.
isMutetrue is mute, false is unmute.
Returns
kStatus_Success is success, else configure failed.

brief set audio codec module mute.

param handle codec handle. param channel audio codec play channel, can be a value or combine value of _codec_play_channel. param isMute true is mute, false is unmute. return kStatus_Success is success, else configure failed.

Definition at line 163 of file fsl_codec_adapter.c.

◆ HAL_CODEC_SetPlay()

status_t HAL_CODEC_SetPlay ( void *  handle,
uint32_t  playSource 
)

codec set play source.

Parameters
handlecodec handle.
playSourceaudio codec play source, can be a value or combine value of _codec_play_source.
Returns
kStatus_Success is success, else configure failed.

brief codec set play source.

param handle codec handle. param playSource audio codec play source, can be a value or combine value of _codec_play_source.

return kStatus_Success is success, else configure failed.

Definition at line 237 of file fsl_codec_adapter.c.

◆ HAL_CODEC_SetPower()

status_t HAL_CODEC_SetPower ( void *  handle,
uint32_t  module,
bool  powerOn 
)

set audio codec module power.

Parameters
handlecodec handle.
moduleaudio codec module.
powerOntrue is power on, false is power down.
Returns
kStatus_Success is success, else configure failed.

brief set audio codec module power.

param handle codec handle. param module audio codec module. param powerOn true is power on, false is power down. return kStatus_Success is success, else configure failed.

Definition at line 192 of file fsl_codec_adapter.c.

◆ HAL_CODEC_SetRecord()

status_t HAL_CODEC_SetRecord ( void *  handle,
uint32_t  recordSource 
)

codec set record source.

Parameters
handlecodec handle.
recordSourceaudio codec record source, can be a value or combine value of _codec_record_source.
Returns
kStatus_Success is success, else configure failed.

brief codec set record source.

param handle codec handle. param source audio codec record source, can be a value or combine value of _codec_record_source.

Returns
kStatus_Success is success, else configure failed.

Definition at line 224 of file fsl_codec_adapter.c.

◆ HAL_CODEC_SetRecordChannel()

status_t HAL_CODEC_SetRecordChannel ( void *  handle,
uint32_t  leftRecordChannel,
uint32_t  rightRecordChannel 
)

codec set record channel.

Parameters
handlecodec handle.
leftRecordChannelaudio codec record channel, reference _codec_record_channel, can be a value or combine value of member in _codec_record_channel.
rightRecordChannelaudio codec record channel, reference _codec_record_channel, can be a value combine of member in _codec_record_channel.
Returns
kStatus_Success is success, else configure failed.

brief codec set record channel.

param handle codec handle. param leftRecordChannel audio codec record channel, reference _codec_record_channel, can be a value or combine value of member in _codec_record_channel. param rightRecordChannel audio codec record channel, reference _codec_record_channel, can be a value combine of member in _codec_record_channel.

return kStatus_Success is success, else configure failed.

Definition at line 211 of file fsl_codec_adapter.c.

◆ HAL_CODEC_SetVolume()

status_t HAL_CODEC_SetVolume ( void *  handle,
uint32_t  playChannel,
uint32_t  volume 
)

set audio codec module volume.

Parameters
handlecodec handle.
playChannelaudio codec play channel, can be a value or combine value of _codec_play_channel.
volumevolume value, support 0 ~ 100, 0 is mute, 100 is the maximum volume value.
Returns
kStatus_Success is success, else configure failed.

brief set audio codec module volume.

param handle codec handle. param channel audio codec play channel, can be a value or combine value of _codec_play_channel. param volume volume value, support 0 ~ 100, 0 is mute, 100 is the maximum volume value. return kStatus_Success is success, else configure failed.

Definition at line 134 of file fsl_codec_adapter.c.



picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:09