Add "Hear Mic" feature to the Mic App (#1518)

* Add "Hear Mic" feature to the Mic App

* Following consensus change about ternary operators
This commit is contained in:
Brumi-2021
2023-10-21 01:43:22 +02:00
committed by GitHub
parent 86d4b17257
commit efcedd9005
7 changed files with 108 additions and 7 deletions

View File

@@ -359,7 +359,21 @@ class WM8731 : public audio::Codec {
}
void microphone_disable() override {
// TODO: Implement
microphone_mute(true);
microphone_to_HP_disable();
}
void microphone_to_HP_enable() override {
map.r.analog_audio_path_control.sidetone = 1; // Side Tone Switch (Analogue) 1 = Enable Side Tone
map.r.analog_audio_path_control.sideatt = 0b00; // Side Tone Attenuation 00 = -6dB
write(Register::AnalogAudioPathControl);
headphone_enable();
}
void microphone_to_HP_disable() override {
map.r.analog_audio_path_control.sidetone = 0; // Side Tone Switch (Analogue) 0 = Disable Side Tone
map.r.analog_audio_path_control.sideatt = 0b11; // Side Tone Attenuation 11 = -15dB
write(Register::AnalogAudioPathControl);
}
void microphone_boost(const bool boost) {