|
LDL
0.5.0
|
The application should initialise the radio with MAC in the following order:
MAC calls all non-static (i.e. functions that pass self as first argument) via ldl_radio_interface. This means it is possible to wrap Radio in a C++ if necessary.
Be careful using these interfaces for other projects. The driver expects certain functions to be called before others. For best results you should study how MAC calls the interfaces to figure out what will work.
| const struct ldl_radio_interface* LDL_Radio_getInterface | ( | const struct ldl_radio * | self | ) |
Get interface for initialised radio driver
| void LDL_Radio_setEventCallback | ( | struct ldl_radio * | self, |
| struct ldl_mac * | ctx, | ||
| ldl_radio_event_fn | cb | ||
| ) |
Set event handler callback
This is how the Radio tells the MAC about rising interrupt lines.
| [in] | self | ldl_radio |
| [in] | ctx | passed back as first argument of handler |
| [in] | cb | LDL_MAC_radioEvent() or an intermediate |
| int16_t LDL_Radio_getMinSNR | ( | enum ldl_spreading_factor | sf | ) |
Get minimum SNR for a given spreading factor
| [in] | sf | spreading factor |
| uint32_t LDL_Radio_getAirTime | ( | enum ldl_signal_bandwidth | bw, |
| enum ldl_spreading_factor | sf, | ||
| uint8_t | size, | ||
| bool | crc | ||
| ) |
Time taken to transmit a message of certain size
| [in] | bw | |
| [in] | sf | |
| [in] | size | |
| [in] | crc |
| milliseconds |
| uint32_t LDL_Radio_bwToNumber | ( | enum ldl_signal_bandwidth | bw | ) |
Convert bandwidth enumeration to Hz
| [in] | bw | bandwidth |
| void LDL_SX1261_init | ( | struct ldl_radio * | self, |
| const struct ldl_sx126x_init_arg * | arg | ||
| ) |
Initialise SX1261 radio driver
| [in] | self | |
| [in] | arg | ldl_sx126x_init_arg |
| void LDL_SX1262_init | ( | struct ldl_radio * | self, |
| const struct ldl_sx126x_init_arg * | arg | ||
| ) |
Initialise SX1262 radio driver
| [in] | self | |
| [in] | arg | ldl_sx126x_init_arg |
| const struct ldl_radio_interface* LDL_SX1261_getInterface | ( | void | ) |
Get radio interface
| const struct ldl_radio_interface* LDL_SX1262_getInterface | ( | void | ) |
Get radio interface
| void LDL_SX1272_init | ( | struct ldl_radio * | self, |
| const struct ldl_sx127x_init_arg * | arg | ||
| ) |
Initialise SX1272 radio driver
| [in] | self | |
| [in] | arg | ldl_sx127x_init_arg |
| void LDL_SX1276_init | ( | struct ldl_radio * | self, |
| const struct ldl_sx127x_init_arg * | arg | ||
| ) |
Initialise SX1276 radio driver
| [in] | self | |
| [in] | arg | ldl_sx127x_init_arg |
| const struct ldl_radio_interface* LDL_SX1272_getInterface | ( | void | ) |
Get radio interface
| const struct ldl_radio_interface* LDL_SX1276_getInterface | ( | void | ) |
Get radio interface
| struct ldl_radio |
Radio state
| struct ldl_sx126x_init_arg |
init arguments for SX1261 and SX1262 radio
| Data Fields | ||
|---|---|---|
| enum ldl_radio_xtal | xtal |
type of XTAL |
| int16_t | tx_gain |
Apply TX gain compensation in units of (dB x 10-2) (e.g. -2.4dB == -240) |
| void * | chip |
a pointer that will be passed as self when calling ldl_chip_* functions |
| ldl_chip_write_fn | chip_write | |
| ldl_chip_read_fn | chip_read | |
| ldl_chip_set_mode_fn | chip_set_mode | |
| enum ldl_sx126x_regulator | regulator |
choose regulator hardware is configured for |
| enum ldl_sx126x_voltage | voltage |
choose tcxo voltage setting |
| enum ldl_sx126x_txen | txen |
choose txen switch mode |
| bool | trim_xtal |
set true to trim xtal with xta and xtb parameters |
| uint8_t | xta |
XTA trim value |
| uint8_t | xtb |
XTB trim value |
| struct ldl_sx127x_init_arg |
init arguments for SX1272 and SX1276 radio
| Data Fields | ||
|---|---|---|
| enum ldl_radio_xtal | xtal |
type of XTAL |
| int16_t | tx_gain |
Apply TX gain compensation in units of (dB x 10-2) (e.g. -2.4dB == -240) |
| void * | chip |
a pointer that will be passed as self when calling ldl_chip_* functions |
| ldl_chip_write_fn | chip_write | |
| ldl_chip_read_fn | chip_read | |
| ldl_chip_set_mode_fn | chip_set_mode | |
| enum ldl_sx127x_pa | pa |
SX1272/6 transceivers have PAs on different physical pins The driver needs to know if one or both are connected. |
| enum ldl_radio_type |
| enum ldl_radio_mode |
| enum ldl_radio_xtal |
| enum ldl_sx127x_pa |
| enum ldl_sx126x_regulator |
SX126X regulator setting
| enum ldl_spreading_factor |
| enum ldl_signal_bandwidth |