SFM_FLOW_METER Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Namespaces
sfm_flow_meter_protocols.hpp File Reference

The six protocol policies: pure constexpr functions that turn an operation into a Plan of bus steps and decode what the sensor sent back. No I/O, no state. More...

#include <array>
#include <cstddef>
#include <cstdint>
#include <span>
#include "sfm_flow_meter_detail.hpp"
#include "sfm_flow_meter_i2c_interface.hpp"
#include "sfm_flow_meter_parts.hpp"
#include "sfm_flow_meter_registers.hpp"
#include "sfm_flow_meter_types.hpp"

Go to the source code of this file.

Namespaces

namespace  sfm
 The SFM flow meter driver: everything it declares lives here; internals in detail.
 

Detailed Description

The six protocol policies: pure constexpr functions that turn an operation into a Plan of bus steps and decode what the sensor sent back. No I/O, no state.

The driver core runs a Plan one step at a time (it never blocks) and hands the bytes it received to a decoder. Every decoder reads the bytes through ParseWords(), the only code that reads raw bytes: it checks the CRC-8 of every word before any value is decoded (invariant I1). The dispatch is on PartInfo::family and on feature bits, never on a variant.