mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-21 04:11:48 +03:00
4ce41a3e6f
* SubGhz: changing the operation of the capture timer, and the logic of the work of parsers * Add toolbox lib. Move levels to toolbox. Subghz switch to levels. * Subghz: update worker signatures * SubGhz: pluggable level duration implementations. * SubGhz : test drawing pictures in Gui * SubGhz: Added a callback with the parser structure as argument * SubGhz: copy protocol data to model * SubGhz: refactoing code * SubGhz: cleanup and format sources * SubGhz: remove comments Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com> Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
57 lines
1.4 KiB
C
57 lines
1.4 KiB
C
#pragma once
|
|
|
|
#include <api-hal.h>
|
|
|
|
typedef struct SubGhzWorker SubGhzWorker;
|
|
|
|
typedef void (*SubGhzWorkerOverrunCallback)(void* context);
|
|
|
|
typedef void (*SubGhzWorkerPairCallback)(void* context, bool level, uint32_t duration);
|
|
|
|
void subghz_worker_rx_callback(bool level, uint32_t duration, void* context);
|
|
|
|
/** Allocate SubGhzWorker
|
|
*
|
|
* @return SubGhzWorker*
|
|
*/
|
|
SubGhzWorker* subghz_worker_alloc();
|
|
|
|
/** Free SubGhzWorker
|
|
*
|
|
* @param instance SubGhzWorker instance
|
|
*/
|
|
void subghz_worker_free(SubGhzWorker* instance);
|
|
|
|
/** Overrun callback SubGhzWorker
|
|
*
|
|
* @param instance SubGhzWorker instance
|
|
* @param callback SubGhzWorkerOverrunCallback callback
|
|
*/
|
|
void subghz_worker_set_overrun_callback(SubGhzWorker* instance, SubGhzWorkerOverrunCallback callback);
|
|
|
|
/** Pair callback SubGhzWorker
|
|
*
|
|
* @param instance SubGhzWorker instance
|
|
* @param callback SubGhzWorkerOverrunCallback callback
|
|
*/
|
|
void subghz_worker_set_pair_callback(SubGhzWorker* instance, SubGhzWorkerPairCallback callback);
|
|
|
|
/** Context callback SubGhzWorker
|
|
*
|
|
* @param instance SubGhzWorker instance
|
|
* @param context
|
|
*/
|
|
void subghz_worker_set_context(SubGhzWorker* instance, void* context);
|
|
|
|
/** Start SubGhzWorker
|
|
*
|
|
* @param instance SubGhzWorker instance
|
|
*/
|
|
void subghz_worker_start(SubGhzWorker* instance);
|
|
|
|
/** Stop SubGhzWorker
|
|
*
|
|
* @param instance SubGhzWorker instance
|
|
*/
|
|
void subghz_worker_stop(SubGhzWorker* instance);
|