Classes | |
struct | _codec_capability |
codec capability More... | |
struct | _codec_config |
Initialize structure of the codec. More... | |
struct | _codec_handle |
Codec handle definition. More... | |
Variables | |
const codec_capability_t * | _codec_handle::codecCapability |
codec_config_t * | _codec_handle::codecConfig |
void * | _codec_config::codecDevConfig |
uint8_t | _codec_handle::codecDevHandle [HAL_CODEC_HANDLER_SIZE] |
uint32_t | _codec_config::codecDevType |
uint32_t | _codec_capability::codecModuleCapability |
uint32_t | _codec_capability::codecPlayCapability |
uint32_t | _codec_capability::codecRecordCapability |
#define CODEC_VOLUME_MAX_VALUE (100U) |
codec maximum volume range
Definition at line 29 of file fsl_codec_common.h.
#define FSL_CODEC_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) |
CLOCK driver version 2.2.0.
Definition at line 25 of file fsl_codec_common.h.
typedef enum _codec_audio_protocol codec_audio_protocol_t |
AUDIO format definition.
typedef struct _codec_capability codec_capability_t |
codec capability
typedef struct _codec_config codec_config_t |
Initialize structure of the codec.
typedef struct _codec_handle codec_handle_t |
codec handle declaration
Definition at line 218 of file fsl_codec_common.h.
typedef enum _codec_module_ctrl_cmd codec_module_ctrl_cmd_t |
audio codec module control cmd
typedef enum _codec_module codec_module_t |
audio codec module
audio bit width
Enumerator | |
---|---|
kCODEC_AudioBitWidth16bit | audio bit width 16 |
kCODEC_AudioBitWidth20bit | audio bit width 20 |
kCODEC_AudioBitWidth24bit | audio bit width 24 |
kCODEC_AudioBitWidth32bit | audio bit width 32 |
Definition at line 71 of file fsl_codec_common.h.
AUDIO format definition.
Definition at line 43 of file fsl_codec_common.h.
audio sample rate definition
Definition at line 54 of file fsl_codec_common.h.
audio codec capability
Definition at line 170 of file fsl_codec_common.h.
enum _codec_module |
audio codec module
Definition at line 80 of file fsl_codec_common.h.
audio codec module control cmd
Enumerator | |
---|---|
kCODEC_ModuleSwitchI2SInInterface | module digital interface siwtch. |
Definition at line 98 of file fsl_codec_common.h.
audio codec module digital interface
Enumerator | |
---|---|
kCODEC_ModuleI2SInInterfacePCM | Pcm interface |
kCODEC_ModuleI2SInInterfaceDSD | DSD interface |
Definition at line 104 of file fsl_codec_common.h.
enum _codec_play_channel |
codec play channel
Definition at line 150 of file fsl_codec_common.h.
enum _codec_play_source |
audio codec module play source value
Definition at line 138 of file fsl_codec_common.h.
enum _codec_record_source |
audio codec module record source value
Definition at line 111 of file fsl_codec_common.h.
audio codec record channel
Definition at line 121 of file fsl_codec_common.h.
enum _codec_status |
CODEC status.
Definition at line 32 of file fsl_codec_common.h.
status_t CODEC_Deinit | ( | codec_handle_t * | handle | ) |
Codec de-initilization.
handle | codec handle. |
brief Codec de-initilization.
param handle codec handle. return kStatus_Success is success, else de-initial failed.
Definition at line 48 of file fsl_codec_common.c.
status_t CODEC_Init | ( | codec_handle_t * | handle, |
codec_config_t * | config | ||
) |
Codec initilization.
handle | codec handle. |
config | codec configurations. |
brief Codec initilization.
param handle codec handle. param config codec configuration. return kStatus_Success is success, else initial failed.
Definition at line 32 of file fsl_codec_common.c.
status_t CODEC_ModuleControl | ( | codec_handle_t * | handle, |
codec_module_ctrl_cmd_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.
handle | codec handle. |
cmd | module control cmd, reference _codec_module_ctrl_cmd. |
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. |
brief 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
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 84 of file fsl_codec_common.c.
status_t CODEC_SetFormat | ( | codec_handle_t * | handle, |
uint32_t | mclk, | ||
uint32_t | sampleRate, | ||
uint32_t | bitWidth | ||
) |
set audio data format.
handle | codec handle. |
mclk | master clock frequency in HZ. |
sampleRate | sample rate in HZ. |
bitWidth | bit width. |
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 64 of file fsl_codec_common.c.
status_t CODEC_SetMute | ( | codec_handle_t * | handle, |
uint32_t | playChannel, | ||
bool | mute | ||
) |
set audio codec module mute.
handle | codec handle. |
channel | audio codec play channel, can be a value or combine value of _codec_play_channel. |
mute | true is mute, false is unmute. |
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 mute true is mute, false is unmute. return kStatus_Success is success, else configure failed.
Definition at line 136 of file fsl_codec_common.c.
status_t CODEC_SetPlay | ( | codec_handle_t * | handle, |
uint32_t | playSource | ||
) |
codec set play source.
handle | codec handle. |
playSource | audio codec play source, can be a value or combine value of _codec_play_source. |
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 232 of file fsl_codec_common.c.
status_t CODEC_SetPower | ( | codec_handle_t * | handle, |
codec_module_t | module, | ||
bool | powerOn | ||
) |
set audio codec power.
handle | codec handle. |
module | audio codec module. |
powerOn | true is power on, false is power down. |
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 158 of file fsl_codec_common.c.
status_t CODEC_SetRecord | ( | codec_handle_t * | handle, |
uint32_t | recordSource | ||
) |
codec set record source.
handle | codec handle. |
recordRource | audio codec record source, can be a value or combine value of _codec_record_source. |
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.
return kStatus_Success is success, else configure failed.
Definition at line 180 of file fsl_codec_common.c.
status_t CODEC_SetRecordChannel | ( | codec_handle_t * | handle, |
uint32_t | leftRecordChannel, | ||
uint32_t | rightRecordChannel | ||
) |
codec set record channel.
handle | codec handle. |
leftRecordChannel | audio codec record channel, reference _codec_record_channel, can be a value combine of member in _codec_record_channel. |
rightRecordChannel | audio codec record channel, reference _codec_record_channel, can be a value combine of member in _codec_record_channel. |
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 205 of file fsl_codec_common.c.
status_t CODEC_SetVolume | ( | codec_handle_t * | handle, |
uint32_t | playChannel, | ||
uint32_t | volume | ||
) |
set audio codec pl volume.
handle | codec handle. |
channel | audio codec play channel, can be a value or combine value of _codec_play_channel. |
volume | volume value, support 0 ~ 100, 0 is mute, 100 is the maximum volume value. |
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 113 of file fsl_codec_common.c.
const codec_capability_t* _codec_handle::codecCapability |
codec capability
Definition at line 243 of file fsl_codec_common.h.
codec_config_t* _codec_handle::codecConfig |
codec configuration function pointer
Definition at line 242 of file fsl_codec_common.h.
void* _codec_config::codecDevConfig |
Codec device specific configuration
Definition at line 224 of file fsl_codec_common.h.
uint8_t _codec_handle::codecDevHandle[HAL_CODEC_HANDLER_SIZE] |
codec device handle
Definition at line 244 of file fsl_codec_common.h.
uint32_t _codec_config::codecDevType |
codec type
Definition at line 223 of file fsl_codec_common.h.
uint32_t _codec_capability::codecModuleCapability |
codec module capability
Definition at line 230 of file fsl_codec_common.h.
uint32_t _codec_capability::codecPlayCapability |
codec play capability
Definition at line 231 of file fsl_codec_common.h.
uint32_t _codec_capability::codecRecordCapability |
codec record capability
Definition at line 232 of file fsl_codec_common.h.