mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-11 15:29:28 -05:00
added RXIQCALC (#1974)
Co-authored-by: GullCode <gullradriel@hotmail.com>
This commit is contained in:
parent
ccd71d9593
commit
866e12fbc5
@ -338,6 +338,7 @@ GlassView::GlassView(
|
|||||||
&field_trigger,
|
&field_trigger,
|
||||||
&button_jump,
|
&button_jump,
|
||||||
&button_rst,
|
&button_rst,
|
||||||
|
&field_rx_iq_phase_cal,
|
||||||
&freq_stats});
|
&freq_stats});
|
||||||
|
|
||||||
load_presets(); // Load available presets from TXT files (or default).
|
load_presets(); // Load available presets from TXT files (or default).
|
||||||
@ -474,6 +475,13 @@ GlassView::GlassView(
|
|||||||
reset_live_view();
|
reset_live_view();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
field_rx_iq_phase_cal.set_range(0, hackrf_r9 ? 63 : 31); // max2839 has 6 bits [0..63], max2837 has 5 bits [0..31]
|
||||||
|
field_rx_iq_phase_cal.set_value(get_spec_iq_phase_calibration_value()); // using accessor function of AnalogAudioView to read iq_phase_calibration_value from rx_audio.ini
|
||||||
|
field_rx_iq_phase_cal.on_change = [this](int32_t v) {
|
||||||
|
set_spec_iq_phase_calibration_value(v); // using accessor function of AnalogAudioView to write inside SPEC submenu, register value to max283x and save it to rx_audio.ini
|
||||||
|
};
|
||||||
|
set_spec_iq_phase_calibration_value(get_spec_iq_phase_calibration_value()); // initialize iq_phase_calibration in radio
|
||||||
|
|
||||||
display.scroll_set_area(109, 319);
|
display.scroll_set_area(109, 319);
|
||||||
|
|
||||||
// trigger:
|
// trigger:
|
||||||
@ -491,6 +499,15 @@ GlassView::GlassView(
|
|||||||
receiver_model.enable();
|
receiver_model.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t GlassView::get_spec_iq_phase_calibration_value() { // define accessor functions inside AnalogAudioView to read & write real iq_phase_calibration_value
|
||||||
|
return iq_phase_calibration_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GlassView::set_spec_iq_phase_calibration_value(uint8_t cal_value) { // define accessor functions
|
||||||
|
iq_phase_calibration_value = cal_value;
|
||||||
|
radio::set_rx_max283x_iq_phase_calibration(iq_phase_calibration_value);
|
||||||
|
}
|
||||||
|
|
||||||
void GlassView::load_presets() {
|
void GlassView::load_presets() {
|
||||||
File presets_file;
|
File presets_file;
|
||||||
auto error = presets_file.open("LOOKINGGLASS/PRESETS.TXT");
|
auto error = presets_file.open("LOOKINGGLASS/PRESETS.TXT");
|
||||||
|
@ -69,6 +69,9 @@ class GlassView : public View {
|
|||||||
void on_hide() override;
|
void on_hide() override;
|
||||||
void focus() override;
|
void focus() override;
|
||||||
|
|
||||||
|
uint8_t get_spec_iq_phase_calibration_value();
|
||||||
|
void set_spec_iq_phase_calibration_value(uint8_t cal_value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NavigationView& nav_;
|
NavigationView& nav_;
|
||||||
RxRadioState radio_state_{ReceiverModel::Mode::SpectrumAnalysis};
|
RxRadioState radio_state_{ReceiverModel::Mode::SpectrumAnalysis};
|
||||||
@ -79,8 +82,9 @@ class GlassView : public View {
|
|||||||
uint8_t filter_index = 0; // OFF
|
uint8_t filter_index = 0; // OFF
|
||||||
uint8_t trigger = 32;
|
uint8_t trigger = 32;
|
||||||
uint8_t mode = LOOKING_GLASS_FASTSCAN;
|
uint8_t mode = LOOKING_GLASS_FASTSCAN;
|
||||||
uint8_t live_frequency_view = 0; // Spectrum
|
uint8_t live_frequency_view = 0; // Spectrum
|
||||||
uint8_t live_frequency_integrate = 3; // Default (3 * old value + new_value) / 4
|
uint8_t live_frequency_integrate = 3; // Default (3 * old value + new_value) / 4
|
||||||
|
uint8_t iq_phase_calibration_value{15}; // initial default RX IQ phase calibration value , used for both max2837 & max2839
|
||||||
app_settings::SettingsManager settings_{
|
app_settings::SettingsManager settings_{
|
||||||
"rx_glass"sv,
|
"rx_glass"sv,
|
||||||
app_settings::Mode::RX,
|
app_settings::Mode::RX,
|
||||||
@ -93,6 +97,7 @@ class GlassView : public View {
|
|||||||
{"scan_mode"sv, &mode},
|
{"scan_mode"sv, &mode},
|
||||||
{"freq_view"sv, &live_frequency_view},
|
{"freq_view"sv, &live_frequency_view},
|
||||||
{"freq_integrate"sv, &live_frequency_integrate},
|
{"freq_integrate"sv, &live_frequency_integrate},
|
||||||
|
{"iq_phase_calibration"sv, &iq_phase_calibration_value}, // we are saving and restoring that CAL from Settings.
|
||||||
}};
|
}};
|
||||||
|
|
||||||
struct preset_entry {
|
struct preset_entry {
|
||||||
@ -160,7 +165,7 @@ class GlassView : public View {
|
|||||||
{{0, 0 * 16}, "MIN: MAX: LNA VGA ", Color::light_grey()},
|
{{0, 0 * 16}, "MIN: MAX: LNA VGA ", Color::light_grey()},
|
||||||
{{0, 1 * 16}, "RANGE: FILTER: AMP:", Color::light_grey()},
|
{{0, 1 * 16}, "RANGE: FILTER: AMP:", Color::light_grey()},
|
||||||
{{0, 2 * 16}, "PRESET:", Color::light_grey()},
|
{{0, 2 * 16}, "PRESET:", Color::light_grey()},
|
||||||
{{0, 3 * 16}, "MARKER: MHz", Color::light_grey()},
|
{{0, 3 * 16}, "MARKER: MHz RXIQCAL", Color::light_grey()},
|
||||||
{{0, 4 * 16}, "RES: STEP:", Color::light_grey()}};
|
{{0, 4 * 16}, "RES: STEP:", Color::light_grey()}};
|
||||||
|
|
||||||
NumberField field_frequency_min{
|
NumberField field_frequency_min{
|
||||||
@ -208,6 +213,14 @@ class GlassView : public View {
|
|||||||
{7 * 8, 3 * 16, 9 * 8, 16},
|
{7 * 8, 3 * 16, 9 * 8, 16},
|
||||||
""};
|
""};
|
||||||
|
|
||||||
|
NumberField field_rx_iq_phase_cal{
|
||||||
|
{28 * 8, 3 * 16},
|
||||||
|
2,
|
||||||
|
{0, 63}, // 5 or 6 bits IQ CAL phase adjustment (range updated later)
|
||||||
|
1,
|
||||||
|
' ',
|
||||||
|
};
|
||||||
|
|
||||||
NumberField field_trigger{
|
NumberField field_trigger{
|
||||||
{4 * 8, 4 * 16},
|
{4 * 8, 4 * 16},
|
||||||
3,
|
3,
|
||||||
|
Loading…
Reference in New Issue
Block a user