mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-13 19:43:34 -07:00
New formatting
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
#define DEBUG_INIT() \
|
||||
furi_hal_gpio_init(DEBUG_PIN, GpioModeOutputPushPull, GpioPullNo, GpioSpeedVeryHigh)
|
||||
#define DEBUG_SET_HIGH() furi_hal_gpio_write(DEBUG_PIN, true)
|
||||
#define DEBUG_SET_LOW() furi_hal_gpio_write(DEBUG_PIN, false)
|
||||
#define DEBUG_SET_LOW() furi_hal_gpio_write(DEBUG_PIN, false)
|
||||
#else
|
||||
#define DEBUG_INIT()
|
||||
#define DEBUG_SET_HIGH()
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
#include <storage/storage.h>
|
||||
#include <toolbox/saved_struct.h>
|
||||
|
||||
#define RGB_BACKLIGHT_SETTINGS_MAGIC 0x15
|
||||
#define RGB_BACKLIGHT_SETTINGS_MAGIC 0x15
|
||||
#define RGB_BACKLIGHT_SETTINGS_VERSION 6
|
||||
#define RGB_BACKLIGHT_SETTINGS_PATH CFG_PATH("rgb_backlight.settings")
|
||||
#define RGB_BACKLIGHT_SETTINGS_PATH CFG_PATH("rgb_backlight.settings")
|
||||
|
||||
static struct {
|
||||
RgbColor colors[SK6805_LED_COUNT];
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
#define INSTAFOB_DECODED_DATA_SIZE_BYTES (8)
|
||||
|
||||
#define INSTAFOB_ENCODED_DATA_SIZE_BYTES ((4 * 7) + 1)
|
||||
#define INSTAFOB_ENCODED_DATA_SIZE_BITS ((8 * 4 * 7) + 1)
|
||||
#define INSTAFOB_ENCODED_DATA_OFFSET (7)
|
||||
#define INSTAFOB_ENCODED_DATA_SIZE_BITS ((8 * 4 * 7) + 1)
|
||||
#define INSTAFOB_ENCODED_DATA_OFFSET (7)
|
||||
|
||||
#define INSTAFOB_BLOCK1 (0x00107060)
|
||||
|
||||
#define LFRFID_FREQUENCY (125000)
|
||||
#define INSTAFOB_CLOCK_PER_BIT (32)
|
||||
#define INSTAFOB_READ_LONG_TIME_BASE (1000000 / (LFRFID_FREQUENCY / INSTAFOB_CLOCK_PER_BIT))
|
||||
#define LFRFID_FREQUENCY (125000)
|
||||
#define INSTAFOB_CLOCK_PER_BIT (32)
|
||||
#define INSTAFOB_READ_LONG_TIME_BASE (1000000 / (LFRFID_FREQUENCY / INSTAFOB_CLOCK_PER_BIT))
|
||||
#define INSTAFOB_READ_SHORT_TIME_BASE (INSTAFOB_READ_LONG_TIME_BASE / 2)
|
||||
#define INSTAFOB_READ_SEQTERM_TIME_BASE \
|
||||
(1000000 / (LFRFID_FREQUENCY * 32 / 50 / INSTAFOB_CLOCK_PER_BIT))
|
||||
@@ -57,16 +57,16 @@ ProtocolInstaFob* protocol_insta_fob_alloc(void) {
|
||||
bit_lib_num_to_bytes_be(INSTAFOB_BLOCK1, 4, protocol->data);
|
||||
protocol->debug_string = furi_string_alloc();
|
||||
return (void*)protocol;
|
||||
};
|
||||
}
|
||||
|
||||
void protocol_insta_fob_free(ProtocolInstaFob* protocol) {
|
||||
free(protocol->debug_string);
|
||||
free(protocol);
|
||||
};
|
||||
}
|
||||
|
||||
uint8_t* protocol_insta_fob_get_data(ProtocolInstaFob* protocol) {
|
||||
return protocol->data;
|
||||
};
|
||||
}
|
||||
|
||||
void protocol_insta_fob_decoder_start(ProtocolInstaFob* protocol) {
|
||||
memset(protocol->data, 0, INSTAFOB_DECODED_DATA_SIZE_BYTES);
|
||||
@@ -78,7 +78,7 @@ void protocol_insta_fob_decoder_start(ProtocolInstaFob* protocol) {
|
||||
NULL);
|
||||
protocol->encoded_polarity = false;
|
||||
protocol->encoded_term_state = ProtocolInstaFobSeqTermNone;
|
||||
};
|
||||
}
|
||||
|
||||
static const char* protocol_insta_fob_get_encoded_data(ProtocolInstaFob* protocol) {
|
||||
furi_string_reset(protocol->debug_string);
|
||||
@@ -87,7 +87,7 @@ static const char* protocol_insta_fob_get_encoded_data(ProtocolInstaFob* protoco
|
||||
protocol->debug_string, bit_lib_get_bit(protocol->encoded_data, i) ? "1" : "0");
|
||||
}
|
||||
return furi_string_get_cstr(protocol->debug_string);
|
||||
};
|
||||
}
|
||||
|
||||
static bool protocol_insta_fob_can_be_decoded(ProtocolInstaFob* protocol) {
|
||||
return bit_lib_get_bits_32(protocol->encoded_data, INSTAFOB_ENCODED_DATA_OFFSET, 32) ==
|
||||
@@ -96,11 +96,11 @@ static bool protocol_insta_fob_can_be_decoded(ProtocolInstaFob* protocol) {
|
||||
|
||||
static void protocol_insta_fob_decode(ProtocolInstaFob* protocol) {
|
||||
bit_lib_copy_bits(protocol->data, 0, 64, protocol->encoded_data, INSTAFOB_ENCODED_DATA_OFFSET);
|
||||
};
|
||||
}
|
||||
|
||||
static bool protocol_insta_fob_in_range(uint32_t value, uint32_t base, uint32_t jitter) {
|
||||
return (value > (base - jitter)) && (value < (base + jitter));
|
||||
};
|
||||
}
|
||||
|
||||
static ManchesterEvent protocol_insta_fob_manchester_event(bool level, uint32_t duration_us) {
|
||||
ManchesterEvent event = ManchesterEventReset;
|
||||
@@ -122,12 +122,12 @@ static ManchesterEvent protocol_insta_fob_manchester_event(bool level, uint32_t
|
||||
}
|
||||
|
||||
return event;
|
||||
};
|
||||
}
|
||||
|
||||
static bool protocol_insta_fob_is_sequence_terminator(uint32_t duration_us) {
|
||||
return protocol_insta_fob_in_range(
|
||||
duration_us, INSTAFOB_READ_SEQTERM_TIME_BASE, INSTAFOB_READ_JITTER_TIME_BASE);
|
||||
};
|
||||
}
|
||||
|
||||
static bool protocol_insta_fob_decoder_seq_terminator(
|
||||
ProtocolInstaFob* protocol,
|
||||
@@ -221,7 +221,7 @@ bool protocol_insta_fob_decoder_feed(ProtocolInstaFob* protocol, bool level, uin
|
||||
}
|
||||
|
||||
return decoded_signal;
|
||||
};
|
||||
}
|
||||
|
||||
bool protocol_insta_fob_encoder_start(ProtocolInstaFob* protocol) {
|
||||
uint32_t block1 = bit_lib_get_bits_32(protocol->data, 0, 32);
|
||||
@@ -301,7 +301,7 @@ LevelDuration protocol_insta_fob_encoder_yield(ProtocolInstaFob* protocol) {
|
||||
}
|
||||
|
||||
return level_duration_make(level, duration_cycles);
|
||||
};
|
||||
}
|
||||
|
||||
void protocol_insta_fob_render_data(ProtocolInstaFob* protocol, FuriString* result) {
|
||||
furi_string_printf(
|
||||
@@ -309,7 +309,7 @@ void protocol_insta_fob_render_data(ProtocolInstaFob* protocol, FuriString* resu
|
||||
"InstaFob\nBlk[1]: %08lX\nBlk[2]: %08lX",
|
||||
bit_lib_get_bits_32(protocol->data, 0, 32),
|
||||
bit_lib_get_bits_32(protocol->data, 32, 32));
|
||||
};
|
||||
}
|
||||
|
||||
void protocol_insta_fob_render_brief_data(ProtocolInstaFob* protocol, FuriString* result) {
|
||||
furi_string_printf(
|
||||
@@ -317,7 +317,7 @@ void protocol_insta_fob_render_brief_data(ProtocolInstaFob* protocol, FuriString
|
||||
"Fob %08lX %08lX",
|
||||
bit_lib_get_bits_32(protocol->data, 0, 32),
|
||||
bit_lib_get_bits_32(protocol->data, 32, 32));
|
||||
};
|
||||
}
|
||||
|
||||
bool protocol_insta_fob_write_data(ProtocolInstaFob* protocol, void* data) {
|
||||
LFRFIDWriteRequest* request = (LFRFIDWriteRequest*)data;
|
||||
@@ -347,7 +347,7 @@ bool protocol_insta_fob_write_data(ProtocolInstaFob* protocol, void* data) {
|
||||
request->t5577.block[2]);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
const ProtocolBase protocol_insta_fob = {
|
||||
.name = "InstaFob",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#include <toolbox/protocols/protocol.h>
|
||||
|
||||
extern const ProtocolBase protocol_insta_fob;
|
||||
extern const ProtocolBase protocol_insta_fob;
|
||||
|
||||
@@ -12,9 +12,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#define MOMENTUM_SETTINGS_PATH CFG_PATH("momentum_settings.txt")
|
||||
#define ASSET_PACKS_PATH EXT_PATH("asset_packs")
|
||||
#define MAINMENU_APPS_PATH CFG_PATH("mainmenu_apps.txt")
|
||||
#define ASSET_PACKS_NAME_LEN 32
|
||||
#define ASSET_PACKS_PATH EXT_PATH("asset_packs")
|
||||
#define MAINMENU_APPS_PATH CFG_PATH("mainmenu_apps.txt")
|
||||
#define ASSET_PACKS_NAME_LEN 32
|
||||
|
||||
typedef enum {
|
||||
BatteryIconOff,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#define NAMESPOOF_HEADER "Flipper Name File"
|
||||
#define NAMESPOOF_HEADER "Flipper Name File"
|
||||
#define NAMESPOOF_VERSION 1
|
||||
#define NAMESPOOF_PATH EXT_PATH("dolphin/name.txt")
|
||||
#define NAMESPOOF_PATH EXT_PATH("dolphin/name.txt")
|
||||
|
||||
void namespoof_init(void);
|
||||
|
||||
@@ -68,13 +68,13 @@ static const struct {
|
||||
uint8_t u_sz;
|
||||
};
|
||||
};
|
||||
#define setting(t, n) .type = momentum_settings_type##t, .key = #n, .val = &momentum_settings.n
|
||||
#define setting_str(n) setting(_str, n), .str_len = sizeof(momentum_settings.n)
|
||||
#define num(t, n, min, max) .t##_min = min, .t##_max = max, .t##_sz = sizeof(momentum_settings.n)
|
||||
#define setting_int(n, min, max) setting(_int, n), num(i, n, min, max)
|
||||
#define setting(t, n) .type = momentum_settings_type##t, .key = #n, .val = &momentum_settings.n
|
||||
#define setting_str(n) setting(_str, n), .str_len = sizeof(momentum_settings.n)
|
||||
#define num(t, n, min, max) .t##_min = min, .t##_max = max, .t##_sz = sizeof(momentum_settings.n)
|
||||
#define setting_int(n, min, max) setting(_int, n), num(i, n, min, max)
|
||||
#define setting_uint(n, min, max) setting(_uint, n), num(u, n, min, max)
|
||||
#define setting_enum(n, cnt) setting_uint(n, 0, cnt - 1)
|
||||
#define setting_bool(n) setting(_bool, n)
|
||||
#define setting_enum(n, cnt) setting_uint(n, 0, cnt - 1)
|
||||
#define setting_bool(n) setting(_bool, n)
|
||||
} momentum_settings_entries[] = {
|
||||
{setting_str(asset_pack)},
|
||||
{setting_uint(anim_speed, 25, 300)},
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
#define ISO14443_4_BLOCK_PCB_R (5U << 5)
|
||||
#define ISO14443_4_BLOCK_PCB_S (3U << 6)
|
||||
|
||||
#define ISO14443_4_BLOCK_PCB_I_ (0U << 6)
|
||||
#define ISO14443_4_BLOCK_PCB_R_ (2U << 6)
|
||||
#define ISO14443_4_BLOCK_PCB_I_ (0U << 6)
|
||||
#define ISO14443_4_BLOCK_PCB_R_ (2U << 6)
|
||||
#define ISO14443_4_BLOCK_PCB_TYPE_MASK (3U << 6)
|
||||
|
||||
#define ISO14443_4_BLOCK_PCB_S_DESELECT (0U << 4)
|
||||
#define ISO14443_4_BLOCK_PCB_S_WTX (3U << 4)
|
||||
#define ISO14443_4_BLOCK_PCB_S_DESELECT (0U << 4)
|
||||
#define ISO14443_4_BLOCK_PCB_S_WTX (3U << 4)
|
||||
#define ISO14443_4_BLOCK_PCB_BLOCK_NUMBER (1U << 0)
|
||||
|
||||
#define ISO14443_4_BLOCK_PCB_NAD (1U << 2)
|
||||
#define ISO14443_4_BLOCK_PCB_CID (1U << 3)
|
||||
#define ISO14443_4_BLOCK_PCB_NAD (1U << 2)
|
||||
#define ISO14443_4_BLOCK_PCB_CID (1U << 3)
|
||||
#define ISO14443_4_BLOCK_PCB_CHAINING (1U << 4)
|
||||
|
||||
struct Iso14443_4Layer {
|
||||
|
||||
@@ -213,4 +213,4 @@ Iso14443_4aData* emv_get_base_data(const EmvData* data) {
|
||||
furi_assert(data);
|
||||
|
||||
return data->iso14443_4a_data;
|
||||
}
|
||||
}
|
||||
|
||||
+29
-29
@@ -12,44 +12,44 @@ extern "C" {
|
||||
|
||||
#define UNKNOWN_TAG 0x0B
|
||||
|
||||
#define EMV_TAG_AID 0x4F
|
||||
#define EMV_TAG_PRIORITY 0x87
|
||||
#define EMV_TAG_AID 0x4F
|
||||
#define EMV_TAG_PRIORITY 0x87
|
||||
#define EMV_TAG_APPL_INTERCHANGE_PROFILE 0x82
|
||||
#define EMV_TAG_PDOL 0x9F38
|
||||
#define EMV_TAG_APPL_LABEL 0x50
|
||||
#define EMV_TAG_APPL_NAME 0x9F12
|
||||
#define EMV_TAG_APPL_EFFECTIVE 0x5F25
|
||||
#define EMV_TAG_PIN_TRY_COUNTER 0x9F17
|
||||
#define EMV_TAG_LOG_ENTRY 0x9F4D
|
||||
#define EMV_TAG_LOG_FMT 0x9F4F
|
||||
#define EMV_TAG_PDOL 0x9F38
|
||||
#define EMV_TAG_APPL_LABEL 0x50
|
||||
#define EMV_TAG_APPL_NAME 0x9F12
|
||||
#define EMV_TAG_APPL_EFFECTIVE 0x5F25
|
||||
#define EMV_TAG_PIN_TRY_COUNTER 0x9F17
|
||||
#define EMV_TAG_LOG_ENTRY 0x9F4D
|
||||
#define EMV_TAG_LOG_FMT 0x9F4F
|
||||
|
||||
#define EMV_TAG_LAST_ONLINE_ATC 0x9F13
|
||||
#define EMV_TAG_ATC 0x9F36
|
||||
#define EMV_TAG_LOG_AMOUNT 0x9F02
|
||||
#define EMV_TAG_LOG_COUNTRY 0x9F1A
|
||||
#define EMV_TAG_LOG_CURRENCY 0x5F2A
|
||||
#define EMV_TAG_LOG_DATE 0x9A
|
||||
#define EMV_TAG_LOG_TIME 0x9F21
|
||||
#define EMV_TAG_ATC 0x9F36
|
||||
#define EMV_TAG_LOG_AMOUNT 0x9F02
|
||||
#define EMV_TAG_LOG_COUNTRY 0x9F1A
|
||||
#define EMV_TAG_LOG_CURRENCY 0x5F2A
|
||||
#define EMV_TAG_LOG_DATE 0x9A
|
||||
#define EMV_TAG_LOG_TIME 0x9F21
|
||||
|
||||
#define EMV_TAG_TRACK_1_EQUIV 0x56
|
||||
#define EMV_TAG_TRACK_2_EQUIV 0x57
|
||||
#define EMV_TAG_PAN 0x5A
|
||||
#define EMV_TAG_AFL 0x94
|
||||
#define EMV_TAG_EXP_DATE 0x5F24
|
||||
#define EMV_TAG_COUNTRY_CODE 0x5F28
|
||||
#define EMV_TAG_CURRENCY_CODE 0x9F42
|
||||
#define EMV_TAG_CARDHOLDER_NAME 0x5F20
|
||||
#define EMV_TAG_TRACK_1_EQUIV 0x56
|
||||
#define EMV_TAG_TRACK_2_EQUIV 0x57
|
||||
#define EMV_TAG_PAN 0x5A
|
||||
#define EMV_TAG_AFL 0x94
|
||||
#define EMV_TAG_EXP_DATE 0x5F24
|
||||
#define EMV_TAG_COUNTRY_CODE 0x5F28
|
||||
#define EMV_TAG_CURRENCY_CODE 0x9F42
|
||||
#define EMV_TAG_CARDHOLDER_NAME 0x5F20
|
||||
#define EMV_TAG_CARDHOLDER_NAME_EXTENDED 0x9F0B
|
||||
#define EMV_TAG_TRACK_2_DATA 0x9F6B
|
||||
#define EMV_TAG_GPO_FMT1 0x80
|
||||
#define EMV_TAG_TRACK_2_DATA 0x9F6B
|
||||
#define EMV_TAG_GPO_FMT1 0x80
|
||||
|
||||
#define EMV_TAG_RESP_BUF_SIZE 0x6C
|
||||
#define EMV_TAG_RESP_BUF_SIZE 0x6C
|
||||
#define EMV_TAG_RESP_BYTES_AVAILABLE 0x61
|
||||
|
||||
// Not used tags
|
||||
#define EMV_TAG_FORM_FACTOR 0x9F6E
|
||||
#define EMV_TAG_APP_TEMPLATE 0x61
|
||||
#define EMV_TAG_FCI 0xBF0C
|
||||
#define EMV_TAG_FORM_FACTOR 0x9F6E
|
||||
#define EMV_TAG_APP_TEMPLATE 0x61
|
||||
#define EMV_TAG_FCI 0xBF0C
|
||||
#define EMV_TAG_DEPOSIT_LOG_ENTRY 0xDF4D
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -203,4 +203,4 @@ const NfcPollerBase emv_poller = {
|
||||
.run = (NfcPollerRun)emv_poller_run,
|
||||
.detect = (NfcPollerDetect)emv_poller_detect,
|
||||
.get_data = (NfcPollerGetData)emv_poller_get_data,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -56,4 +56,4 @@ EmvError emv_poller_get_last_online_atc(EmvPoller* instance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
#include <nfc/protocols/nfc_poller_base.h>
|
||||
|
||||
extern const NfcPollerBase emv_poller;
|
||||
extern const NfcPollerBase emv_poller;
|
||||
|
||||
@@ -9,10 +9,10 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
// Default btn ID
|
||||
#define SUBGHZ_CUSTOM_BTN_OK (0U)
|
||||
#define SUBGHZ_CUSTOM_BTN_UP (1U)
|
||||
#define SUBGHZ_CUSTOM_BTN_DOWN (2U)
|
||||
#define SUBGHZ_CUSTOM_BTN_LEFT (3U)
|
||||
#define SUBGHZ_CUSTOM_BTN_OK (0U)
|
||||
#define SUBGHZ_CUSTOM_BTN_UP (1U)
|
||||
#define SUBGHZ_CUSTOM_BTN_DOWN (2U)
|
||||
#define SUBGHZ_CUSTOM_BTN_LEFT (3U)
|
||||
#define SUBGHZ_CUSTOM_BTN_RIGHT (4U)
|
||||
|
||||
bool subghz_custom_btn_set(uint8_t btn_id);
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#include "custom_btn.h"
|
||||
|
||||
#define PROG_MODE_OFF (0U)
|
||||
#define PROG_MODE_KEELOQ_BFT (1U)
|
||||
#define PROG_MODE_OFF (0U)
|
||||
#define PROG_MODE_KEELOQ_BFT (1U)
|
||||
#define PROG_MODE_KEELOQ_APRIMATIC (2U)
|
||||
#define PROG_MODE_KEELOQ_DEA_MIO (3U)
|
||||
#define PROG_MODE_KEELOQ_DEA_MIO (3U)
|
||||
|
||||
typedef uint8_t ProgMode;
|
||||
|
||||
|
||||
@@ -12,4 +12,4 @@
|
||||
SubGhzProtocolStatus subghz_block_generic_serialize_common(
|
||||
const char* protocol_name,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzRadioPreset* preset);
|
||||
SubGhzRadioPreset* preset);
|
||||
|
||||
@@ -479,4 +479,4 @@ const uint8_t subghz_device_cc1101_preset_gfsk_9_99kb_async_regs[] = {
|
||||
// 0x00,
|
||||
// 0x00,
|
||||
// 0x00,
|
||||
// 0x00};
|
||||
// 0x00};
|
||||
|
||||
@@ -85,4 +85,4 @@ bool ws_protocol_encoder_acurite_592txr_get_upload(WSProtocolEncoderAcurite_592T
|
||||
SubGhzProtocolStatus
|
||||
ws_protocol_encoder_acurite_592txr_deserialize(void* context, FlipperFormat* flipper_format);
|
||||
LevelDuration ws_protocol_encoder_acurite_592txr_yield(void* context);
|
||||
void ws_protocol_encoder_acurite_592txr_stop(void* context);
|
||||
void ws_protocol_encoder_acurite_592txr_stop(void* context);
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
* and on decoding also 0xffd45
|
||||
*/
|
||||
|
||||
#define AMBIENT_WEATHER_PACKET_HEADER_1 0xFFD440000000000 //0xffd45 .. 0xffd46
|
||||
#define AMBIENT_WEATHER_PACKET_HEADER_2 0x001440000000000 //0x00145 .. 0x00146
|
||||
#define AMBIENT_WEATHER_PACKET_HEADER_1 0xFFD440000000000 //0xffd45 .. 0xffd46
|
||||
#define AMBIENT_WEATHER_PACKET_HEADER_2 0x001440000000000 //0x00145 .. 0x00146
|
||||
#define AMBIENT_WEATHER_PACKET_HEADER_MASK 0xFFFFC0000000000
|
||||
|
||||
static const SubGhzBlockConst ws_protocol_ambient_weather_const = {
|
||||
|
||||
@@ -35,12 +35,12 @@
|
||||
* - Temperature and Humidity are sent in different messages bursts.
|
||||
*/
|
||||
|
||||
#define LACROSSE_TX_GAP 1000
|
||||
#define LACROSSE_TX_BIT_SIZE 44
|
||||
#define LACROSSE_TX_SUNC_PATTERN 0x0A000000000
|
||||
#define LACROSSE_TX_SUNC_MASK 0x0F000000000
|
||||
#define LACROSSE_TX_GAP 1000
|
||||
#define LACROSSE_TX_BIT_SIZE 44
|
||||
#define LACROSSE_TX_SUNC_PATTERN 0x0A000000000
|
||||
#define LACROSSE_TX_SUNC_MASK 0x0F000000000
|
||||
#define LACROSSE_TX_MSG_TYPE_TEMP 0x00
|
||||
#define LACROSSE_TX_MSG_TYPE_HUM 0x0E
|
||||
#define LACROSSE_TX_MSG_TYPE_HUM 0x0E
|
||||
|
||||
static const SubGhzBlockConst ws_protocol_lacrosse_tx_const = {
|
||||
.te_short = 550,
|
||||
|
||||
@@ -20,7 +20,7 @@ static const SubGhzBlockConst ws_oregon2_const = {
|
||||
|
||||
#define OREGON2_PREAMBLE_BITS 19
|
||||
#define OREGON2_PREAMBLE_MASK 0b1111111111111111111
|
||||
#define OREGON2_SENSOR_ID(d) (((d) >> 16) & 0xFFFF)
|
||||
#define OREGON2_SENSOR_ID(d) (((d) >> 16) & 0xFFFF)
|
||||
#define OREGON2_CHECKSUM_BITS 8
|
||||
|
||||
// 15 ones + 0101 (inverted A)
|
||||
@@ -32,34 +32,34 @@ static const SubGhzBlockConst ws_oregon2_const = {
|
||||
/// Documentation for Oregon Scientific protocols can be found here:
|
||||
/// http://wmrx00.sourceforge.net/Arduino/OregonScientific-RF-Protocols.pdf
|
||||
// Sensors ID
|
||||
#define ID_THGR122N 0x1d20
|
||||
#define ID_THGR968 0x1d30
|
||||
#define ID_BTHR918 0x5d50
|
||||
#define ID_BHTR968 0x5d60
|
||||
#define ID_RGR968 0x2d10
|
||||
#define ID_THR228N 0xec40
|
||||
#define ID_THN132N 0xec40 // same as THR228N but different packet size
|
||||
#define ID_RTGN318 0x0cc3 // warning: id is from 0x0cc3 and 0xfcc3
|
||||
#define ID_RTGN129 0x0cc3 // same as RTGN318 but different packet size
|
||||
#define ID_THGR810 0xf824 // This might be ID_THGR81, but what's true is lost in (git) history
|
||||
#define ID_THGR810a 0xf8b4 // unconfirmed version
|
||||
#define ID_THN802 0xc844
|
||||
#define ID_PCR800 0x2914
|
||||
#define ID_PCR800a 0x2d14 // Different PCR800 ID - AU version I think
|
||||
#define ID_WGR800 0x1984
|
||||
#define ID_WGR800a 0x1994 // unconfirmed version
|
||||
#define ID_WGR968 0x3d00
|
||||
#define ID_UV800 0xd874
|
||||
#define ID_THN129 0xcc43 // THN129 Temp only
|
||||
#define ID_RTHN129 0x0cd3 // RTHN129 Temp, clock sensors
|
||||
#define ID_RTHN129_1 0x9cd3
|
||||
#define ID_RTHN129_2 0xacd3
|
||||
#define ID_RTHN129_3 0xbcd3
|
||||
#define ID_RTHN129_4 0xccd3
|
||||
#define ID_RTHN129_5 0xdcd3
|
||||
#define ID_BTHGN129 0x5d53 // Baro, Temp, Hygro sensor
|
||||
#define ID_UVR128 0xec70
|
||||
#define ID_THGR328N 0xcc23 // Temp & Hygro sensor similar to THR228N with 5 channel instead of 3
|
||||
#define ID_THGR122N 0x1d20
|
||||
#define ID_THGR968 0x1d30
|
||||
#define ID_BTHR918 0x5d50
|
||||
#define ID_BHTR968 0x5d60
|
||||
#define ID_RGR968 0x2d10
|
||||
#define ID_THR228N 0xec40
|
||||
#define ID_THN132N 0xec40 // same as THR228N but different packet size
|
||||
#define ID_RTGN318 0x0cc3 // warning: id is from 0x0cc3 and 0xfcc3
|
||||
#define ID_RTGN129 0x0cc3 // same as RTGN318 but different packet size
|
||||
#define ID_THGR810 0xf824 // This might be ID_THGR81, but what's true is lost in (git) history
|
||||
#define ID_THGR810a 0xf8b4 // unconfirmed version
|
||||
#define ID_THN802 0xc844
|
||||
#define ID_PCR800 0x2914
|
||||
#define ID_PCR800a 0x2d14 // Different PCR800 ID - AU version I think
|
||||
#define ID_WGR800 0x1984
|
||||
#define ID_WGR800a 0x1994 // unconfirmed version
|
||||
#define ID_WGR968 0x3d00
|
||||
#define ID_UV800 0xd874
|
||||
#define ID_THN129 0xcc43 // THN129 Temp only
|
||||
#define ID_RTHN129 0x0cd3 // RTHN129 Temp, clock sensors
|
||||
#define ID_RTHN129_1 0x9cd3
|
||||
#define ID_RTHN129_2 0xacd3
|
||||
#define ID_RTHN129_3 0xbcd3
|
||||
#define ID_RTHN129_4 0xccd3
|
||||
#define ID_RTHN129_5 0xdcd3
|
||||
#define ID_BTHGN129 0x5d53 // Baro, Temp, Hygro sensor
|
||||
#define ID_UVR128 0xec70
|
||||
#define ID_THGR328N 0xcc23 // Temp & Hygro sensor similar to THR228N with 5 channel instead of 3
|
||||
#define ID_RTGR328N_1 0xdcc3 // RTGR328N_[1-5] RFclock(date &time)&Temp&Hygro sensor
|
||||
#define ID_RTGR328N_2 0xccc3
|
||||
#define ID_RTGR328N_3 0xbcc3
|
||||
|
||||
@@ -21,7 +21,7 @@ static const SubGhzBlockConst ws_oregon3_const = {
|
||||
#define OREGON3_PREAMBLE_BITS 28
|
||||
#define OREGON3_PREAMBLE_MASK 0b1111111111111111111111111111
|
||||
// 24 ones + 0101 (inverted A)
|
||||
#define OREGON3_PREAMBLE 0b1111111111111111111111110101
|
||||
#define OREGON3_PREAMBLE 0b1111111111111111111111110101
|
||||
|
||||
// Fixed part contains:
|
||||
// - Sensor type: 16 bits
|
||||
@@ -29,8 +29,8 @@ static const SubGhzBlockConst ws_oregon3_const = {
|
||||
// - ID (changes when batteries are changed): 8 bits
|
||||
// - Battery status: 4 bits
|
||||
#define OREGON3_FIXED_PART_BITS (16 + 4 + 8 + 4)
|
||||
#define OREGON3_SENSOR_ID(d) (((d) >> 16) & 0xFFFF)
|
||||
#define OREGON3_CHECKSUM_BITS 8
|
||||
#define OREGON3_SENSOR_ID(d) (((d) >> 16) & 0xFFFF)
|
||||
#define OREGON3_CHECKSUM_BITS 8
|
||||
|
||||
// bit indicating the low battery
|
||||
#define OREGON3_FLAG_BAT_LOW 0x4
|
||||
|
||||
@@ -37,4 +37,4 @@ SubGhzProtocolStatus
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -22,15 +22,15 @@ static const SubGhzBlockConst pocsag2400_const = {
|
||||
};
|
||||
|
||||
// Minimal amount of sync bits (interleaving zeros and ones)
|
||||
#define POCSAG_MIN_SYNC_BITS 24
|
||||
#define POCSAG_CW_BITS 32
|
||||
#define POCSAG_CW_MASK 0xFFFFFFFF
|
||||
#define POCSAG_MIN_SYNC_BITS 24
|
||||
#define POCSAG_CW_BITS 32
|
||||
#define POCSAG_CW_MASK 0xFFFFFFFF
|
||||
#define POCSAG_FRAME_SYNC_CODE 0x7CD215D8
|
||||
#define POCSAG_IDLE_CODE_WORD 0x7A89C197
|
||||
#define POCSAG_IDLE_CODE_WORD 0x7A89C197
|
||||
|
||||
#define POCSAG_FUNC_NUM 0
|
||||
#define POCSAG_FUNC_ALERT1 1
|
||||
#define POCSAG_FUNC_ALERT2 2
|
||||
#define POCSAG_FUNC_NUM 0
|
||||
#define POCSAG_FUNC_ALERT1 1
|
||||
#define POCSAG_FUNC_ALERT2 2
|
||||
#define POCSAG_FUNC_ALPHANUM 3
|
||||
|
||||
static const char* func_msg[] = {"\e#Num:\e# ", "\e#Alert\e#", "\e#Alert:\e# ", "\e#Msg:\e# "};
|
||||
|
||||
@@ -40,7 +40,7 @@ Data layout:
|
||||
- C: 8 bit Checksum (CRC8, Poly 0x7, Init 0x0)
|
||||
*/
|
||||
|
||||
#define PREAMBLE 0b000
|
||||
#define PREAMBLE 0b000
|
||||
#define PREAMBLE_BITS_LEN 3
|
||||
|
||||
static const SubGhzBlockConst tpms_protocol_schrader_gg4_const = {
|
||||
|
||||
@@ -165,4 +165,4 @@ SubGhzProtocolStatus tpms_block_generic_deserialize_check_count_bit(
|
||||
}
|
||||
} while(false);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,4 +61,4 @@ SubGhzProtocolStatus tpms_block_generic_deserialize_check_count_bit(
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -234,4 +234,4 @@ void ws_block_generic_get_string(WSBlockGeneric* instance, FuriString* output) {
|
||||
if(instance->humidity != WS_NO_HUMIDITY) {
|
||||
furi_string_cat_printf(output, "Hum: %d%%", instance->humidity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define WS_NO_ID 0xFFFFFFFF
|
||||
#define WS_NO_BATT 0xFF
|
||||
#define WS_NO_HUMIDITY 0xFF
|
||||
#define WS_NO_CHANNEL 0xFF
|
||||
#define WS_NO_BTN 0xFF
|
||||
#define WS_NO_ID 0xFFFFFFFF
|
||||
#define WS_NO_BATT 0xFF
|
||||
#define WS_NO_HUMIDITY 0xFF
|
||||
#define WS_NO_CHANNEL 0xFF
|
||||
#define WS_NO_BTN 0xFF
|
||||
#define WS_NO_TEMPERATURE -273.0f
|
||||
|
||||
typedef struct WSBlockGeneric WSBlockGeneric;
|
||||
@@ -72,4 +72,4 @@ void ws_block_generic_get_string(WSBlockGeneric* instance, FuriString* output);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SUBGHZ_SETTING_FILE_TYPE "Flipper SubGhz Setting File"
|
||||
#define SUBGHZ_SETTING_FILE_TYPE "Flipper SubGhz Setting File"
|
||||
#define SUBGHZ_SETTING_FILE_VERSION 1
|
||||
|
||||
#define SUBGHZ_SETTING_DEFAULT_PRESET_COUNT 4
|
||||
|
||||
Reference in New Issue
Block a user