Module pump

Module pump 

Source
Expand description

The receiver orchestration loop.

This is the part that would otherwise be copied into every firmware: power the receiver when it is wanted, read its UART, hand each completed fix upward, and put it back to sleep when it is not. It is generic over the three things that actually differ between boards — the byte stream, the power sequencing, and what is done with a fix — so a new board contributes those and nothing else.

#[embassy_executor::task] functions cannot be generic, so a firmware still writes a task shim; the shim is a handful of lines that constructs a UART and a control type and calls run. The loop itself lives here, once, for both cargo workspaces.

§Off means off

While disabled the receiver is powered down, not merely ignored. On most of these boards it is the largest continuous load there is, so a loop that kept reading and discarded the sentences would save nothing that matters.

The exception is rtc_read_once, for boards whose only surviving clock is the one inside the receiver. That reads the time out of a receiver that is otherwise off, discards everything positional it sees on the way, and returns the receiver to its off state. It is a clock operation, and is gated on whether the receiver’s time is trusted rather than on whether positioning is enabled.

Re-exports§

pub use embedded_io_async;
pub use embedded_hal_async;

Constants§

RTC_READ_TIMEOUT_MS
How long rtc_read_once waits for a dated sentence before giving up, in milliseconds.

Traits§

Enable
Whether the receiver should be running, and a way to wait for that to change.
Power
Board-specific power sequencing for one receiver.
Sink
What the firmware does with what the receiver says.

Functions§

rtc_read_once
Power the receiver just long enough to read the time out of it, then return it to its off state.
run
Drive one receiver forever.