|
| enum class | DriverError : uint8_t {
None = 0
, InvalidParameter
, NotInitialized
, BusWrite
,
BusRead
, NoData
, Crc
, UnsupportedGas
,
NotSupported
, UnexpectedUnit
, VariantUnknown
} |
| | Driver-level error codes (stable for logging / telemetry). More...
|
| |
| enum class | Family : uint8_t { Sf06 = 0
, Sfx6000
} |
| | Part family: decides command meaning, frame layout and optional features. More...
|
| |
| enum class | Gas : uint8_t {
O2 = 0
, Air
, N2O
, CO2
,
AirO2Mix
, N2OO2Mix
, CO2O2Mix
, Ar
,
HeOx
, HeOxO2Mix
} |
| | Calibrated gas / gas-mixture lookup table selector (family-neutral). More...
|
| |
| enum class | Variant : uint8_t {
Unknown = 0
, Sfm4300_20_B
, Sfm4300_20_O
, Sfm4300_20_P
,
Sfm4300_50_B
, Sfm4300_50_O
, Sfm4300_50_P
, Sfm6000D_50
,
Sfm6000D_20
, Sfm6000D_5
, Sfm3003_300_CL
, Sfm3003_300_CE
,
Sfm3013_300_CL
, Sfm3013_300_CLM
, Sfm3019_240
, Sfm3119_240_CL
} |
| | Part variant decoded from the product identifier. More...
|
| |
|
| const char * | GetDriverVersion () noexcept |
| | Driver version string (from generated sfm_version.h).
|
| |
| constexpr uint8_t | Crc8 (const uint8_t *data, std::size_t len) noexcept |
| | CRC-8 per Sensirion SF06 (poly 0x31, init 0xFF, no reflection/xorout).
|
| |
| constexpr uint8_t | Crc8Word (uint16_t word) noexcept |
| | CRC-8 of one big-endian 16-bit word.
|
| |
| constexpr std::string_view | ToString (DriverError e) noexcept |
| |
| constexpr std::string_view | ToString (Family f) noexcept |
| |
| constexpr std::string_view | ToString (Gas g) noexcept |
| |
| constexpr uint16_t | StartCommandFor (Family family, Gas g) noexcept |
| | Start-measurement command code for g on family.
|
| |
| constexpr bool | IsMixture (Gas g) noexcept |
| |
| constexpr std::string_view | ToString (Variant v) noexcept |
| |
| constexpr Family | FamilyOf (Variant v) noexcept |
| | Family of a known variant (Sf06 for Unknown — the caller's assumption).
|
| |
| constexpr Variant | VariantFromProductId (uint32_t product_id) noexcept |
| | Decode a 32-bit product identifier.
|
| |
| constexpr float | FullScaleSlm (Variant v) noexcept |
| | Full-scale Air / O2 flow [slm] for a known variant (0 when unknown).
|
| |
| constexpr bool | SupportsGas (Variant v, Gas g) noexcept |
| | Whether a variant carries a factory calibration for g.
|
| |
| constexpr bool | GasNeedsKnownFamily (Gas g) noexcept |
| | True when g's start code differs between families (needs a known variant).
|
| |
| constexpr bool | StatusNibbleIsKnown (Family family, uint8_t nibble) noexcept |
| | Whether nibble (status bits 15:12) names a start command of family.
|
| |
| constexpr Gas | GasFromStatusNibble (Family family, uint8_t nibble) noexcept |
| | Map the status command nibble back onto a gas selector (per family).
|
| |
| constexpr Gas | GasFromStatusNibble (Variant variant, uint8_t nibble) noexcept |
| | Variant-aware status decode: as the family overload, except that on the SFM3013-300-CLM nibble 2 is HeOx and 7 is HeOx/O2.
|
| |
| constexpr bool sfm::StatusNibbleIsKnown |
( |
Family |
family, |
|
|
uint8_t |
nibble |
|
) |
| |
|
constexprnoexcept |
Whether nibble (status bits 15:12) names a start command of family.
SF06 (SFM4300 data sheet §4.3.2 Table 5): the nibble is the index of the running command in the start-command table — 0 O2, 1 Air, 2 N2O, 3 CO2, 4 and 5 reserved (0x3624, 0x362F), 6 Air/O2, 7 N2O/O2, 8 CO2/O2. SFx6000: 0 to 4 pure gases, 0xA O2 in Air.
| constexpr bool sfm::SupportsGas |
( |
Variant |
v, |
|
|
Gas |
g |
|
) |
| |
|
constexprnoexcept |
Whether a variant carries a factory calibration for g.
SFM4300-50-x: O2, Air, Air/O2 mixture only (Table 16). SFM4300-20-x: the seven SF06 tables. SFM6000D-x: O2, Air, CO2, N2O, Ar and O2-in-Air. SFM3003 / SFM3013-300-CL / SFM3019 / SFM3119: O2, Air, Air/O2 (Table 2 of each data sheet); SFM3013-300-CLM adds HeOx and HeOx/O2. Unknown variants: O2 and Air only — every other start code means a different gas (or none) on the other family, so it is refused until the identity is read (see GasNeedsKnownFamily).