Loading...
Searching...
No Matches
cc1101_ext.h File Reference

External CC1101 transceiver access 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.

Typedefs

typedef void(* SubGhzDeviceCC1101ExtCaptureCallback) (bool level, uint32_t duration, void *context)
 Signal Timings Capture callback.
 
typedef LevelDuration(* SubGhzDeviceCC1101ExtCallback) (void *context)
 Async TX callback type.
 

Functions

void subghz_device_cc1101_ext_set_async_mirror_pin (const GpioPin *pin)
 
const GpioPinsubghz_device_cc1101_ext_get_data_gpio (void)
 Get data GPIO.
 
bool subghz_device_cc1101_ext_alloc (void)
 Initialize device.
 
void subghz_device_cc1101_ext_free (void)
 Deinitialize device.
 
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 reinitialize device to safe state and send it to sleep.
 
void subghz_device_cc1101_ext_sleep (void)
 Send device to sleep mode.
 
void subghz_device_cc1101_ext_dump_state (void)
 Dump info to stdout.
 
void subghz_device_cc1101_ext_load_custom_preset (const uint8_t *preset_data)
 Load custom registers from preset.
 
void subghz_device_cc1101_ext_load_registers (const uint8_t *data)
 Load registers.
 
void subghz_device_cc1101_ext_load_patable (const uint8_t data[8])
 Load PATABLE.
 
void subghz_device_cc1101_ext_write_packet (const uint8_t *data, uint8_t size)
 Write packet to FIFO.
 
bool subghz_device_cc1101_ext_rx_pipe_not_empty (void)
 Check if receive pipe is not empty.
 
bool subghz_device_cc1101_ext_is_rx_data_crc_valid (void)
 Check if received data crc is valid.
 
void subghz_device_cc1101_ext_read_packet (uint8_t *data, uint8_t *size)
 Read packet from FIFO.
 
void subghz_device_cc1101_ext_flush_rx (void)
 Flush rx FIFO buffer.
 
void subghz_device_cc1101_ext_flush_tx (void)
 Flush tx FIFO buffer.
 
void subghz_device_cc1101_ext_shutdown (void)
 Shutdown Issue SPWD command.
 
void subghz_device_cc1101_ext_reset (void)
 Reset Issue reset command.
 
void subghz_device_cc1101_ext_idle (void)
 Switch to Idle.
 
void subghz_device_cc1101_ext_rx (void)
 Switch to Receive.
 
bool subghz_device_cc1101_ext_tx (void)
 Switch to Transmit.
 
float subghz_device_cc1101_ext_get_rssi (void)
 Get RSSI value in dBm.
 
uint8_t subghz_device_cc1101_ext_get_lqi (void)
 Get LQI.
 
bool subghz_device_cc1101_ext_is_frequency_valid (uint32_t value)
 Check if frequency is in valid range.
 
uint32_t subghz_device_cc1101_ext_set_frequency (uint32_t value)
 Set frequency.
 
void subghz_device_cc1101_ext_start_async_rx (SubGhzDeviceCC1101ExtCaptureCallback callback, void *context)
 Enable signal timings capture Initializes GPIO and TIM2 for timings capture.
 
void subghz_device_cc1101_ext_stop_async_rx (void)
 Disable signal timings capture Resets GPIO and TIM2.
 
bool subghz_device_cc1101_ext_start_async_tx (SubGhzDeviceCC1101ExtCallback callback, void *context)
 Start async TX Initializes GPIO, TIM2 and DMA1 for signal output.
 
bool subghz_device_cc1101_ext_is_async_tx_complete (void)
 Wait for async transmission to complete.
 
void subghz_device_cc1101_ext_stop_async_tx (void)
 Stop async transmission and cleanup resources Resets GPIO, TIM2, and DMA1.
 

Detailed Description

External CC1101 transceiver access API.

Typedef Documentation

◆ SubGhzDeviceCC1101ExtCallback

typedef LevelDuration(* SubGhzDeviceCC1101ExtCallback) (void *context)

Async TX callback type.

Parameters
contextcallback context
Returns
LevelDuration

Function Documentation

◆ subghz_device_cc1101_ext_alloc()

