2021-06-30 00:19:20 +03:00
|
|
|
#pragma once
|
|
|
|
|
2022-01-05 19:10:18 +03:00
|
|
|
#include <furi_hal.h>
|
2021-06-30 00:19:20 +03:00
|
|
|
|
2022-09-14 19:11:38 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-06-30 00:19:20 +03:00
|
|
|
typedef struct SubGhzWorker SubGhzWorker;
|
|
|
|
|
|
|
|
typedef void (*SubGhzWorkerOverrunCallback)(void* context);
|
|
|
|
|
2021-07-07 22:49:45 +03:00
|
|
|
typedef void (*SubGhzWorkerPairCallback)(void* context, bool level, uint32_t duration);
|
2021-06-30 00:19:20 +03:00
|
|
|
|
2021-07-07 22:49:45 +03:00
|
|
|
void subghz_worker_rx_callback(bool level, uint32_t duration, void* context);
|
2021-06-30 00:19:20 +03:00
|
|
|
|
2022-03-16 12:18:48 +03:00
|
|
|
/**
|
|
|
|
* Allocate SubGhzWorker.
|
|
|
|
* @return SubGhzWorker* Pointer to a SubGhzWorker instance
|
2021-07-02 16:25:49 +03:00
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
SubGhzWorker* subghz_worker_alloc();
|
|
|
|
|
2022-03-16 12:18:48 +03:00
|
|
|
/**
|
|
|
|
* Free SubGhzWorker.
|
|
|
|
* @param instance Pointer to a SubGhzWorker instance
|
2021-07-02 16:25:49 +03:00
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
void subghz_worker_free(SubGhzWorker* instance);
|
|
|
|
|
2022-03-16 12:18:48 +03:00
|
|
|
/**
|
|
|
|
* Overrun callback SubGhzWorker.
|
|
|
|
* @param instance Pointer to a SubGhzWorker instance
|
2021-07-02 16:25:49 +03:00
|
|
|
* @param callback SubGhzWorkerOverrunCallback callback
|
|
|
|
*/
|
2022-01-05 19:10:18 +03:00
|
|
|
void subghz_worker_set_overrun_callback(
|
|
|
|
SubGhzWorker* instance,
|
|
|
|
SubGhzWorkerOverrunCallback callback);
|
2021-06-30 00:19:20 +03:00
|
|
|
|
2022-03-16 12:18:48 +03:00
|
|
|
/**
|
|
|
|
* Pair callback SubGhzWorker.
|
|
|
|
* @param instance Pointer to a SubGhzWorker instance
|
2021-07-02 16:25:49 +03:00
|
|
|
* @param callback SubGhzWorkerOverrunCallback callback
|
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
void subghz_worker_set_pair_callback(SubGhzWorker* instance, SubGhzWorkerPairCallback callback);
|
|
|
|
|
2022-03-16 12:18:48 +03:00
|
|
|
/**
|
|
|
|
* Context callback SubGhzWorker.
|
|
|
|
* @param instance Pointer to a SubGhzWorker instance
|
2021-07-02 16:25:49 +03:00
|
|
|
* @param context
|
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
void subghz_worker_set_context(SubGhzWorker* instance, void* context);
|
|
|
|
|
2022-03-16 12:18:48 +03:00
|
|
|
/**
|
|
|
|
* Start SubGhzWorker.
|
|
|
|
* @param instance Pointer to a SubGhzWorker instance
|
2021-07-02 16:25:49 +03:00
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
void subghz_worker_start(SubGhzWorker* instance);
|
|
|
|
|
2021-07-02 16:25:49 +03:00
|
|
|
/** Stop SubGhzWorker
|
2022-03-16 12:18:48 +03:00
|
|
|
* @param instance Pointer to a SubGhzWorker instance
|
2021-07-02 16:25:49 +03:00
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
void subghz_worker_stop(SubGhzWorker* instance);
|
Skorp subghz signal archive (#667)
* SubGhz: Add millis() furi, add subghz history struct
* SubGhz: Fix subghz history
* Gubghz: Fix code repeat history, add clean history
* SubGhz: reading and adding keys to history
* Gui: Renaming Sub 1-Ghz -> SubGhz
* Archive: Renaming Sub 1-Ghz -> SubGhz
* SubGhz: Add menu history, modified button for sending a signal, changed output of data about accepted protocol
* Archive: Fix name subghz
* SubGhz: Menu navigation
* Assets: Add assets/SubGHz/icon.png
* Assets: add new icons for subghz
* SubGhz: Fix name Add manually scene
* SubGhz: Fix load icon Read scene. rename encoder struct, rename protocol function load from file, add load raw data protocol, add info pleasant signals all protocol
* SubGhz: fix memory leak
* SubGhz: change of receiving frequency for read scene
* SubGhz: Add save/load frequency and preset, add automatic configuration of transmit/receive to the desired frequency and modulation, add button "save" config scene
* SubGhz: Fix frequency and preset, fix frequency add manualli scene, fix re-executing the parser
* Furi-hal-subghz: add 2-FSK config, fix ook config 650KHz BW Tx filter
* Fix formatting and release build
* SubGhz: Delete read scene
* SubGhz: Fix frequency add manualli scene, refactoring code
* SubGhz: 2 profiles for OOK, fix broken build.
* SubGhz: Add passing static codes from read scene, add notification read scene, refactoring code
* SubGhz: fix assert on worker double stop.
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-28 16:51:48 +03:00
|
|
|
|
2022-03-16 12:18:48 +03:00
|
|
|
/**
|
|
|
|
* Check if worker is running.
|
|
|
|
* @param instance Pointer to a SubGhzWorker instance
|
Skorp subghz signal archive (#667)
* SubGhz: Add millis() furi, add subghz history struct
* SubGhz: Fix subghz history
* Gubghz: Fix code repeat history, add clean history
* SubGhz: reading and adding keys to history
* Gui: Renaming Sub 1-Ghz -> SubGhz
* Archive: Renaming Sub 1-Ghz -> SubGhz
* SubGhz: Add menu history, modified button for sending a signal, changed output of data about accepted protocol
* Archive: Fix name subghz
* SubGhz: Menu navigation
* Assets: Add assets/SubGHz/icon.png
* Assets: add new icons for subghz
* SubGhz: Fix name Add manually scene
* SubGhz: Fix load icon Read scene. rename encoder struct, rename protocol function load from file, add load raw data protocol, add info pleasant signals all protocol
* SubGhz: fix memory leak
* SubGhz: change of receiving frequency for read scene
* SubGhz: Add save/load frequency and preset, add automatic configuration of transmit/receive to the desired frequency and modulation, add button "save" config scene
* SubGhz: Fix frequency and preset, fix frequency add manualli scene, fix re-executing the parser
* Furi-hal-subghz: add 2-FSK config, fix ook config 650KHz BW Tx filter
* Fix formatting and release build
* SubGhz: Delete read scene
* SubGhz: Fix frequency add manualli scene, refactoring code
* SubGhz: 2 profiles for OOK, fix broken build.
* SubGhz: Add passing static codes from read scene, add notification read scene, refactoring code
* SubGhz: fix assert on worker double stop.
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-28 16:51:48 +03:00
|
|
|
* @return bool - true if running
|
|
|
|
*/
|
|
|
|
bool subghz_worker_is_running(SubGhzWorker* instance);
|
2022-09-14 19:11:38 +03:00
|
|
|
|
2023-02-08 16:20:42 +03:00
|
|
|
/**
|
|
|
|
* Short duration filter setting.
|
|
|
|
* glues short durations into 1. The default setting is 30 us, if set to 0 the filter will be disabled
|
|
|
|
* @param instance Pointer to a SubGhzWorker instance
|
|
|
|
* @param timeout time in us
|
|
|
|
*/
|
|
|
|
void subghz_worker_set_filter(SubGhzWorker* instance, uint16_t timeout);
|
|
|
|
|
2022-09-14 19:11:38 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|