Driver for the SX1261/2/8 and LLCC68 LoRa radio device. More...
Driver for the SX1261/2/8 and LLCC68 LoRa radio device.
Modules | |
SX1261/2/8 and LLCC68 internal functions | |
Internal functions for the SX1261/2/8 and LLCC68. | |
Files | |
file | sx126x.h |
file | sx126x_netdev.h |
Netdev driver definitions for SX1261/2/8 and LLCC68 driver. | |
file | sx126x_params.h |
Default configuration. | |
Data Structures | |
struct | sx126x_params_t |
Device initialization parameters. More... | |
struct | sx126x |
Device descriptor for the driver. More... | |
Macros | |
#define | SX126X_SINGLE |
Whether there's only one variant of this driver at compile time or not. | |
Typedefs | |
typedef struct sx126x | sx126x_t |
Enumerations | |
enum | sx126x_rf_mode_t { SX126X_RF_MODE_RX , SX126X_RF_MODE_TX_LPA , SX126X_RF_MODE_TX_HPA } |
RF switch states. More... | |
enum | sx126x_type_t { SX126X_TYPE_SX1261 , SX126X_TYPE_SX1262 , SX126X_TYPE_SX1268 , SX126X_TYPE_LLCC68 , SX126X_TYPE_STM32WL } |
Used to identify if its a generic SPI module. More... | |
Functions | |
void | sx126x_setup (sx126x_t *dev, const sx126x_params_t *params, uint8_t index) |
Setup the radio device. | |
int | sx126x_init (sx126x_t *dev) |
Initialize the given device. | |
static int | sx126x_symbol_to_msec (sx126x_t *dev, uint16_t symbols) |
Converts symbol value to time in milliseconds. | |
uint32_t | sx126x_get_channel (const sx126x_t *dev) |
Gets the channel RF frequency. | |
void | sx126x_set_channel (sx126x_t *dev, uint32_t freq) |
Sets the channel RF frequency. | |
uint8_t | sx126x_get_bandwidth (const sx126x_t *dev) |
Gets the LoRa bandwidth. | |
void | sx126x_set_bandwidth (sx126x_t *dev, uint8_t bandwidth) |
Sets the LoRa bandwidth. | |
uint8_t | sx126x_get_spreading_factor (const sx126x_t *dev) |
Gets the LoRa spreading factor. | |
void | sx126x_set_spreading_factor (sx126x_t *dev, uint8_t sf) |
Sets the LoRa spreading factor. | |
uint8_t | sx126x_get_coding_rate (const sx126x_t *dev) |
Gets the LoRa coding rate. | |
void | sx126x_set_coding_rate (sx126x_t *dev, uint8_t cr) |
Sets the LoRa coding rate. | |
uint8_t | sx126x_get_lora_payload_length (const sx126x_t *dev) |
Gets the payload length. | |
void | sx126x_set_lora_payload_length (sx126x_t *dev, uint8_t len) |
Sets the payload length. | |
bool | sx126x_get_lora_crc (const sx126x_t *dev) |
Checks if CRC verification mode is enabled. | |
void | sx126x_set_lora_crc (sx126x_t *dev, bool crc) |
Enable/Disable CRC verification mode. | |
bool | sx126x_get_lora_implicit_header (const sx126x_t *dev) |
Gets the LoRa implicit header mode. | |
void | sx126x_set_lora_implicit_header (sx126x_t *dev, bool mode) |
Sets LoRa implicit header mode. | |
uint16_t | sx126x_get_lora_preamble_length (const sx126x_t *dev) |
Gets the LoRa preamble length. | |
void | sx126x_set_lora_preamble_length (sx126x_t *dev, uint16_t preamble) |
Sets the LoRa preamble length. | |
bool | sx126x_get_lora_iq_invert (const sx126x_t *dev) |
Checks if the LoRa inverted IQ mode is enabled/disabled. | |
void | sx126x_set_lora_iq_invert (sx126x_t *dev, bool iq_invert) |
Enable/disable the LoRa IQ inverted mode. | |
#define SX126X_SINGLE |
enum sx126x_rf_mode_t |
enum sx126x_type_t |
uint8_t sx126x_get_bandwidth | ( | const sx126x_t * | dev | ) |
Gets the LoRa bandwidth.
[in] | dev | Device descriptor of the driver |
uint32_t sx126x_get_channel | ( | const sx126x_t * | dev | ) |
Gets the channel RF frequency.
[in] | dev | Device descriptor of the driver |
uint8_t sx126x_get_coding_rate | ( | const sx126x_t * | dev | ) |
Gets the LoRa coding rate.
[in] | dev | Device descriptor of the driver |
bool sx126x_get_lora_crc | ( | const sx126x_t * | dev | ) |
Checks if CRC verification mode is enabled.
[in] | dev | Device descriptor of the driver |
bool sx126x_get_lora_implicit_header | ( | const sx126x_t * | dev | ) |
Gets the LoRa implicit header mode.
[in] | dev | Device descriptor of the driver |
bool sx126x_get_lora_iq_invert | ( | const sx126x_t * | dev | ) |
Checks if the LoRa inverted IQ mode is enabled/disabled.
[in] | dev | Device descriptor of the driver |
uint8_t sx126x_get_lora_payload_length | ( | const sx126x_t * | dev | ) |
Gets the payload length.
[in] | dev | Device descriptor of the driver |
uint16_t sx126x_get_lora_preamble_length | ( | const sx126x_t * | dev | ) |
Gets the LoRa preamble length.
[in] | dev | Device descriptor of the driver |
uint8_t sx126x_get_spreading_factor | ( | const sx126x_t * | dev | ) |
Gets the LoRa spreading factor.
[in] | dev | Device descriptor of the driver |
int sx126x_init | ( | sx126x_t * | dev | ) |
Initialize the given device.
[in,out] | dev | Device descriptor of the driver |
void sx126x_set_bandwidth | ( | sx126x_t * | dev, |
uint8_t | bandwidth | ||
) |
Sets the LoRa bandwidth.
[in] | dev | Device descriptor of the driver |
[in] | bandwidth | The new bandwidth |
void sx126x_set_channel | ( | sx126x_t * | dev, |
uint32_t | freq | ||
) |
Sets the channel RF frequency.
[in] | dev | Device descriptor of the driver |
[in] | freq | Channel RF frequency |
void sx126x_set_coding_rate | ( | sx126x_t * | dev, |
uint8_t | cr | ||
) |
Sets the LoRa coding rate.
[in] | dev | Device descriptor of the driver |
[in] | cr | The LoRa coding rate |
void sx126x_set_lora_crc | ( | sx126x_t * | dev, |
bool | crc | ||
) |
Enable/Disable CRC verification mode.
[in] | dev | Device descriptor of the driver |
[in] | crc | The CRC check mode |
void sx126x_set_lora_implicit_header | ( | sx126x_t * | dev, |
bool | mode | ||
) |
Sets LoRa implicit header mode.
[in] | dev | Device descriptor of the driver |
[in] | mode | The header mode |
void sx126x_set_lora_iq_invert | ( | sx126x_t * | dev, |
bool | iq_invert | ||
) |
Enable/disable the LoRa IQ inverted mode.
[in] | dev | Device descriptor of the driver |
[in] | iq_invert | The LoRa IQ inverted mode |
void sx126x_set_lora_payload_length | ( | sx126x_t * | dev, |
uint8_t | len | ||
) |
Sets the payload length.
[in] | dev | Device descriptor of the driver |
[in] | len | The payload len |
void sx126x_set_lora_preamble_length | ( | sx126x_t * | dev, |
uint16_t | preamble | ||
) |
Sets the LoRa preamble length.
[in] | dev | Device descriptor of the driver |
[in] | preamble | The LoRa preamble length |
void sx126x_set_spreading_factor | ( | sx126x_t * | dev, |
uint8_t | sf | ||
) |
Sets the LoRa spreading factor.
[in] | dev | Device descriptor of the driver |
[in] | sf | The spreading factor |
void sx126x_setup | ( | sx126x_t * | dev, |
const sx126x_params_t * | params, | ||
uint8_t | index | ||
) |
Setup the radio device.
[in] | dev | Device descriptor |
[in] | params | Parameters for device initialization |
[in] | index | Index of params in a global parameter struct array. If initialized manually, pass a unique identifier instead. |