![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Data Structures | |
struct | ak4458_dac_config_t |
Initialize DAC configuration structure of AK4458 since it has 4 DAC modules. More... | |
struct | ak4458_dsd_config_t |
Initialize DSD mode structure of AK4458. More... | |
struct | ak4458_pcm_config_t |
Initialize PCM mode structure of AK4458. More... | |
struct | ak4458_config_t |
Initialize structure of AK4458. More... | |
Macros | |
#define | AK4458_CONTROL1 (0x00) |
define the registers offset of AK4458. More... | |
#define | AK4458_CONTROL1_RSTN_MASK (0x1U) |
define the registers offset of AK4458. More... | |
#define | AK4458_I2C_ADDR (0x10) |
AK4458 I2C address. More... | |
#define | AK4458_DAC_NUM (4U) |
The numbers of DAC for AK4458. | |
Enumerations | |
enum | ak4458_mode_t |
The AK4458 playback mode. | |
enum | ak4458_dac_selection_t |
The DAC output enable selection of AK4458 AK4458 has 4 DAC modules, using DacMask to select which one to be used. | |
enum | ak4458_output_phase_mode_t { kAK4458_AllDisable = 0x0, kAK4458_JustRchEnable = 0x1, kAK4458_JustLchEnable = 0x2, kAK4458_AllEnable = 0x3 } |
The AOUTR output phase inverting, defined by INVL,INVR. More... | |
enum | ak4458_dac_mode_t { kAK4458_Stereo = 0x0, kAK4458_Mono = 0x1 } |
The DAC mode, defined by MONO bit. More... | |
enum | ak4458_data_channel_mode_t { kAK4458_NormalMode = 0x0, kAK4458_ExchangeMode = 0x1 } |
The Data selection of L-channel and R-channel for DSD mode, defined by SELLR bit. More... | |
enum | ak4458_dsd_mclk_t { kAK4458_mclk512fs = 0x0, kAK4458_mclk768fs = 0x1 } |
The MCLK select for DSD mode, defined by DCKS bit. More... | |
enum | ak4458_dsd_dclk_t { kAK4458_dclk64fs = 0x0, kAK4458_dclk128fs = 0x1, kAK4458_dclk256fs = 0x2 } |
The DCLK select for DSD mode, defined by DSDSEL[1:0]. More... | |
enum | ak4458_dsd_playback_path_t { kAK4458_NormalPath = 0x0, kAK4458_VolumeBypass = 0x1 } |
DSD playback path. More... | |
enum | ak4458_dsd_data_mute_t |
DSD mute flag. | |
enum | ak4458_dsd_dclk_polarity_t { kAK4458_FallingEdge = 0x0, kAK4458_RisingEdge = 0x1 } |
DSD bclk polarity. More... | |
enum | ak4458_pcm_samplefreqmode_t { kAK4458_ManualSettingMode = 0x0, kAK4458_AutoSettingMode = 0x1 } |
The sampling frequency mode for PCM and EXDF mode, defined by CR01[AFSD], CR00[ACKS]. More... | |
enum | ak4458_pcm_samplefreqselect_t { kAK4458_NormalSpeed = 0x0, kAK4458_DoubleSpeed = 0x1, kAK4458_QuadSpeed = 0x2, kAK4458_OctSpeed = 0x4, kAK4458_HexSpeed = 0x5 } |
The sampling speed select, defined by DFS[2:0]. More... | |
enum | ak4458_pcm_sdata_format_t { kAK4458_16BitLSB = 0x0, kAK4458_20BitLSB = 0x1, kAK4458_24BitMSB = 0x2, kAK4458_16_24BitI2S = 0x3, kAK4458_24BitLSB = 0x4, kAK4458_32BitLSB = 0x5, kAK4458_32BitMSB = 0x6, kAK4458_32BitI2S = 0x7 } |
The audio data interface modes, defined by DIF[2:0]. More... | |
enum | ak4458_pcm_tdm_mode_t { kAK4458_Normal = 0x0, kAK4458_TDM128 = 0x1, kAK4458_TDM256 = 0x2, kAK4458_TDM512 = 0x3 } |
The TDM mode select, defined by TDM[1:0]. More... | |
enum | ak4458_pcm_sds_select_t |
The audio data slot selection, defined by SDS[2:0]. | |
enum | ak4458_pcm_deemphasis_mode_t { kAK4458_Fs44100 = 0x0, kAK4458_Off = 0x1, kAK4458_Fs48000 = 0x2, kAK4458_Fs32000 = 0x3 } |
The De-emphasis filter, defined by DEM[1:0], the mode only valid in PCM Normal Speed Mode. More... | |
Functions | |
void | AK4458_DefaultConfig (ak4458_config_t *config) |
Default initializes AK4458. More... | |
status_t | AK4458_Init (codec_handle_t *handle, void *config) |
Initializes AK4458. More... | |
status_t | AK4458_SetEncoding (codec_handle_t *handle, uint8_t format) |
Set the codec PCM mode or DSD mode based on the format info. More... | |
status_t | AK4458_ConfigDataFormat (codec_handle_t *handle, uint32_t mclk, uint32_t sampleRate, uint32_t bitWidth) |
Configure the data format of audio data. More... | |
status_t | AK4458_SetDAC1Volume (codec_handle_t *handle, uint8_t value) |
Set the volume of different modules in AK4458. More... | |
status_t | AK4458_GetDAC1Volume (codec_handle_t *handle, uint8_t *value) |
Get the volume of DAC1 in AK4458. More... | |
status_t | AK4458_ModuleControl (codec_handle_t *handle, codec_module_ctrl_cmd_t cmd, uint32_t data) |
AK4497 codec module control. More... | |
status_t | AK4458_Deinit (codec_handle_t *handle) |
Deinit the AK4458 codec. More... | |
status_t | AK4458_WriteReg (codec_handle_t *handle, uint8_t reg, uint8_t val) |
Write register to AK4458 using I2C. More... | |
status_t | AK4458_ReadReg (codec_handle_t *handle, uint8_t reg, uint8_t *val) |
Read register from AK4458 using I2C. More... | |
status_t | AK4458_ModifyReg (codec_handle_t *handle, uint8_t reg, uint8_t mask, uint8_t val) |
Modify some bits in the register using I2C. More... | |
Variables | |
const codec_operation_t | ak4458_ops |
aak4458 operation function pointer | |
Driver version | |
#define | FSL_AK4458_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) |
CLOCK driver version 2.1.0. | |
struct ak4458_dac_config_t |
struct ak4458_dsd_config_t |
struct ak4458_pcm_config_t |
struct ak4458_config_t |
#define AK4458_CONTROL1 (0x00) |
#define AK4458_CONTROL1_RSTN_MASK (0x1U) |
#define AK4458_I2C_ADDR (0x10) |
enum ak4458_dac_mode_t |
enum ak4458_dsd_mclk_t |
enum ak4458_dsd_dclk_t |
void AK4458_DefaultConfig | ( | ak4458_config_t * | config | ) |
config | AK4458 configure structure. |
status_t AK4458_Init | ( | codec_handle_t * | handle, |
void * | config | ||
) |
handle | AK4458 handle structure. |
config | AK4458 configure structure. |
status_t AK4458_SetEncoding | ( | codec_handle_t * | handle, |
uint8_t | format | ||
) |
This function would configure the codec playback mode.
handle | AK4458 handle structure pointer. |
format | info. |
status_t AK4458_ConfigDataFormat | ( | codec_handle_t * | handle, |
uint32_t | mclk, | ||
uint32_t | sampleRate, | ||
uint32_t | bitWidth | ||
) |
This function would configure the registers about the sample rate, bit depths.
handle | AK4458 handle structure pointer. |
mclk | system clock of the codec which can be generated by MCLK or PLL output. |
sampleRate | Sample rate of audio file running in AK4458. |
bitWidth | Bit depth of audio file. |
status_t AK4458_SetDAC1Volume | ( | codec_handle_t * | handle, |
uint8_t | value | ||
) |
This function would set the volume of AK4458 modules. Users need to appoint the module. The function assume that left channel and right channel has the same volume.
handle | AK4458 handle structure. |
value | Volume value need to be set. |
status_t AK4458_GetDAC1Volume | ( | codec_handle_t * | handle, |
uint8_t * | value | ||
) |
This function gets the volume of DAC1 in AK4458. Users need to appoint the module. The function assume that left channel and right channel has the same volume.
handle | AK4458 handle structure. |
value | DAC volume value |
status_t AK4458_ModuleControl | ( | codec_handle_t * | handle, |
codec_module_ctrl_cmd_t | cmd, | ||
uint32_t | data | ||
) |
handle | AK4497 handle structure pointer. |
cmd | module control command, support cmd kCODEC_ModuleSwitchDigitalInterface. |
data | control data, support data kCODEC_ModuleDigitalInterfacePCM/kCODEC_ModuleDigitalInterfaceDSD. |
status_t AK4458_Deinit | ( | codec_handle_t * | handle | ) |
This function close all modules in AK4458 to save power.
handle | AK4458 handle structure pointer. |
status_t AK4458_WriteReg | ( | codec_handle_t * | handle, |
uint8_t | reg, | ||
uint8_t | val | ||
) |
handle | AK4458 handle structure. |
reg | The register address in AK4458. |
val | Value needs to write into the register. |
status_t AK4458_ReadReg | ( | codec_handle_t * | handle, |
uint8_t | reg, | ||
uint8_t * | val | ||
) |
handle | AK4458 handle structure. |
reg | The register address in AK4458. |
val | Value written to. |
status_t AK4458_ModifyReg | ( | codec_handle_t * | handle, |
uint8_t | reg, | ||
uint8_t | mask, | ||
uint8_t | val | ||
) |
handle | AK4458 handle structure. |
reg | The register address in AK4458. |
mask | The mask code for the bits want to write. The bit you want to write should be 0. |
val | Value needs to write into the register. |