add setgain

This commit is contained in:
gemu2015 2022-08-08 13:58:54 +02:00
parent a97c5d8dae
commit 7831c72be5
2 changed files with 8 additions and 0 deletions

View File

@ -95,4 +95,11 @@ esp_err_t es7243e_adc_init(TwoWire *tw, audio_hal_codec_config_t *codec_cfg)
}
return ret;
}
void es7243e_setgain(uint8_t gain) {
uint8_t gaintab[8] = {0x10, 0x12, 0x20, 0x22, 0x04, 0x40, 0x06, 0x42};
es7243e_write_reg(0x08, gaintab[gain & 7] | 0x09);
}
#endif

View File

@ -72,6 +72,7 @@ esp_err_t es7243e_adc_init(TwoWire *tw, audio_hal_codec_config_t *codec_cfg);
*/
// esp_err_t es7243_adc_set_gain(es7243_input_mics_t mic_mask, es7243_gain_value_t gain);
void es7243e_setgain(uint8_t gain);
#ifdef __cplusplus
}