Skyward boardcore
|
#include <SX1278Lora.h>
Classes | |
struct | Config |
Requested SX1278 configuration. More... | |
Public Types | |
enum class | Error { NONE , BAD_VALUE , BAD_VERSION , IRQ_TIMEOUT } |
Error enum. More... | |
Public Member Functions | |
SX1278Lora (SPIBus &bus, miosix::GpioPin cs, miosix::GpioPin dio0, miosix::GpioPin dio1, miosix::GpioPin dio3, SPI::ClockDivider clock_divider, std::unique_ptr< SX1278::ISX1278Frontend > frontend) | |
Construct a new SX1278. | |
virtual Error | init (const Config &config) |
Setup the device. | |
bool | checkVersion () |
virtual Error | configure (const Config &config) |
Configure this device on the fly. | |
ssize_t | receive (uint8_t *pkt, size_t max_len) override |
Wait until a new packet is received. | |
bool | send (uint8_t *pkt, size_t len) override |
Send a packet. The function must block until the packet is sent (successfully or not) | |
float | getLastRxRssi () override |
Get the RSSI in dBm, during last packet receive. | |
float | getLastRxSnr () override |
Get the RSSI in dBm, during last packet receive. | |
![]() | |
void | handleDioIRQ () |
Handle generic DIO irq. | |
![]() | |
virtual float | getLastRxFei () |
Get the frequency error index in Hz, during last packet receive (NaN if not available). | |
![]() | |
Transceiver () | |
virtual | ~Transceiver () |
Static Public Attributes | |
static constexpr size_t | MTU = 255 |
Additional Inherited Members | |
![]() | |
using | IrqFlags = int |
using | Mode = int |
![]() | |
SX1278Common (SPIBus &bus, miosix::GpioPin cs, miosix::GpioPin dio0, miosix::GpioPin dio1, miosix::GpioPin dio3, SPI::ClockDivider clock_divider, std::unique_ptr< ISX1278Frontend > frontend) | |
~SX1278Common () | |
void | setDefaultMode (Mode mode, DioMapping mapping, InterruptTrigger dio1_trigger, bool set_tx_frontend_on, bool set_rx_frontend_on) |
Set default device mode. | |
IrqFlags | waitForIrq (LockMode &guard, IrqFlags set_irq, IrqFlags reset_irq, bool unlock=false) |
Wait for generic irq. | |
IrqFlags | waitForIrqBusy (LockMode &guard, IrqFlags set_irq, IrqFlags reset_irq, int timeout) |
Busy waits for an interrupt by polling the irq register. | |
IrqFlags | checkForIrqAndReset (IrqFlags set_irq, IrqFlags reset_irq) |
Returns a mask containing triggered interrupts. | |
ISX1278Frontend & | getFrontend () |
SPISlave & | getSpiSlave () |
Definition at line 33 of file SX1278Lora.h.
Error enum.
Enumerator | |
---|---|
NONE | |
BAD_VALUE | |
BAD_VERSION | |
IRQ_TIMEOUT |
Definition at line 130 of file SX1278Lora.h.
|
inlineexplicit |
Construct a new SX1278.
Definition at line 141 of file SX1278Lora.h.
bool Boardcore::SX1278Lora::checkVersion | ( | ) |
Definition at line 146 of file SX1278Lora.cpp.
|
virtual |
Configure this device on the fly.
Definition at line 163 of file SX1278Lora.cpp.
|
overridevirtual |
Get the RSSI in dBm, during last packet receive.
Implements Boardcore::SX1278::ISX1278.
Definition at line 351 of file SX1278Lora.cpp.
|
overridevirtual |
Get the RSSI in dBm, during last packet receive.
Reimplemented from Boardcore::SX1278::ISX1278.
Definition at line 369 of file SX1278Lora.cpp.
|
virtual |
Setup the device.
Definition at line 133 of file SX1278Lora.cpp.
Wait until a new packet is received.
pkt | Buffer to store the received packet into. |
pkt_len | Maximum length of the received data. |
Implements Boardcore::Transceiver.
Definition at line 294 of file SX1278Lora.cpp.
Send a packet. The function must block until the packet is sent (successfully or not)
pkt | Pointer to the packet (needs to be at least pkt_len bytes). |
pkt_len | Length of the packet to be sent. |
Implements Boardcore::Transceiver.
Definition at line 324 of file SX1278Lora.cpp.
Definition at line 36 of file SX1278Lora.h.