SubGhz HAL API. More...
#include <lib/subghz/devices/preset.h>
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include <toolbox/level_duration.h>
#include <furi_hal_gpio.h>
Go to the source code of this file.
Macros | |
#define | FURI_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL (256u) |
Various subghz defines. | |
#define | FURI_HAL_SUBGHZ_ASYNC_TX_BUFFER_HALF (FURI_HAL_SUBGHZ_ASYNC_TX_BUFFER_FULL / 2) |
#define | FURI_HAL_SUBGHZ_ASYNC_TX_GUARD_TIME (999u) |
Typedefs | |
typedef void(* | FuriHalSubGhzCaptureCallback) (bool level, uint32_t duration, void *context) |
Signal Timings Capture callback. | |
typedef LevelDuration(* | FuriHalSubGhzAsyncTxCallback) (void *context) |
Async TX callback type. | |
Enumerations | |
enum | FuriHalSubGhzPath { FuriHalSubGhzPathIsolate , FuriHalSubGhzPath433 , FuriHalSubGhzPath315 , FuriHalSubGhzPath868 } |
Switchable Radio Paths. More... | |
Functions | |
void | furi_hal_subghz_set_async_mirror_pin (const GpioPin *pin) |
const GpioPin * | furi_hal_subghz_get_data_gpio (void) |
Get data GPIO. | |
void | furi_hal_subghz_init (void) |
Initialize and switch to power save mode Used by internal API-HAL initialization routine Can be used to reinitialize device to safe state and send it to sleep. | |
void | furi_hal_subghz_sleep (void) |
Send device to sleep mode. | |
void | furi_hal_subghz_dump_state (void) |
Dump info to stdout. | |
void | furi_hal_subghz_load_custom_preset (const uint8_t *preset_data) |
Load custom registers from preset. | |
void | furi_hal_subghz_load_registers (const uint8_t *data) |
Load registers. | |
void | furi_hal_subghz_load_patable (const uint8_t data[8]) |
Load PATABLE. | |
void | furi_hal_subghz_write_packet (const uint8_t *data, uint8_t size) |
Write packet to FIFO. | |
bool | furi_hal_subghz_rx_pipe_not_empty (void) |
Check if receive pipe is not empty. | |
bool | furi_hal_subghz_is_rx_data_crc_valid (void) |
Check if received data crc is valid. | |
void | furi_hal_subghz_read_packet (uint8_t *data, uint8_t *size) |
Read packet from FIFO. | |
void | furi_hal_subghz_flush_rx (void) |
Flush rx FIFO buffer. | |
void | furi_hal_subghz_flush_tx (void) |
Flush tx FIFO buffer. | |
void | furi_hal_subghz_shutdown (void) |
Shutdown Issue SPWD command. | |
void | furi_hal_subghz_reset (void) |
Reset Issue reset command. | |
void | furi_hal_subghz_idle (void) |
Switch to Idle. | |
void | furi_hal_subghz_rx (void) |
Switch to Receive. | |
bool | furi_hal_subghz_tx (void) |
Switch to Transmit. | |
float | furi_hal_subghz_get_rssi (void) |
Get RSSI value in dBm. | |
uint8_t | furi_hal_subghz_get_lqi (void) |
Get LQI. | |
bool | furi_hal_subghz_is_frequency_valid (uint32_t value) |
Check if frequency is in valid range. | |
uint32_t | furi_hal_subghz_set_frequency_and_path (uint32_t value) |
Set frequency and path This function automatically selects antenna matching network. | |
uint32_t | furi_hal_subghz_set_frequency (uint32_t value) |
Set frequency. | |
void | furi_hal_subghz_set_path (FuriHalSubGhzPath path) |
Set path. | |
void | furi_hal_subghz_start_async_rx (FuriHalSubGhzCaptureCallback callback, void *context) |
Enable signal timings capture Initializes GPIO and TIM2 for timings capture. | |
void | furi_hal_subghz_stop_async_rx (void) |
Disable signal timings capture Resets GPIO and TIM2. | |
bool | furi_hal_subghz_start_async_tx (FuriHalSubGhzAsyncTxCallback callback, void *context) |
Start async TX Initializes GPIO, TIM2 and DMA1 for signal output. | |
bool | furi_hal_subghz_is_async_tx_complete (void) |
Wait for async transmission to complete. | |
void | furi_hal_subghz_stop_async_tx (void) |
Stop async transmission and cleanup resources Resets GPIO, TIM2, and DMA1. | |
SubGhz HAL API.
typedef LevelDuration(* FuriHalSubGhzAsyncTxCallback) (void *context) |
Async TX callback type.
context | callback context |
enum FuriHalSubGhzPath |
Switchable Radio Paths.
const GpioPin * furi_hal_subghz_get_data_gpio | ( | void | ) |
Get data GPIO.
uint8_t furi_hal_subghz_get_lqi | ( | void | ) |
Get LQI.
float furi_hal_subghz_get_rssi | ( | void | ) |
Get RSSI value in dBm.
bool furi_hal_subghz_is_async_tx_complete | ( | void | ) |
Wait for async transmission to complete.
bool furi_hal_subghz_is_frequency_valid | ( | uint32_t | value | ) |
Check if frequency is in valid range.
value | frequency in Hz |
bool furi_hal_subghz_is_rx_data_crc_valid | ( | void | ) |
Check if received data crc is valid.
void furi_hal_subghz_load_custom_preset | ( | const uint8_t * | preset_data | ) |
Load custom registers from preset.
preset_data | registers to load |
void furi_hal_subghz_load_patable | ( | const uint8_t | data[8] | ) |
Load PATABLE.
data | 8 uint8_t values |
void furi_hal_subghz_load_registers | ( | const uint8_t * | data | ) |
Load registers.
data | Registers data |
void furi_hal_subghz_read_packet | ( | uint8_t * | data, |
uint8_t * | size ) |
Read packet from FIFO.
data | pointer |
size | size |
void furi_hal_subghz_reset | ( | void | ) |
Reset Issue reset command.
bool furi_hal_subghz_rx_pipe_not_empty | ( | void | ) |
Check if receive pipe is not empty.
uint32_t furi_hal_subghz_set_frequency | ( | uint32_t | value | ) |
Set frequency.
value | frequency in Hz |
uint32_t furi_hal_subghz_set_frequency_and_path | ( | uint32_t | value | ) |
Set frequency and path This function automatically selects antenna matching network.
value | frequency in Hz |
void furi_hal_subghz_set_path | ( | FuriHalSubGhzPath | path | ) |
Set path.
path | path to use |
void furi_hal_subghz_shutdown | ( | void | ) |
Shutdown Issue SPWD command.
void furi_hal_subghz_start_async_rx | ( | FuriHalSubGhzCaptureCallback | callback, |
void * | context ) |
Enable signal timings capture Initializes GPIO and TIM2 for timings capture.
callback | FuriHalSubGhzCaptureCallback |
context | callback context |
bool furi_hal_subghz_start_async_tx | ( | FuriHalSubGhzAsyncTxCallback | callback, |
void * | context ) |
Start async TX Initializes GPIO, TIM2 and DMA1 for signal output.
callback | FuriHalSubGhzAsyncTxCallback |
context | callback context |
bool furi_hal_subghz_tx | ( | void | ) |
Switch to Transmit.
void furi_hal_subghz_write_packet | ( | const uint8_t * | data, |
uint8_t | size ) |
Write packet to FIFO.
data | bytes array |
size | size |