Merge pull request #395 from Brumi-2021/New-Feature-Add-Gain_TX-control-to-the-Replay-App

Add Gain_TX control to the Replay App
This commit is contained in:
Erwin Ried 2021-10-06 01:15:32 +02:00 committed by GitHub
commit 848dba44d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 5 deletions

View File

@ -139,7 +139,12 @@ void ReplayAppView::start() {
} }
); );
} }
field_rfgain.on_change = [this](int32_t v) {
tx_gain = v;
};
field_rfgain.set_value(tx_gain);
receiver_model.set_tx_gain(tx_gain);
radio::enable({ radio::enable({
receiver_model.tuning_frequency(), receiver_model.tuning_frequency(),
sample_rate * 8 , sample_rate * 8 ,
@ -180,6 +185,8 @@ ReplayAppView::ReplayAppView(
NavigationView& nav NavigationView& nav
) : nav_ (nav) ) : nav_ (nav)
{ {
tx_gain = 35;field_rfgain.set_value(tx_gain);
baseband::run_image(portapack::spi_flash::image_tag_replay); baseband::run_image(portapack::spi_flash::image_tag_replay);
add_children({ add_children({
@ -190,7 +197,7 @@ ReplayAppView::ReplayAppView(
&text_duration, &text_duration,
&progressbar, &progressbar,
&field_frequency, &field_frequency,
&field_lna, &field_rfgain,
&field_rf_amp, &field_rf_amp,
&check_loop, &check_loop,
&button_play, &button_play,

View File

@ -51,6 +51,7 @@ private:
static constexpr ui::Dim header_height = 3 * 16; static constexpr ui::Dim header_height = 3 * 16;
uint32_t sample_rate = 0; uint32_t sample_rate = 0;
int32_t tx_gain { 47 };
static constexpr uint32_t baseband_bandwidth = 2500000; static constexpr uint32_t baseband_bandwidth = 2500000;
const size_t read_size { 16384 }; const size_t read_size { 16384 };
const size_t buffer_count { 3 }; const size_t buffer_count { 3 };
@ -75,7 +76,7 @@ private:
bool ready_signal { false }; bool ready_signal { false };
Labels labels { Labels labels {
{ { 10 * 8, 2 * 16 }, "LNA: A:", Color::light_grey() } { { 10 * 8, 2 * 16 }, "GAIN A:", Color::light_grey() }
}; };
Button button_open { Button button_open {
@ -103,8 +104,13 @@ private:
FrequencyField field_frequency { FrequencyField field_frequency {
{ 0 * 8, 2 * 16 }, { 0 * 8, 2 * 16 },
}; };
LNAGainField field_lna {
{ 14 * 8, 2 * 16 } NumberField field_rfgain {
{ 14 * 8, 2 * 16 },
2,
{ 0, 47 },
1,
' '
}; };
RFAmpField field_rf_amp { RFAmpField field_rf_amp {
{ 19 * 8, 2 * 16 } { 19 * 8, 2 * 16 }