mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
[FL-3375] SubGhz: add CC1101 module external (#2747)
* SubGhz: add CC1101 Ext driver * SubGhz: move TIM2 -> TIM17 use cc1101_ext * FuriHal: SPI move channel DMA 3,4 -> 6.7 * Documentation: fix font * SubGhz: add work with SubGhz devices by link to device * SubGhz: add support switching external/internal cc1101 "subghz chat" * SubGhz: add support switching external/internal cc1101 "subghz tx" and "subghz rx" * SubGhz: add "Radio Settings" scene * SubGhz: add icon * SubGhz: add supported CC1101 external module in SubGhz app * SubGhz: fix check frequency supported radio device * SubGhz: fix clang-formatted * Sughz: move dirver CC1101_Ext to lib , compile cmd ./fbt launch_app APPSRC=radio_device_cc1101_ext * SubGhz: fix CLI * SubGhz: fix PVS * SubGhz: delete comments * SubGhz: fix unit_test * Format sources * Update api symbols and drivers targets * Drivers: find proper place for target option * SubGhz: external device connected method naming * Format sources * SubGhz: fix module selection menu, when external is not connected * SubGhz: fix furi_assert(device); * SubGhz: fix split h and c * SubGhz: furi_hal_subghz remove preset load function by name * SubGhz: deleted comments * Format Sources * SubGhz: add some consts and fix unit tests * Sync API Symbols Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <furi.h>
|
||||
#include <m-list.h>
|
||||
#include <furi_hal_subghz_configs.h>
|
||||
#include <lib/subghz/devices/cc1101_configs.h>
|
||||
|
||||
#define TAG "SubGhzSetting"
|
||||
|
||||
@@ -218,8 +218,7 @@ void subghz_setting_free(SubGhzSetting* instance) {
|
||||
static void subghz_setting_load_default_preset(
|
||||
SubGhzSetting* instance,
|
||||
const char* preset_name,
|
||||
const uint8_t* preset_data,
|
||||
const uint8_t preset_pa_table[8]) {
|
||||
const uint8_t* preset_data) {
|
||||
furi_assert(instance);
|
||||
furi_assert(preset_data);
|
||||
uint32_t preset_data_count = 0;
|
||||
@@ -235,10 +234,8 @@ static void subghz_setting_load_default_preset(
|
||||
preset_data_count += 2;
|
||||
item->custom_preset_data_size = sizeof(uint8_t) * preset_data_count + sizeof(uint8_t) * 8;
|
||||
item->custom_preset_data = malloc(item->custom_preset_data_size);
|
||||
//load preset register
|
||||
memcpy(&item->custom_preset_data[0], &preset_data[0], preset_data_count);
|
||||
//load pa table
|
||||
memcpy(&item->custom_preset_data[preset_data_count], &preset_pa_table[0], 8);
|
||||
//load preset register + pa table
|
||||
memcpy(&item->custom_preset_data[0], &preset_data[0], item->custom_preset_data_size);
|
||||
}
|
||||
|
||||
static void subghz_setting_load_default_region(
|
||||
@@ -262,25 +259,13 @@ static void subghz_setting_load_default_region(
|
||||
}
|
||||
|
||||
subghz_setting_load_default_preset(
|
||||
instance,
|
||||
"AM270",
|
||||
(uint8_t*)furi_hal_subghz_preset_ook_270khz_async_regs,
|
||||
furi_hal_subghz_preset_ook_async_patable);
|
||||
instance, "AM270", subghz_device_cc1101_preset_ook_270khz_async_regs);
|
||||
subghz_setting_load_default_preset(
|
||||
instance,
|
||||
"AM650",
|
||||
(uint8_t*)furi_hal_subghz_preset_ook_650khz_async_regs,
|
||||
furi_hal_subghz_preset_ook_async_patable);
|
||||
instance, "AM650", subghz_device_cc1101_preset_ook_650khz_async_regs);
|
||||
subghz_setting_load_default_preset(
|
||||
instance,
|
||||
"FM238",
|
||||
(uint8_t*)furi_hal_subghz_preset_2fsk_dev2_38khz_async_regs,
|
||||
furi_hal_subghz_preset_2fsk_async_patable);
|
||||
instance, "FM238", subghz_device_cc1101_preset_2fsk_dev2_38khz_async_regs);
|
||||
subghz_setting_load_default_preset(
|
||||
instance,
|
||||
"FM476",
|
||||
(uint8_t*)furi_hal_subghz_preset_2fsk_dev47_6khz_async_regs,
|
||||
furi_hal_subghz_preset_2fsk_async_patable);
|
||||
instance, "FM476", subghz_device_cc1101_preset_2fsk_dev47_6khz_async_regs);
|
||||
}
|
||||
|
||||
void subghz_setting_load_default(SubGhzSetting* instance) {
|
||||
@@ -359,6 +344,7 @@ void subghz_setting_load(SubGhzSetting* instance, const char* file_path) {
|
||||
}
|
||||
while(flipper_format_read_uint32(
|
||||
fff_data_file, "Frequency", (uint32_t*)&temp_data32, 1)) {
|
||||
//Todo: add a frequency support check depending on the selected radio device
|
||||
if(furi_hal_subghz_is_frequency_valid(temp_data32)) {
|
||||
FURI_LOG_I(TAG, "Frequency loaded %lu", temp_data32);
|
||||
FrequencyList_push_back(instance->frequencies, temp_data32);
|
||||
|
||||
Reference in New Issue
Block a user