2022-09-27 22:01:09 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-10-02 10:50:29 +00:00
|
|
|
// Enable saving detect raw setting state
|
|
|
|
// #define SUBGHZ_SAVE_DETECT_RAW_SETTING 1
|
|
|
|
|
2022-09-27 22:01:09 +00:00
|
|
|
#include <furi_hal.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <storage/storage.h>
|
2022-10-02 10:50:29 +00:00
|
|
|
#ifdef SUBGHZ_SAVE_DETECT_RAW_SETTING
|
|
|
|
#include <lib/subghz/protocols/base.h>
|
2022-09-27 22:01:09 +00:00
|
|
|
|
2022-10-02 10:50:29 +00:00
|
|
|
#define DETECT_RAW_FALSE SubGhzProtocolFlag_Decodable
|
|
|
|
#define DETECT_RAW_TRUE SubGhzProtocolFlag_Decodable | SubGhzProtocolFlag_RAW
|
|
|
|
#endif
|
2022-09-27 22:01:09 +00:00
|
|
|
typedef struct {
|
|
|
|
uint32_t frequency;
|
2022-10-02 10:50:29 +00:00
|
|
|
#ifdef SUBGHZ_SAVE_DETECT_RAW_SETTING
|
|
|
|
uint32_t detect_raw;
|
|
|
|
#endif
|
2022-09-28 01:49:06 +00:00
|
|
|
int32_t preset;
|
2022-10-11 14:45:46 +00:00
|
|
|
uint32_t frequency_analyzer_feedback_level;
|
2022-11-16 21:37:35 +00:00
|
|
|
float frequency_analyzer_trigger;
|
2022-09-27 22:01:09 +00:00
|
|
|
} SubGhzLastSettings;
|
|
|
|
|
2022-09-28 01:49:06 +00:00
|
|
|
SubGhzLastSettings* subghz_last_settings_alloc(void);
|
|
|
|
|
|
|
|
void subghz_last_settings_free(SubGhzLastSettings* instance);
|
|
|
|
|
|
|
|
void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count);
|
|
|
|
|
2022-10-01 04:39:51 +00:00
|
|
|
bool subghz_last_settings_save(SubGhzLastSettings* instance);
|
2022-10-02 10:50:29 +00:00
|
|
|
#ifdef SUBGHZ_SAVE_DETECT_RAW_SETTING
|
|
|
|
void subghz_last_settings_set_detect_raw_values(void* context);
|
|
|
|
#endif
|