Commit Graph

1051 Commits

Author SHA1 Message Date
Silvano Seva 24c4a25b2d Made "static" all the variables local to each translation unit 2024-02-01 11:07:20 +01:00
Silvano Seva e54234f968 Renamed UI_NO_KEYBOARD macro to CONFIG_UI_NO_KEYBOARD 2024-02-01 11:07:20 +01:00
Silvano Seva 8bc867beae Using Kconfig-style #defines for GPS, RTC and knob type description 2024-02-01 11:07:20 +01:00
Silvano Seva cc27cc28a4 Using Kconfig-style #defines for battery type description. 2024-02-01 11:07:20 +01:00
Silvano Seva 0f4290cdfe Using Kconfig-style #defines for display parameters' description. 2024-02-01 11:07:20 +01:00
Silvano Seva f771d4ec06 Improved indentation in _ui_drawMacroMenu() 2024-02-01 11:07:19 +01:00
marco c3f1ec0ea1 Improve the callsign input of module17 UI
This will change the bahavior of the left and right button in callsign input:
The right button will add a new character to the input starting at `A`.
The right button will stop at the maximum allowed length.
The left button will delete the current charater.
The left button will go back one character and make it editable again.
The left button will not do anything when only one character is displayed.
2024-01-31 08:45:30 +01:00
Silvano Seva 3f0cfe94e5 M17: always open squelch on tramsissions with destination set to INFO or ECHO
Fix #229
2024-01-28 19:16:14 +01:00
Silvano Seva 598f1c4523 M17: deeply restructured the demodulator code
Restructured the M17Demodulator class and rewritten the
demodulator logic to have a more solid lock on the
baseband stream. This fixes the long standing bug of the
demodulator causing random losses of lock even when
receiving a solid baseband stream.
2024-01-27 15:15:37 +01:00
Silvano Seva ddf889177c Frame synchronizer class 2024-01-27 15:15:37 +01:00
Silvano Seva 3375d0b5d1 Correlator class 2024-01-27 12:17:07 +01:00
Silvano Seva 90cf0f6f58 Added reset() method to RingBuffer class 2024-01-27 12:17:07 +01:00
Silvano Seva 275ef16977 Added IIR filter implementation 2024-01-20 14:31:39 +01:00
Silvano Seva dbe7ff4700 M17: activate speaker only when a valid transmission is received
Audio path from codec2 to speaker is now set up only when an incoming stream
with matching CAN and destination callsign is received. Speaker is then turned
off when the demodulator goes back in unlocked state.
2024-01-10 19:03:48 +01:00
Morgan Diepart 2653ee01aa M17: added callsign-based squelch for incoming transmissions 2024-01-10 19:03:48 +01:00
Morgan Diepart 5ec0587c48 Added macro menu latching setting 2024-01-10 18:08:35 +01:00
Silvano Seva b1fa154ad9 UI: renamed "Voice Prompts" menu to "Accessibility" 2024-01-10 18:06:48 +01:00
Silvano Seva c4b7b7a337 Removed low-pass filtering of battery voltage in state update for GD77 and DM-1801
GD77 and DM-1801 already have an hardware low-pass filter on the battery measurement
probe which causes the low battery protection to trigger at boot if the digital low
pass filter is also used. Given that the hardware one is good enough for our purposes,
the digital filter is now excluded.

Provides a fix for #221
2024-01-09 18:54:41 +01:00
marco 4a45ce0c16 Allow skipping keypad lock when only hash key is pressed 2024-01-09 14:14:49 +01:00
marco 7987bd732f Add button info for mod17 callsign entry 2023-12-31 17:18:50 +01:00
Silvano Seva 3a2bac3e7e Fixed missing transmission of the 1750Hz tone when keypad is locked.
Fix #210
2023-12-12 19:05:52 +01:00
Silvano Seva 096da4102d Utility functions to perform read/write/erase operations on NVM areas and partitions 2023-12-03 19:00:55 +01:00
Silvano Seva 070ed3de32 Device driver for file-based nonvolatile memory storage 2023-12-03 19:00:55 +01:00
Silvano Seva d9b22c1d2d Added function to retrieve the list of available NVM areas 2023-12-03 18:34:39 +01:00
Silvano Seva 7174246492 Standard interface for non volatile memory devices 2023-12-03 18:34:39 +01:00
Silvano Seva be07b8f73e Refactoring of W25Qx driver 2023-12-03 18:34:39 +01:00
Marco 5a0f92e23d Add a volume bar in the bottom over the other bars
This will fix #190
2023-11-25 19:08:38 +01:00
Silvano Seva 91c0965007 Module17: made M17 baseband output have correct DC bias and amplitude
Removed an old workaround for an hardware bug of Module17 rev 0.1b limiting
the output swing of baseband signal in newer hardware revisions.

