Expand description
§API related to WMBus operations
This module provides an API for configuring and operating the LR2021 chip for WMBus communication. WMBus is metering protocol using ISM bands, uwing various (G)FSK modulation schemes.
§Quick Start
Here’s a typical sequence to initialize the chip for WMBus operations:
use lr2021::radio::PacketType;
use lr2021::wmbus::*;
// Set packet type to WMBus
let mut mode = WmbusMode::ModeS;
let rf = mode.rf(0, WmbusSubBand::A); // Choose channel 0
lr2021.set_rf(rf).await.expect("SetRF");
lr2021.set_packet_type(PacketType::Wmbus).await.expect("SetPktType");
let params = WmbusPacketParams::new(mode, WmbusFormat::FormatA, PLD_SIZE);
lr2021.set_wmbus_packet(params).await.expect("SetPktParams");
lr2021.set_rx_continuous().await.expect("SetRX");§Available Methods
set_wmbus_packet- Set Wmbus packet parameters: preamble, Bandwidth, Payload length, Address filteringset_wmbus_address- Configure the node address for address filteringget_wmbus_packet_status- Return info about last packet received: length, CRC error per block, RSSI, LQIget_wmbus_rx_stats- Return basic RX stats
Re-exports§
pub use super::cmd::cmd_wmbus::*;
Structs§
- Wmbus
Packet Params - W-MBus Packet parameters