Edit config for mics

This commit is contained in:
Ben V. Brown 2023-02-04 11:33:45 +11:00 committed by Rudis Muiznieks
parent 97c2a54186
commit 9c14484f09
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
2 changed files with 38 additions and 41 deletions

View File

@ -104,7 +104,7 @@ const struct HAL_KEY_GPIOKEY_CFG_T cfg_hw_gpio_key_cfg[CFG_HW_GPIOKEY_NUM] = {
// bt config
// const char *BT_LOCAL_NAME = TO_STRING(BT_DEV_NAME) "\0";
const char *BT_LOCAL_NAME = "PineBuds Pro";
const char *BLE_DEFAULT_NAME = "BES_BLE";
const char *BLE_DEFAULT_NAME = "PineBuds Pro BLE";
uint8_t ble_addr[6] = {
#ifdef BLE_DEV_ADDR
BLE_DEV_ADDR
@ -122,6 +122,7 @@ uint8_t bt_addr[6] = {
#endif
};
/// True Wireless side configuration using resistor fitment
const struct HAL_IOMUX_PIN_FUNCTION_MAP cfg_hw_tws_channel_cfg = {
HAL_IOMUX_PIN_P1_4, HAL_IOMUX_FUNC_AS_GPIO, HAL_IOMUX_PIN_VOLTAGE_VIO,
HAL_IOMUX_PIN_PULLUP_ENABLE};
@ -159,21 +160,23 @@ const struct CODEC_DAC_VOL_T codec_dac_vol[TGT_VOLUME_LEVEL_QTY] = {
{TX_PA_GAIN, 0x03, -3}, {TX_PA_GAIN, 0x03, 0}, // 0dBm
};
#if SPEECH_CODEC_CAPTURE_CHANNEL_NUM == 2
#define CFG_HW_AUD_INPUT_PATH_MAINMIC_DEV \
(AUD_CHANNEL_MAP_CH0 | AUD_CHANNEL_MAP_CH4 | AUD_VMIC_MAP_VMIC2 | \
AUD_VMIC_MAP_VMIC3)
#elif SPEECH_CODEC_CAPTURE_CHANNEL_NUM == 3
#define CFG_HW_AUD_INPUT_PATH_MAINMIC_DEV \
(AUD_CHANNEL_MAP_CH0 | AUD_CHANNEL_MAP_CH1 | AUD_CHANNEL_MAP_CH4 | \
AUD_VMIC_MAP_VMIC1)
#else
#define CFG_HW_AUD_INPUT_PATH_MAINMIC_DEV \
(AUD_CHANNEL_MAP_CH4 | AUD_VMIC_MAP_VMIC3)
#endif
// MIC and channel configurations
// Pinebuds pro have the following mic's and biases
/*
* User Voice (Talking) = MIC5 input and VMIC3 Bias
* ANC Feed Forward = MIC1 input and VMIC2 Bias
* ANC Feed Backward = MIC3 input and VMIC2 Bias
*
* Note that AUD_CHANNEL_MAP is offset by 1 (0 start)
*/
#define USER_TALK_MIC AUD_CHANNEL_MAP_CH4
#define USER_TALK_VMIC_CFG AUD_VMIC_MAP_VMIC3
#define CFG_HW_AUD_INPUT_PATH_MAINMIC_DEV (USER_TALK_MIC | USER_TALK_VMIC_CFG)
#define CFG_HW_AUD_INPUT_PATH_LINEIN_DEV \
(AUD_CHANNEL_MAP_CH0 | AUD_CHANNEL_MAP_CH1)
#ifdef VOICE_DETECTOR_EN
#define CFG_HW_AUD_INPUT_PATH_VADMIC_DEV \
(AUD_CHANNEL_MAP_CH4 | AUD_VMIC_MAP_VMIC1)
@ -184,32 +187,23 @@ const struct CODEC_DAC_VOL_T codec_dac_vol[TGT_VOLUME_LEVEL_QTY] = {
const struct AUD_IO_PATH_CFG_T
cfg_audio_input_path_cfg[CFG_HW_AUD_INPUT_PATH_NUM] = {
#if defined(SPEECH_TX_AEC_CODEC_REF)
// NOTE: If enable Ch5 and CH6, need to add channel_num when setup
// audioflinger stream
{
AUD_INPUT_PATH_MAINMIC,
CFG_HW_AUD_INPUT_PATH_MAINMIC_DEV | AUD_CHANNEL_MAP_CH4,
},
#else
{
AUD_INPUT_PATH_MAINMIC,
CFG_HW_AUD_INPUT_PATH_MAINMIC_DEV,
},
#endif
{
AUD_INPUT_PATH_LINEIN,
CFG_HW_AUD_INPUT_PATH_LINEIN_DEV,
CFG_HW_AUD_INPUT_PATH_MAINMIC_DEV,
},
#ifdef VOICE_DETECTOR_EN
{
AUD_INPUT_PATH_VADMIC,
CFG_HW_AUD_INPUT_PATH_VADMIC_DEV,
CFG_HW_AUD_INPUT_PATH_MAINMIC_DEV,
},
#else
{
AUD_INPUT_PATH_ASRMIC,
CFG_HW_AUD_INPUT_PATH_ASRMIC_DEV,
CFG_HW_AUD_INPUT_PATH_MAINMIC_DEV,
},
#endif
};
@ -233,16 +227,6 @@ HAL_IOMUX_PIN_PULLUP_ENABLE
};
*/
// const struct HAL_IOMUX_PIN_FUNCTION_MAP TOUCH_I2C_SDA ={
// HAL_IOMUX_PIN_P2_1, HAL_IOMUX_FUNC_AS_GPIO, HAL_IOMUX_PIN_VOLTAGE_VIO,
// HAL_IOMUX_PIN_PULLUP_ENABLE
// };
// const struct HAL_IOMUX_PIN_FUNCTION_MAP TOUCH_I2C_SCL ={
// HAL_IOMUX_PIN_P2_0, HAL_IOMUX_FUNC_AS_GPIO, HAL_IOMUX_PIN_VOLTAGE_VIO,
// HAL_IOMUX_PIN_PULLUP_ENABLE
// };
#define IIR_COUNTER_FF_L (6)
#define IIR_COUNTER_FF_R (6)
#define IIR_COUNTER_FB_L (5)

View File

@ -96,10 +96,25 @@ extern const struct HAL_KEY_GPIOKEY_CFG_T cfg_hw_gpio_key_cfg[CFG_HW_GPIOKEY_NUM
#define ANC_COEF_LIST_NUM (ANC_COEF_NUM)
#endif
// MIC and channel configurations
// Pinebuds pro have the following mic's and biases
/*
* User Voice (Talking) = MIC5 input and VMIC3 Bias
* ANC Feed Forward = MIC1 input and VMIC2 Bias
* ANC Feed Backward = MIC3 input and VMIC2 Bias
*
* Note that AUD_CHANNEL_MAP is offset by 1 (0 start)
*/
#define ANC_FF_MIC_CH_L AUD_CHANNEL_MAP_CH0
#define ANC_FF_MIC_CH_R AUD_CHANNEL_MAP_CH1
#define ANC_FF_MIC_CH_R 0
#define ANC_FB_MIC_CH_L AUD_CHANNEL_MAP_CH2
#define ANC_FB_MIC_CH_R AUD_CHANNEL_MAP_CH3
#define ANC_FB_MIC_CH_R 0
#define ANC_FF_MIC AUD_CHANNEL_MAP_CH0
#define ANC_FB_MIC AUD_CHANNEL_MAP_CH2
#define ANC_VMIC_CFG AUD_VMIC_MAP_VMIC2
// audio codec
#define CFG_HW_AUD_INPUT_PATH_NUM 3
@ -139,8 +154,6 @@ extern const struct HAL_IOMUX_PIN_FUNCTION_MAP app_battery_ext_charger_indicator
extern bool tgt_tws_get_channel_is_right(void);
extern const struct HAL_IOMUX_PIN_FUNCTION_MAP TOUCH_I2C_SDA;
extern const struct HAL_IOMUX_PIN_FUNCTION_MAP TOUCH_I2C_SCL;
#ifdef __cplusplus
}
#endif