Contribution by Mathis Schmieder DB9MAT.
2023-11-21 18:46:03 +01:00
Silvano Seva 7ccfbe62c8 Fixed compilation errors in M17 demodulator logger 2023-11-12 12:41:35 +01:00
Silvano Seva 7dc2ca5524 Driver for random number generator peripheral 2023-11-02 18:36:07 +01:00
marco 9433f8735a Mod17: get last callsign if available 2023-10-28 11:58:25 +02:00
Morgan Diepart f43281e815 Display callsign on splash screen 2023-10-26 06:01:54 +02:00
Morgan Diepart 1124c76b73 Added M17 destination to settings
# callsign in backed-up settings
2023-10-23 00:40:55 +02:00
Silvano Seva 44bfdec947 Added 30ms sleep in OpMode_M17::offState to prevent the rtx thread from going into an endless loop. 2023-10-22 18:59:06 +02:00
Niccolò Izzo 744ad85799 Adapt Radio settings to UI_NO_KEYBOARD interface
Enabled the T-TWR Plus to use split frequency settings by adapting the
Settings->Radio menu to the UI_NO_KEYBOARD user interface.

TG-553
2023-10-16 21:50:03 +02:00
Niccolò Izzo 17d5be118e Enable frequency offset input from radio menu
Adapted callsign input to create a frequency input menu, that was used
to enable the input of a frequency offset from the Settings->Radio menu.
2023-10-16 21:50:03 +02:00
Niccolò Izzo 5d3c6c825d Add radio settings for frequency offset, direction, and frequency step.
Add customizable frequency_step in radio state.
Offset is not yet selectable from Settings->Radio but only with keypad
from the VFO screen.
2023-10-16 21:49:56 +02:00
tarxvf 7612044d91 VFO screen cleanup: removed unused options, introduced compressed frequency print and lock icon.
Contribution by tarxvf.
2023-10-16 21:47:01 +02:00
tarxvf 7e291fe6fd Implement UI input lockout logic, toggled by macro menu key 9.
Contribution by tarxvf.
2023-10-16 21:46:37 +02:00
marco 20b0c375aa Change M17_orig to link and change callsign handling
This will swap the first extended callsign with the source callsign
if there is extended callsign data.
This allows to always store the true source in the M17_src variable

See #188
2023-10-13 09:58:34 +02:00
Niccolò Izzo e939218001
Integrate west manifest to facilitate Zephyr build
Add west manifest contributed by edgetriggered to allow automated
cloning of the correst Zephyr revision.
Now codec2 dependency is enabled also for T-TWR build, enabling to build
it from scratch without first building a Miosix target.
Enabled non-cross build to use codec2 compiled sources.
2023-10-09 09:23:45 +02:00
marco 6baa368984 Enable edit mode for dst callsign on mod17
This allows editing the destination callsign on the module17
When on the main screen, the right arrow will enter edit mode.
2023-09-29 17:05:14 +02:00
marco 0126efe429 Fixed possible undeflow in battery charge level computation. Fix #192.
We check if the battery is below minimum and, if so, assume that the charge
is 0%. This to prevent an underflow which would result in the function
returing a 100% charge level.
2023-09-22 19:32:29 +02:00
marco 77e0ad27a0 Added support for 1750Hz squelch tone, implemented squelch tone in UV-3x0 radio driver.
When pressing the Hash key and the PTT key in FM mode
a 1750 Hz tone is transmitted
2023-09-22 13:58:59 +02:00
Silvano Seva 73bfc2a15d Set proper thread stack size also when using the Zephyr RTOS 2023-09-22 13:57:33 +02:00
Niccolò Izzo e11c529807 Bump Zephyr to commit a4de2eb3d1756c
TODO: the include fixes can be probably refactored by including the
correct zephyr directories, as include/zephyr/posix/pthread.h should
already bringing in those header files.

