unleashed-firmware/lib/subghz/subghz_worker.h
あく 389ff92cc1
Naming and coding style convention, new linter tool. (#945)
* Makefile, Scripts: new linter
* About: remove ID from IC
* Firmware: remove double define for DIVC/DIVR
* Scripts: check folder names too. Docker: replace syntax check with make lint.
* Reformat Sources and Migrate to new file naming convention
* Docker: symlink clang-format-12 to clang-format
* Add coding style guide
2022-01-05 19:10:18 +03:00

64 lines
1.6 KiB
C

#pragma once
#include <furi_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);
/** Check if worker is running
* @param instance SubGhzWorker instance
* @return bool - true if running
*/
bool subghz_worker_is_running(SubGhzWorker* instance);