#include "platform.h"
#include "hal_headfile.h"
#include "board.h"
#include "debug.h"
#include "audio.h"
#include "config.h"
#include "config_infor.h"

/**
 * This function is denoise default parameter initialization
 *
 * @param : none.
 * @return: none.
 */
void show_default_denoise_param(void)
{
    config_bug("****get denoise param from user config *****\r\n");
    config_bug("****denoise_param.start_magic:0x%x\r\n", 5);
    config_bug("****denoise_param.param_version:0x%x\r\n", denoise_param.param_version);
    config_bug("****denoise_param.function:0x%x\r\n", denoise_param.function);
    config_bug("****denoise_param.mode:0x%x\r\n", denoise_param.mode);
    config_bug("****denoise_param.enable:%d\r\n", denoise_param.enable);
    config_bug("****denoise_param.level:%d\r\n", denoise_param.level);
    config_bug("****denoise_param.input_option:%d\r\n", denoise_param.input_option);
    config_bug("****denoise_param.output_option:%d\r\n", denoise_param.output_option);
    config_bug("****denoise_param.mic_gain:%d\r\n", denoise_param.mic_gain);
    config_bug("****denoise_param.hp_volume:0x%x\r\n", denoise_param.hp_volume);
    config_bug("****denoise_param.dac_output_inverse:0x%x\r\n", denoise_param.dac_output_inverse);
    config_bug("****denoise_param.stop_magic:0x%x\r\n", denoise_param.stop_magic);
}
/**
 * This function is AEC default parameter initialization
 *
 * @param : none.
 * @return: none.
 */
void show_default_AEC_param(void)
{
    config_bug("****get AEC param from user config *****\r\n");
    config_bug("****AEC_param->start_magic:0x%x\r\n", aec_param.start_magic);
    config_bug("****AEC_param->param_version:0x%x\r\n", aec_param.param_version);
    config_bug("****AEC_param->function:0x%d\r\n", aec_param.function);
    config_bug("****AEC_param->mode:%d\r\n", aec_param.mode);
    config_bug("****AEC_param->enable:%d\r\n", aec_param.enable);
    config_bug("****AEC_param->level:%d\r\n", aec_param.level);
    config_bug("****AEC_param->mian_mic_option:%d\r\n", aec_param.mian_mic_option);
    config_bug("****AEC_param->mian_mic_gain:0x%x\r\n", aec_param.mian_mic_gain);
    config_bug("****AEC_param->sub_mic_option:0x%x\r\n", aec_param.sub_mic_option);
    config_bug("****AEC_param->sub_mic_gain:%d\r\n", aec_param.sub_mic_gain);
    config_bug("****AEC_param->output_option:0x%x\r\n", aec_param.output_option);
    config_bug("****AEC_param->hp_volume:0x%x\r\n", aec_param.hp_volume);
    config_bug("****AEC_param->dac_output_inverse:0x%x\r\n", aec_param.dac_output_inverse);

    config_bug("****AEC_param->iis_smplerate:0x%x\r\n", aec_param.iis_smplerate);
    config_bug("****AEC_param->iis_bitwidth:0x%x\r\n", aec_param.iis_bitwidth);
    config_bug("****AEC_param->iis_rx_function:0x%x\r\n", aec_param.iis_rx_function);
    config_bug("****AEC_param->iis_tx_function:0x%x\r\n", aec_param.iis_tx_function);

    config_bug("****AEC_param->agc_stop_magic:0x%x\r\n", aec_param.stop_magic);
}
/**
 * This function is agc default parameter initialization
 *
 * @param : none.
 * @return: none.
 */
void show_default_agc_param(void)
{

    config_bug("****get AGC param from user config *****\r\n");
    config_bug("****agc_param.agc_start_magic:%x\r\n", agc_param.agc_start_magic);
    config_bug("****agc_param.agc_param_type:%x\r\n", agc_param.agc_param_type);
    config_bug("****agc_param.agc_param_enable:%d\r\n", agc_param.agc_param_enable);
    config_bug("****agc_param.agc_config.AGC_enable:%d\r\n", agc_param.agc_config.AGC_enable);
    config_bug("****agc_param.agc_config.noise_gain_enable:%d\r\n", agc_param.agc_config.noise_gain_enable);
    config_bug("****agc_param.agc_config.Hysteresis:%d\r\n", agc_param.agc_config.Hysteresis);
    config_bug("****agc_param.agc_config.Min_gain:%d\r\n", agc_param.agc_config.Min_gain);
    config_bug("****agc_param.agc_config.Max_gain:%x\r\n", agc_param.agc_config.Max_gain);
    config_bug("****agc_param.agc_config.noise_level:%x\r\n", agc_param.agc_config.noise_level);
    config_bug("****agc_param.agc_config.Target_level:%d\r\n", agc_param.agc_config.Target_level);
    config_bug("****agc_param.agc_config.Peak_Attack_time:%x\r\n", agc_param.agc_config.Peak_Attack_time);
    config_bug("****agc_param.agc_config.Peak_Release_time:%x\r\n", agc_param.agc_config.Peak_Release_time);
    config_bug("****agc_param.agc_config.Gain_Attack_time:%x\r\n", agc_param.agc_config.Gain_Attack_time);
    config_bug("****agc_param.agc_config.Gain_Release_time:%x\r\n", agc_param.agc_config.Gain_Release_time);
    config_bug("****agc_param.agc_stop_magic:%x\r\n", agc_param.agc_stop_magic);
}
/**
 * This function is EQ default parameter initialization
 *
 * @param : none.
 * @return: none.
 */