TG-553
2023-09-20 21:16:43 +02:00
Niccolò Izzo 21895ae304 ttwrplus: disable Tx in menus
As T-TWR Plus reuses the PTT as a back button, thus we need to disable
PTT in menus. Also enforce rx_only logic from CPS.

TG-553
2023-09-20 21:16:40 +02:00
Niccolò Izzo fe027c440c ttwrplus: enable volume control
Replaced KEY_F7 and KEY_F8 with KEY_VOLUP and KEY_VOLDOWN.
Remapped the T-TWR Plus volume up and down keys to those, fixing a bug
in the pmu key detection where the wrong active edge was selected.
Adapt soft volume code for the UV3x0 to control code in the T-TWR Plus
by acting on the AT1846s Rx gain.
For target T-TWR Plus bound long press of KEY_VOLDOWN to macro menu open.
Unbound KNOB_LEFT and KNOB_RIGHT to squelch control and bound
instead KEY_VOLUP and KEY_VOLDOWN.

TG-553
2023-09-20 21:08:35 +02:00
Silvano Seva de3b319518 ttwrplus: added SA868 firmware version to info menu 2023-09-20 21:08:35 +02:00
Niccolò Izzo a72f8387ad ttwrplus: disable low battery warning
T-TWR Plus appears to have sever voltage drops during normal operation,
therefore we cannot use OpenRTX's low voltage warning screen on this
radio.

TG-553
2023-09-20 21:08:35 +02:00
Niccolò Izzo ad1beffcf3 ttwrplus: implemented PMU interrupts handling
TG-553
2023-09-20 21:08:35 +02:00
Niccolò Izzo 024c7ffe3a ttwrplus: fix sporadic missing TX
The bug was due to an uninitialized memory being used to configure the
RTX thread, that disabled Tx in a random way by randomly set the
txDisable field.

TG-553
2023-09-20 21:08:35 +02:00
Niccolò Izzo 0c27c9ce28 Enable Zephyr dynamic stack threads
Enable Zephyr dynamic stack posix threading, with stack pool of 4 and
stack size of 4096.

TG-553
2023-09-20 21:08:35 +02:00
Silvano Seva dd13732343 Fix some compilation warnings generated by xtensa-espressif-gcc 2023-09-20 21:08:35 +02:00
Silvano Seva ebc5910015 Renamed "bcd2bin" utility to "bcdToBin" to avoid conflicting with Zephyr includes 2023-09-20 21:08:35 +02:00
Silvano Seva 7ce3a8a605 Fix compilation error caused by voiceprompts data section definitions 2023-09-20 21:08:35 +02:00
Marco 467ad6bd7a Fix regression in memory mode
Show frequency in memory mode when not receiving M17
2023-09-17 13:00:12 +02:00
Marco 1a7d62fb42 Add UI and check for CAN on RX 2023-09-16 19:14:17 +02:00
marco f425a4c740 Fix M17 Call Info flickering during reception 2023-09-15 19:41:48 +02:00
Silvano Seva c49ae03d01 Audio stream: fixed missing NULL pointer check in audio device driver selection. 2023-09-13 22:26:41 +02:00
Silvano Seva 8fe9837035 Implemented rxSquelchOpen() function for M17 opmode handler, returning true in case of valid stream data. 2023-09-12 17:47:49 +02:00
Silvano Seva 0adab74255 M17: workaround to avoid UI glitches when a new dst callsign is set.
When a new dst callsign is set, the rtx configuration data structure is
updated and this may trigger false setting of the lsfOk variable to true,
causing the M17 info screen to appear for a very small, but noticeable,
amount of time.
2023-09-12 17:47:49 +02:00
marco 22afe0ecde Port changes for M17 Call Info to module17 2023-09-12 17:47:49 +02:00
Marco 7a67768c8d Show M17 stream information on receive 2023-09-12 17:47:49 +02:00
Marco a3fbe34b30 Add symbols for M17 stream data display 2023-09-12 17:47:49 +02:00
Marco dc0114e7e2 Retrieve M17 source, destination and extended callsign data from LSF 2023-09-12 17:47:49 +02:00
Marco a0f5d55cc1 Add M17 stream information to rtxStatus struct 2023-09-12 17:47:49 +02:00
Marco 74f7912b4c Fix M17 callsign decoder sometimes causing crashes 2023-09-12 17:47:49 +02:00
Niccolò Izzo 3860894bff
Implement macro menu without keyboard
Adapt UI for radios that do not have a keyboard, add macro menu UI code
that can only use KEY_ENTER and KEY_UP, KEY_DOWN.

