modm API documentation
|
#include <modm/driver/radio/sx1276.hpp>
Public Typedefs | |
typedef modm::Configuration< OpModeRegister_t, ModemMode, Bit0|Bit1|Bit2 > | ModemMode_t |
typedef modm::Configuration< ModemConfig1_t, Bandwidth, Bit7|Bit6|Bit5|Bit4 > | Bandwidth_t |
typedef modm::Configuration< ModemConfig1_t, CodingRate, Bit3|Bit2|Bit1 > | CodingRate_t |
typedef modm::Configuration< ModemConfig2_t, SpreadingFactor, Bit7|Bit6|Bit5|Bit4 > | SpreadingFactor_t |
Public Types | |
enum | Sx1276Register : uint8_t |
Definitions of all the Registers of the modem in LoRa mode. | |
enum | OpModeRegister : uint8_t |
Operation mode register. | |
enum | ModemMode : uint8_t |
Modem operation modes. | |
enum | Interrupts : uint8_t |
Available interrupts with their positions in the flag and mask register. | |
enum | ModemConfig1 : uint8_t |
Operation mode register. | |
enum | Bandwidth : uint8_t |
LoRa Bandwidth Modes. | |
enum | CodingRate : uint8_t |
LoRa Coding Rate. | |
enum | ModemConfig2 : uint8_t |
enum | ModemConfig3 : uint8_t |
enum | SpreadingFactor : uint8_t |
Available Spreading Factors. | |
Public Member Functions | |
Sx1276 () | |
Construct a new Sx1276 Driver. | |
modm::ResumableResult< void > | initialize () |
Initialize the modem into Lora mode. | |
modm::ResumableResult< void > | setModemParams (Bandwidth bw, SpreadingFactor sf, CodingRate cr, bool implicitHeader, bool payloadCrc) |
Setup the modem parameters. More... | |
modm::ResumableResult< void > | setCarrierFrequency (frequency_t freq) |
Set the carrier frequency of the Modem. More... | |
modm::ResumableResult< void > | setSyncWord (uint8_t syncWord) |
Set the sync word for the LoRa packages. More... | |
modm::ResumableResult< bool > | transmit (uint8_t *data, uint8_t length) |
Transmit a single package. More... | |
modm::ResumableResult< void > | enableListening () |
Enable the Rx mode and start listening for packages. | |
modm::ResumableResult< void > | disableListening () |
Disable Rx mode. | |
modm::ResumableResult< uint8_t > | readPacket (uint8_t *data, uint8_t maxLength) |
Reads a package from the modem if one is available. The return value indicates how many bytes have been read from the last received package. If the return value is 0 no package has been received, is it larger than the max length parameter, the package was bigger than the buffer provided and got discarded. More... | |
modm::ResumableResult< int8_t > | getPacketSnr () |
Get the signal to noise ratio for the last received packet. More... | |
modm::ResumableResult< int16_t > | getPacketRssi () |
Get the recieved signal strength indicator (RSSI) of the last received packet. More... | |
modm::ResumableResult< int16_t > | getCurrentRssi () |
Get the current recieved signal strength indicator (RSSI) More... | |
MODM_FLAGS8 (OpModeRegister) | |
MODM_FLAGS8 (Interrupts) | |
MODM_FLAGS8 (ModemConfig1) | |
MODM_FLAGS8 (ModemConfig2) | |
MODM_FLAGS8 (ModemConfig3) | |
void | attachConfigurationHandler (Spi::ConfigurationHandler handler) |
Static Public Attributes | |
static constexpr int16_t | rssiOffsetLF = -164 |
Protected Member Functions | |
bool | acquireMaster () |
bool | releaseMaster () |
int8_t | getResumableDepth () const |
bool | isResumableRunning () const |
void | stopResumable () |
modm::ResumableResult<int16_t> modm::Sx1276< SpiMaster, Cs >::getCurrentRssi | ( | ) |
Get the current recieved signal strength indicator (RSSI)
modm::ResumableResult<int16_t> modm::Sx1276< SpiMaster, Cs >::getPacketRssi | ( | ) |
Get the recieved signal strength indicator (RSSI) of the last received packet.
modm::ResumableResult<int8_t> modm::Sx1276< SpiMaster, Cs >::getPacketSnr | ( | ) |
Get the signal to noise ratio for the last received packet.
modm::ResumableResult<uint8_t> modm::Sx1276< SpiMaster, Cs >::readPacket | ( | uint8_t * | data, |
uint8_t | maxLength | ||
) |
Reads a package from the modem if one is available. The return value indicates how many bytes have been read from the last received package. If the return value is 0 no package has been received, is it larger than the max length parameter, the package was bigger than the buffer provided and got discarded.
data | A pointer to a buffer where received data will be stored |
maxLength | The maximum amount of bytes that can be read |
modm::ResumableResult<void> modm::Sx1276< SpiMaster, Cs >::setCarrierFrequency | ( | frequency_t | freq | ) |
Set the carrier frequency of the Modem.
freq | The Carrier frequency the modem will be tuned to |
modm::ResumableResult<void> modm::Sx1276< SpiMaster, Cs >::setModemParams | ( | Bandwidth | bw, |
SpreadingFactor | sf, | ||
CodingRate | cr, | ||
bool | implicitHeader, | ||
bool | payloadCrc | ||
) |
Setup the modem parameters.
bw | The Bandwidth of the LoRa Transmission |
sf | The Spreading factor for each symbol |
cr | The Coding rate for the symbols |
implicitHeader | Run the modem in implicit header mode |
payloadCrc | Append CRC checksums to validate the packages |
modm::ResumableResult<void> modm::Sx1276< SpiMaster, Cs >::setSyncWord | ( | uint8_t | syncWord | ) |
Set the sync word for the LoRa packages.
syncWord | The new sync word of upcoming lora packages |
modm::ResumableResult<bool> modm::Sx1276< SpiMaster, Cs >::transmit | ( | uint8_t * | data, |
uint8_t | length | ||
) |
Transmit a single package.
data | A pointer to the payload data of the Package |
length | The length of the payload data in bytes |