Skip to content

Commit

Permalink
[FL-3375] SubGhz: add CC1101 module external (#2747)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Skorpionm and skotopes committed Jun 30, 2023
1 parent 6d9de25 commit 8c93695
Show file tree
Hide file tree
Showing 67 changed files with 2,931 additions and 650 deletions.
11 changes: 8 additions & 3 deletions applications/debug/unit_tests/subghz/subghz_test.c
Expand Up @@ -7,6 +7,8 @@
#include <lib/subghz/subghz_file_encoder_worker.h>
#include <lib/subghz/protocols/protocol_items.h>
#include <flipper_format/flipper_format_i.h>
#include <lib/subghz/devices/devices.h>
#include <lib/subghz/devices/cc1101_configs.h>

#define TAG "SubGhz TEST"
#define KEYSTORE_DIR_NAME EXT_PATH("subghz/assets/keeloq_mfcodes")
Expand Down Expand Up @@ -49,12 +51,15 @@ static void subghz_test_init(void) {
subghz_environment_set_protocol_registry(
environment_handler, (void*)&subghz_protocol_registry);

subghz_devices_init();

receiver_handler = subghz_receiver_alloc_init(environment_handler);
subghz_receiver_set_filter(receiver_handler, SubGhzProtocolFlag_Decodable);
subghz_receiver_set_rx_callback(receiver_handler, subghz_test_rx_callback, NULL);
}

static void subghz_test_deinit(void) {
subghz_devices_deinit();
subghz_receiver_free(receiver_handler);
subghz_environment_free(environment_handler);
}
Expand All @@ -68,7 +73,7 @@ static bool subghz_decoder_test(const char* path, const char* name_decoder) {

if(decoder) {
file_worker_encoder_handler = subghz_file_encoder_worker_alloc();
if(subghz_file_encoder_worker_start(file_worker_encoder_handler, path)) {
if(subghz_file_encoder_worker_start(file_worker_encoder_handler, path, NULL)) {
// the worker needs a file in order to open and read part of the file
furi_delay_ms(100);

Expand Down Expand Up @@ -108,7 +113,7 @@ static bool subghz_decode_random_test(const char* path) {
uint32_t test_start = furi_get_tick();

file_worker_encoder_handler = subghz_file_encoder_worker_alloc();
if(subghz_file_encoder_worker_start(file_worker_encoder_handler, path)) {
if(subghz_file_encoder_worker_start(file_worker_encoder_handler, path, NULL)) {
// the worker needs a file in order to open and read part of the file
furi_delay_ms(100);

Expand Down Expand Up @@ -318,7 +323,7 @@ bool subghz_hal_async_tx_test_run(SubGhzHalAsyncTxTestType type) {
SubGhzHalAsyncTxTest test = {0};
test.type = type;
furi_hal_subghz_reset();
furi_hal_subghz_load_preset(FuriHalSubGhzPresetOok650Async);
furi_hal_subghz_load_custom_preset(subghz_device_cc1101_preset_ook_650khz_async_regs);
furi_hal_subghz_set_frequency_and_path(433920000);

if(!furi_hal_subghz_start_async_tx(subghz_hal_async_tx_test_yield, &test)) {
Expand Down
6 changes: 6 additions & 0 deletions applications/drivers/application.fam
@@ -0,0 +1,6 @@
# Placeholder
App(
appid="drivers",
name="Drivers device",
apptype=FlipperAppType.METAPACKAGE,
)
8 changes: 8 additions & 0 deletions applications/drivers/subghz/application.fam
@@ -0,0 +1,8 @@
App(
appid="radio_device_cc1101_ext",
apptype=FlipperAppType.PLUGIN,
targets=["f7"],
entry_point="subghz_device_cc1101_ext_ep",
requires=["subghz"],
fap_libs=["hwdrivers"],
)

0 comments on commit 8c93695

Please sign in to comment.