TG-553
2023-09-10 12:12:13 +02:00
Silvano Seva 5ea94ee1af Improved management of FM audio volume on MD-UV3x0.
Fix #160.
2023-09-08 16:14:11 +02:00
marco d7578c4441 Refactor ui sizes
This changes line 3 to line 3 large and adds
two new lines, line 3 and line 4, similar to
line 1 and line 2
2023-09-04 15:12:18 +02:00
Wojciech Kaczmarski ffdc04be3e `m17crypto_t` update
m17crypto_t now conforms to M17 spec
2023-09-04 12:24:05 +02:00
Silvano Seva 6dd0a718e0 Fixed bug in M17 opmode handler causing missing audio output 2023-08-30 18:04:25 +02:00
Silvano Seva c9cd620530 Audio codec: added function returning the codec's current operational status 2023-08-30 18:04:25 +02:00
Silvano Seva fc5e3b0bce Audio stream: cleanup dead streams while searching for an empty slot 2023-08-30 18:04:25 +02:00
Silvano Seva e610979ac7 Codec2: second round of refactoring and implemented proper access contention in codec_startEncode() 2023-08-30 18:04:25 +02:00
Silvano Seva 5b3e136127 Audio codec: using a single condition variable for queue wait management. 2023-08-30 18:04:25 +02:00
Silvano Seva dd118d0a87 Adapted voice prompt and M17 code to new codec2 API 2023-08-30 18:04:25 +02:00
Silvano Seva 94fdd1090b Refactoring and improvement of codec2 module 2023-08-30 18:04:25 +02:00
Silvano Seva 7d90d15a5f Adapt code to the new audio stream API. 2023-08-30 18:04:25 +02:00
Silvano Seva 24208db609 New unified audio stream manager 2023-08-30 18:04:25 +02:00
Silvano Seva adf88611f4 Changed codec_startEncode() and codec_startDecode() input parameter from an audio source/sink to an audio path 2023-08-30 18:04:25 +02:00
Silvano Seva 60b771b375 Added function to get all the informations of a given audio path 2023-08-30 18:04:25 +02:00
Silvano Seva 584dd356e2 Standard interface for drivers managing audio input and output devices 2023-08-30 18:04:24 +02:00
Silvano Seva 1011dd1081 Moved audio_stream.h from interfaces to core headers 2023-08-30 18:04:24 +02:00
marco 7b64fca573 M17: change BROADCAST to ALL for decode callsign 2023-08-28 10:31:09 +02:00
marco f40ecc60db M17: change decode callsign x to space 2023-08-28 10:30:51 +02:00
marco 278d7850c7 M17: add data structures for GNSS and extended callsign metadata. 2023-08-28 10:25:46 +02:00
Ryan Turner ec57e74bc6 feat(ui): add tooling to generate symbols, add GPS status icon and macro latch icon to the macro menu
Ref https://github.com/OpenRTX/OpenRTX/issues/161
2023-08-24 09:32:01 +02:00
Marco a3c7df2b3e Remove unused latch timer functions 2023-08-17 16:58:22 +02:00
Marco 8399dcd3a3 Change macro latching behavior
Latch macro menu when macro button is long pressed
Unlatch macro menu when macro button is pressed again
2023-08-17 16:57:14 +02:00
k5jae c1a9db22b7 Made Brightness setting optional based on HW capabilities 2023-08-16 20:46:25 +02:00
k5jae 4a6d0b4c2b Change English string for M17 destination from Broadcast to ALL
This aligns with M17 Specification and other tools.
2023-08-16 20:45:36 +02:00
marco 60735822db Align Macro menu fm and M17 2023-07-21 19:27:20 +02:00
Silvano Seva 4cd1fdfcf3 Moved gpio.h to peripherals 2023-07-21 19:27:14 +02:00
Silvano Seva 28122a3bf3 Moved gps.h to peripherals 2023-07-21 08:32:26 +02:00
Silvano Seva dcafd07085 Created "peripherals" include folder for non-mandatory drivers, moved rtc.h to peripherals folder. 2023-07-21 08:23:41 +02:00
Silvano Seva 009930f914 Moved get/set of current time to platform interface API 2023-07-21 07:58:29 +02:00
Silvano Seva 498f959798 Removed CPS flash backup and restore (actually unused) and hidden its UI menu entry
CPS flash backup and restore will be implemented via rtxlink/FMP, removed
current implementation which was never actually used. Code for backup and
restore UI menu entry kept for now.
2023-07-20 07:00:54 +02:00
Silvano Seva 65dde770e7 Changed return type of cps_readBankData() from "int32_t" to "int".
Made the return type of cps_readBankData() consistent with the one of
the other CPS API functions.
2023-07-18 23:04:31 +02:00
Silvano Seva 8019b29947 Moved the setBacklightLevel() API function from platform.h to display.h 2023-07-14 12:26:47 +02:00
Silvano Seva 313e9615a6 Removed platform_getCalibrationData() function because of limited usefulness.
Given that each radio driver loads its calibration data when initializing
and that the radio driver is strongly platform-specific, there is no strong
need for an intermediate redirection layer through the platform API.
2023-07-14 12:26:39 +02:00
marco ec62bda31a Fix CTCSS tone not correctly set when decreasing 2023-06-30 10:59:27 +02:00
Silvano Seva e5b3ea1bed Set default opmode to M17 in cps_getDefaultChannel() when compiling for Module17 2023-06-15 08:21:38 +02:00
Silvano Seva f3f36fc2ae Module17: quick and (very) dirty implementation of shutdown menu for hardware rev 0.1e 2023-06-15 08:16:53 +02:00
Silvano Seva 5c3e8fed80 Module17: reorganized the "info" menu entry, removed the unused fields 2023-06-14 21:51:31 +02:00
Silvano Seva 1afd868d64 Renamed "lcd_type" field of hardare info struct to "hw_version" 2023-06-14 21:30:52 +02:00
marcoSchr 4ee4cb656d
Check if in M17 mode before entering destination callsign edit 2023-06-13 09:02:50 +02:00
Silvano Seva cadec3dfd4 Default UI: implemented setting of M17 CAN 2023-05-29 22:12:40 +02:00
Silvano Seva 2f0d56a8e0 Moved M17 destination callsign directly inside radio state data structure 2023-05-29 22:12:40 +02:00
Silvano Seva 423183700c Moved M17 CAN to settings 2023-05-29 22:12:40 +02:00
Silvano Seva feaab4a965 Module17 UI: fixed a couple of compiler warnings and implemented reset to defaults of settings. 2023-05-29 22:12:40 +02:00
Silvano Seva f038603bed Module17 UI: small improvements to callsign input 2023-05-29 22:12:40 +02:00
Silvano Seva 40b82e3169 Module17 UI: using only left/right button to change all the numeric values 2023-05-29 22:12:40 +02:00
Silvano Seva e5d6d8ebde Module17 UI: cleaned up dead code of unused menu entries 2023-05-29 22:12:40 +02:00
Silvano Seva f42b9d2cda Implemented transmission of user-configured M17 channel access number 2023-05-29 22:12:40 +02:00
Silvano Seva fb8e3412c5 Implemented change of M17 baseband signal phase according to user settings for both TX and RX in Module17 2023-05-29 22:12:40 +02:00
Silvano Seva e93b461beb Added phase inversion setting to M17 modulator 2023-05-29 22:12:40 +02:00
Mathis Schmieder adc916dbca Added CAN setting 2023-05-29 22:12:40 +02:00
Mathis Schmieder cddf8e1c1f Save contrast settings on Module 17 2023-05-29 22:12:40 +02:00
Mathis Schmieder 89aedef3ae Implemented non-volatile memory for settings on Module 17 2023-05-29 22:12:40 +02:00
Mathis Schmieder 3f849bd8a1 Module17 UI: call sign input using arrows 2023-05-29 22:12:40 +02:00
Mathis Schmieder bd8f0d70c7 Added RX/TX inversion and mic gain setting on Module 17 UI 2023-05-29 22:12:40 +02:00
Mathis Schmieder f32255c258 Implemented softpot settings UI for Module 17 2023-05-29 22:12:40 +02:00
Silvano Seva c862638fd1 Created calibration data structure for Module17 2023-05-29 22:12:40 +02:00
Wojciech Kaczmarski 22e9d8ce48 Module 17 UI: layout and main screen 2023-05-29 22:12:40 +02:00
Silvano Seva e3b66f6a4b Added channel access number and frame type to M17 data field in radio state, merged TX and RX channel access number fields of rtx configuaration data structure into one. 2023-05-29 22:12:40 +02:00
Silvano Seva d8c4ba4420 Base sources for Module 17 UI 2023-05-29 22:12:40 +02:00
Silvano Seva 76ded06751 Split UI sources in a default one for the radios and the Module17 one. 2023-05-29 22:12:40 +02:00
marco 7ce72d8325 Fix default channel index
it should be 0 instead of 1
2023-05-29 08:49:04 +02:00
Silvano Seva 4a3bc93fa4 Always send an M17 EOT frame as the last frame before terminating baseband output 2023-03-12 16:27:31 +01:00
Silvano Seva a89a7523cb Updated year in copyright headers 2023-02-08 16:33:02 +01:00
Silvano Seva 49c6cbd7c0 Added implementation of soft-decision Viterbi decoder for M17 protocol, updated version number in meson.build 2022-11-11 22:04:34 +01:00
Silvano Seva ae8bba88b6 Updated voice prompt for UTC timezone to support also half hour values, thanks to Joe VK7JS. 2022-10-31 18:04:08 +01:00
Silvano Seva ce1dc202ae Added support for half-hour timezones, moved datetime_t struct fields from bitfields to full 8-bit variables, added function to adjust the off-range fields of a datetime_t struct. 2022-10-31 11:41:54 +01:00
Silvano Seva f26afc42e5 Small reorganization and cleanup of splash screen code, fixed bug causing audio path for voice prompts never being released at vp end 2022-10-31 08:41:31 +01:00
vk7js d5d49fbbb2 Refactored to decouple vp_init from speaking of splash screen. 2022-10-31 08:41:31 +01:00
Silvano Seva 16d750c55c Excluded announcement of time and date settings for devices without RTC 2022-10-31 08:41:31 +01:00
vk7js 438c224a2a Fixed announcement of initial digit when entering rx freq in VFO mode. It once worked but somehow got clobbered along the way. 2022-10-31 08:41:31 +01:00
Silvano Seva dd30c899df Added a 50ms startup delay to voiceprompts. This provides a workaround to fix cracking sounds when changing rtx parameters on MD-UV3x0. 2022-10-31 08:41:31 +01:00
Silvano Seva f24699f14e Fixed bug in M17 demodulator causing it to sometimes take more than 20ms to process a block of baseband samples when, in unlocked state, a valid syncword is searched. 2022-10-31 08:41:31 +01:00
Silvano Seva c6a40a9625 Ensure proper syncronization between codec2 decode thread and output stream when the former is started 2022-10-31 08:41:31 +01:00
Silvano Seva 0692bea269 Partial fix for speaker pop when a voiceprompt begins 2022-10-31 08:41:31 +01:00
Silvano Seva 5ee3a2e9f0 Reorganised codec_pushFrame and codec_popFrame functions for true non-blocking behaviour 2022-10-31 08:41:31 +01:00
Silvano Seva 9d021b7557 Fixed bug in M17 modulator and demodulator making them not releasing their audio paths on termination thus locking up the thread on M17 mode re-entering. 2022-10-31 08:41:31 +01:00
vk7js 12932db37c Refinement to last checkin: only clear function latch without beep for PTT, not for open squelch. 2022-10-31 08:41:31 +01:00
vk7js f61313638f Cancel function key latch if ptt is pressed (without playing the latch off beep). 2022-10-31 08:41:31 +01:00
vk7js 793a76d1ea When PTT is pressed, stop any voice prompt or beep in process. 2022-10-31 08:41:13 +01:00
Silvano Seva f9228ec23c Halved the additional output gain for MD3x0 radios inside codec2 module to avoid sound distortion when voice prompts are played. 2022-10-28 09:47:47 +02:00
Silvano Seva 71a15c2cfb Fixed bug in voice prompts audio path management causing no audio output in case of rapid key sequences. Improved managment of audio path release in voice prompts module. 2022-10-28 09:47:47 +02:00