unleashed-firmware/lib/subghz/subghz_tx_rx_worker.h
Skorpionm 8c93695d01
[FL-3375] SubGhz: add CC1101 module external ()
* SubGhz: add CC1101 Ext driver
* SubGhz:  move TIM2 -> TIM17 use cc1101_ext
* FuriHal: SPI move channel DMA 3,4 -> 6.7
* Documentation: fix font
* SubGhz: add work with SubGhz devices by link to device
* SubGhz: add support switching external/internal cc1101 "subghz chat"
* SubGhz: add support switching external/internal cc1101 "subghz tx" and "subghz rx"
* SubGhz: add "Radio Settings" scene
* SubGhz: add icon
* SubGhz: add supported CC1101 external module in SubGhz app
* SubGhz: fix check frequency supported radio device
* SubGhz: fix clang-formatted
* Sughz: move dirver CC1101_Ext to lib , compile cmd ./fbt launch_app APPSRC=radio_device_cc1101_ext
* SubGhz: fix CLI
* SubGhz: fix PVS
* SubGhz: delete comments
* SubGhz: fix unit_test
* Format sources
* Update api symbols and drivers targets
* Drivers: find proper place for target option
* SubGhz: external device connected method naming
* Format sources
* SubGhz:  fix module selection menu, when external is not connected
* SubGhz: fix furi_assert(device);
* SubGhz: fix split h and c
* SubGhz: furi_hal_subghz remove preset load function by name
* SubGhz: deleted comments
* Format Sources
* SubGhz: add some consts and fix unit tests
* Sync API Symbols

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-06-30 23:03:36 +09:00

95 lines
2.5 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <furi_hal.h>
#include <devices/devices.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*SubGhzTxRxWorkerCallbackHaveRead)(void* context);
typedef struct SubGhzTxRxWorker SubGhzTxRxWorker;
typedef enum {
SubGhzTxRxWorkerStatusIDLE,
SubGhzTxRxWorkerStatusTx,
SubGhzTxRxWorkerStatusRx,
} SubGhzTxRxWorkerStatus;
/**
* SubGhzTxRxWorker, add data to transfer
* @param instance Pointer to a SubGhzTxRxWorker instance
* @param data *data
* @param size data size
* @return bool true if ok
*/
bool subghz_tx_rx_worker_write(SubGhzTxRxWorker* instance, uint8_t* data, size_t size);
/**
* SubGhzTxRxWorker, get available data
* @param instance Pointer to a SubGhzTxRxWorker instance
* @return size_t data size
*/
size_t subghz_tx_rx_worker_available(SubGhzTxRxWorker* instance);
/**
* SubGhzTxRxWorker, read data
* @param instance Pointer to a SubGhzTxRxWorker instance
* @param data *data
* @param size max data size, which can be read
* @return size_t data size, how much is actually read
*/
size_t subghz_tx_rx_worker_read(SubGhzTxRxWorker* instance, uint8_t* data, size_t size);
/**
* Сallback SubGhzTxRxWorker when there is data to read in an empty buffer
* @param instance Pointer to a SubGhzTxRxWorker instance
* @param callback SubGhzTxRxWorkerCallbackHaveRead callback
* @param context
*/
void subghz_tx_rx_worker_set_callback_have_read(
SubGhzTxRxWorker* instance,
SubGhzTxRxWorkerCallbackHaveRead callback,
void* context);
/**
* Allocate SubGhzTxRxWorker
* @return SubGhzTxRxWorker* Pointer to a SubGhzTxRxWorker instance
*/
SubGhzTxRxWorker* subghz_tx_rx_worker_alloc();
/**
* Free SubGhzTxRxWorker
* @param instance Pointer to a SubGhzTxRxWorker instance
*/
void subghz_tx_rx_worker_free(SubGhzTxRxWorker* instance);
/**
* Start SubGhzTxRxWorker
* @param instance Pointer to a SubGhzTxRxWorker instance
* @param device Pointer to a SubGhzDevice instance
* @return bool - true if ok
*/
bool subghz_tx_rx_worker_start(
SubGhzTxRxWorker* instance,
const SubGhzDevice* device,
uint32_t frequency);
/**
* Stop SubGhzTxRxWorker
* @param instance Pointer to a SubGhzTxRxWorker instance
*/
void subghz_tx_rx_worker_stop(SubGhzTxRxWorker* instance);
/**
* Check if worker is running
* @param instance Pointer to a SubGhzTxRxWorker instance
* @return bool - true if running
*/
bool subghz_tx_rx_worker_is_running(SubGhzTxRxWorker* instance);
#ifdef __cplusplus
}
#endif