![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
NXP Semiconductors
|
The da7212 driver provides a codec control interface.
Data Structures | |
struct | _da7212_pll_config |
da7212 pll configuration More... | |
struct | _da7212_audio_format |
da7212 audio format More... | |
struct | da7212_config |
DA7212 configure structure. More... | |
struct | _da7212_handle |
da7212 codec handler More... | |
Macros | |
#define | DA7212_I2C_HANDLER_SIZE CODEC_I2C_MASTER_HANDLER_SIZE |
da7212 handle size | |
#define | DA7212_ADDRESS (0x1A) |
DA7212 I2C address. | |
#define | DA7212_HEADPHONE_MAX_VOLUME_VALUE 0x3FU |
da7212 volume setting range | |
Typedefs | |
typedef enum _da7212_Input | da7212_Input_t |
DA7212 input source select. | |
typedef enum _da7212_Output | da7212_Output_t |
DA7212 output device select. | |
typedef enum _da7212_dac_source | da7212_dac_source_t |
DA7212 functionality. | |
typedef enum _da7212_volume | da7212_volume_t |
DA7212 volume. | |
typedef enum _da7212_protocol | da7212_protocol_t |
The audio data transfer protocol choice. | |
typedef enum _da7212_sys_clk_source | da7212_sys_clk_source_t |
da7212 system clock source | |
typedef enum _da7212_pll_clk_source | da7212_pll_clk_source_t |
DA7212 pll clock source. | |
typedef enum _da7212_pll_out_clk | da7212_pll_out_clk_t |
DA7212 output clock frequency. | |
typedef enum _da7212_master_bits | da7212_master_bits_t |
master mode bits per frame | |
typedef struct _da7212_pll_config | da7212_pll_config_t |
da7212 pll configuration | |
typedef struct _da7212_audio_format | da7212_audio_format_t |
da7212 audio format | |
typedef struct da7212_config | da7212_config_t |
DA7212 configure structure. | |
typedef struct _da7212_handle | da7212_handle_t |
da7212 codec handler | |
Functions | |
status_t | DA7212_Init (da7212_handle_t *handle, da7212_config_t *codecConfig) |
DA7212 initialize function. More... | |
status_t | DA7212_ConfigAudioFormat (da7212_handle_t *handle, uint32_t masterClock_Hz, uint32_t sampleRate_Hz, uint32_t dataBits) |
Set DA7212 audio format. More... | |
status_t | DA7212_SetPLLConfig (da7212_handle_t *handle, da7212_pll_config_t *config) |
DA7212 set PLL configuration This function will enable the GPIO1 FLL clock output function, so user can see the generated fll output clock frequency from WM8904 GPIO1. More... | |
void | DA7212_ChangeHPVolume (da7212_handle_t *handle, da7212_volume_t volume) |
Set DA7212 playback volume. More... | |
void | DA7212_Mute (da7212_handle_t *handle, bool isMuted) |
Mute or unmute DA7212. More... | |
void | DA7212_ChangeInput (da7212_handle_t *handle, da7212_Input_t DA7212_Input) |
Set the input data source of DA7212. More... | |
void | DA7212_ChangeOutput (da7212_handle_t *handle, da7212_Output_t DA7212_Output) |
Set the output device of DA7212. More... | |
status_t | DA7212_SetChannelVolume (da7212_handle_t *handle, uint32_t channel, uint32_t volume) |
Set module volume. More... | |
status_t | DA7212_SetChannelMute (da7212_handle_t *handle, uint32_t channel, bool isMute) |
Set module mute. More... | |
status_t | DA7212_SetProtocol (da7212_handle_t *handle, da7212_protocol_t protocol) |
Set protocol for DA7212. More... | |
status_t | DA7212_SetMasterModeBits (da7212_handle_t *handle, uint32_t bitWidth) |
Set master mode bits per frame for DA7212. More... | |
status_t | DA7212_WriteRegister (da7212_handle_t *handle, uint8_t u8Register, uint8_t u8RegisterData) |
Write a register for DA7212. More... | |
status_t | DA7212_ReadRegister (da7212_handle_t *handle, uint8_t u8Register, uint8_t *pu8RegisterData) |
Get a register value of DA7212. More... | |
status_t | DA7212_Deinit (da7212_handle_t *handle) |
Deinit DA7212. More... | |
Driver version | |
#define | FSL_DA7212_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) |
CLOCK driver version 2.3.0. More... | |
struct _da7212_pll_config |
Data Fields | |
da7212_pll_clk_source_t | source |
pll reference clock source | |
uint32_t | refClock_HZ |
pll reference clock frequency | |
da7212_pll_out_clk_t | outputClock_HZ |
pll output clock frequency | |
struct _da7212_audio_format |
Data Fields | |
uint32_t | mclk_HZ |
master clock frequency | |
uint32_t | sampleRate |
sample rate | |
uint32_t | bitWidth |
bit width | |
bool | isBclkInvert |
bit clock intervet | |
struct da7212_config |
Data Fields | |
bool | isMaster |
If DA7212 is master, true means master, false means slave. More... | |
da7212_protocol_t | protocol |
Audio bus format, can be I2S, LJ, RJ or DSP mode. More... | |
da7212_dac_source_t | dacSource |
DA7212 data source. More... | |
da7212_audio_format_t | format |
audio format | |
uint8_t | slaveAddress |
device address | |
codec_i2c_config_t | i2cConfig |
i2c configuration | |
da7212_sys_clk_source_t | sysClkSource |
system clock source | |
da7212_pll_config_t * | pll |
pll configuration | |
da7212_Input_t | inputSource |
AD212 input source. | |
bool da7212_config::isMaster |
da7212_protocol_t da7212_config::protocol |
da7212_dac_source_t da7212_config::dacSource |
struct _da7212_handle |
Data Fields | |
da7212_config_t * | config |
da7212 config pointer | |
uint8_t | i2cHandle [DA7212_I2C_HANDLER_SIZE] |
i2c handle | |
#define FSL_DA7212_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) |
enum _da7212_Input |
enum _da7212_play_channel |
enum _da7212_Output |
enum _da7212_module |
enum _da7212_dac_source |
enum _da7212_volume |
enum _da7212_protocol |
enum _da7212_pll_out_clk |
enum _da7212_master_bits |
status_t DA7212_Init | ( | da7212_handle_t * | handle, |
da7212_config_t * | codecConfig | ||
) |
handle | DA7212 handle pointer. |
codecConfig | Codec configure structure. This parameter can be NULL, if NULL, set as default settings. The default setting: * sgtl_init_t codec_config
* codec_config.route = kDA7212_RoutePlayback
* codec_config.bus = kDA7212_BusI2S
* codec_config.isMaster = false
*
|
status_t DA7212_ConfigAudioFormat | ( | da7212_handle_t * | handle, |
uint32_t | masterClock_Hz, | ||
uint32_t | sampleRate_Hz, | ||
uint32_t | dataBits | ||
) |
handle | DA7212 handle pointer. |
masterClock_Hz | Master clock frequency in Hz. If DA7212 is slave, use the frequency of master, if DA7212 as master, it should be 1228000 while sample rate frequency is 8k/12K/16K/24K/32K/48K/96K, 11289600 whie sample rate is 11.025K/22.05K/44.1K |
sampleRate_Hz | Sample rate frequency in Hz. |
dataBits | How many bits in a word of a audio frame, DA7212 only supports 16/20/24/32 bits. |
status_t DA7212_SetPLLConfig | ( | da7212_handle_t * | handle, |
da7212_pll_config_t * | config | ||
) |
handle | DA7212 handler pointer. |
config | PLL configuration pointer. |
void DA7212_ChangeHPVolume | ( | da7212_handle_t * | handle, |
da7212_volume_t | volume | ||
) |
handle | DA7212 handle pointer. |
volume | The volume of playback. |
void DA7212_Mute | ( | da7212_handle_t * | handle, |
bool | isMuted | ||
) |
handle | DA7212 handle pointer. |
isMuted | True means mute, false means unmute. |
void DA7212_ChangeInput | ( | da7212_handle_t * | handle, |
da7212_Input_t | DA7212_Input | ||
) |
handle | DA7212 handle pointer. |
DA7212_Input | Input data source. |
void DA7212_ChangeOutput | ( | da7212_handle_t * | handle, |
da7212_Output_t | DA7212_Output | ||
) |
handle | DA7212 handle pointer. |
DA7212_Output | Output device of DA7212. |
status_t DA7212_SetChannelVolume | ( | da7212_handle_t * | handle, |
uint32_t | channel, | ||
uint32_t | volume | ||
) |
handle | DA7212 handle pointer. |
channel | shoule be a value of _da7212_channel. |
volume | volume range 0 - 0x3F mapped to range -57dB - 6dB. |
status_t DA7212_SetChannelMute | ( | da7212_handle_t * | handle, |
uint32_t | channel, | ||
bool | isMute | ||
) |
handle | DA7212 handle pointer. |
channel | shoule be a value of _da7212_channel. |
isMute | true is mute, false is unmute. |
status_t DA7212_SetProtocol | ( | da7212_handle_t * | handle, |
da7212_protocol_t | protocol | ||
) |
handle | DA7212 handle pointer. |
protocol | da7212_protocol_t. |
status_t DA7212_SetMasterModeBits | ( | da7212_handle_t * | handle, |
uint32_t | bitWidth | ||
) |
handle | DA7212 handle pointer. |
bitWidth | audio data bitwidth. |
status_t DA7212_WriteRegister | ( | da7212_handle_t * | handle, |
uint8_t | u8Register, | ||
uint8_t | u8RegisterData | ||
) |
handle | DA7212 handle pointer. |
u8Register | DA7212 register address to be written. |
u8RegisterData | Data to be written into regsiter |
status_t DA7212_ReadRegister | ( | da7212_handle_t * | handle, |
uint8_t | u8Register, | ||
uint8_t * | pu8RegisterData | ||
) |
handle | DA7212 handle pointer. |
u8Register | DA7212 register address to be read. |
pu8RegisterData | Pointer where the read out value to be stored. |
status_t DA7212_Deinit | ( | da7212_handle_t * | handle | ) |
handle | DA7212 handle pointer. |