unleashed-firmware/lib/subghz/blocks/encoder.h
Skorpionm 9a9abd59e9
[FL-2904, FL-2900, FL-2890] WS: add app WeatherStation (#1833)
* WeatherStation: start
* SubGhz: rename protocol magellen -> magellan
* WeatherStation: err Unresolved symbols: {'subghz_protocol_decoder_base_get_string'}
* WeatherStation: fix Unresolved symbols: {'subghz_protocol_decoder_base_get_string'}
* Subghz: add set protocol_items
* WeatherStation: adding your protocols
* WS: add Infactory protocol
* WS: add history
* WS: add setting
* WS: add lock
* WS: add hopper frequency
* WS: fix history
* WS fix string_t -> FuriString*
* WS: add images
* WS: history record update when receiving data from the sensor again
* WS: add receiver info, delete extra code
* WS: add protocol ThermoPRO_TX4
* [FL-2900] SubGhz: Move icons in Sub-GHz
* WS: add Notification
* [FL-2890] SubGhz: Rename *_user files in resources to _user.example
* WS: add about scene
* WS: removing redundant code
* WS: add  protocol Nexus-TH
* WS: add protocol GT_WT03
* WS: fix notification and rename "Weather Station" -> "Read Weather Station"
* SubGhz: partial unit tests fix
* SubGhz: fix unit_test
* SubGhz: remove dead code
* SubGhz: rename SubGhzPresetDefinition into SubGhzRadioPreset, cleanup subghz types.

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-20 02:27:26 +09:00

60 lines
1.5 KiB
C

#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include <lib/toolbox/level_duration.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
bool is_running;
size_t repeat;
size_t front;
size_t size_upload;
LevelDuration* upload;
} SubGhzProtocolBlockEncoder;
/**
* Set data bit when encoding HEX array.
* @param bit_value The value of the bit to be set
* @param data_array Pointer to a HEX array
* @param set_index_bit Number set a bit in the array starting from the left
* @param max_size_array array size, check not to overflow
*/
void subghz_protocol_blocks_set_bit_array(
bool bit_value,
uint8_t data_array[],
size_t set_index_bit,
size_t max_size_array);
/**
* Get data bit when encoding HEX array.
* @param data_array Pointer to a HEX array
* @param read_index_bit Number get a bit in the array starting from the left
* @return bool value bit
*/
bool subghz_protocol_blocks_get_bit_array(uint8_t data_array[], size_t read_index_bit);
/**
* Generating an upload from data.
* @param data_array Pointer to a HEX array
* @param count_bit_data_array How many bits in the array are processed
* @param upload Pointer to a LevelDuration
* @param max_size_upload upload size, check not to overflow
* @param duration_bit duration 1 bit
*/
size_t subghz_protocol_blocks_get_upload(
uint8_t data_array[],
size_t count_bit_data_array,
LevelDuration* upload,
size_t max_size_upload,
uint32_t duration_bit);
#ifdef __cplusplus
}
#endif