Go to the documentation of this file.
9 #ifndef _FSL_CODEC_COMMON_H_
10 #define _FSL_CODEC_COMMON_H_
25 #define FSL_CODEC_DRIVER_VERSION (MAKE_VERSION(2, 2, 0))
29 #define CODEC_VOLUME_MAX_VALUE (100U)
251 #if defined(__cplusplus)
360 #if defined(__cplusplus)
@ kCODEC_PlayChannelHeadphoneLeft
@ kCODEC_SupportModuleDAC
@ kCODEC_RecordChannelLeft1
enum _codec_audio_protocol codec_audio_protocol_t
AUDIO format definition.
@ kCODEC_SupportRecordChannelRight1
@ kCODEC_SupportModuleVref
@ kCODEC_AudioSampleRate16KHz
@ kCODEC_PlayChannelLineOutRight
@ kCODEC_SupportPlaySourceMixerIn
@ kCODEC_RecordChannelLeft2
@ kCODEC_SupportRecordSourceDifferentialMic
Initialize structure of the codec.
@ kCODEC_SupportModuleMixer
@ kCODEC_SupportPlaySourceInput
uint32_t codecPlayCapability
@ kCODEC_PlayChannelLineOutLeft
_codec_play_source
audio codec module play source value
@ kCODEC_SupportModuleHeadphone
@ kCODEC_AudioBitWidth20bit
@ kCODEC_SupportRecordChannelLeft3
@ kCODEC_SupportModuleI2SIn
codec_config_t * codecConfig
@ kCODEC_SupportModuleADC
enum _codec_module_ctrl_cmd codec_module_ctrl_cmd_t
audio codec module control cmd
_codec_module
audio codec module
@ kCODEC_PlaySourceMixerIn
@ kCODEC_SupportModulePGA
@ kCODEC_ModuleSwitchI2SInInterface
@ kCODEC_RecordChannelRight2
_codec_module_ctrl_cmd
audio codec module control cmd
_codec_audio_protocol
AUDIO format definition.
status_t CODEC_SetFormat(codec_handle_t *handle, uint32_t mclk, uint32_t sampleRate, uint32_t bitWidth)
set audio data format.
@ kCODEC_AudioSampleRate32KHz
@ kCODEC_PlayChannelLeft2
@ kCODEC_PlayChannelLeft0
@ kCODEC_AudioSampleRate192KHz
@ kCODEC_SupportModuleI2SInSwitchInterface
@ kCODEC_SupportPlaySourceAux
@ kCODEC_SupportModuleMicbias
@ kCODEC_SupportRecordChannelLeft2
@ kCODEC_PlayChannelLeft3
@ kCODEC_RecordChannelRight1
@ kCODEC_SupportRecordChannelLeft1
_codec_module_ctrl_i2s_in_interface
audio codec module digital interface
status_t CODEC_Init(codec_handle_t *handle, codec_config_t *config)
Codec initilization.
@ kCODEC_SupportModuleMic
@ kCODEC_PlayChannelRight1
@ kCODEC_SupportPlayChannelRight1
@ kStatus_CODEC_I2CBusInitialFailed
@ kCODEC_SupportRecordChannelRight2
@ kCODEC_AudioSampleRate384KHz
@ kCODEC_PlayChannelRight3
@ kStatus_CODEC_I2CCommandTransferFailed
@ kCODEC_ModuleI2SInInterfacePCM
@ kCODEC_RecordChannelDifferentialPositive1
@ kCODEC_SupportPlayChannelLeft2
@ kCODEC_SupportPlaySourcePGA
status_t CODEC_SetRecordChannel(codec_handle_t *handle, uint32_t leftRecordChannel, uint32_t rightRecordChannel)
codec set record channel.
#define MAKE_STATUS(group, code)
Construct a status code value from a group and code number.
@ kCODEC_SupportRecordSourceSingleEndMic
@ kCODEC_SupportRecordSourceLineInput
@ kCODEC_SupportPlayChannelRight0
@ kCODEC_SupportPlayChannelRight3
status_t CODEC_ModuleControl(codec_handle_t *handle, codec_module_ctrl_cmd_t cmd, uint32_t data)
codec module control.
_codec_reocrd_channel
audio codec record channel
const codec_capability_t * codecCapability
_codec_status
CODEC status.
@ kCODEC_RecordChannelDifferentialNegative3
@ kStatus_CODEC_NotSupport
enum _codec_module codec_module_t
audio codec module
@ kCODEC_PlayChannelRight2
@ kCODEC_AudioSampleRate11025Hz
@ kCODEC_ModuleI2SInInterfaceDSD
status_t CODEC_SetRecord(codec_handle_t *handle, uint32_t recordRource)
codec set record source.
@ kCODEC_SupportPlaySourceDAC
@ kCODEC_BusLeftJustified
@ kCODEC_RecordChannelDifferentialPositive2
@ kCODEC_AudioSampleRate8KHz
@ kCODEC_PlayChannelSpeakerLeft
@ kCODEC_AudioSampleRate96KHz
status_t CODEC_Deinit(codec_handle_t *handle)
Codec de-initilization.
@ kCODEC_SupportPlayChannelLeft1
@ kCODEC_SupportModuleSpeaker
@ kCODEC_AudioSampleRate12KHz
struct _codec_capability codec_capability_t
codec capability
@ kCODEC_RecordChannelDifferentialNegative2
@ kCODEC_PlayChannelHeadphoneRight
@ kCODEC_PlayChannelLeft1
@ kCODEC_SupportPlayChannelLeft3
_codec_audio_sample_rate
audio sample rate definition
@ kCODEC_SupportRecordSourceDigitalMic
_codec_play_channel
codec play channel
status_t CODEC_SetMute(codec_handle_t *handle, uint32_t channel, bool mute)
set audio codec module mute.
@ kCODEC_SupportRecordSourceDifferentialLine
@ kCODEC_PlayChannelSpeakerRight
@ kCODEC_AudioSampleRate48KHz
@ kCODEC_SupportRecordChannelRight3
@ kCODEC_AudioSampleRate44100Hz
#define HAL_CODEC_HANDLER_SIZE
codec handler size
@ kCODEC_RecordSourceDifferentialMic
@ kCODEC_BusRightJustified
@ kCODEC_SupportPlaySourceMixerInRight
_codec_audio_bit_width
audio bit width
@ kCODEC_SupportModuleLinein
@ kCODEC_SupportPlayChannelRight2
@ kCODEC_PlaySourceMixerInRight
@ kCODEC_RecordChannelLeft3
@ kCODEC_AudioBitWidth24bit
@ kCODEC_PlayChannelRight0
uint8_t codecDevHandle[HAL_CODEC_HANDLER_SIZE]
@ kCODEC_SupportModuleLineout
status_t CODEC_SetPlay(codec_handle_t *handle, uint32_t playSource)
codec set play source.
uint32_t codecRecordCapability
_codec_record_source
audio codec module record source value
struct _codec_config codec_config_t
Initialize structure of the codec.
@ kCODEC_RecordChannelRight3
@ kCODEC_RecordChannelDifferentialNegative1
@ kCODEC_SupportPlaySourceMixerInLeft
@ kCODEC_RecordSourceLineInput
@ kCODEC_AudioSampleRate22050Hz
_codec_capability_flag
audio codec capability
static sai_transceiver_t config
@ kCODEC_AudioBitWidth32bit
@ kCODEC_SupportModuleI2SOut
@ kCODEC_RecordSourceDifferentialLine
@ kCODEC_PlaySourceMixerInLeft
status_t CODEC_SetPower(codec_handle_t *handle, codec_module_t module, bool powerOn)
set audio codec power.
int32_t status_t
Type used for all status and error return values.
@ kStatus_CODEC_DeviceNotRegistered
@ kCODEC_SupportPlayChannelLeft0
@ kCODEC_AudioSampleRate24KHz
status_t CODEC_SetVolume(codec_handle_t *handle, uint32_t channel, uint32_t volume)
set audio codec pl volume.
@ kCODEC_RecordSourceDigitalMic
@ kCODEC_RecordSourceSingleEndMic
uint32_t codecModuleCapability
@ kCODEC_AudioBitWidth16bit
@ kCODEC_RecordChannelDifferentialPositive3