bool subghz_device_cc1101_ext_alloc ( void )

Initialize device.

Returns
true if success

◆ subghz_device_cc1101_ext_get_data_gpio()

const GpioPin * subghz_device_cc1101_ext_get_data_gpio ( void )

Get data GPIO.

Returns
pointer to the gpio pin structure

◆ subghz_device_cc1101_ext_get_lqi()

uint8_t subghz_device_cc1101_ext_get_lqi ( void )

Get LQI.

Returns
LQI value

◆ subghz_device_cc1101_ext_get_rssi()

float subghz_device_cc1101_ext_get_rssi ( void )

Get RSSI value in dBm.

Returns
RSSI value

◆ subghz_device_cc1101_ext_is_async_tx_complete()

bool subghz_device_cc1101_ext_is_async_tx_complete ( void )

Wait for async transmission to complete.

Returns
true if TX complete

◆ subghz_device_cc1101_ext_is_frequency_valid()

bool subghz_device_cc1101_ext_is_frequency_valid ( uint32_t value)

Check if frequency is in valid range.

Parameters
valuefrequency in Hz
Returns
true if frequency is valid, otherwise false

◆ subghz_device_cc1101_ext_is_rx_data_crc_valid()

bool subghz_device_cc1101_ext_is_rx_data_crc_valid ( void )

Check if received data crc is valid.

Returns
true if valid

◆ subghz_device_cc1101_ext_load_custom_preset()

void subghz_device_cc1101_ext_load_custom_preset ( const uint8_t * preset_data)

Load custom registers from preset.

Parameters
preset_dataregisters to load

◆ subghz_device_cc1101_ext_load_patable()

void subghz_device_cc1101_ext_load_patable ( const uint8_t data[8])

Load PATABLE.

Parameters
data8 uint8_t values

◆ subghz_device_cc1101_ext_load_registers()

void subghz_device_cc1101_ext_load_registers ( const uint8_t * data)

Load registers.

Parameters
dataRegisters data

◆ subghz_device_cc1101_ext_read_packet()

void subghz_device_cc1101_ext_read_packet ( uint8_t * data,
uint8_t * size )

Read packet from FIFO.

Parameters
datapointer
sizesize

◆ subghz_device_cc1101_ext_reset()

void subghz_device_cc1101_ext_reset ( void )

Reset Issue reset command.

Warning
registers content will be lost

◆ subghz_device_cc1101_ext_rx_pipe_not_empty()

bool subghz_device_cc1101_ext_rx_pipe_not_empty ( void )

Check if receive pipe is not empty.

Returns
true if not empty

◆ subghz_device_cc1101_ext_set_frequency()

uint32_t subghz_device_cc1101_ext_set_frequency ( uint32_t value)

Set frequency.

Parameters
valuefrequency in Hz
Returns
real frequency in Hz

◆ subghz_device_cc1101_ext_shutdown()

void subghz_device_cc1101_ext_shutdown ( void )

Shutdown Issue SPWD command.

Warning
registers content will be lost

◆ subghz_device_cc1101_ext_start_async_rx()

void subghz_device_cc1101_ext_start_async_rx ( SubGhzDeviceCC1101ExtCaptureCallback callback,
void * context )

Enable signal timings capture Initializes GPIO and TIM2 for timings capture.

Parameters
callbackSubGhzDeviceCC1101ExtCaptureCallback
contextcallback context

◆ subghz_device_cc1101_ext_start_async_tx()

bool subghz_device_cc1101_ext_start_async_tx ( SubGhzDeviceCC1101ExtCallback callback,
void * context )

Start async TX Initializes GPIO, TIM2 and DMA1 for signal output.

Parameters
callbackSubGhzDeviceCC1101ExtCallback
contextcallback context
Returns
true if the transfer is allowed by belonging to the region

◆ subghz_device_cc1101_ext_tx()

bool subghz_device_cc1101_ext_tx ( void )

Switch to Transmit.

Returns
true if the transfer is allowed by belonging to the region

◆ subghz_device_cc1101_ext_write_packet()

void subghz_device_cc1101_ext_write_packet ( const uint8_t * data,
uint8_t size )

Write packet to FIFO.

Parameters
databytes array
sizesize