mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 22:22:21 -04:00
Solving_mic_saturation_and_spectrum_armonics_Mic_App
This commit is contained in:
parent
30449e0adf
commit
d5a1733c1c
8 changed files with 465 additions and 118 deletions
|
@ -24,6 +24,10 @@
|
|||
|
||||
#include "baseband_api.hpp"
|
||||
#include "audio.hpp"
|
||||
|
||||
#include "wm8731.hpp"
|
||||
using wolfson::wm8731::WM8731;
|
||||
|
||||
#include "tonesets.hpp"
|
||||
#include "portapack_hal.hpp"
|
||||
#include "string_format.hpp"
|
||||
|
@ -34,6 +38,10 @@
|
|||
using namespace tonekey;
|
||||
using namespace portapack;
|
||||
|
||||
|
||||
WM8731 audio_codec_wm8731 { i2c0, 0x1a };
|
||||
|
||||
|
||||
namespace ui {
|
||||
|
||||
void MicTXView::focus() {
|
||||
|
@ -178,7 +186,7 @@ void MicTXView::rxaudio(bool is_on) {
|
|||
|
||||
baseband::run_image(portapack::spi_flash::image_tag_mic_tx);
|
||||
audio::output::stop();
|
||||
audio::input::start();
|
||||
audio::input::start(ak4951_alc_GUI_selected); // set up audio input = mic config of any audio coded AK4951/WM8731, (in WM8731 parameter will be ignored)
|
||||
portapack::pin_i2s0_rx_sda.mode(3);
|
||||
configure_baseband();
|
||||
}
|
||||
|
@ -203,10 +211,12 @@ MicTXView::MicTXView(
|
|||
|
||||
baseband::run_image(portapack::spi_flash::image_tag_mic_tx);
|
||||
|
||||
add_children({
|
||||
&labels,
|
||||
|
||||
if ( audio_codec_wm8731.detected() ) {
|
||||
add_children({
|
||||
&labels_WM8731, // we have audio codec WM8731, same MIC menu as original.
|
||||
&vumeter,
|
||||
&options_gain,
|
||||
&options_gain, // MIC GAIN float factor on the GUI.
|
||||
// &check_va,
|
||||
&field_va,
|
||||
&field_va_level,
|
||||
|
@ -229,6 +239,37 @@ MicTXView::MicTXView(
|
|||
&field_rxamp,
|
||||
&tx_button
|
||||
});
|
||||
|
||||
} else {
|
||||
add_children({
|
||||
&labels_AK4951, // we have audio codec AK4951, enable Automatic Level Control
|
||||
&vumeter,
|
||||
&options_gain,
|
||||
&options_ak4951_alc_mode,
|
||||
// &check_va,
|
||||
&field_va,
|
||||
&field_va_level,
|
||||
&field_va_attack,
|
||||
&field_va_decay,
|
||||
&field_bw,
|
||||
&field_rfgain,
|
||||
&field_rfamp,
|
||||
&options_mode,
|
||||
&field_frequency,
|
||||
&options_tone_key,
|
||||
&check_rogerbeep,
|
||||
&check_rxactive,
|
||||
&field_volume,
|
||||
&field_rxbw,
|
||||
&field_squelch,
|
||||
&field_rxfrequency,
|
||||
&field_rxlna,
|
||||
&field_rxvga,
|
||||
&field_rxamp,
|
||||
&tx_button
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
tone_keys_populate(options_tone_key);
|
||||
options_tone_key.on_change = [this](size_t i, int32_t) {
|
||||
|
@ -242,6 +283,12 @@ MicTXView::MicTXView(
|
|||
};
|
||||
options_gain.set_selected_index(1); // x1.0
|
||||
|
||||
options_ak4951_alc_mode.on_change = [this](size_t, int8_t v) {
|
||||
ak4951_alc_GUI_selected = v;
|
||||
audio::input::start(ak4951_alc_GUI_selected);
|
||||
};
|
||||
// options_ak4951_alc_mode.set_selected_index(0);
|
||||
|
||||
tx_frequency = transmitter_model.tuning_frequency();
|
||||
field_frequency.set_value(transmitter_model.tuning_frequency());
|
||||
field_frequency.set_step(receiver_model.frequency_step());
|
||||
|
@ -478,7 +525,7 @@ MicTXView::MicTXView(
|
|||
set_tx(false);
|
||||
|
||||
audio::set_rate(audio::Rate::Hz_24000);
|
||||
audio::input::start();
|
||||
audio::input::start(ak4951_alc_GUI_selected); // originally , audio::input::start(); (we added parameter)
|
||||
}
|
||||
|
||||
MicTXView::~MicTXView() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue