Loading...
Searching...
No Matches
cc1101_ext.h
Go to the documentation of this file.
1
6#pragma once
7#include <lib/subghz/devices/preset.h>
8#include <stdbool.h>
9#include <stdint.h>
10#include <stddef.h>
11#include <toolbox/level_duration.h>
12#include <furi_hal_gpio.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/* Mirror RX/TX async modulation signal to specified pin
19 *
20 * @warning Configures pin to output mode. Make sure it is not connected
21 * directly to power or ground.
22 *
23 * @param[in] pin pointer to the gpio pin structure or NULL to disable
24 */
25void subghz_device_cc1101_ext_set_async_mirror_pin(const GpioPin* pin);
26
32
38
42
48
52
56
61void subghz_device_cc1101_ext_load_custom_preset(const uint8_t* preset_data);
62
67void subghz_device_cc1101_ext_load_registers(const uint8_t* data);
68
73void subghz_device_cc1101_ext_load_patable(const uint8_t data[8]);
74
80void subghz_device_cc1101_ext_write_packet(const uint8_t* data, uint8_t size);
81
87
93
99void subghz_device_cc1101_ext_read_packet(uint8_t* data, uint8_t* size);
100
104
108
113
118
122
126
132
138
144
152
159uint32_t subghz_device_cc1101_ext_set_frequency(uint32_t value);
160
161/* High Level API */
162
164typedef void (*SubGhzDeviceCC1101ExtCaptureCallback)(bool level, uint32_t duration, void* context);
165
173 void* context);
174
178
184
193
199
203
204#ifdef __cplusplus
205}
206#endif
void subghz_device_cc1101_ext_stop_async_tx(void)
Stop async transmission and cleanup resources Resets GPIO, TIM2, and DMA1.
Definition cc1101_ext.c:833
void subghz_device_cc1101_ext_load_registers(const uint8_t *data)
Load registers.
Definition cc1101_ext.c:310
void(* SubGhzDeviceCC1101ExtCaptureCallback)(bool level, uint32_t duration, void *context)
Signal Timings Capture callback.
Definition cc1101_ext.h:164
void subghz_device_cc1101_ext_shutdown(void)
Shutdown Issue SPWD command.
Definition cc1101_ext.c:381
bool subghz_device_cc1101_ext_start_async_tx(SubGhzDeviceCC1101ExtCallback callback, void *context)
Start async TX Initializes GPIO, TIM2 and DMA1 for signal output.
Definition cc1101_ext.c:721
bool subghz_device_cc1101_ext_rx_pipe_not_empty(void)
Check if receive pipe is not empty.
Definition cc1101_ext.c:347
void subghz_device_cc1101_ext_flush_rx(void)
Flush rx FIFO buffer.
Definition cc1101_ext.c:335
void subghz_device_cc1101_ext_load_patable(const uint8_t data[8])
Load PATABLE.
Definition cc1101_ext.c:321
void subghz_device_cc1101_ext_free(void)
Deinitialize device.
Definition cc1101_ext.c:224
uint8_t subghz_device_cc1101_ext_get_lqi(void)
Get LQI.
Definition cc1101_ext.c:455
void subghz_device_cc1101_ext_load_custom_preset(const uint8_t *preset_data)
Load custom registers from preset.
Definition cc1101_ext.c:279
void subghz_device_cc1101_ext_read_packet(uint8_t *data, uint8_t *size)
Read packet from FIFO.
Definition cc1101_ext.c:375
LevelDuration(* SubGhzDeviceCC1101ExtCallback)(void *context)
Async TX callback type.
Definition cc1101_ext.h:183
bool subghz_device_cc1101_ext_is_rx_data_crc_valid(void)
Check if received data crc is valid.
Definition cc1101_ext.c:362
void subghz_device_cc1101_ext_flush_tx(void)
Flush tx FIFO buffer.
Definition cc1101_ext.c:341
const GpioPin * subghz_device_cc1101_ext_get_data_gpio(void)
Get data GPIO.
Definition cc1101_ext.c:235
uint32_t subghz_device_cc1101_ext_set_frequency(uint32_t value)
Set frequency.
Definition cc1101_ext.c:474
void subghz_device_cc1101_ext_dump_state(void)
Dump info to stdout.
Definition cc1101_ext.c:270
bool subghz_device_cc1101_ext_is_frequency_valid(uint32_t value)
Check if frequency is in valid range.
Definition cc1101_ext.c:464
bool subghz_device_cc1101_ext_alloc(void)
Initialize device.
Definition cc1101_ext.c:209
void subghz_device_cc1101_ext_rx(void)
Switch to Receive.
Definition cc1101_ext.c:414
void subghz_device_cc1101_ext_idle(void)
Switch to Idle.
Definition cc1101_ext.c:402
void subghz_device_cc1101_ext_reset(void)
Reset Issue reset command.
Definition cc1101_ext.c:388
void subghz_device_cc1101_ext_sleep(void)
Send device to sleep mode.
Definition cc1101_ext.c:255
float subghz_device_cc1101_ext_get_rssi(void)
Get RSSI value in dBm.
Definition cc1101_ext.c:440
void subghz_device_cc1101_ext_stop_async_rx(void)
Disable signal timings capture Resets GPIO and TIM2.
Definition cc1101_ext.c:590
bool subghz_device_cc1101_ext_is_connect(void)
Check and switch to power save mode Used by internal API-HAL initialization routine Can be used to re...
Definition cc1101_ext.c:239
bool subghz_device_cc1101_ext_tx(void)
Switch to Transmit.
Definition cc1101_ext.c:427
void subghz_device_cc1101_ext_start_async_rx(SubGhzDeviceCC1101ExtCaptureCallback callback, void *context)
Enable signal timings capture Initializes GPIO and TIM2 for timings capture.
Definition cc1101_ext.c:544
void subghz_device_cc1101_ext_write_packet(const uint8_t *data, uint8_t size)
Write packet to FIFO.
Definition cc1101_ext.c:327
bool subghz_device_cc1101_ext_is_async_tx_complete(void)
Wait for async transmission to complete.
Definition cc1101_ext.c:828
Gpio structure.
Definition furi_hal_gpio.h:161
Definition level_duration.h:15