pub struct DeviceControl<M: RawMutex> { /* private fields */ }Expand description
Control handle for device_runner: latest-wins settings updates and
on-demand instantaneous-RSSI sampling. Place in a static next to the
Channels.
Implementations§
Source§impl<M: RawMutex> DeviceControl<M>
impl<M: RawMutex> DeviceControl<M>
pub const fn new() -> Self
Sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Put the radio into chip sleep and stop the runner.
Terminal, and meant for the board’s own power-off path: the runner parks forever once it observes this, so nothing after it can transmit or receive. The SX1262 keeps its own supply while the host MCU is in deep sleep, so skipping this would leave the chip receiving and dominate the sleeping board’s current draw.
The flag is what the runner acts on; the settings signal only exists to break it out of RX so it can look.
Sourcepub fn apply(&self, settings: DeviceSettings)
pub fn apply(&self, settings: DeviceSettings)
Apply new settings. The runner picks them up at its next await point and rebuilds modulation/packet params.
Sourcepub fn request_rssi(&self)
pub fn request_rssi(&self)
Request an instantaneous-RSSI sample from the runner. Pair with
wait_rssi. Only meaningful while the radio is in RX
(i.e. enabled); the caller is responsible for that gating.