103constexpr uint8_t
Crc8(
const uint8_t* data, std::size_t len)
noexcept {
105 for (std::size_t i = 0; i < len; ++i) {
107 for (
int bit = 0; bit < 8; ++bit) {
108 crc =
static_cast<uint8_t
>((crc & 0x80U) != 0U ? ((crc << 1) ^ 0x31U) : (crc << 1));
115constexpr uint8_t
Crc8Word(uint16_t word)
noexcept {
116 const uint8_t b[2] = {
static_cast<uint8_t
>(word >> 8),
static_cast<uint8_t
>(word & 0xFFU)};
120static_assert(
Crc8Word(0xBEEF) == 0x92,
"SF06 CRC-8 test vector (0xBEEF -> 0x92)");
constexpr uint8_t kSfm4300Alt1
ADDR to GND via 1.2 kΩ
Definition sfm_commands.hpp:27
constexpr uint8_t kSfm4300Alt3
ADDR to GND via 5.6 kΩ
Definition sfm_commands.hpp:29
constexpr uint8_t kSfm6000R2k7
2.7 kΩ
Definition sfm_commands.hpp:39
constexpr uint8_t kSfm6000R560
560 Ω
Definition sfm_commands.hpp:37
constexpr uint8_t kGeneralCall
I2C general-call (soft reset)
Definition sfm_commands.hpp:43
constexpr uint8_t kSfm3019
Definition sfm_commands.hpp:34
constexpr uint8_t kSfm6000Default
SFx6000 (SFM6000D / SFC6000D): ADDR pin to GND through a resistor (±5 %).
Definition sfm_commands.hpp:36
constexpr uint8_t kSfm6000R27k
27 kΩ
Definition sfm_commands.hpp:42
constexpr uint8_t kSfm4300Alt2
ADDR to GND via 2.7 kΩ
Definition sfm_commands.hpp:28
constexpr uint8_t kSfm3119
Definition sfm_commands.hpp:30
constexpr uint8_t kSfm3003Ce
SFM3003-300-CE (SFM3003 data sheet Table 2)
Definition sfm_commands.hpp:32
constexpr uint8_t kSfm6000R5k6
5.6 kΩ
Definition sfm_commands.hpp:40
constexpr uint8_t kSfm6000R12k
12 kΩ
Definition sfm_commands.hpp:41
constexpr uint8_t kSfm4300Default
ADDR to GND or floating.
Definition sfm_commands.hpp:26
constexpr uint8_t kSfm3013
Definition sfm_commands.hpp:33
constexpr uint8_t kSfm3003
SFM3003-300-CL.
Definition sfm_commands.hpp:31
constexpr uint8_t kSfm6000R1k2
1.2 kΩ
Definition sfm_commands.hpp:38
constexpr uint16_t kStopContinuous
Definition sfm_commands.hpp:69
constexpr uint16_t kSfx6000PointerGasInfo
after kReadScaleOffsetUnit
Definition sfm_commands.hpp:64
constexpr uint16_t kConfigureAveraging
argument: N (0 = avg-until-read)
Definition sfm_commands.hpp:70
constexpr uint16_t kSfx6000StartGas3
N2O (CO2 on SF06!)
Definition sfm_commands.hpp:60
constexpr uint16_t kEnterSleep
Definition sfm_commands.hpp:72
constexpr uint16_t kSfx6000StartGas2
CO2 (N2O on SF06!)
Definition sfm_commands.hpp:59
constexpr uint16_t kSfx6000StartGas4
Ar.
Definition sfm_commands.hpp:61
constexpr uint16_t kStartCO2O2Mix
argument: O2 volume fraction (‰)
Definition sfm_commands.hpp:55
constexpr uint16_t kStartAirO2Mix
argument: O2 volume fraction (‰)
Definition sfm_commands.hpp:53
constexpr uint16_t kUpdateConcentrationSet
argument: ‰
Definition sfm_commands.hpp:67
constexpr uint16_t kStartN2O
Definition sfm_commands.hpp:51
constexpr uint16_t kStartN2OO2Mix
argument: O2 volume fraction (‰)
Definition sfm_commands.hpp:54
constexpr uint16_t kSfx6000StartGas1
Air.
Definition sfm_commands.hpp:58
constexpr uint16_t kUpdateConcentrationActivate
Definition sfm_commands.hpp:68
constexpr uint8_t kGeneralCallReset
single byte to address 0x00
Definition sfm_commands.hpp:74
constexpr uint16_t kStartAir
Definition sfm_commands.hpp:50
constexpr uint16_t kSfx6000StartMix0
Gas0 in Gas1 (O2 in Air); argument ‰
Definition sfm_commands.hpp:62
constexpr uint16_t kReadProductIdentifier
Definition sfm_commands.hpp:73
constexpr uint16_t kReadScaleOffsetUnit
argument: start command code
Definition sfm_commands.hpp:71
constexpr uint16_t kSfx6000PointerResult
back to flow / reserved / status
Definition sfm_commands.hpp:66
constexpr uint16_t kSfx6000PointerTemperature
while measuring (product ID when idle)
Definition sfm_commands.hpp:65
constexpr uint16_t kStartO2
Definition sfm_commands.hpp:49
constexpr uint16_t kStartCO2
Definition sfm_commands.hpp:52
constexpr uint16_t kSfx6000StartGas0
O2.
Definition sfm_commands.hpp:57
constexpr uint32_t kSfx6000SoftResetMs
interface reference §1.2
Definition sfm_commands.hpp:87
constexpr uint32_t kWarmUpMs
after reset / exit sleep
Definition sfm_commands.hpp:82
constexpr uint32_t kFirstResultAfterStartMs
first reading valid after start
Definition sfm_commands.hpp:79
constexpr uint32_t kMeasurementPeriodUs
internal sample period (~2 kHz)
Definition sfm_commands.hpp:83
constexpr uint32_t kAccuracySettleAfterStartMs
few-% deviations possible before
Definition sfm_commands.hpp:80
constexpr uint32_t kSfx6000MeasurementPeriodUs
1 kHz, NACK when no new sample
Definition sfm_commands.hpp:88
constexpr uint32_t kStopToIdleMs
kStopToIdleUs rounded up for DelayMs()
Definition sfm_commands.hpp:85
constexpr uint16_t kMaxAveragingWindow
Definition sfm_commands.hpp:86
constexpr uint32_t kStopToIdleUs
§4.3.4: idle and receptive ≤ 0.5 ms after stop
Definition sfm_commands.hpp:84
constexpr uint32_t kSoftResetMs
typ. 16 ms, max 20 ms
Definition sfm_commands.hpp:81
constexpr uint16_t kStatusPureGasFraction
Status-word gas fraction value for a pure calibration gas (bits 9:0).
Definition sfm_commands.hpp:98
constexpr uint8_t Crc8Word(uint16_t word) noexcept
CRC-8 of one big-endian 16-bit word.
Definition sfm_commands.hpp:115
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).
Definition sfm_commands.hpp:103
constexpr float kTemperatureScalePerC
Temperature scale (data sheet Tables 15/16: scale 200 per °C, offset 0).
Definition sfm_commands.hpp:95
constexpr uint16_t kFlowUnitSlm20C
Fixed flow-unit code returned by the SFM4300 (slm at 20 °C, 1013.25 mbar).
Definition sfm_commands.hpp:92