mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-10 00:29:33 +00:00
Airband VOR receiver and trasmitter (#3244)
* First test * Reorder includes for consistency and fix string dereference in VorCdiIndicator * Add memory section and linker script entry for vor_rx application * Testing VOR TX * Moving VOR TX to SD * Code refactoring to align with guidelines * Add TODO comment to verify radial sign convention in vor_tx_config * Remove unnecessary set_dirty() calls in VorRxView methods * Update Course Deviation Indicator label and adjust UI element positions * Update VorTxView to run prepared image from memory map * Update build condition in nightly release workflow to include workflow_dispatch event * Reverting action changes * Adjust Course Deviation Indicator layout and refine painting logic * Refactor VorRxView UI elements for improved layout and clarity * Add calibration field and update radial calculation logic in VorRxView * Enhance VOR processing: add renormalization to phase oscillator, improve signal handling, and update configuration parameters * Implement radial smoothing and TO/FROM state handling in VorRxView; update VOR processing logic * Setting comments inline * Refactor VorCdiIndicator and VorRxView: change normalize_signed_degrees to use int32_t, update radial smoothing to use fixed point arithmetic to reduce flash usage * Update external app address end to 0xAE0B0000 * Update set_vor_tx_config to include enabled parameter for consistency * Refactor VorRx to omit decim_2 stage and update comments for clarity on VOR processing * Add RSSI, Channel, and Audio fields to VorRxView to mimic existing apps * Refactor VorRxView labels and status messages * Update VorRxView calibration field range to allow full circle input * Completing Ident transmission logic * Fixing TX gain and moving log label * Refactor VOR phase calculations and update radial offset handling for accurate bearing representation * Add low-pass filters to strip 9960 Hz subcarrier from audio output
This commit is contained in:
@@ -119,4 +119,12 @@ constexpr iir_biquad_config_t apt_audio_12k_lpf_2000hz_config{
|
||||
{0.15505103f, 0.31010205f, 0.15505103f},
|
||||
{1.00000000f, -0.6202041f, 0.24040821f}};
|
||||
|
||||
// scipy.signal.butter(2, 3200 / 24000.0, 'low', analog=False)
|
||||
// VOR RX audio low-pass. Removes the 9960 Hz FM subcarrier (the annoying
|
||||
// high-pitch whine) while passing voice and the 1020 Hz ident tone. Cascade
|
||||
// two of these sections for a 4th-order roll-off (~44 dB at 9960 Hz).
|
||||
constexpr iir_biquad_config_t audio_48k_lpf_3200hz_config{
|
||||
{0.03357181f, 0.06714362f, 0.03357181f},
|
||||
{1.00000000f, -1.41898265f, 0.55326989f}};
|
||||
|
||||
#endif /*__DSP_IIR_CONFIG_H__*/
|
||||
|
||||
@@ -162,6 +162,9 @@ class Message {
|
||||
ToneDetectConfig = 104,
|
||||
FlexTosend = 105,
|
||||
EPIRBRXConfig = 106,
|
||||
VorRxConfigure = 107,
|
||||
VorRxStatusData = 108,
|
||||
VorTxConfigure = 109,
|
||||
MAX
|
||||
};
|
||||
|
||||
@@ -1899,6 +1902,68 @@ class ToneDetectConfigureMessage : public Message {
|
||||
uint32_t ctcss_freq_x10{0}; // CTCSS frequency × 10 (e.g. 1000 = 100.0 Hz); 0 = None
|
||||
};
|
||||
|
||||
class VorRxConfigureMessage : public Message {
|
||||
public:
|
||||
constexpr VorRxConfigureMessage(bool enabled = true)
|
||||
: Message{ID::VorRxConfigure},
|
||||
enabled{enabled} {
|
||||
}
|
||||
|
||||
bool enabled{true};
|
||||
};
|
||||
|
||||
class VorRxStatusDataMessage : public Message {
|
||||
public:
|
||||
constexpr VorRxStatusDataMessage(
|
||||
uint16_t phase_deg = 0,
|
||||
uint16_t radial_deg = 0,
|
||||
uint16_t reference_level = 0,
|
||||
uint16_t variable_level = 0,
|
||||
uint8_t quality = 0,
|
||||
bool valid = false,
|
||||
bool to_from = false)
|
||||
: Message{ID::VorRxStatusData},
|
||||
phase_deg{phase_deg},
|
||||
radial_deg{radial_deg},
|
||||
reference_level{reference_level},
|
||||
variable_level{variable_level},
|
||||
quality{quality},
|
||||
valid{valid},
|
||||
to_from{to_from} {
|
||||
}
|
||||
|
||||
uint16_t phase_deg{0};
|
||||
uint16_t radial_deg{0};
|
||||
uint16_t reference_level{0};
|
||||
uint16_t variable_level{0};
|
||||
uint8_t quality{0};
|
||||
bool valid{false};
|
||||
bool to_from{false};
|
||||
};
|
||||
|
||||
class VorTxConfigureMessage : public Message {
|
||||
public:
|
||||
VorTxConfigureMessage(
|
||||
uint16_t radial_deg = 0,
|
||||
bool ident_enabled = true,
|
||||
const char* ident = "",
|
||||
bool enabled = true)
|
||||
: Message{ID::VorTxConfigure},
|
||||
radial_deg{radial_deg},
|
||||
ident_enabled{ident_enabled},
|
||||
enabled{enabled} {
|
||||
size_t i = 0;
|
||||
for (; ident && ident[i] && i < sizeof(ident_text) - 1; ++i)
|
||||
ident_text[i] = ident[i];
|
||||
ident_text[i] = '\0';
|
||||
}
|
||||
|
||||
uint16_t radial_deg{0};
|
||||
bool ident_enabled{true};
|
||||
bool enabled{true};
|
||||
char ident_text[8]{}; // CW identifier, null-terminated (max 7 chars)
|
||||
};
|
||||
|
||||
class FlexTosendMessage : public Message {
|
||||
public:
|
||||
constexpr FlexTosendMessage(
|
||||
|
||||
@@ -129,6 +129,8 @@ constexpr image_tag_t image_tag_noaaapt_rx{'P', 'N', 'O', 'A'};
|
||||
constexpr image_tag_t image_tag_sstv_rx{'P', 'S', 'R', 'X'};
|
||||
constexpr image_tag_t image_tag_morse{'P', 'M', 'R', 'S'};
|
||||
constexpr image_tag_t image_tag_morsetx{'P', 'M', 'R', 'T'};
|
||||
constexpr image_tag_t image_tag_vor_tx{'P', 'V', 'T', 'X'};
|
||||
constexpr image_tag_t image_tag_vor_rx{'P', 'V', 'R', 'X'};
|
||||
constexpr image_tag_t image_tag_rttyrx{'P', 'R', 'T', 'R'};
|
||||
constexpr image_tag_t image_tag_rttytx{'P', 'R', 'T', 'T'};
|
||||
constexpr image_tag_t image_tag_tonedetect{'P', 'T', 'N', 'E'};
|
||||
|
||||
Reference in New Issue
Block a user