Wykres commitów

220 Commity (1035c2b80178c2f00d930b4e07ab1c025a8edbba)

Autor SHA1 Wiadomość Data
Niccolò Izzo b4c8fca767
Implemented uf2 image wrapping for T-TWR Plus
T-TWR Plus target now produces images in UF2 format.
This format is compatible with bootloaders such as tinyuf2, and future
releases of the hardware will come pre-flashed with tinyuf2, thus
flashing them will not requires any other dependency than the uf2 file
itself.

TG-553
2023-10-18 11:27:43 +02:00
Niccolò Izzo 95e79e871d ttwrplus: Add emergency shutdown
Enabled 10 second long press emergency shutdown PMU function to be able
to reset the radio even when OpenRTX is freezed, without the need of
pulling out and back in the battery.

TG-553
2023-10-17 09:54:13 +02:00
Niccolò Izzo 4697be5ea6 Fix squelch behaviour on T-TWR Plus
On LILYGO T-TWR Plus the squelch was being controlled by AT1846s,
resulting in the squelch bar setting being completely ignored. Now we
are introducing the support for a new command of sa8x8-fw called
AT+AUDIO that controls the muting or unmuting of the speaker power
amplifier, enabling us to:
1. Disable AT1846s embedded squelch
2. Enable OpeRTX squelch
Also fixed a bug where the sa8x8-fw version was incorrectly checked.
AT+AUDIO requires sa8x8-fw version v1.3.0.r1, bumped version check in
OpenRTX.

TG-553
2023-10-17 09:54:09 +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
Silvano Seva 6f567cc38d ttwrplus: implemented the platform_pwrButtonStatus() function.
The platform_pwrButtonStatus() function returns false (shutdown) in
case of a long press of the power button.
2023-09-20 21:16:43 +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
Niccolò Izzo 8aa9b0a18f ttwrplus: enable macro menu usage
Enabled macro menu implementation without keyboard.

TG-553
2023-09-20 21:08:35 +02:00
Silvano Seva 6a17bb8483 ttwrplus: implemented radio band detection. 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 2dabacebd8 ttwrplus: Implement power control on SA8x8
Implemented power control in T-TWR Plus by using the embedded switch
(RADIO_PWR) that controls the H/L pin of the SA868.

TG-553
2023-09-20 21:08:35 +02:00
Niccolò Izzo c276fc5a51 ttwrplus: moved all the SA8x8 code in a dedicated translation unit. 2023-09-20 21:08:35 +02:00
Niccolò Izzo d935532fc4 ttwrplus: enable GPS
GPS was enabled using UART1 and Zephyr message queues.
UI is a bit crushed on the small 128x64 screen but hardware works as expected.

TG-553
2023-09-20 21:08:35 +02:00
Niccolò Izzo eeb05bcc0f ttwrplus: fix unstable baseband startup
A proper baseband reset is now issued at each startup. Now OpenRTX check
for SA868 responsiveness before proceeding with radio initialization,
eliminating unstable behaviour at boot.

TG-553
2023-09-20 21:08:35 +02:00
Niccolò Izzo dc84908fbc ttwrplus: enable TURBO mode on SA868S
Enabled AT+TURBO command on SA868 that switches the baud rate of the
serial communication from 9600 to 115200 to get a more responsive
baseband. Bumped up the required baseband firmware version to
v1.1.0.r20.

TG-553
2023-09-20 21:08:35 +02:00
Niccolò Izzo 15f5477ae0 ttwrplus: add battery voltage readout
Add battery voltage readout through the XPowersLib library.

TG-553
2023-09-20 21:08:35 +02:00
Niccolò Izzo 4df315473f ttwrplus: add RGB LED support
Implemented WS2812C support with Zephyr driver.
Hooked up the RGB control to the existing RED and GREEN LED support.

TG-553
2023-09-20 21:08:35 +02:00
Niccolò Izzo c60f580396 ttwrplus: add support for SA868
Add support for initializing SA868 and querying its firmware version,
created a new instance of the AT1846S class that leverages the SA8x8
serial connection as an i2c implementation.
Rx works! In the sense that the RSSI bar behaves as expected, still no
audio.

This commit was contributed by edgetriggered.

TG-553
2023-09-20 21:08:35 +02:00
Federico Amedeo Izzo e05d09f0fe ttwrplus: Set battery charging current to 500mAh to limit PMU heating and max. capacity to 80% to extend lifetime by 2.5x-3x
Reference article: https://batteryuniversity.com/article/bu-808-how-to-prolong-lithium-based-batteries
2023-09-20 21:08:35 +02:00
Niccolò Izzo 8e8daa78c8 ttwrplus: implement PMU support
Begin implementing PMU, now successfully read and write registers, need
to implement button functionality, battery voltage readout, charge
detection etc.

