Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a191631
DIR_NAME and Drivers
gid9798 Jun 18, 2023
3000b8f
prt1
gid9798 Jun 18, 2023
5eb677a
prt2
gid9798 Jun 18, 2023
2817913
prt3
gid9798 Jun 18, 2023
72712d9
updated TODO descriptions
gid9798 Jun 19, 2023
ab12c8c
SubRem configurator update
gid9798 Jun 19, 2023
a519a24
SubRem Config internal module by default
gid9798 Jun 19, 2023
f9472ef
Now really block transmission at dangerous freq
gid9798 Jun 20, 2023
e2e9e53
Sub playlist app: new external and some fixes
gid9798 Jun 20, 2023
6e26de3
SubGhz app: fix is_tx_allowed and freq check
gid9798 Jun 20, 2023
7bd0273
SubGhz app: deleted extra check
gid9798 Jun 20, 2023
1e76c2d
SubRem Apps: update
gid9798 Jun 21, 2023
c1f056c
Merge remote-tracking branch 'UFW/dev' into cc1101_ext
gid9798 Jul 3, 2023
2fb5752
SubGhz: fiz module seletion, furi_assert(device). drivers targets
gid9798 Jul 3, 2023
0d6e6c4
SubGhz: fix split h and c
gid9798 Jul 3, 2023
01d7bee
SubGhz: furi_hal_subghz remove preset load function by name
gid9798 Jul 3, 2023
2ef07a7
SubGhz: add some consts and fix unit tests
gid9798 Jul 3, 2023
90ed11e
subrem_configurator app: Upd TXRX
gid9798 Jul 3, 2023
d208b69
subghz_playlist app: Upd external module init
gid9798 Jul 3, 2023
cb08b84
Spectrum analyzer: new ext radio driver (#2)
gid9798 Jul 6, 2023
b1850fd
Weather station: new external radio driver (#3)
gid9798 Jul 6, 2023
dd2cad0
External radio driver in frequency analyzer & test carrier (#5)
gid9798 Jul 6, 2023
9494cc0
Merge remote-tracking branch 'UFW/dev' into cc1101_ext
gid9798 Jul 7, 2023
5fa0706
Merge branch 'dev' into cc1101_ext
xMasterX Jul 10, 2023
76ddb5d
Merge branch 'dev' into cc1101_ext
xMasterX Jul 10, 2023
9f9664f
Merge branch 'dev' into cc1101_ext
xMasterX Jul 10, 2023
5897b82
api
xMasterX Jul 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions applications/debug/subghz_test/views/subghz_test_carrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct SubGhzTestCarrier {
View* view;
FuriTimer* timer;
SubGhzTestCarrierCallback callback;
// const SubGhzDevice* radio_device;
void* context;
};

Expand Down Expand Up @@ -84,6 +85,7 @@ void subghz_test_carrier_draw(Canvas* canvas, SubGhzTestCarrierModel* model) {
bool subghz_test_carrier_input(InputEvent* event, void* context) {
furi_assert(context);
SubGhzTestCarrier* subghz_test_carrier = context;
// const SubGhzDevice* radio_device = subghz_test_carrier->radio_device;

if(event->key == InputKeyBack || event->type != InputTypeShort) {
return false;
Expand All @@ -94,6 +96,7 @@ bool subghz_test_carrier_input(InputEvent* event, void* context) {
SubGhzTestCarrierModel * model,
{
furi_hal_subghz_idle();
// subghz_devices_idle(radio_device);

if(event->key == InputKeyLeft) {
if(model->frequency > 0) model->frequency--;
Expand All @@ -114,10 +117,18 @@ bool subghz_test_carrier_input(InputEvent* event, void* context) {
model->real_frequency =
furi_hal_subghz_set_frequency(subghz_frequencies_testing[model->frequency]);
furi_hal_subghz_set_path(model->path);
// model->real_frequency = subghz_devices_set_frequency(
// radio_device, subghz_frequencies_testing[model->frequency]);

if(model->status == SubGhzTestCarrierModelStatusRx) {
furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);
furi_hal_subghz_rx();
// furi_hal_gpio_init(
// subghz_devices_get_data_gpio(radio_device),
// GpioModeInput,
// GpioPullNo,
// GpioSpeedLow);
// subghz_devices_set_rx(radio_device);
} else {
furi_hal_gpio_init(
&gpio_cc1101_g0, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
Expand All @@ -127,6 +138,15 @@ bool subghz_test_carrier_input(InputEvent* event, void* context) {
subghz_test_carrier->callback(
SubGhzTestCarrierEventOnlyRx, subghz_test_carrier->context);
}
// if(!subghz_devices_set_tx(radio_device)) {
// furi_hal_gpio_init(
// subghz_devices_get_data_gpio(radio_device),
// GpioModeInput,
// GpioPullNo,
// GpioSpeedLow);
// subghz_test_carrier->callback(
// SubGhzTestCarrierEventOnlyRx, subghz_test_carrier->context);
// }
}
},
true);
Expand All @@ -137,26 +157,37 @@ bool subghz_test_carrier_input(InputEvent* event, void* context) {
void subghz_test_carrier_enter(void* context) {
furi_assert(context);
SubGhzTestCarrier* subghz_test_carrier = context;
// furi_assert(subghz_test_carrier->radio_device);
// const SubGhzDevice* radio_device = subghz_test_carrier->radio_device;

furi_hal_subghz_reset();
furi_hal_subghz_load_custom_preset(subghz_device_cc1101_preset_ook_650khz_async_regs);

furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);

// subghz_devices_reset(radio_device);
// subghz_devices_load_preset(radio_device, FuriHalSubGhzPresetOok650Async, NULL);

// furi_hal_gpio_init(
// subghz_devices_get_data_gpio(radio_device), GpioModeInput, GpioPullNo, GpioSpeedLow);

with_view_model(
subghz_test_carrier->view,
SubGhzTestCarrierModel * model,
{
model->frequency = subghz_frequencies_433_92_testing; // 433
model->real_frequency =
furi_hal_subghz_set_frequency(subghz_frequencies_testing[model->frequency]);
// model->real_frequency = subghz_devices_set_frequency(
// radio_device, subghz_frequencies_testing[model->frequency]);
model->path = FuriHalSubGhzPathIsolate; // isolate
model->rssi = 0.0f;
model->status = SubGhzTestCarrierModelStatusRx;
},
true);

furi_hal_subghz_rx();
// subghz_devices_set_rx(radio_device);

furi_timer_start(subghz_test_carrier->timer, furi_kernel_get_tick_frequency() / 4);
}
Expand All @@ -169,6 +200,7 @@ void subghz_test_carrier_exit(void* context) {

// Reinitialize IC to default state
furi_hal_subghz_sleep();
// subghz_devices_sleep(subghz_test_carrier->radio_device);
}

void subghz_test_carrier_rssi_timer_callback(void* context) {
Expand All @@ -181,6 +213,7 @@ void subghz_test_carrier_rssi_timer_callback(void* context) {
{
if(model->status == SubGhzTestCarrierModelStatusRx) {
model->rssi = furi_hal_subghz_get_rssi();
// model->rssi = subghz_devices_get_rssi(subghz_test_carrier->radio_device);
}
},
false);
Expand Down Expand Up @@ -216,3 +249,10 @@ View* subghz_test_carrier_get_view(SubGhzTestCarrier* subghz_test_carrier) {
furi_assert(subghz_test_carrier);
return subghz_test_carrier->view;
}

// void subghz_test_carrier_set_radio(
// SubGhzTestCarrier* subghz_test_carrier,
// const SubGhzDevice* radio_device) {
// furi_assert(subghz_test_carrier);
// subghz_test_carrier->radio_device = radio_device;
// }
5 changes: 5 additions & 0 deletions applications/debug/subghz_test/views/subghz_test_carrier.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <gui/view.h>
// #include <lib/subghz/devices/devices.h>

typedef enum {
SubGhzTestCarrierEventOnlyRx,
Expand All @@ -20,3 +21,7 @@ SubGhzTestCarrier* subghz_test_carrier_alloc();
void subghz_test_carrier_free(SubGhzTestCarrier* subghz_test_carrier);

View* subghz_test_carrier_get_view(SubGhzTestCarrier* subghz_test_carrier);

// void subghz_test_carrier_set_radio(
// SubGhzTestCarrier* subghz_test_carrier,
// const SubGhzDevice* radio_device);
11 changes: 8 additions & 3 deletions applications/debug/unit_tests/subghz/subghz_test.c
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"],
)
Loading