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. | |
modm::ResumableResult< void > | reset () |
modm::ResumableResult< bool > | getStatus (Status *status) |
modm::ResumableResult< bool > | writeRegister (Register reg, uint8_t data) |
Writes a single byte in a data memory space at the specified address. | |
modm::ResumableResult< 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. | |
modm::ResumableResult< bool > | readRegister (Register reg, uint8_t *data) |
Read a single byte of data at the given address. | |
modm::ResumableResult< bool > | readRegister (Register reg, std::span< uint8_t > data) |
Read a block of data starting at a given address. | |
modm::ResumableResult< bool > | writeBuffer (uint8_t offset, std::span< const uint8_t > data) |
modm::ResumableResult< bool > | readBuffer (uint8_t offset, std::span< uint8_t > data) |
This function is used to read the received data payload. | |
modm::ResumableResult< bool > | setSleep (SleepConfig_t sleepConfig) |
modm::ResumableResult< bool > | setStandby (StandbyConfig standbyConfig=StandbyConfig::StdbyRc) |
modm::ResumableResult< bool > | setFs () |
modm::ResumableResult< bool > | setTx (PeriodBase periodBase, uint16_t periodBaseCount) |
modm::ResumableResult< bool > | setRx (PeriodBase periodBase, uint16_t periodBaseCount) |
modm::ResumableResult< bool > | setRxDutyCycle (PeriodBase periodBase, uint16_t rxPeriodBaseCount, uint16_t sleepPeriodBaseCount) |
modm::ResumableResult< bool > | setCad () |
modm::ResumableResult< bool > | setTxContinuousWave () |
modm::ResumableResult< bool > | setTxContinuousPreamble () |
modm::ResumableResult< bool > | setPacketType (PacketType packetType) |
modm::ResumableResult< bool > | getPacketType (PacketType *packetType) |
Get the current operating packet type of the radio. | |
modm::ResumableResult< bool > | setRfFrequency (uint32_t rfFrequency) |
modm::ResumableResult< bool > | setTxParams (uint8_t power, RampTime rampTime) |
modm::ResumableResult< bool > | setCadParams (CadSymbolNumber cadSymbolNumber) |
Set the number of symbols on which which Channel Activity Detected (CAD) operates. | |
modm::ResumableResult< 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. | |
modm::ResumableResult< bool > | setModulationParams (ModulationParams modulationParams) |
modm::ResumableResult< bool > | setPacketParams (PacketParams packetParams) |
modm::ResumableResult< bool > | getRxBufferStatus (RxBufferStatus *rxBufferStatus) |
Get length of the last received packet and the address of the first byte received. | |
modm::ResumableResult< bool > | getPacketStatus (PacketStatus *packetStatus) |
modm::ResumableResult< bool > | getRssiInst (uint8_t *rssiInst) |
modm::ResumableResult< 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. | |
modm::ResumableResult< bool > | getIrqStatus (Irq_t *irqStatus) |
Get the value of the IRQ register. | |
modm::ResumableResult< bool > | clearIrqStatus (Irq_t irqMask) |
Clear IRQ flags in the IRQ register. | |
modm::ResumableResult< bool > | setRegulatorMode (RegulatorMode regModeParam) |
Specify if DC-DC or LDO is used for power regulation. | |
modm::ResumableResult< bool > | setSaveContext () |
Save the present context of the radio register values to the Data RAM. | |
modm::ResumableResult< bool > | setAutoFs (bool enable=true) |
modm::ResumableResult< bool > | setAutoTx (uint16_t time) |
modm::ResumableResult< bool > | setLongPreamble (bool enable=true) |
modm::ResumableResult< bool > | setUartSpeed (UartDividerRatio uartDividerRatio) |
modm::ResumableResult< bool > | setRangingRole (RangingRole rangingRole) |
Set the role of the radio in ranging operation. | |
modm::ResumableResult< 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 |
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::getPacketStatus | ( | PacketStatus * | packetStatus | ) |
Retrieve information about the last received packet
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::getRssiInst | ( | uint8_t * | rssiInst | ) |
Get the instantaneous RSSI value during reception of the packet
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::getStatus | ( | Status * | status | ) |
Get the transceiver status directly.
modm::ResumableResult<void> modm::Sx128x< Transport, Reset, Busy >::reset | ( | ) |
Reset the transceiver
modm::ResumableResult<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
modm::ResumableResult<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
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setCad | ( | ) |
Set the transceiver to use CAD (Channel Activity Detection) mode
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setFs | ( | ) |
Set the device in Frequency Synthesizer mode where the PLL is locked to the carrier frequency
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setLongPreamble | ( | bool | enable = true | ) |
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setModulationParams | ( | ModulationParams | modulationParams | ) |
Set the modulation parameters of the radio
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setPacketParams | ( | PacketParams | packetParams | ) |
Set the parameters of the packet handling block
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setPacketType | ( | PacketType | packetType | ) |
Set the transceiver radio frame out of a choice of 5 different packet types
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setRfFrequency | ( | uint32_t | rfFrequency | ) |
Set the frequency of the RF frequency mode.
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setRx | ( | PeriodBase | periodBase, |
uint16_t | periodBaseCount | ||
) |
Set the device in Receiver mode
modm::ResumableResult<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
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setSleep | ( | SleepConfig_t | sleepConfig | ) |
Set the transceiver to Sleep mode with the lowest current consumption possible
modm::ResumableResult<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.
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setTx | ( | PeriodBase | periodBase, |
uint16_t | periodBaseCount | ||
) |
Set the device in Transmit mode
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setTxContinuousPreamble | ( | ) |
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setTxContinuousWave | ( | ) |
Set the transceiver to generate a Continuous Wave (RF tone) at a selected frequency and output power
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setTxParams | ( | uint8_t | power, |
RampTime | rampTime | ||
) |
Set the Tx output power and the Tx ramp time
modm::ResumableResult<bool> modm::Sx128x< Transport, Reset, Busy >::setUartSpeed | ( | UartDividerRatio | uartDividerRatio | ) |
modm::ResumableResult<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