Classes
fsl_wm8904.h File Reference
#include "fsl_common.h"
#include "fsl_codec_i2c.h"
Include dependency graph for fsl_wm8904.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _wm8904_audio_format
 Audio format configuration. More...
 
struct  _wm8904_config
 Configuration structure of WM8904. More...
 
struct  _wm8904_fll_config
 wm8904 fll configuration More...
 
struct  _wm8904_handle
 wm8904 codec handler More...
 

Driver version

enum  _wm8904_bit_width { kWM8904_BitWidth16 = 0x0, kWM8904_BitWidth20 = 0x1, kWM8904_BitWidth24 = 0x2, kWM8904_BitWidth32 = 0x3 }
 Bit width. More...
 
enum  _wm8904_fll_clk_source { kWM8904_FLLClkSourceMCLK = 0U }
 wm8904 fll clock source More...
 
enum  _wm8904_fs_ratio {
  kWM8904_FsRatio64X = 0x0, kWM8904_FsRatio128X = 0x1, kWM8904_FsRatio192X = 0x2, kWM8904_FsRatio256X = 0x3,
  kWM8904_FsRatio384X = 0x4, kWM8904_FsRatio512X = 0x5, kWM8904_FsRatio768X = 0x6, kWM8904_FsRatio1024X = 0x7,
  kWM8904_FsRatio1408X = 0x8, kWM8904_FsRatio1536X = 0x9
}
 The SYSCLK / fs ratio. More...
 
enum  _wm8904_lrc_polarity { kWM8904_LRCPolarityNormal = 0U, kWM8904_LRCPolarityInverted = 1U << 4U }
 WM8904 lrc polarity. More...
 
enum  _wm8904_module {
  kWM8904_ModuleADC = 0, kWM8904_ModuleDAC = 1, kWM8904_ModulePGA = 2, kWM8904_ModuleHeadphone = 3,
  kWM8904_ModuleLineout = 4
}
 wm8904 module value More...
 
enum  _wm8904_play_channel { kWM8904_HeadphoneLeft = 1U, kWM8904_HeadphoneRight = 2U, kWM8904_LineoutLeft = 4U, kWM8904_LineoutRight = 8U }
 wm8904 play channel
More...
 
enum  _wm8904_play_source { kWM8904_PlaySourcePGA = 1U, kWM8904_PlaySourceDAC = 4U }
 wm8904 play source More...
 
enum  _wm8904_protocol {
  kWM8904_ProtocolI2S = 0x2, kWM8904_ProtocolLeftJustified = 0x1, kWM8904_ProtocolRightJustified = 0x0, kWM8904_ProtocolPCMA = 0x3,
  kWM8904_ProtocolPCMB = 0x3 | (1 << 4)
}
 The audio data transfer protocol. More...
 
enum  _wm8904_record_channel {
  kWM8904_RecordChannelLeft1 = 1U, kWM8904_RecordChannelLeft2 = 2U, kWM8904_RecordChannelLeft3 = 4U, kWM8904_RecordChannelRight1 = 1U,
  kWM8904_RecordChannelRight2 = 2U, kWM8904_RecordChannelRight3 = 4U, kWM8904_RecordChannelDifferentialPositive1 = 1U, kWM8904_RecordChannelDifferentialPositive2 = 2U,
  kWM8904_RecordChannelDifferentialPositive3 = 4U, kWM8904_RecordChannelDifferentialNegative1 = 8U, kWM8904_RecordChannelDifferentialNegative2 = 16U, kWM8904_RecordChannelDifferentialNegative3 = 32U
}
 wm8904 record channel More...
 
enum  _wm8904_record_source { kWM8904_RecordSourceDifferentialLine = 1U, kWM8904_RecordSourceLineInput = 2U, kWM8904_RecordSourceDifferentialMic = 4U, kWM8904_RecordSourceDigitalMic = 8U }
 wm8904 record source More...
 
enum  _wm8904_sample_rate {
  kWM8904_SampleRate8kHz = 0x0, kWM8904_SampleRate12kHz = 0x1, kWM8904_SampleRate16kHz = 0x2, kWM8904_SampleRate24kHz = 0x3,
  kWM8904_SampleRate32kHz = 0x4, kWM8904_SampleRate48kHz = 0x5
}
 Sample rate. More...
 
enum  _wm8904_status { kStatus_WM8904_Success = 0x0, kStatus_WM8904_Fail = 0x1 }
 WM8904 status return codes. More...
 
enum  _wm8904_sys_clk_source { kWM8904_SysClkSourceMCLK = 0U, kWM8904_SysClkSourceFLL = 1U << 14 }
 wm8904 system clock source More...
 
