36 static constexpr size_t MTU = 255;
117 using namespace SX1278::Lora;
142 miosix::GpioPin dio1, miosix::GpioPin dio3,
144 std::unique_ptr<SX1278::ISX1278Frontend> frontend)
146 std::move(frontend)),
154 [[nodiscard]]
virtual Error init(
const Config& config);
173 ssize_t
receive(uint8_t* pkt,
size_t max_len)
override;
184 bool send(uint8_t* pkt,
size_t len)
override;
197 void enterLoraMode();
199 void readFifo(uint8_t addr, uint8_t* dst, uint8_t size);
200 void writeFifo(uint8_t addr, uint8_t* src, uint8_t size);
203 void resetIrqFlags(
IrqFlags flags)
override;
205 void setMode(
Mode mode)
override;
static PrintLogger getLogger(const string &name)
Driver for STM32 low level SPI peripheral.
RAII scoped bus lock guard.
float getLastRxSnr() override
Get the RSSI in dBm, during last packet receive.
bool send(uint8_t *pkt, size_t len) override
Send a packet. The function must block until the packet is sent (successfully or not)
ssize_t receive(uint8_t *pkt, size_t max_len) override
Wait until a new packet is received.
virtual Error init(const Config &config)
Setup the device.
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 configure(const Config &config)
Configure this device on the fly.
static constexpr size_t MTU
float getLastRxRssi() override
Get the RSSI in dBm, during last packet receive.
ClockDivider
SPI Clock divider.
constexpr uint32_t bandwidthToInt(Bw bw)
constexpr uint32_t effectiveBitrate(uint32_t spreading_factor, uint32_t bandwidth, uint32_t coding_rate)
Computes the actual usable bitrate in b/s.
This file includes all the types the logdecoder script will decode.
Represents an actual Dio mapping..
Requested SX1278 configuration.
Cr
Coding rate of the device.
Bw
Bandwidth of the device.
Sf
Spreading factor of the devide.
bool low_data_rate_optimize
uint32_t effectiveBitrate() const
Calculates effective and usable bitrate.