void show_default_EQ_param(void)
{

    config_bug("****get EQ param from user config *****\r\n");
    config_bug("****eq_param.eq_start_magic:%x\r\n", eq_param.eq_start_magic);
    config_bug("****eq_param.eq_param_type:%x\r\n", eq_param.eq_param_type);
    config_bug("****eq_param.eq_param_enable:%d\r\n", eq_param.eq_param_enable);
    config_bug("****eq_param.eq_enable:%d\r\n", eq_param.eq_enable);
    config_bug("****eq_param.eq_type:%d\r\n", eq_param.eq_type);

    if (eq_param.eq_type == 0x07) //自定义EQ参数
    {
        for (uint8_t i = 0; i < 40; i++)
        {
            config_bug("****eq_param.data[i]:%x\r\n", i, eq_param.data[i]);
        }
    }

    config_bug("****eq_param.eq_stop_magic:%x\r\n", eq_param.eq_stop_magic);
}
/**
 * This function is DRC default parameter initialization
 *
 * @param : none.
 * @return: none.
 */
void show_default_DRC_param(void)
{

    config_bug("****get DRC param from user config *****\r\n");
    config_bug("****drc_param.drc_start_magic:%x\r\n", drc_param.drc_start_magic);
    config_bug("****drc_param.drc_param_type:%x\r\n", drc_param.drc_param_type);
    config_bug("****drc_param.drc_param_enable:%d\r\n", drc_param.drc_param_enable);
    config_bug("****drc_param.drc_config.drc_enable:%d\r\n", drc_param.drc_config.drc_enable);
    config_bug("****drc_param.drc_config.drc_lmth:%d\r\n", drc_param.drc_config.drc_lmth);
    config_bug("****drc_param.drc_config.drc_slop:%d\r\n", drc_param.drc_config.drc_slop);
    config_bug("****drc_param.drc_config.drc_peak_at:%d\r\n", drc_param.drc_config.drc_peak_at);
    config_bug("****drc_param.drc_config.drc_peak_rt:%d\r\n", drc_param.drc_config.drc_peak_rt);
    config_bug("****drc_param.drc_config.drc_gain_at:%d\r\n", drc_param.drc_config.drc_gain_at);
    config_bug("****drc_param.drc_config.drc_gain_rt:%d\r\n", drc_param.drc_config.drc_gain_rt);
    config_bug("****drc_param.agc_stop_magic:%x\r\n", drc_param.agc_stop_magic);
}
/**
 * This function is user hardware default parameter initialization
 *
 * @param : none.
 * @return: none.
 */
void show_default_user_param(void)
{
    config_bug("****get user function param from user config *****\r\n");
    config_bug("****user_param.start_magic:%x\r\n", user_param.start_magic);
    config_bug("****user_param.param_type:%x\r\n", user_param.param_type);
    config_bug("****user_param.param_enable:%d\r\n", user_param.param_enable);
    config_bug("****user_param.function_switch_pin:%d\r\n", user_param.function_switch_pin);
    config_bug("****user_param.mute_switch_pin:%d\r\n", user_param.mute_switch_pin);
    config_bug("****user_param.function_led_pin:%d\r\n", user_param.function_led_pin);
    config_bug("****user_param.mute_led_pin:%d\r\n", user_param.mute_led_pin);
    config_bug("****user_param.power_contrl:%d\r\n", user_param.power_contrl);
    config_bug("****user_param.codec_bus:%d\r\n", user_param.codec_bus);
    config_bug("****user_param.stop_magic:%x\r\n", user_param.stop_magic);
}
/**
 * This function is user hardware default parameter initialization
 *
 * @param : none.
 * @return: none.
 */
void show_default_user_config(void)
{
	if(denoise_param.function == 0)
	{
		show_default_denoise_param();
	}
	else if(aec_param.function == 2)
	{
		show_default_AEC_param();
	}
    show_default_agc_param();
    show_default_EQ_param();
    show_default_DRC_param();
    show_default_user_param();
}
