SFM Flow Meter Driver 1.0.0
API reference
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
sfm_types.hpp File Reference

Flow-meter types: families, gases, variants, readings, status word, results. More...

#include "sfm_commands.hpp"
#include <cstdint>
#include <string_view>
Include dependency graph for sfm_types.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sfm::DriverResult< T >
 
struct  sfm::DriverResult< void >
 
struct  sfm::ProductInfo
 Product identifier + 8-byte serial number (data sheet §4.3.9). More...
 
struct  sfm::Scaling
 Scale factor / offset / unit for one gas lookup table (data sheet §4.3.6). More...
 
struct  sfm::StatusWord
 Decoded status word (data sheet §4.3.2, Table 5). More...
 
struct  sfm::Measurement
 One continuous-mode sample (data sheet §4.3.1 read frame). More...
 

Namespaces

namespace  sfm
 

Enumerations

enum class  sfm::DriverError : uint8_t {
  sfm::None = 0 , sfm::InvalidParameter , sfm::NotInitialized , sfm::BusWrite ,
  sfm::BusRead , sfm::NoData , sfm::Crc , sfm::UnsupportedGas ,
  sfm::NotSupported , sfm::UnexpectedUnit , sfm::VariantUnknown
}
 Driver-level error codes (stable for logging / telemetry). More...
 
enum class  sfm::Family : uint8_t { sfm::Sf06 = 0 , sfm::Sfx6000 }
 Part family: decides command meaning, frame layout and optional features. More...
 
enum class  sfm::Gas : uint8_t {
  sfm::O2 = 0 , sfm::Air , sfm::N2O , sfm::CO2 ,
  sfm::AirO2Mix , sfm::N2OO2Mix , sfm::CO2O2Mix , sfm::Ar ,
  sfm::HeOx , sfm::HeOxO2Mix
}
 Calibrated gas / gas-mixture lookup table selector (family-neutral). More...
 
enum class  sfm::Variant : uint8_t {
  sfm::Unknown = 0 , sfm::Sfm4300_20_B , sfm::Sfm4300_20_O , sfm::Sfm4300_20_P ,
  sfm::Sfm4300_50_B , sfm::Sfm4300_50_O , sfm::Sfm4300_50_P , sfm::Sfm6000D_50 ,
  sfm::Sfm6000D_20 , sfm::Sfm6000D_5 , sfm::Sfm3003_300_CL , sfm::Sfm3003_300_CE ,
  sfm::Sfm3013_300_CL , sfm::Sfm3013_300_CLM , sfm::Sfm3019_240 , sfm::Sfm3119_240_CL
}
 Part variant decoded from the product identifier. More...
 

Functions

constexpr std::string_view sfm::ToString (DriverError e) noexcept
 
constexpr std::string_view sfm::ToString (Family f) noexcept
 
constexpr std::string_view sfm::ToString (Gas g) noexcept
 
constexpr uint16_t sfm::StartCommandFor (Family family, Gas g) noexcept
 Start-measurement command code for g on family.
 
constexpr bool sfm::IsMixture (Gas g) noexcept
 
constexpr std::string_view sfm::ToString (Variant v) noexcept
 
constexpr Family sfm::FamilyOf (Variant v) noexcept
 Family of a known variant (Sf06 for Unknown — the caller's assumption).
 
constexpr Variant sfm::VariantFromProductId (uint32_t product_id) noexcept
 Decode a 32-bit product identifier.
 
constexpr float sfm::FullScaleSlm (Variant v) noexcept
 Full-scale Air / O2 flow [slm] for a known variant (0 when unknown).
 
constexpr bool sfm::SupportsGas (Variant v, Gas g) noexcept
 Whether a variant carries a factory calibration for g.
 
constexpr bool sfm::GasNeedsKnownFamily (Gas g) noexcept
 True when g's start code differs between families (needs a known variant).
 
constexpr bool sfm::StatusNibbleIsKnown (Family family, uint8_t nibble) noexcept
 Whether nibble (status bits 15:12) names a start command of family.
 
constexpr Gas sfm::GasFromStatusNibble (Family family, uint8_t nibble) noexcept
 Map the status command nibble back onto a gas selector (per family).
 
constexpr Gas sfm::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.
 

Detailed Description

Flow-meter types: families, gases, variants, readings, status word, results.

Two Sensirion families share framing and CRC but not gas codes: