![]() |
CI130X SDK API手册
2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
|
CI130X芯片inner CODEC驱动 更多...
结构体 | |
| struct | inner_codec_adc_config_t |
| inner CODEC ADC配置 更多... | |
| struct | inner_codec_alc_config_t |
| inner CODEC ALC设置结构体类型 更多... | |
| struct | inner_codec_alc_use_config_t |
| inner CODEC简易版ALC配置 更多... | |
CI130X芯片inner CODEC驱动
| struct inner_codec_adc_config_t |
inner CODEC ADC配置
| 成员变量 | ||
|---|---|---|
| inner_codec_input_mode_t | codec_adc_input_mode_l | ADC L 输入模式选择 |
| inner_codec_input_mode_t | codec_adc_input_mode_r | ADC R 输入模式选择 |
| inner_codec_mic_amplify_t | codec_adc_mic_amp_l | MIC L 增益设置 |
| inner_codec_mic_amplify_t | codec_adc_mic_amp_r | MIC R 增益设置 |
| float | dig_gain_l | 左声道数字增益 |
| float | dig_gain_r | 右声道数字增益 |
| float | pga_gain_l | 不使能ALC的情况下,PGA L 的固定增益 |
| float | pga_gain_r | 不使能ALC的情况下,PGA R 的固定增益 |
| struct inner_codec_alc_config_t |
inner CODEC ALC设置结构体类型
| 成员变量 | ||
|---|---|---|
| inner_codec_alc_mode_t | alcmode | ALC模式设置 |
| inner_codec_alc_attack_time_t | attacktime | ALC attack time设置 |
| inner_codec_alc_decay_time_t | decaytime | ALC decay time设置 |
| inner_codec_alc_hold_time_t | holdtime | ALC hold time设置 |
| inner_codec_alc_level_t | max_level | ALC max level设置 |
| inner_codec_alc_pga_max_gain_t | max_pga_gain | ALC设置PGA的上限设置 |
| inner_codec_alc_level_t | min_level | ALC min level设置 |
| inner_codec_alc_pga_min_gain_t | min_pga_gain | ALC设置PGA的下限设置 |
| float | pga_gain | 不使能ALC的情况下,PGA的增益设置 |
| inner_codec_samplerate_t | samplerate | ALC采样率设置 |
| struct inner_codec_alc_use_config_t |
inner CODEC简易版ALC配置
| 成员变量 | ||
|---|---|---|
| inner_cedoc_gate_t | alc_gate | ALC开关 |
| inner_codec_alc_pga_max_gain_t | alc_maxgain | ALC设置PGA增益上限设置 |
| inner_codec_alc_pga_min_gain_t | alc_mingain | ALC设置PGA增益下限设置 |
| inner_codec_alc_attack_time_t | attack_time | ALC attack time设置 |
| inner_codec_alc_decay_time_t | decay_time | ALC decay time设置 |
| uint16_t | digt_gain | 基本的数字增益 |
| inner_cedoc_gate_t | fast_decrece_87_5 | 过顶保护开关 |
| inner_codec_alc_hold_time_t | hold_time | ALC hold time设置 |
| inner_codec_alc_level_t | max_level | ALC max level设置 |
| inner_codec_alc_level_t | min_level | ALC min level设置 |
| inner_cedoc_gate_t | noise_gate | noise gate 开关 |
| inner_codec_noise_gate_threshold_t | noise_gate_threshold | 噪声门限阈值 |
| inner_codec_samplerate_t | sample_rate | ALC ALC的采样率设置 |
| inner_cedoc_gate_t | use_ci130x_alc | 使用CI130X的ALC控制inner CODEC还是使用其本身的ALC控制 |
| inner_cedoc_gate_t | zero_cross | 过零检测开关 |
inner CODEC ALC attack time设置
inner CODEC ALC decay time配置
inner CODEC ALC hold time设置
inner CODEC ALC 最大增益设置
inner CODEC ALC 最小增益设置
inner CODEC采样率设置
| void inner_codec_adc_disable | ( | inner_codec_cha_sel_t | cha, |
| inner_cedoc_gate_t | EN | ||
| ) |
关闭CODEC中的ADC
| cha | 左右通道、全部通道的选择; |
| EN | 选择是否关闭ADC |
| void inner_codec_adc_enable | ( | inner_codec_adc_config_t * | ADC_Config | ) |
使能CODEC中的ADC: 1.使用此函数之前先初始化CODEC_ADC_Config_TypeDef结构体并填写参数; 2.ALCL_Gain和ALCR_Gain的上下限分别是28.5dB和-18dB,步长1.5。
| ADC_Config | CODEC_ADC_Config_TypeDef结构体指针 |
| void inner_codec_adc_mode_set | ( | inner_codec_mode_t | mode, |
| inner_codec_frame_1_2len_t | frame_Len, | ||
| inner_codec_valid_word_len_t | word_len, | ||
| inner_codec_i2s_data_famat_t | data_fram | ||
| ) |
CODEC作为ADC的模式选择
| mode | Master模式或者Slave模式; |
| frame_Len | 数据宽度; |
| word_len | 有效数据长度; |
| data_fram | 数据格式 |
| void inner_codec_alc_disable | ( | inner_codec_cha_sel_t | cha | ) |
关闭CODEC中的ALC,并切换到 pga_gain_reg 控制PGA增益
| cha | 通道选择 |
| ALC_Gain | 关闭ALC之后,使用寄存器0x27控制ALC增益的大小 |
| void inner_codec_dac_disable | ( | void | ) |
关闭DAC
| cha | 声道选择 |
| EN | 开关 |
| void inner_codec_dac_enable | ( | bool | is_first_enable | ) |
开启DAC
| is_first_enable | 是否为第1次开启 |
| void inner_codec_dac_mode_set | ( | inner_codec_mode_t | mode, |
| inner_codec_frame_1_2len_t | frame_Len, | ||
| inner_codec_valid_word_len_t | word_len, | ||
| inner_codec_i2s_data_famat_t | data_fram | ||
| ) |
CODEC作为DAC的模式选择
| mode | Master模式或者Slave模式; |
| frame_Len | 数据宽度; |
| word_len | 有效数据长度; |
| data_fram | 数据格式 |
| void inner_codec_hp_filter_config | ( | inner_cedoc_gate_t | gate, |
| inner_codec_highpass_cut_off_t | Hz | ||
| ) |
配置CODEC模块的高通滤波器
| gate | 高通滤波器开关 |
| Hz | 高通滤波器的截止频率 |
| void inner_codec_micbias_set | ( | inner_codec_micbias_t | bias | ) |
设置MICBIAS的大小
| bias |
| void inner_codec_power_off | ( | void | ) |
关闭CODEC模块电源
| void inner_codec_power_up | ( | inner_codec_current_t | current | ) |
CODEC模块上电
| current | pre-charge/dis-charge的电流大小 |
| void inner_codec_reset | ( | void | ) |
INNER CODEC reset
| void inner_codec_up_ibas_adc | ( | void | ) |
ADC电流源强制启动
| void inner_codec_up_ibas_dac | ( | void | ) |
DAC电流源强制启动
1.8.14