[FL-1496] SubGhz: Library, Cli, Application (#543)

* ApiHal: set frequency and path in one go. Drivers: proper frequency registers calculation for CC1101. Update subghz cli to match new api.
* SubGhz: preparation for parsers porting, tim2 sharing
* ApiHal: add interrupts API, move all TIM2 related things there.
* SubGhz: refactor protocol lib and add keeloq.
* SubGhz: proper init_set for keeloq manafacture key
* SubGhz: port more protocols to lib
* SubGhz: load keeloq manufacture keys from sd card (if any).
* SubGhz: format output from protocols.
* SubGhz: use default frequency in subghz_rx cli command.
* SubGhz: keeloq key types
* Fix compillation error when internal storage disabled
* SubGhz: minor cleanup
* SubGhz: properly handle timeout and reset signal in subghz_rx
* SubGhz: Worker, Capture View. Furi: emulate thread join.
* SubGhz: free strings on keeloq key load end
* SubGhz: update protocols reporting API, app refactoring and capture view, update API HAL usage.
* SubGhz: update dump formatting
* ApiHal: backport subghz preset to F5
* ApiHal: backport subghz frequency range to F5
This commit is contained in:
あく
2021-06-30 00:19:20 +03:00
committed by GitHub
parent dce3665f63
commit e8211226f3
46 changed files with 2114 additions and 265 deletions

View File

@@ -11,6 +11,7 @@ extern "C" {
typedef enum {
ApiHalSubGhzPresetOokAsync, /** OOK, asynchronous */
ApiHalSubGhzPreset2FskPacket, /** 2FSK, 115kBaud, variable packet length */
ApiHalSubGhzPresetMP, /** MP OOK, asynchronous */
} ApiHalSubGhzPreset;
/** Switchable Radio Paths */
@@ -88,6 +89,13 @@ void api_hal_subghz_tx();
/** Get RSSI value in dBm */
float api_hal_subghz_get_rssi();
/** Set frequency and path
* This function automatically selects antenna matching network
* @param frequency in herz
* @return real frequency in herz
*/
uint32_t api_hal_subghz_set_frequency_and_path(uint32_t value);
/** Set frequency
* @param frequency in herz
* @return real frequency in herz
@@ -99,6 +107,36 @@ uint32_t api_hal_subghz_set_frequency(uint32_t value);
*/
void api_hal_subghz_set_path(ApiHalSubGhzPath path);
/** Front Definition for capture callback */
typedef enum {
ApiHalSubGhzCaptureLevelHigh,
ApiHalSubGhzCaptureLevelLow,
ApiHalSubGhzCaptureLevelOverrun,
ApiHalSubGhzCaptureLevelUnderrun,
} ApiHalSubGhzCaptureLevel;
typedef struct {
ApiHalSubGhzCaptureLevel level;
uint32_t duration;
} LevelPair;
/** Signal Timings Capture callback */
typedef void (*ApiHalSubGhzCaptureCallback)(ApiHalSubGhzCaptureLevel level, uint32_t time, void* context);
/** Set signal timings capture callback
* @param callback - your callback for front capture
*/
void api_hal_subghz_set_capture_callback(ApiHalSubGhzCaptureCallback callback, void* context);
/** Enable signal timings capture
* Initializes GPIO and TIM2 for timings capture
*/
void api_hal_subghz_enable_capture();
/** Disable signal timings capture
* Resets GPIO and TIM2
*/
void api_hal_subghz_disable_capture();
#ifdef __cplusplus
}

View File

@@ -13,7 +13,6 @@ template <unsigned int N> struct STOP_EXTERNING_ME {};
#include "api-hal-delay.h"
#include "api-hal-pwm.h"
#include "api-hal-task.h"
#include "api-hal-tim.h"
#include "api-hal-power.h"
#include "api-hal-vcp.h"
#include "api-hal-version.h"