modm API documentation
|
#include <modm/driver/radio/sx128x.hpp>
Classes | |
struct | Ble |
struct | Flrc |
struct | Gfsk |
struct | LoRa |
union | ModulationParams |
union | PacketParams |
union | PacketStatus |
struct | Ranging |
struct | RxBufferStatus |
struct | Status |
Public Member Functions | |
bool | isBusy () |
Determine if radio is busy. | |
void | reset () |
bool | getStatus (Status *status) |
bool | writeRegister (Register reg, uint8_t data) |
Writes a single byte in a data memory space at the specified address. | |
bool | writeRegister (Register reg, std::span< const uint8_t > data) |
Writes a block of bytes in a data memory space starting at a specific address. | |
bool | readRegister (Register reg, uint8_t *data) |
Read a single byte of data at the given address. | |
bool | readRegister (Register reg, std::span< uint8_t > data) |
Read a block of data starting at a given address. | |
bool | writeBuffer (uint8_t offset, std::span< const uint8_t > data) |
bool | readBuffer (uint8_t offset, std::span< uint8_t > data) |
This function is used to read the received data payload. | |
bool | setSleep (SleepConfig_t sleepConfig) |
bool | setStandby (StandbyConfig standbyConfig=StandbyConfig::StdbyRc) |
bool | setFs () |
bool | setTx (PeriodBase periodBase, uint16_t periodBaseCount) |
bool | setRx (PeriodBase periodBase, uint16_t periodBaseCount) |
bool | setRxDutyCycle (PeriodBase periodBase, uint16_t rxPeriodBaseCount, uint16_t sleepPeriodBaseCount) |
bool | setCad () |
bool | setTxContinuousWave () |
bool | setTxContinuousPreamble () |
bool | setPacketType (PacketType packetType) |
bool | getPacketType (PacketType *packetType) |
Get the current operating packet type of the radio. | |
bool | setRfFrequency (uint32_t rfFrequency) |
bool | setTxParams (uint8_t power, RampTime rampTime) |
bool | setCadParams (CadSymbolNumber cadSymbolNumber) |
Set the number of symbols on which which Channel Activity Detected (CAD) operates. | |
bool | setBufferBaseAddress (uint8_t txBaseAddress, uint8_t rxBaseAddress) |
Set the base address for the packet handling operation in Tx and Rx mode for all packet types. | |
bool | setModulationParams (ModulationParams modulationParams) |
bool | setPacketParams (PacketParams packetParams) |
bool | getRxBufferStatus (RxBufferStatus *rxBufferStatus) |
Get length of the last received packet and the address of the first byte received. | |
bool | getPacketStatus (PacketStatus *packetStatus) |
bool | getRssiInst (uint8_t *rssiInst) |
bool | setDioIrqParams (Irq_t irqMask, Irq_t dio1Mask=Irq_t (), Irq_t dio2Mask=Irq_t (), Irq_t dio3Mask=Irq_t ()) |
Enable IRQs and to route IRQs to DIO pins. | |
bool | getIrqStatus (Irq_t *irqStatus) |
Get the value of the IRQ register. | |
bool | clearIrqStatus (Irq_t irqMask) |
Clear IRQ flags in the IRQ register. | |
bool | setRegulatorMode (RegulatorMode regModeParam) |
Specify if DC-DC or LDO is used for power regulation. | |
bool | setSaveContext () |
Save the present context of the radio register values to the Data RAM. | |
bool | setAutoFs (bool enable=true) |
bool | setAutoTx (uint16_t time) |
bool | setLongPreamble (bool enable=true) |
bool | setUartSpeed (UartDividerRatio uartDividerRatio) |
bool | setRangingRole (RangingRole rangingRole) |
Set the role of the radio in ranging operation. | |
bool | setAdvancedRanging (bool enable=true) |
Enable advanced ranging. | |
MODM_FLAGS8 (SleepConfig) | |
MODM_FLAGS16 (Irq) | |
Static Public Attributes | |
static constexpr float | frequencyLsb = float(52_MHz) / 262144.f |
Transport | Transpot Layer for SX128x |
bool modm::Sx128x< Transport, Reset, Busy >::getPacketStatus | ( | PacketStatus * | packetStatus | ) |
Retrieve information about the last received packet
bool modm::Sx128x< Transport, Reset, Busy >::getRssiInst | ( | uint8_t * | rssiInst | ) |
Get the instantaneous RSSI value during reception of the packet
bool modm::Sx128x< Transport, Reset, Busy >::getStatus | ( | Status * | status | ) |
Get the transceiver status directly.
void modm::Sx128x< Transport, Reset, Busy >::reset | ( | ) |
Reset the transceiver
bool modm::Sx128x< Transport, Reset, Busy >::setAutoFs | ( | bool | enable = true | ) |
Set the chip so that the state following a Rx or Tx operation is FS and not STDBY This feature is to be used to reduce the switching time between consecutive Rx and/or Tx operations
bool modm::Sx128x< Transport, Reset, Busy >::setAutoTx | ( | uint16_t | time | ) |
Set the device to be able to send back a response 150 us after a packet reception
bool modm::Sx128x< Transport, Reset, Busy >::setCad | ( | ) |
Set the transceiver to use CAD (Channel Activity Detection) mode
bool modm::Sx128x< Transport, Reset, Busy >::setFs | ( | ) |
Set the device in Frequency Synthesizer mode where the PLL is locked to the carrier frequency
bool modm::Sx128x< Transport, Reset, Busy >::setLongPreamble | ( | bool | enable = true | ) |
bool modm::Sx128x< Transport, Reset, Busy >::setModulationParams | ( | ModulationParams | modulationParams | ) |
Set the modulation parameters of the radio
bool modm::Sx128x< Transport, Reset, Busy >::setPacketParams | ( | PacketParams | packetParams | ) |
Set the parameters of the packet handling block
bool modm::Sx128x< Transport, Reset, Busy >::setPacketType | ( | PacketType | packetType | ) |
Set the transceiver radio frame out of a choice of 5 different packet types
bool modm::Sx128x< Transport, Reset, Busy >::setRfFrequency | ( | uint32_t | rfFrequency | ) |
Set the frequency of the RF frequency mode.
bool modm::Sx128x< Transport, Reset, Busy >::setRx | ( | PeriodBase | periodBase, |
uint16_t | periodBaseCount | ||
) |
Set the device in Receiver mode
bool modm::Sx128x< Transport, Reset, Busy >::setRxDutyCycle | ( | PeriodBase | periodBase, |
uint16_t | rxPeriodBaseCount, | ||
uint16_t | sleepPeriodBaseCount | ||
) |
Set the transceiver in sniff mode, so that it regularly looks for new packets
bool modm::Sx128x< Transport, Reset, Busy >::setSleep | ( | SleepConfig_t | sleepConfig | ) |
Set the transceiver to Sleep mode with the lowest current consumption possible
bool modm::Sx128x< Transport, Reset, Busy >::setStandby | ( | StandbyConfig | standbyConfig = StandbyConfig::StdbyRc | ) |
Set the device in either STDBY_RC or STDBY_XOSC mode which are intermediate levels of power consumption By default in this state, the system is clocked by the 13 MHz RC oscillator to reduce power consumption. However if the application is time critical, the XOSC block can be turned or left ON.
bool modm::Sx128x< Transport, Reset, Busy >::setTx | ( | PeriodBase | periodBase, |
uint16_t | periodBaseCount | ||
) |
Set the device in Transmit mode
bool modm::Sx128x< Transport, Reset, Busy >::setTxContinuousPreamble | ( | ) |
bool modm::Sx128x< Transport, Reset, Busy >::setTxContinuousWave | ( | ) |
Set the transceiver to generate a Continuous Wave (RF tone) at a selected frequency and output power
bool modm::Sx128x< Transport, Reset, Busy >::setTxParams | ( | uint8_t | power, |
RampTime | rampTime | ||
) |
Set the Tx output power and the Tx ramp time
bool modm::Sx128x< Transport, Reset, Busy >::setUartSpeed | ( | UartDividerRatio | uartDividerRatio | ) |
bool modm::Sx128x< Transport, Reset, Busy >::writeBuffer | ( | uint8_t | offset, |
std::span< const uint8_t > | data | ||
) |
This function is used to write the data payload to be transmitted