2021-06-30 00:19:20 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <api-hal.h>
|
|
|
|
|
|
|
|
typedef struct SubGhzWorker SubGhzWorker;
|
|
|
|
|
|
|
|
typedef void (*SubGhzWorkerOverrunCallback)(void* context);
|
|
|
|
|
2021-07-07 22:49:45 +03:00
|
|
|
typedef void (*SubGhzWorkerPairCallback)(void* context, bool level, uint32_t duration);
|
2021-06-30 00:19:20 +03:00
|
|
|
|
2021-07-07 22:49:45 +03:00
|
|
|
void subghz_worker_rx_callback(bool level, uint32_t duration, void* context);
|
2021-06-30 00:19:20 +03:00
|
|
|
|
2021-07-02 16:25:49 +03:00
|
|
|
/** Allocate SubGhzWorker
|
|
|
|
*
|
|
|
|
* @return SubGhzWorker*
|
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
SubGhzWorker* subghz_worker_alloc();
|
|
|
|
|
2021-07-02 16:25:49 +03:00
|
|
|
/** Free SubGhzWorker
|
|
|
|
*
|
|
|
|
* @param instance SubGhzWorker instance
|
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
void subghz_worker_free(SubGhzWorker* instance);
|
|
|
|
|
2021-07-02 16:25:49 +03:00
|
|
|
/** Overrun callback SubGhzWorker
|
|
|
|
*
|
|
|
|
* @param instance SubGhzWorker instance
|
|
|
|
* @param callback SubGhzWorkerOverrunCallback callback
|
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
void subghz_worker_set_overrun_callback(SubGhzWorker* instance, SubGhzWorkerOverrunCallback callback);
|
|
|
|
|
2021-07-02 16:25:49 +03:00
|
|
|
/** Pair callback SubGhzWorker
|
|
|
|
*
|
|
|
|
* @param instance SubGhzWorker instance
|
|
|
|
* @param callback SubGhzWorkerOverrunCallback callback
|
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
void subghz_worker_set_pair_callback(SubGhzWorker* instance, SubGhzWorkerPairCallback callback);
|
|
|
|
|
2021-07-02 16:25:49 +03:00
|
|
|
/** Context callback SubGhzWorker
|
|
|
|
*
|
|
|
|
* @param instance SubGhzWorker instance
|
|
|
|
* @param context
|
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
void subghz_worker_set_context(SubGhzWorker* instance, void* context);
|
|
|
|
|
2021-07-02 16:25:49 +03:00
|
|
|
/** Start SubGhzWorker
|
|
|
|
*
|
|
|
|
* @param instance SubGhzWorker instance
|
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
void subghz_worker_start(SubGhzWorker* instance);
|
|
|
|
|
2021-07-02 16:25:49 +03:00
|
|
|
/** Stop SubGhzWorker
|
|
|
|
*
|
|
|
|
* @param instance SubGhzWorker instance
|
|
|
|
*/
|
2021-06-30 00:19:20 +03:00
|
|
|
void subghz_worker_stop(SubGhzWorker* instance);
|