TG-553
2023-09-20 21:08:35 +02:00
Niccolò Izzo df853c8527 ttwrplus: add support for keys using Zephyr bindings
Zephyr already provides button support based on gpios. We are mapping
Zephyr keycodes to OpenRTX therefore future targets will only need to
configure their devicetrees to have button support.

Rotary encoder readout leverages the hardware pulse counter. PTT in
this device is also bound to KEY_ESC, that matched the behaviour
observed in many commercial radios.

TG-553
2023-09-20 21:08:35 +02:00
Niccolò Izzo 9a445f3b31 Enable malloc on ESP32 BSP, specify ttwrplus battery type.
Mallocs now are working.
This radio sports a single cell Li-Po battery.

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
Niccolò Izzo 1f1d20e120 Update T-TWR devicetree
Updated T-TWR devicetree to reflect changes in upstream Zephyr.

TG-553
2023-09-20 21:08:35 +02:00
Silvano Seva 67f6d56168 Display driver for ttwrplus 2023-09-20 21:08:35 +02:00
Silvano Seva 7c2c61f948 Added Lilygo T-TWR Plus target, using stub drivers. 2023-09-20 21:08:35 +02:00
tarxvf 9d141b8f93 Fix emulator screenshot 2023-09-11 12:22:08 +02:00
Silvano Seva dd46a48cd1 Improved conversion law in MD-3x0 and MD-UV3x0 platform_getVolumeLevel().
Rewritten the conversion law from ADC measurement in mV and normalized
0-255 output, adding a linearization if the pseudo-logarithmic output
curve of the potentiometer.

Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2023-09-08 16:02:53 +02:00
Silvano Seva 344aa46da7 Audio devices table for MDx 2023-08-30 18:04:25 +02:00
k5jae c1a9db22b7 Made Brightness setting optional based on HW capabilities 2023-08-16 20:46:25 +02:00
Silvano Seva 4cd1fdfcf3 Moved gpio.h to peripherals 2023-07-21 19:27:14 +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 8019b29947 Moved the setBacklightLevel() API function from platform.h to display.h 2023-07-14 12:26:47 +02:00
Silvano Seva 163a3df607 Refactored MDx backlight driver 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
Silvano Seva 6d58230c8c Module17: set threshold for detection of hardware rev 0.1e to 3V 2023-07-13 09:12:45 +02:00
Silvano Seva 933d291154 Made hwInfo struct const and statically initialized where dynamic loading is not needed.
Changed the hwInfo variable to static const in all the platformw where
the information are not loaded from NVM. Doing so puts the variable in
.rodata section and spares a tiny amount of RAM and FLASH.
2023-07-13 08:49:25 +02:00
Silvano Seva beca0ea093 Module17: implemented control of power on switch, introduced in rev 0.1e 2023-06-14 21:57:33 +02:00
Silvano Seva 694181df92 Module17: implemented detection of hardware version 2023-06-14 21:50:12 +02:00
Silvano Seva 1afd868d64 Renamed "lcd_type" field of hardare info struct to "hw_version" 2023-06-14 21:30:52 +02:00
Silvano Seva c862638fd1 Created calibration data structure for Module17 2023-05-29 22:12:40 +02:00
Wojciech Kaczmarski a9a6217d89 Removed RTC_PRESENT macro for Module 17 since hardware does not have an RTC 2023-05-29 22:12:40 +02:00
Silvano Seva a89a7523cb Updated year in copyright headers 2023-02-08 16:33:02 +01:00
vk7js 853db877e9 Link beep to volume knob appropriately. 2022-10-28 08:30:47 +02:00
vk7js 94424ce908 Adding beeps to MD380 platform.c. 2022-10-28 08:30:47 +02:00
vk7js eb89f5a55a Now play generic beep on any key press as well as different tones when navigating the menu, when menu item wraps, and when function key latches and unlatches if voice prompt level is set to beep. 2022-10-28 08:30:47 +02:00
vk7js a1e302b19d Got beeps working so long as you don't have ctcss set.
Reduced durations to sensible values.
2022-10-28 08:30:47 +02:00
vk7js 0298aa897b Implemented beeps on MD-UV3x0 platform driver. 2022-10-28 08:30:47 +02:00
Silvano Seva e2137eae23 Implemented CRC of persistent data (settings and VFO state) in MDx devices 2022-08-11 17:02:04 +02:00
Silvano Seva 1bb574c4fa Reorganised graphics module and moved graphics.h from interfaces to core folder 2022-07-18 21:30:43 +02:00