Skip to content

Commit

Permalink
Add Gain_TX control to the Replay App
Browse files Browse the repository at this point in the history
Current Replay App , shows in the user menu a UI to select two kind of controls for the RF output level :
1-) LNA GAIN (0..40 ) dB => but it has no TX effect because it is the RX-LNA . GAIN
2-) RF AMP (0 / +14dBm , (that was correct , we have two IC's , RX / TX ) (sw is controlling weill .

Note, although SW Version 1.40 do not leave to control drictly the GAIN TX
, that Replay App , in fact, it was using the inheritated selected GAIN TX from any previous usage of MIC App.

That Pull request alllows now to have the following controls
1-) GAIN TX (0..47 ) dB (now it is OK
2-) RF AMP (0 / +14dBm , (that was correct , we have two IC's , RX / TX ) (sw is controlling weill .

Remakrs : After the change , now we can control the GAIN TX , but not "in the fly" . When we are in the Replay loop , any change of the FREQUENCY or GAIN TX will be ignored , till we play STOP / START the loop again. (but the AMP RF (0 /+14 dBs) it works in the loop withouth any problems (same as before ) .
  • Loading branch information
Brumi-2021 committed Jul 15, 2021
1 parent 010f06c commit 03eae70
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
11 changes: 9 additions & 2 deletions firmware/application/apps/replay_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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({
receiver_model.tuning_frequency(),
sample_rate * 8 ,
Expand Down Expand Up @@ -180,6 +185,8 @@ ReplayAppView::ReplayAppView(
NavigationView& nav
) : nav_ (nav)
{

tx_gain = 35;field_rfgain.set_value(tx_gain);
baseband::run_image(portapack::spi_flash::image_tag_replay);

add_children({
Expand All @@ -190,7 +197,7 @@ ReplayAppView::ReplayAppView(
&text_duration,
&progressbar,
&field_frequency,
&field_lna,
&field_rfgain,
&field_rf_amp,
&check_loop,
&button_play,
Expand Down
12 changes: 9 additions & 3 deletions firmware/application/apps/replay_app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class ReplayAppView : public View {
static constexpr ui::Dim header_height = 3 * 16;

uint32_t sample_rate = 0;
int32_t tx_gain { 47 };
static constexpr uint32_t baseband_bandwidth = 2500000;
const size_t read_size { 16384 };
const size_t buffer_count { 3 };
Expand All @@ -75,7 +76,7 @@ class ReplayAppView : public View {
bool ready_signal { false };

Labels labels {
{ { 10 * 8, 2 * 16 }, "LNA: A:", Color::light_grey() }
{ { 10 * 8, 2 * 16 }, "GAIN A:", Color::light_grey() }
};

Button button_open {
Expand Down Expand Up @@ -103,8 +104,13 @@ class ReplayAppView : public View {
FrequencyField field_frequency {
{ 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 {
{ 19 * 8, 2 * 16 }
Expand Down

0 comments on commit 03eae70

Please sign in to comment.