enum  _wm8904_timeslot { kWM8904_TimeSlot0 = 0U, kWM8904_TimeSlot1 = 1U }
 WM8904 time slot. More...
 
#define FSL_WM8904_DRIVER_VERSION   (MAKE_VERSION(2, 4, 1))
 WM8904 driver version 2.4.1. More...
 
#define WM8904_ADC_DIGITAL_VOLUME_LEFT   (0x24)
 
#define WM8904_ADC_DIGITAL_VOLUME_RIGHT   (0x25)
 
#define WM8904_ANALOG_ADC_0   (0x0A)
 
#define WM8904_ANALOG_HP_0   (0x5A)
 
#define WM8904_ANALOG_LEFT_IN_0   (0x2C)
 
#define WM8904_ANALOG_LEFT_IN_1   (0x2E)
 
#define WM8904_ANALOG_OUT12_ZC   (0x3D)
 
#define WM8904_ANALOG_OUT1_LEFT   (0x39)
 
#define WM8904_ANALOG_OUT1_RIGHT   (0x3A)
 
#define WM8904_ANALOG_OUT2_LEFT   (0x3B)
 
#define WM8904_ANALOG_OUT2_RIGHT   (0x3C)
 
#define WM8904_ANALOG_RIGHT_IN_0   (0x2D)
 
#define WM8904_ANALOG_RIGHT_IN_1   (0x2F)
 
typedef struct _wm8904_audio_format wm8904_audio_format_t
 Audio format configuration. More...
 
#define WM8904_AUDIO_IF_0   (0x18)
 
#define WM8904_AUDIO_IF_1   (0x19)
 
#define WM8904_AUDIO_IF_2   (0x1A)
 
#define WM8904_AUDIO_IF_3   (0x1B)
 
typedef enum _wm8904_bit_width wm8904_bit_width_t
 Bit width. More...
 
status_t WM8904_CheckAudioFormat (wm8904_handle_t *handle, wm8904_audio_format_t *format, uint32_t mclkFreq)
 check and update the audio data format. This api is used check the fsRatio setting based on the mclk and sample rate, if fsRatio setting is not correct, it will correct it according to mclk and sample rate. More...
 
#define WM8904_CHRG_PUMP_0   (0x62)
 
#define WM8904_CLK_RATES_0   (0x14)
 
#define WM8904_CLK_RATES_1   (0x15)
 
#define WM8904_CLK_RATES_2   (0x16)
 
#define WM8904_CLS_W_0   (0x68)
 
typedef struct _wm8904_config wm8904_config_t
 Configuration structure of WM8904. More...
 
#define WM8904_DAC_DIG_0   (0x27)
 
#define WM8904_DAC_DIG_1   (0x21)
 
#define WM8904_DAC_DIGITAL_VOLUME_LEFT   (0x1E)
 
#define WM8904_DAC_DIGITAL_VOLUME_RIGHT   (0x1F)
 
#define WM8904_DC_SERVO_0   (0x43)
 
#define WM8904_DEBUG_REGISTER   0
 wm8904 debug macro More...
 
status_t WM8904_Deinit (wm8904_handle_t *handle)
 Deinitializes the WM8904 codec. More...
 
status_t WM8904_EnableADCTDMMode (wm8904_handle_t *handle, wm8904_timeslot_t timeSlot)
 Enable WM8904 ADC time slot. More...
 
status_t WM8904_EnableDACTDMMode (wm8904_handle_t *handle, wm8904_timeslot_t timeSlot)
 Enable WM8904 DAC time slot. More...
 
typedef enum _wm8904_fll_clk_source wm8904_fll_clk_source_t
 wm8904 fll clock source More...
 
typedef struct _wm8904_fll_config wm8904_fll_config_t
 wm8904 fll configuration More...
 
#define WM8904_FLL_CONTROL_1   (0x74)
 
#define WM8904_FLL_CONTROL_2   (0x75)
 
#define WM8904_FLL_CONTROL_3   (0x76)
 
#define WM8904_FLL_CONTROL_4   (0x77)
 
#define WM8904_FLL_CONTROL_5   (0x78)
 
#define WM8904_FLL_NCO_TEST_0   (0xF7U)
 
#define WM8904_FLL_NCO_TEST_1   (0xF8U)
 
typedef enum _wm8904_fs_ratio wm8904_fs_ratio_t
 The SYSCLK / fs ratio. More...
 
void WM8904_GetDefaultConfig (wm8904_config_t *config)
 Fills the configuration structure with default values. More...
 
#define WM8904_GPIO_CONTROL_1   (0x79)
 
