26#include "sx126x_driver.h"
47 SX126X_RF_MODE_TX_LPA,
48 SX126X_RF_MODE_TX_HPA,
55#define SX126X_SINGLE (( \
56 IS_USED(MODULE_SX1261) \
57 + IS_USED(MODULE_SX1262) \
58 + IS_USED(MODULE_SX1268) \
59 + IS_USED(MODULE_LLCC68) \
60 + IS_USED(MODULE_SX126X_STM32WL) \
66#if (IS_USED(MODULE_SX1261) || IS_USED(MODULE_SX1262) || \
67 IS_USED(MODULE_SX1268) || IS_USED(MODULE_LLCC68))
93#if IS_USED(MODULE_SX126X_RF_SWITCH)
POSIX.1-2008 compliant version of the assert macro.
#define assert(cond)
abort the program if assertion is false
Definitions low-level network driver interface.
Low-level GPIO peripheral driver interface definitions.
int sx126x_init(sx126x_t *dev)
Initialize the given device.
void sx126x_set_spreading_factor(sx126x_t *dev, uint8_t sf)
Sets the LoRa spreading factor.
void sx126x_set_bandwidth(sx126x_t *dev, uint8_t bandwidth)
Sets the LoRa bandwidth.
void sx126x_set_lora_implicit_header(sx126x_t *dev, bool mode)
Sets LoRa implicit header mode.
void sx126x_set_lora_iq_invert(sx126x_t *dev, bool iq_invert)
Enable/disable the LoRa IQ inverted mode.
uint16_t sx126x_get_lora_preamble_length(const sx126x_t *dev)
Gets the LoRa preamble length.
void sx126x_set_coding_rate(sx126x_t *dev, uint8_t cr)
Sets the LoRa coding rate.
void sx126x_set_lora_crc(sx126x_t *dev, bool crc)
Enable/Disable CRC verification mode.
sx126x_type_t
Used to identify if its a generic SPI module.
void sx126x_setup(sx126x_t *dev, const sx126x_params_t *params, uint8_t index)
Setup the radio device.
void sx126x_set_lora_preamble_length(sx126x_t *dev, uint16_t preamble)
Sets the LoRa preamble length.
void sx126x_set_lora_payload_length(sx126x_t *dev, uint8_t len)
Sets the payload length.
uint8_t sx126x_get_spreading_factor(const sx126x_t *dev)
Gets the LoRa spreading factor.
static int sx126x_symbol_to_msec(sx126x_t *dev, uint16_t symbols)
Converts symbol value to time in milliseconds.
uint8_t sx126x_get_coding_rate(const sx126x_t *dev)
Gets the LoRa coding rate.
void sx126x_set_channel(sx126x_t *dev, uint32_t freq)
Sets the channel RF frequency.
sx126x_rf_mode_t
RF switch states.
uint8_t sx126x_get_bandwidth(const sx126x_t *dev)
Gets the LoRa bandwidth.
uint32_t sx126x_get_channel(const sx126x_t *dev)
Gets the channel RF frequency.
bool sx126x_get_lora_implicit_header(const sx126x_t *dev)
Gets the LoRa implicit header mode.
bool sx126x_get_lora_crc(const sx126x_t *dev)
Checks if CRC verification mode is enabled.
uint8_t sx126x_get_lora_payload_length(const sx126x_t *dev)
Gets the payload length.
bool sx126x_get_lora_iq_invert(const sx126x_t *dev)
Checks if the LoRa inverted IQ mode is enabled/disabled.
Low-level SPI peripheral driver interface definition.
Structure to hold driver state.
Device initialization parameters.
gpio_t nss_pin
SPI NSS pin.
sx126x_type_t type
Variant of sx126x.
sx126x_reg_mod_t regulator
Power regulator mode.
gpio_t reset_pin
Reset pin.
Device descriptor for the driver.
uint32_t channel
Current channel frequency (in Hz)
bool radio_sleep
Radio sleep status.
sx126x_mod_params_lora_t mod_params
Lora modulation parameters.
sx126x_pkt_params_lora_t pkt_params
Lora packet parameters.
netdev_t netdev
Netdev parent struct.
uint16_t rx_timeout
Rx Timeout in terms of symbols.
sx126x_params_t * params
Initialization parameters.