|
SFM_FLOW_METER Driver 0.1.0
API reference
|
Errors, results, families, variants, samples and configuration. More...
Classes | |
| struct | sfm::Result< T > |
| The value of a call, or why there is none. More... | |
| struct | sfm::Result< void > |
| The result of a call that returns no value. More... | |
| struct | sfm::Wait |
A wait the caller owes the driver: delay us, then call Poll(). 0 means nothing to wait. More... | |
| struct | sfm::ProductInfo |
| The product identifier read at initialisation. More... | |
| struct | sfm::ScalingInfo |
| What the sensor reports about the scaling of a gas, and whether it matches the table. More... | |
| struct | sfm::Capabilities |
| Which calls a part offers, from its table row. More... | |
| struct | sfm::Sample |
| One measurement. Flow is in millilitres per minute at the part's reference conditions. More... | |
| struct | sfm::RawReply |
| The words of one reply, after their CRCs were checked and before anything was decoded. More... | |
| struct | sfm::Stats |
| Counters the driver keeps; none of them is cleared by a successful call. More... | |
| struct | sfm::Config |
Everything EnsureInitialized() applies. More... | |
Functions | |
| constexpr const char * | sfm::ToString (Error error) noexcept |
| The name of an error, for logs. | |
| constexpr uint32_t | sfm::FamilyBit (Family f) noexcept |
A bit in a family mask: SfmFlowMeter<Port, kFamilySf06 | kFamilySf05>. | |
| constexpr const char * | sfm::GetDriverVersion () noexcept |
| constexpr uint32_t | sfm::GetDriverVersionMajor () noexcept |
| constexpr uint32_t | sfm::GetDriverVersionMinor () noexcept |
| constexpr uint32_t | sfm::GetDriverVersionPatch () noexcept |
Variables | |
| constexpr uint32_t | sfm::kFamilySf06 = 1U << 0 |
| Family mask bits. | |
| constexpr uint32_t | sfm::kFamilySf06Gen2 = 1U << 1 |
Family::Sf06Gen2. | |
| constexpr uint32_t | sfm::kFamilySf06Dual = 1U << 2 |
Family::Sf06Dual. | |
| constexpr uint32_t | sfm::kFamilySf05 = 1U << 3 |
Family::Sf05. | |
| constexpr uint32_t | sfm::kFamilySf04 = 1U << 4 |
Family::Sf04. | |
| constexpr uint32_t | sfm::kFamilySfx6000 = 1U << 5 |
| constexpr uint32_t | sfm::kAllFamilies = 0x3FU |
| Every family: the default mask. | |
| constexpr uint16_t | sfm::kAveragingDefault = 0xFFFFU |
Marks Config::averaging as "the family's reset value". | |
| constexpr uint16_t | sfm::kFilterDefault = 50961U |
| The filter argument of the default 3 ms response (SFM3304, SFM3505). | |
Errors, results, families, variants, samples and configuration.
|
strong |
Why a call failed. Every call of the driver returns one of these in its Result.
Values 0 to 9 are the shared base set; chip-specific values start at 16. [[nodiscard]] on the type: a function that returns a bare Error cannot have it ignored either (KB-CPP20-037).
| Enumerator | |
|---|---|
| Ok | The call succeeded. |
| NotInitialized |
|
| InvalidArgument | An argument or a |
| Bus | A write hook returned |
| Timeout | A bounded wait or poll ended: wake, reset, stretched read. |
| DeviceIdMismatch | The product identifier is not the configured part (or a prototype). |
| Crc | A received word failed its CRC-8; the whole transfer was discarded. |
| Busy | The call is not allowed in the current mode, or a wait is pending. |
| DeviceFault | The scaling the sensor reports differs from the part's datasheet value. |
| Unsupported | The part, the port hook or the family mask does not offer this call. |
| NoData | The read header was NACKed: no new sample yet (or the sensor is idle). |
| NoDevice | The address is not acknowledged on a write, a poll or initialisation. |
| OutOfRange | A flow or temperature outside the part's span plus margin. |
| StatusMismatch | The status word does not describe the measurement the driver started. |
| Stale | The sample may not be fresh enough (settling, smoothing or age). |
| DeviceReset | The measurement is over (the sensor reset, or was silent for the whole bound): idle again. |
| StateUnknown | A failed command left the chip's mode unknown; initialise again. |
| InvalidReply | A CRC-valid reply the sensor cannot send (stuck line, reserved value). |
|
strong |
The command-set family of a part. One protocol policy per family; every part is a row of data that names its family.
|
strong |
A calibrated gas or gas mixture. Which gases a part offers is in its table row.
|
strong |
|
strong |
What ReadSample() does with a flow or temperature outside the part's span.
| Enumerator | |
|---|---|
| Reject |
|
| Flag | The value is returned with |
|
strong |
What ReadScaling() does when the sensor's scale or offset differs from the datasheet.
|
strong |
The driver's shadow of the chip's mode.
|
strong |
|
strong |
A part (one row of the table in sfm_flow_meter_parts.hpp). The names follow the vendor's ordering suffixes; _B, _O and _P are the SFM4300 fittings.
|
constexprnoexcept |
A bit in a family mask: SfmFlowMeter<Port, kFamilySf06 | kFamilySf05>.
| f | The family. |
f.
|
constexprnoexcept |
"0.1.0", from the generated sfm_flow_meter_version.h. No I/O.
|
constexprnoexcept |
|
constexprnoexcept |
|
constexprnoexcept |
|
constexprnoexcept |
The name of an error, for logs.
| error | The error. |
"Timeout"; "Unknown" for a value that is not an enumerator.
|
inlineconstexpr |
Family mask bits.
|
inlineconstexpr |