44 static constexpr size_t MTU = 255;
139 miosix::GpioPin dio1, miosix::GpioPin dio3,
141 std::unique_ptr<SX1278::ISX1278Frontend> frontend)
143 std::move(frontend)),
151 [[nodiscard]]
virtual Error init(
const Config& config);
170 ssize_t
receive(uint8_t* pkt,
size_t max_len)
override;
181 bool send(uint8_t* pkt,
size_t len)
override;
204 void resetIrqFlags(
IrqFlags flags)
override;
209 void setMode(
Mode mode)
override;
213 long long last_tx = 0;
214 float last_rx_rssi = 0.0f;
static PrintLogger getLogger(const string &name)
Driver for STM32 low level SPI peripheral.
RAII scoped bus lock guard.
Various SX1278 register/enums definitions.
virtual Error init(const Config &config)
Setup the device.
virtual Error configure(const Config &config)
Configure this device on the fly.
static constexpr size_t MTU
Maximum transmittable unit of this driver.
float getLastRxFei() override
Get the frequency error index in Hz, during last packet receive.
float getLastRxRssi() override
Get the RSSI in dBm, during last packet receive.
float getCurRssi()
Get the current perceived RSSI in dBm.
bool send(uint8_t *pkt, size_t len) override
Send a packet. The function must block until the packet is sent (successfully or not)
SX1278Fsk(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.
ssize_t receive(uint8_t *pkt, size_t max_len) override
Wait until a new packet is received.
ClockDivider
SPI Clock divider.
@ MODULATION_SHAPING_GAUSSIAN_BT_1_0
@ MODULATION_SHAPING_NONE
@ MODULATION_SHAPING_GAUSSIAN_BT_0_5
@ MODULATION_SHAPING_GAUSSIAN_BT_0_3
This file includes all the types the logdecoder script will decode.
Represents an actual Dio mapping..
Requested SX1278 configuration.
RxBw
Channel filter bandwidth.
Shaping
Output modulation shaping.