#define WM8904_GPIO_CONTROL_2   (0x7A)
 
#define WM8904_GPIO_CONTROL_3   (0x7B)
 
#define WM8904_GPIO_CONTROL_4   (0x7C)
 
#define WM8904_GPIO_CONTROL_4   (0x7C)
 
typedef struct _wm8904_handle wm8904_handle_t
 wm8904 codec handler More...
 
#define WM8904_I2C_ADDRESS   (0x1A)
 WM8904 I2C address. More...
 
#define WM8904_I2C_BITRATE   (400000U)
 WM8904 I2C bit rate. More...
 
#define WM8904_I2C_HANDLER_SIZE   (CODEC_I2C_MASTER_HANDLER_SIZE)
 wm8904 handle size More...
 
status_t WM8904_Init (wm8904_handle_t *handle, wm8904_config_t *wm8904_config)
 Initializes WM8904. More...
 
status_t WM8904_ModifyRegister (wm8904_handle_t *handle, uint8_t reg, uint16_t mask, uint16_t value)
 WM8904 modify register. More...
 
typedef enum _wm8904_module wm8904_module_t
 wm8904 module value More...
 
#define WM8904_POWER_MGMT_0   (0x0C)
 
#define WM8904_POWER_MGMT_2   (0x0E)
 
#define WM8904_POWER_MGMT_3   (0x0F)
 
#define WM8904_POWER_MGMT_6   (0x12)
 
typedef enum _wm8904_protocol wm8904_protocol_t
 The audio data transfer protocol. More...
 
status_t WM8904_ReadRegister (wm8904_handle_t *handle, uint8_t reg, uint16_t *value)
 WM8904 write register. More...
 
#define WM8904_RESET   (0x00)
 WM8904 register map. More...
 
typedef enum _wm8904_sample_rate wm8904_sample_rate_t
 Sample rate. More...
 
status_t WM8904_SelectLRCPolarity (wm8904_handle_t *handle, uint32_t polarity)
 Select LRC polarity. More...
 
status_t WM8904_SeMasterClock (wm8904_handle_t *handle, uint32_t sysclk, uint32_t sampleRate, uint32_t bitWidth)
 Sets WM8904 master clock configuration. More...
 
status_t WM8904_SetAudioFormat (wm8904_handle_t *handle, uint32_t sysclk, uint32_t sampleRate, uint32_t bitWidth)
 Sets the audio data format. More...
 
status_t WM8904_SetChannelMute (wm8904_handle_t *handle, uint32_t channel, bool isMute)
 Sets the channel mute. More...
 
status_t WM8904_SetChannelVolume (wm8904_handle_t *handle, uint32_t channel, uint32_t volume)
 Sets the channel output volume. More...
 
status_t WM8904_SetFLLConfig (wm8904_handle_t *handle, wm8904_fll_config_t *config)
 WM8904 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...
 
status_t WM8904_SetMasterSlave (wm8904_handle_t *handle, bool master)
 Sets WM8904 as master or slave. More...
 
status_t WM8904_SetModulePower (wm8904_handle_t *handle, wm8904_module_t module, bool isEnabled)
 
status_t WM8904_SetMute (wm8904_handle_t *handle, bool muteLeft, bool muteRight)
 Sets the headphone output mute. More...
 
status_t WM8904_SetPlay (wm8904_handle_t *handle, uint32_t playSource)
 SET the WM8904 play source. More...
 
status_t WM8904_SetProtocol (wm8904_handle_t *handle, wm8904_protocol_t protocol)
 Sets the audio data transfer protocol. More...
 
status_t WM8904_SetRecord (wm8904_handle_t *handle, uint32_t recordSource)
 SET the WM8904 record source. More...
 
status_t WM8904_SetRecordChannel (wm8904_handle_t *handle, uint32_t leftRecordChannel, uint32_t rightRecordChannel)
 SET the WM8904 record source. More...
 
status_t WM8904_SetVolume (wm8904_handle_t *handle, uint16_t volumeLeft, uint16_t volumeRight)
 Sets the module output volume. More...
 
typedef enum _wm8904_sys_clk_source wm8904_sys_clk_source_t
 wm8904 system clock source More...
 
typedef enum _wm8904_timeslot wm8904_timeslot_t
 WM8904 time slot. More...
 
status_t WM8904_WriteRegister (wm8904_handle_t *handle, uint8_t reg, uint16_t value)
 WM8904 write register. More...
 
#define WM8904_WRT_SEQUENCER_0   (0x6C)
 
#define WM8904_WRT_SEQUENCER_3   (0x6F)
 
#define WM8904_WRT_SEQUENCER_4   (0x70)
 


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:57