![]() |
CI130X SDK API手册
2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
|
为ES8388封装的驱动程序 更多...
#include "sdk_default_config.h"
#include "ci130x_iic.h"
#include "ci130x_iisdma.h"
#include "es8388.h"
#include <stdint.h>
#include <string.h>
#include "ci_log.h"
#include "ci130x_system.h"
#include "platform_config.h"
函数 | |
void | es8388_i2c_init (es8388_num_sel_t num_8388) |
es8388使用的I2C初始化 更多... | |
static void | I2C_WriteEs8388Data (es8388_num_sel_t num_8388, unsigned int regaddr, char val) |
为8388写入一个字节数据 更多... | |
static int | I2C_ReadEs8388Data (es8388_num_sel_t num_8388, unsigned int regaddr) |
读取8388某个寄存器的值 更多... | |
int32_t | ES8388_reset (es8388_num_sel_t num_8388) |
设置8388 复位 更多... | |
int32_t | ES8388_reset_release (es8388_num_sel_t num_8388) |
设置8388 解除复位 更多... | |
int32_t | ES8388_chip_control_config (es8388_num_sel_t num_8388, uint32_t dacmclk, uint32_t samefs, uint32_t ref, uint32_t divider) |
设置8388 chipcontrol的配置 更多... | |
int32_t | ES8388_mastermode_config (es8388_num_sel_t num_8388, es8388_mode_sel_t mode) |
设置8388 mastermode寄存器的值,使用基本固定,全部都是0x00 更多... | |
int32_t | ES8388_ADC_mic_amplify_set (es8388_num_sel_t num_8388, es8388_mic_amp_t l_amp, es8388_mic_amp_t r_amp) |
设置8388 MIC增益的设置 更多... | |
static int32_t | ES8388_input_channal_config (es8388_num_sel_t num_8388, es8388_input_cha_t *InChaType) |
8388的输入线路选择 更多... | |
int32_t | ES8388_ADC_data_format_set (es8388_num_sel_t num_8388, es8388_adc_data_len_t data_length, es8388_adc_data_format_t data_format) |
ADC的数据格式设置 更多... | |
int32_t | ES8388_ADC_oversample_config (es8388_num_sel_t num_8388, uint32_t fs_mode, uint32_t fs_ratio) |
ADC过采样率设置 更多... | |
int32_t | ES8388_ADC_invl_config (es8388_num_sel_t num_8388, es8388_adc_inv_sel_t gate_l, es8388_adc_inv_sel_t gate_r) |
设置8388 ADC 数据极性反转 更多... | |
int32_t | ES8388_ADC_HPF_config (es8388_num_sel_t num_8388, uint32_t gate_l, uint32_t gate_r) |
设置8388 ADC 高通滤波器的开关(8388的高通滤波器的截止频率大概为6.7Hz) 更多... | |
int32_t | ES8388_ADC_soft_ramp_config (es8388_num_sel_t num_8388, uint32_t gate, uint32_t x_lrck) |
设置8388 ADC 的softramp设置 更多... | |
int32_t | ES8388_ADC_mute_config (es8388_num_sel_t num_8388, uint32_t gate) |
设置8388 ADC mute的开关 更多... | |
int32_t | ES8388_ADC_vol_config (es8388_num_sel_t num_8388, float adc_vol_l, float adc_vol_r) |
配置8388的ADCVOL的值 更多... | |
int32_t | ES8388_ALC_config (es8388_num_sel_t num_8388, es8388_alc_config_t *ALC_str, es8388_alc_cha_gate_t ALC_gate) |
配置8388的ALC 更多... | |
void | ES8388_alc_gate (es8388_num_sel_t num_8388, es8388_alc_cha_gate_t ALC_gate) |
void | ES8388_alc_max_gain_set (es8388_num_sel_t num_8388, es8388_alc_maxgain_t max_gain) |
static int32_t | ES8388_noise_gate_config (es8388_num_sel_t num_8388, float threshold, uint32_t type, uint32_t gate) |
设置8388 ALC noisegate设置 更多... | |
int32_t | ES8388_DAC_data_format_set (es8388_num_sel_t num_8388, es8388_dac_data_len_t data_length, es8388_dac_data_format_t data_format) |
设置8388 DAC数据格式设置 更多... | |
int32_t | ES8388_DAC_oversample_config (es8388_num_sel_t num_8388, uint32_t fs_mode, uint32_t fs_ratio) |
DAC 过采样设置 更多... | |
int32_t | ES8388_DAC_vol_config (es8388_num_sel_t num_8388, float DAC_vol_l, float DAC_vol_r) |
配置8388的DACVOL的值 更多... | |
int32_t | ES8388_DAC_deemphasismode_config (es8388_num_sel_t num_8388, uint32_t mode) |
DAC DEEMPHASISMODE的设置(去加重模式设置) 更多... | |
int32_t | ES8388_DAC_phase_inversion_config (es8388_num_sel_t num_8388, uint32_t phase_l, uint32_t phase_r) |
DAC 左右通道相位180度翻转开关 更多... | |
int32_t | ES8388_DAC_output_zero_config (es8388_num_sel_t num_8388, uint32_t zero_l, uint32_t zero_r) |
DAC 左右通道输出归零选择 更多... | |
int32_t | ES8388_DAC_mono_config (es8388_num_sel_t num_8388, uint32_t merge_en) |
左右通道是否merge(如果merge,左右通道的和的一半通过左右通道输出) 更多... | |
int32_t | ES8388_DAC_SE_add_vpp_config (es8388_num_sel_t num_8388, uint32_t se, uint32_t vpp) |
设置8388 DAC 音能和Vpp幅值上限设置 更多... | |
int32_t | ES8388_mixsel (es8388_num_sel_t num_8388, uint32_t l_sel, uint32_t r_sel) |
左右通道mix选择 更多... | |
int32_t | ES8388_left_mixer_config (es8388_num_sel_t num_8388, uint32_t ld2lo, uint32_t li2lo, uint32_t li2lovol) |
左通道mixer配置 更多... | |
int32_t | ES8388_right_mixer_config (es8388_num_sel_t num_8388, uint32_t rd2ro, uint32_t ri2ro, uint32_t ri2rovol) |
4通道mixer配置 更多... | |
int32_t | ES8388_dac_clk_config (es8388_num_sel_t num_8388, uint32_t slrck, uint32_t lrck_sel, uint32_t offset, uint32_t mclk, uint32_t adc_dll, uint32_t dac_dll) |
DAC的clk方面的一些配置 更多... | |
int32_t | ES8388_dac_offset_config (es8388_num_sel_t num_8388, uint32_t offset) |
offset大小的设置 更多... | |
int32_t | ES8388_vref_resistance_config (es8388_num_sel_t num_8388, uint32_t vroi) |
VREF to analog output resistance电阻大小选择 更多... | |
int32_t | ES8388_dac_vol_set (es8388_num_sel_t num_8388, int32_t l1vol, int32_t r1vol, int32_t l2vol, int32_t r2vol) |
DAC四个通道的声音大小的设置 更多... | |
int32_t | ES8388_play_init (es8388_num_sel_t num_8388) |
根据8388的编号初始化8388 更多... | |
void | ES8388_DAC_power (es8388_num_sel_t num_8388, es8388_cha_sel_t cha, FunctionalState cmd) |
各个通道DAC电源的开关 更多... | |
void | ES8388_DAC_mute (es8388_num_sel_t num_8388, FunctionalState cmd) |
DAC mute开关 更多... | |
void | ES8388_aec_setting (es8388_num_sel_t num_8388) |
在AEC的情况下8388的配置(参照一代工程) 更多... | |
为ES8388封装的驱动程序
#define ADC_DATA_1ST_BCLK (1<<5) |
#define ADC_DATA_2ND_BCLK (0<<5) |
#define ADC_DATA_INVERTED_POLARITY (1<<5) |
#define ADC_DATA_NORMAL_POLARITY (0<<5) |
#define ADC_DLL_NORMOL (0<<3) |
#define ADC_DLL_POWER_DOWN (1<<3) |
#define ADC_FS_DIF_FROM_DAC_FS (0x0<<4) |
#define ADC_FS_SAME_AS_DAC_FS (0x1<<4) |
#define ADC_HPFL_DISABLE (0<<5) |
#define ADC_HPFL_ENABLE (1<<5) |
#define ADC_HPFR_DISABLE (0<<4) |
#define ADC_HPFR_ENABLE (1<<4) |
#define ADC_LDATA_LADC_RDATA_LADC (0x1<<6) |
#define ADC_LDATA_LADC_RDATA_RADC (0x0<<6) |
#define ADC_LDATA_RADC_RDATA_LADC (0x3<<6) |
#define ADC_LDATA_RADC_RDATA_RADC (0x2<<6) |
#define ADC_MUTE_DISABLE (0<<2) |
#define ADC_MUTE_ENABLE (1<<2) |
#define ADC_RAMPRATE_16LRCK (2<<6) |
#define ADC_RAMPRATE_32LRCK (3<<6) |
#define ADC_RAMPRATE_4LRCK (0<<6) |
#define ADC_RAMPRATE_8LRCK (1<<6) |
#define ADC_SOFTRAMP_DISABLE (0<<5) |
#define ADC_SOFTRAMP_ENABLE (1<<5) |
#define ADCMCLK_AS_MASTER_CLOCK (0x0<<5) |
#define ALC_ATTACKTIME_0_104MS (0<<0) |
#define ALC_ATTACKTIME_0_208MS (1<<0) |
#define ALC_ATTACKTIME_0_416MS (2<<0) |
#define ALC_ATTACKTIME_0_832MS (3<<0) |
#define ALC_ATTACKTIME_106MS (10<<0) |
#define ALC_ATTACKTIME_13_3MS (7<<0) |
#define ALC_ATTACKTIME_1_664MS (4<<0) |
#define ALC_ATTACKTIME_26_6MS (8<<0) |
#define ALC_ATTACKTIME_3_328MS (5<<0) |
#define ALC_ATTACKTIME_53_2MS (9<<0) |
#define ALC_ATTACKTIME_6_65MS (6<<0) |
#define ALC_DECAYTIME_0_41MS (0<<4) |
#define ALC_DECAYTIME_0_82MS (1<<4) |
#define ALC_DECAYTIME_105MS (8<<4) |
#define ALC_DECAYTIME_13_12MS (5<<4) |
#define ALC_DECAYTIME_1_64MS (2<<4) |
#define ALC_DECAYTIME_210MS (9<<4) |
#define ALC_DECAYTIME_26_24MS (6<<4) |
#define ALC_DECAYTIME_3_28MS (3<<4) |
#define ALC_DECAYTIME_420MS (10<<4) |
#define ALC_DECAYTIME_52_5MS (7<<4) |
#define ALC_DECAYTIME_6_56MS (4<<4) |
#define ALC_HOLDTIME_01360MS (10<<0) |
#define ALC_HOLDTIME_0MS (0<<0) |
#define ALC_HOLDTIME_10_5MS (3<<0) |
#define ALC_HOLDTIME_170MS (7<<0) |
#define ALC_HOLDTIME_21MS (4<<0) |
#define ALC_HOLDTIME_2_67MS (1<<0) |
#define ALC_HOLDTIME_340MS (8<<0) |
#define ALC_HOLDTIME_42MS (5<<0) |
#define ALC_HOLDTIME_5_33MS (2<<0) |
#define ALC_HOLDTIME_680MS (9<<0) |
#define ALC_HOLDTIME_85MS (6<<0) |
#define ALC_LIMITER_MODE (1<<7) |
#define ALC_NORMAL_MODE (0<<7) |
#define ALC_ZERO_CROSS_DISABLE (0<<6) |
#define ALC_ZERO_CROSS_ENABLE (1<<6) |
#define ALC_ZERO_CROSS_TIMEOUT_DISABLE (0<<5) |
#define ALC_ZERO_CROSS_TIMEOUT_ENABLE (1<<5) |
#define ANALOG_MONO_MIX_TO_LEFT (0x1<<3) |
#define ANALOG_MONO_MIX_TO_RIGHT (0x2<<3) |
#define ASDOUT_IS_ADC_NORMAL_OUTPUT (0x0<<2) |
#define ASDOUT_TRI_STATED (0x1<<2) |
#define DAC_ADC_LRC_SAME (1<<7) |
#define DAC_ADC_LRC_SEPARATE (0<<7) |
#define DAC_DATA_1ST_BCLK (1<<6) |
#define DAC_DATA_2ND_BCLK (0<<6) |
#define DAC_DATA_INVERTED_POLARITY (1<<6) |
#define DAC_DATA_NORMAL_POLARITY (0<<6) |
#define DAC_DEEMPHASISMODE_32K (1<<6) |
#define DAC_DEEMPHASISMODE_44_1K (2<<6) |
#define DAC_DEEMPHASISMODE_48K (3<<6) |
#define DAC_DEEMPHASISMODE_DISABLE (0<<6) |
#define DAC_DLL_NORMAL (0<<2) |
#define DAC_DLL_POWER_DOWN (1<<2) |
#define DAC_L_180_PHASE_INVERSION (1<<5) |
#define DAC_L_NO_PHASE_INVERSION (0<<5) |
#define DAC_L_R_MERGE (1<<5) |
#define DAC_LRSWAP_DISABLE (0<<7) |
#define DAC_LRSWAP_ENABLE (1<<7) |
#define DAC_NO_MERGE (0<<5) |
#define DAC_R_180_PHASE_INVERSION (1<<4) |
#define DAC_R_NO_PHASE_INVERSION (0<<4) |
#define DAC_SE_STRENGTH_0 (0<<2) |
#define DAC_SE_STRENGTH_1 (1<<2) |
#define DAC_SE_STRENGTH_2 (2<<2) |
#define DAC_SE_STRENGTH_3 (3<<2) |
#define DAC_SE_STRENGTH_4 (4<<2) |
#define DAC_SE_STRENGTH_5 (5<<2) |
#define DAC_SE_STRENGTH_6 (6<<2) |
#define DAC_SE_STRENGTH_7 (7<<2) |
#define DAC_VPP_2_5V (3<<0) |
#define DAC_VPP_3_5V (0<<0) |
#define DAC_VPP_3V (2<<0) |
#define DAC_VPP_4V (1<<0) |
#define DAC_ZERO_OUTPUT_L_DISABLE (0<<7) |
#define DAC_ZERO_OUTPUT_L_ENABLE (1<<7) |
#define DAC_ZERO_OUTPUT_R_DISABLE (0<<6) |
#define DAC_ZERO_OUTPUT_R_ENABLE (1<<6) |
#define DACMCLK_AS_MASTER_CLOCK (0x1<<5) |
#define DIFFERENTIAL_L_CHA (0x3<<6) |
#define DIFFERENTIAL_R_CHA (0x3<<4) |
#define DISABLE_REFERENCE (0x0<<2) |
#define DIVIDER_500K (0x2<<0) |
#define DIVIDER_50K (0x1<<0) |
#define DIVIDER_5K (0x3<<0) |
#define DSL_LINPUT1_RINPUT1 (0x0<<7) |
#define DSL_LINPUT2_RINPUT2 (0x1<<7) |
#define DSR_LINPUT1_RINPUT1 (0x0<<2) |
#define DSR_LINPUT2_RINPUT2 (0x1<<2) |
#define ENABLE_REFERENCE (0x1<<2) |
#define ES8388_ADC_IFACE ES8388_ADCCONTROL4 |
#define ES8388_ADC_MUTE ES8388_ADCCONTROL7 |
#define ES8388_ADCCONTROL1 (0x09) |
#define ES8388_ADCCONTROL10 (0x12) |
#define ES8388_ADCCONTROL11 (0x13) |
#define ES8388_ADCCONTROL12 (0x14) |
#define ES8388_ADCCONTROL13 (0x15) |
#define ES8388_ADCCONTROL14 (0x16) |
#define ES8388_ADCCONTROL2 (0x0a) |
#define ES8388_ADCCONTROL3 (0x0b) |
#define ES8388_ADCCONTROL4 (0x0c) |
#define ES8388_ADCCONTROL5 (0x0d) |
#define ES8388_ADCCONTROL6 (0x0e) |
#define ES8388_ADCCONTROL7 (0x0f) |
#define ES8388_ADCCONTROL8 (0x10) |
#define ES8388_ADCCONTROL9 (0x11) |
#define ES8388_ADCPOWER (0x03) |
#define ES8388_ANAVOLMANAG (0x07) |
#define ES8388_CHIPLOPOW1 (0x05) |
#define ES8388_CHIPLOPOW2 (0x06) |
#define ES8388_CHIPPOWER (0x02) |
#define ES8388_CONTROL1 (0x00) |
#define ES8388_CONTROL2 (0x01) |
#define ES8388_DAC_IFACE ES8388_DACCONTROL1 |
#define ES8388_DAC_MUTE ES8388_DACCONTROL3 |
#define ES8388_DAC_SRATE ES8388_DACCONTROL2 |
#define ES8388_DACCONTROL1 (0x17) |
#define ES8388_DACCONTROL10 (0x20) |
#define ES8388_DACCONTROL11 (0x21) |
#define ES8388_DACCONTROL12 (0x22) |
#define ES8388_DACCONTROL13 (0x23) |
#define ES8388_DACCONTROL14 (0x24) |
#define ES8388_DACCONTROL15 (0x25) |
#define ES8388_DACCONTROL16 (0x26) |
#define ES8388_DACCONTROL17 (0x27) |
#define ES8388_DACCONTROL18 (0x28) |
#define ES8388_DACCONTROL19 (0x29) |
#define ES8388_DACCONTROL2 (0x18) |
#define ES8388_DACCONTROL20 (0x2a) |
#define ES8388_DACCONTROL21 (0x2b) |
#define ES8388_DACCONTROL22 (0x2c) |
#define ES8388_DACCONTROL23 (0x2d) |
#define ES8388_DACCONTROL24 (0x2e) |
#define ES8388_DACCONTROL25 (0x2f) |
#define ES8388_DACCONTROL26 (0x30) |
#define ES8388_DACCONTROL27 (0x31) |
#define ES8388_DACCONTROL28 (0x32) |
#define ES8388_DACCONTROL29 (0x33) |
#define ES8388_DACCONTROL3 (0x19) |
#define ES8388_DACCONTROL30 (0x34) |
#define ES8388_DACCONTROL4 (0x1a) |
#define ES8388_DACCONTROL5 (0x1b) |
#define ES8388_DACCONTROL6 (0x1c) |
#define ES8388_DACCONTROL7 (0x1d) |
#define ES8388_DACCONTROL8 (0x1e) |
#define ES8388_DACCONTROL9 (0x1f) |
#define ES8388_DACPOWER (0x04) |
#define ES8388_IFACE ES8388_MASTERMODE |
#define ES8388_LADC_VOL ES8388_ADCCONTROL8 |
#define ES8388_LDAC_VOL ES8388_DACCONTROL4 |
#define ES8388_LOUT1_VOL ES8388_DACCONTROL24 |
#define ES8388_LOUT2_VOL ES8388_DACCONTROL26 |
#define ES8388_MASTERMODE (0x08) |
#define ES8388_RADC_VOL ES8388_ADCCONTROL9 |
#define ES8388_RDAC_VOL ES8388_DACCONTROL5 |
#define ES8388_ROUT1_VOL ES8388_DACCONTROL25 |
#define ES8388_ROUT2_VOL ES8388_DACCONTROL27 |
#define FS_DOUBLE_SPEED (0x1<<5) |
#define FS_RATIO_1000 (0x18<<0) |
#define FS_RATIO_1024 (0x7<<0) |
#define FS_RATIO_1088 (0x1a<<0) |
#define FS_RATIO_1152 (0x8<<0) |
#define FS_RATIO_125 (0x10<<0) |
#define FS_RATIO_128 (0x0<<0) |
#define FS_RATIO_136 (0x11<<0) |
#define FS_RATIO_1408 (0x9<<0) |
#define FS_RATIO_1496 (0x1b<<0) |
#define FS_RATIO_1500 (0x1c<<0) |
#define FS_RATIO_1536 (0xa<<0) |
#define FS_RATIO_192 (0x1<<0) |
#define FS_RATIO_2112 (0xb<<0) |
#define FS_RATIO_2304 (0xc<<0) |
#define FS_RATIO_250 (0x12<<0) |
#define FS_RATIO_256 (0x2<<0) |
#define FS_RATIO_272 (0x13<<0) |
#define FS_RATIO_375 (0x14<<0) |
#define FS_RATIO_384 (0x3<<0) |
#define FS_RATIO_500 (0x15<<0) |
#define FS_RATIO_512 (0x4<<0) |
#define FS_RATIO_544 (0x16<<0) |
#define FS_RATIO_576 (0x5<<0) |
#define FS_RATIO_750 (0x17<<0) |
#define FS_RATIO_768 (0x6<<0) |
#define FS_SINGLE_SPEED (0x0<<5) |
#define L_DAC_2_L_MIXER_DISABLE (0<<7) |
#define L_DAC_2_L_MIXER_ENABLE (1<<7) |
#define LIN_2_L_MIXER_DISABLE (0<<6) |
#define LIN_2_L_MIXER_ENABLE (1<<6) |
#define LIN_2_L_MIXER_GAIN_0dB (2<<3) |
#define LIN_2_L_MIXER_GAIN_3dB (1<<3) |
#define LIN_2_L_MIXER_GAIN_6dB (0<<3) |
#define LIN_2_L_MIXER_GAIN__12dB (6<<3) |
#define LIN_2_L_MIXER_GAIN__15dB (7<<3) |
#define LIN_2_L_MIXER_GAIN__3dB (3<<3) |
#define LIN_2_L_MIXER_GAIN__6dB (4<<3) |
#define LIN_2_L_MIXER_GAIN__9dB (5<<3) |
#define LINPUT1 (0x0<<6) |
#define LINPUT2 (0x1<<6) |
#define LMIXSEL_LEFT_ADC (3<<3) |
#define LMIXSEL_LIN1 (0<<3) |
#define LMIXSEL_LIN2 (1<<3) |
#define MCLK_INPUT_FROM_PAD_DISABLE (1<<4) |
#define MCLK_INPUT_FROM_PAD_ENABLE (0<<4) |
#define MONOMIX_STEREO (0x0<<3) |
#define MUTE_ADC_OUTPUT (0x1<<1) |
#define NOISE_GATE_DISABLE (0x0<<0) |
#define NOISE_GATE_ENABLE (0x1<<0) |
#define OFFSET_DISABLE (0<<5) |
#define OFFSET_ENABLE (1<<5) |
#define PGA_GAIN_HELD_CONSTANT (0x0<<1) |
#define R_DAC_2_R_MIXER_DISABLE (0<<7) |
#define R_DAC_2_R_MIXER_ENABLE (1<<7) |
#define RIN_2_R_MIXER_DISABLE (0<<6) |
#define RIN_2_R_MIXER_ENABLE (1<<6) |
#define RIN_2_R_MIXER_GAIN_0dB (2<<3) |
#define RIN_2_R_MIXER_GAIN_3dB (1<<3) |
#define RIN_2_R_MIXER_GAIN_6dB (0<<3) |
#define RIN_2_R_MIXER_GAIN__12dB (6<<3) |
#define RIN_2_R_MIXER_GAIN__15dB (7<<3) |
#define RIN_2_R_MIXER_GAIN__3dB (3<<3) |
#define RIN_2_R_MIXER_GAIN__6dB (4<<3) |
#define RIN_2_R_MIXER_GAIN__9dB (5<<3) |
#define RINPUT1 (0x0<<4) |
#define RINPUT2 (0x1<<4) |
#define RMIXSEL_RIGHT_ADC (3<<0) |
#define RMIXSEL_RIN1 (0<<0) |
#define RMIXSEL_RIN2 (1<<0) |
#define USE_ADC_LRCK (1<<6) |
#define USE_DAC_LRCK (0<<6) |
#define USE_DSL_REG11_BIT7_DSR_REG10_BIT2 (0x1<<3) |
#define USE_ONE_DSL_REG11_BIT7 (0x0<<3) |
#define VMID_DISABLE (0x0<<0) |
#define VROI_1_5K (0<<4) |
#define VROI_40K (1<<4) |
int32_t ES8388_ADC_HPF_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | gate_l, | ||
uint32_t | gate_r | ||
) |
设置8388 ADC 高通滤波器的开关(8388的高通滤波器的截止频率大概为6.7Hz)
num_8388 | 8388编号 |
gate_l | 左通道HPF开关 |
gate_r | 右通道HPF开关 |
int32_t ES8388_ADC_mute_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | gate | ||
) |
设置8388 ADC mute的开关
num_8388 | 8388编号 |
gate | ADC 静音开关 |
int32_t ES8388_ADC_oversample_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | fs_mode, | ||
uint32_t | fs_ratio | ||
) |
ADC过采样率设置
num_8388 | 8388编号 |
fs_mode | ADC MCLK模式 |
fs_ratio | 过采样率 |
int32_t ES8388_ADC_soft_ramp_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | gate, | ||
uint32_t | x_lrck | ||
) |
设置8388 ADC 的softramp设置
num_8388 | 8388编号 |
gate | softramp开关 |
x_lrck |
int32_t ES8388_ADC_vol_config | ( | es8388_num_sel_t | num_8388, |
float | adc_vol_l, | ||
float | adc_vol_r | ||
) |
配置8388的ADCVOL的值
num_8388 | 8388编号 |
adc_vol_l | 左声道数字增益,从0dB到-96dB,步进为0.5dB |
adc_vol_r | 右声道数字增益,从0dB到-96dB,步进为0.5dB |
int32_t ES8388_chip_control_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | dacmclk, | ||
uint32_t | samefs, | ||
uint32_t | ref, | ||
uint32_t | divider | ||
) |
设置8388 chipcontrol的配置
num_8388 | 8388编号 |
dacmclk | DAC MCLK选择 |
samefs | 过采样设置 |
ref | 是否使能ref |
divider | 电阻选择 |
int32_t ES8388_dac_clk_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | slrck, | ||
uint32_t | lrck_sel, | ||
uint32_t | offset, | ||
uint32_t | mclk, | ||
uint32_t | adc_dll, | ||
uint32_t | dac_dll | ||
) |
DAC的clk方面的一些配置
num_8388 | 8388编号 |
slrck | lrck选择使用相同的还是不同的 |
lrck_sel | 选择使用ADC或者DAC的LRCK |
offset | offset的开关 |
mclk | MCLK的开关 |
adc_dll | adc_dll的开关 |
dac_dll | dac_dll的开关 |
int32_t ES8388_DAC_deemphasismode_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | mode | ||
) |
DAC DEEMPHASISMODE的设置(去加重模式设置)
num_8388 | 8388编号 |
mode | 模式设置 |
int32_t ES8388_DAC_mono_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | merge_en | ||
) |
左右通道是否merge(如果merge,左右通道的和的一半通过左右通道输出)
num_8388 | 8388编号 |
merge_en | 开关 |
int32_t ES8388_dac_offset_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | offset | ||
) |
offset大小的设置
num_8388 | 8388编号 |
offset | 电压偏移值 |
int32_t ES8388_DAC_output_zero_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | zero_l, | ||
uint32_t | zero_r | ||
) |
DAC 左右通道输出归零选择
num_8388 | 8388编号 |
zero_l | 左声道数据归零选择 |
zero_r | 右声道数据归零选择 |
int32_t ES8388_DAC_oversample_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | fs_mode, | ||
uint32_t | fs_ratio | ||
) |
DAC 过采样设置
num_8388 | 8388编号 |
fs_mode | 过采样模式 |
fs_ratio | 过采样率设置 |
int32_t ES8388_DAC_phase_inversion_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | phase_l, | ||
uint32_t | phase_r | ||
) |
DAC 左右通道相位180度翻转开关
num_8388 | 8388编号 |
phase_l | 左声道数据是否翻转 |
phase_r | 右声道数据是否翻转 |
int32_t ES8388_DAC_SE_add_vpp_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | se, | ||
uint32_t | vpp | ||
) |
设置8388 DAC 音能和Vpp幅值上限设置
num_8388 | 8388编号 |
se | 8个SE_STRENGTH的宏定义 |
vpp | 基准电压设置 |
int32_t ES8388_DAC_vol_config | ( | es8388_num_sel_t | num_8388, |
float | DAC_vol_l, | ||
float | DAC_vol_r | ||
) |
配置8388的DACVOL的值
num_8388 | 8388编号 |
DAC_vol_l | 左通道VOL值,0dB到-96dB,步进为0.5dB |
DAC_vol_r | 右通道VOL值,0dB到-96dB,步进为0.5dB |
void es8388_i2c_init | ( | es8388_num_sel_t | num_8388 | ) |
es8388使用的I2C初始化
num_8388 | 8388的编号 |
|
static |
8388的输入线路选择
num_8388 | 8388编号 |
InChaType | ES8388_Input_Channal_TypeDef类型结构体指针 |
int32_t ES8388_left_mixer_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | ld2lo, | ||
uint32_t | li2lo, | ||
uint32_t | li2lovol | ||
) |
左通道mixer配置
num_8388 | 8388编号 |
ld2lo | left DAC to left mixer开关 |
li2lo | LIN signal to left mixer |
li2lovol | 增益大小 |
int32_t ES8388_mastermode_config | ( | es8388_num_sel_t | num_8388, |
es8388_mode_sel_t | mode | ||
) |
设置8388 mastermode寄存器的值,使用基本固定,全部都是0x00
num_8388 | 8388编号 |
mode | 8388的主从模式选择 |
int32_t ES8388_mixsel | ( | es8388_num_sel_t | num_8388, |
uint32_t | l_sel, | ||
uint32_t | r_sel | ||
) |
左右通道mix选择
num_8388 | 8388编号 |
l_sel | 左通道数据选择 |
r_sel | 右通道数据选择 |
|
static |
设置8388 ALC noisegate设置
num_8388 | 8388编号 |
threshold | 噪声门限阈值(-76.5dBFS – -30dBFS) |
type | 噪声门限模式 |
gate | 噪声门限开关 |
int32_t ES8388_reset | ( | es8388_num_sel_t | num_8388 | ) |
设置8388 复位
num_8388 | 8388编号 |
int32_t ES8388_reset_release | ( | es8388_num_sel_t | num_8388 | ) |
设置8388 解除复位
num_8388 | 8388编号 |
int32_t ES8388_right_mixer_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | rd2ro, | ||
uint32_t | ri2ro, | ||
uint32_t | ri2rovol | ||
) |
4通道mixer配置
num_8388 | 8388编号 |
rd2ro | reft DAC to reft mixer开关 |
ri2ro | rin signal to reft mixer |
ri2rovol | 增益大小 |
int32_t ES8388_vref_resistance_config | ( | es8388_num_sel_t | num_8388, |
uint32_t | vroi | ||
) |
VREF to analog output resistance电阻大小选择
num_8388 | 8388编号 |
vroi | 电阻大小 |
|
static |
读取8388某个寄存器的值
num_8388 | 8388编号 |
regaddr | 8388寄存器地址 |
|
static |
为8388写入一个字节数据
num_8388 | 8388编号 |
regaddr | 8388寄存器地址 |
val | 需要写入的值 |