SFM_FLOW_METER Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Typedefs | Functions | Variables
Commands and fields

Command codes with the datasheet section that defines each. More...

Typedefs

using sfm::reg::StatusCommand = detail::Field< uint16_t, 12U, 4U >
 
using sfm::reg::StatusSmoothing = detail::Field< uint16_t, 11U, 1U >
 Status word, bit 11: exponential smoothing is active (SF06 and SFM3304).
 
using sfm::reg::StatusFixedN = detail::Field< uint16_t, 10U, 1U >
 Status word, bit 10: fixed-N averaging is active (SF06 and SFM3304).
 
using sfm::reg::StatusConcentration = detail::Field< uint16_t, 0U, 10U >
 
using sfm::reg::StatusFilterArg = detail::Field< uint16_t, 9U, 1U >
 SFM3304 status word, bit 9: a filter argument was received.
 
using sfm::reg::StatusAverages = detail::Field< uint16_t, 0U, 9U >
 SFM3304 status word, bits 8:0: the configured number of averages.
 

Functions

constexpr uint8_t sfm::reg::Crc8 (uint8_t init, uint8_t high, uint8_t low) noexcept
 CRC-8 of one 16-bit word as the chip computes it: polynomial 0x31 (x^8.
 
constexpr bool sfm::reg::CrcVectorsHold () noexcept
 The CRC vectors of the datasheets, proved at build time (see the static_assert below).
 

Variables

constexpr uint16_t sfm::reg::kCmdStartGas0 = 0x3603
 Start continuous measurement, gas 0.
 
constexpr uint16_t sfm::reg::kCmdStartGas1 = 0x3608
 Start continuous measurement, gas 1.
 
constexpr uint16_t sfm::reg::kCmdStartGas2 = 0x3615
 Start continuous measurement, gas 2.
 
constexpr uint16_t sfm::reg::kCmdStartGas3 = 0x361E
 Start continuous measurement, gas 3.
 
constexpr uint16_t sfm::reg::kCmdStartGas4
 Start, gas 4 (SFx6000 argon; reserved on SF06).
 
constexpr uint16_t sfm::reg::kCmdStartMixture0
 Start, mixture 0 (argument: O2 in per mille).
 
constexpr uint16_t sfm::reg::kCmdStartMixture1 = 0x3639
 Start, mixture 1.
 
constexpr uint16_t sfm::reg::kCmdStartMixture2 = 0x3646
 Start, mixture 2.
 
constexpr uint16_t sfm::reg::kCmdStartSfxMixture0 = 0x3650
 SFx6000: start, mixture 0.
 
constexpr uint16_t sfm::reg::kCmdUpdateConcentration
 Update concentration, part 1 (argument).
 
constexpr uint16_t sfm::reg::kCmdResultPointer = 0xE000
 Point the read at the result buffer.
 
constexpr uint16_t sfm::reg::kCmdStop = 0x3FF9
 Stop continuous measurement.
 
constexpr uint16_t sfm::reg::kCmdAveraging = 0x366A
 SF06 and SFM3304: configure averaging.
 
constexpr uint16_t sfm::reg::kCmdAveragingDual = 0x364D
 SFM3505: configure averaging.
 
constexpr uint16_t sfm::reg::kCmdReadScale
 Read scale factor, offset and unit (argument).
 
constexpr uint16_t sfm::reg::kCmdSleep = 0x3677
 Enter sleep mode.
 
constexpr uint16_t sfm::reg::kCmdProductId = 0xE102
 Read the product identifier (idle).
 
constexpr uint16_t sfm::reg::kCmdDeviceIdDual = 0x365B
 SFM3505: read the device identifier.
 
constexpr uint16_t sfm::reg::kCmdSfxScalePointer
 SFx6000: point the read at the gas information.
 
constexpr uint16_t sfm::reg::kCmdSfxTemperature
 SFx6000: point the read at the temperature.
 
constexpr uint8_t sfm::reg::kGeneralCallReset = 0x06
 Byte sent to address 0x00 to reset.
 
constexpr uint8_t sfm::reg::kGeneralCallAddress = 0x00
 The I2C general-call address.
 
constexpr uint16_t sfm::reg::kSf05Flow = 0x1000
 Start flow measurement / point at the flow.
 
constexpr uint16_t sfm::reg::kSf05Temperature = 0x1001
 Point at the temperature.
 
constexpr uint16_t sfm::reg::kSf05Reset = 0x2000
 Soft reset (SFM3x00).
 
constexpr uint16_t sfm::reg::kSf05ScaleFlow = 0x30DE
 Flow scale factor.
 
constexpr uint16_t sfm::reg::kSf05OffsetFlow = 0x30DF
 Flow offset.
 
constexpr uint16_t sfm::reg::kSf05Serial = 0x31AE
 
constexpr uint16_t sfm::reg::kSf05SerialLow = 0x31AF
 Serial number, least significant word.
 
constexpr uint8_t sfm::reg::kSf04TriggerFlow = 0xF1
 Trigger a flow measurement.
 
constexpr uint8_t sfm::reg::kSf04TriggerTemperature = 0xF3
 Trigger a temperature measurement.
 
constexpr uint8_t sfm::reg::kSf04SoftReset = 0xFE
 Soft reset.
 
constexpr uint8_t sfm::reg::kSf04UserRegister = 0xE3
 Read the user register.
 
constexpr uint8_t sfm::reg::kSf04ReadOnly2 = 0xE9
 Read read-only register 2.
 
constexpr uint8_t sfm::reg::kSf04Eeprom = 0xFA
 Read the EEPROM.
 
constexpr uint16_t sfm::reg::kSf04EepromSerial
 EEPROM address of the product serial number.
 
constexpr uint16_t sfm::reg::kSf04EepromScale = 0x02B6
 EEPROM address of the scale factor.
 
constexpr uint16_t sfm::reg::kSf04EepromUnit = 0x02B7
 EEPROM address of the flow-unit word.
 
constexpr uint16_t sfm::reg::kSf04FieldStride = 0x0300
 EEPROM size of one calibration field.
 
constexpr uint16_t sfm::reg::kUnitSlm = 0x0148
 
constexpr uint16_t sfm::reg::kUnitSccm = 0x0145
 
constexpr uint16_t sfm::reg::kStatusPureGas = 0x3FF
 Status bits 9:0 of a pure gas.
 

Detailed Description

Command codes with the datasheet section that defines each.

Typedef Documentation

◆ StatusCommand

using sfm::reg::StatusCommand = typedef detail::Field<uint16_t, 12U, 4U>

Status word, bits 15:12: the index of the running start command (SF06, SFx6000).

◆ StatusConcentration

using sfm::reg::StatusConcentration = typedef detail::Field<uint16_t, 0U, 10U>

Status word, bits 9:0: 0x3FF for a pure gas, else the oxygen fraction in per mille (SF06).

Function Documentation

◆ Crc8()

constexpr uint8_t sfm::reg::Crc8 ( uint8_t  init,
uint8_t  high,
uint8_t  low 
)
constexprnoexcept

CRC-8 of one 16-bit word as the chip computes it: polynomial 0x31 (x^8.

  • x^5 + x^4 + 1), no reflection, final XOR 0x00. The initial value is the family's (0xFF for SF06, SFM3304, SFM3505 and SFx6000; 0x00 for SF05 and SF04).
    Parameters
    initThe initial value.
    highThe high data byte (sent first).
    lowThe low data byte.
    Returns
    The CRC.

◆ CrcVectorsHold()

constexpr bool sfm::reg::CrcVectorsHold ( )
constexprnoexcept

The CRC vectors of the datasheets, proved at build time (see the static_assert below).

Returns
true when every vector holds.

Variable Documentation

◆ kCmdReadScale

constexpr uint16_t sfm::reg::kCmdReadScale
inlineconstexpr
Initial value:
=
0x3661

Read scale factor, offset and unit (argument).

◆ kCmdSfxScalePointer

constexpr uint16_t sfm::reg::kCmdSfxScalePointer
inlineconstexpr
Initial value:
=
0xE151

SFx6000: point the read at the gas information.

◆ kCmdSfxTemperature

constexpr uint16_t sfm::reg::kCmdSfxTemperature
inlineconstexpr
Initial value:
=
0xE102

SFx6000: point the read at the temperature.

◆ kCmdStartGas4

constexpr uint16_t sfm::reg::kCmdStartGas4
inlineconstexpr
Initial value:
=
0x3624

Start, gas 4 (SFx6000 argon; reserved on SF06).

◆ kCmdStartMixture0

constexpr uint16_t sfm::reg::kCmdStartMixture0
inlineconstexpr
Initial value:
=
0x3632

Start, mixture 0 (argument: O2 in per mille).

◆ kCmdUpdateConcentration

constexpr uint16_t sfm::reg::kCmdUpdateConcentration
inlineconstexpr
Initial value:
=
0xE17D

Update concentration, part 1 (argument).

◆ kSf04EepromSerial

constexpr uint16_t sfm::reg::kSf04EepromSerial
inlineconstexpr
Initial value:
=
0x02F8

EEPROM address of the product serial number.

◆ kSf05Serial

constexpr uint16_t sfm::reg::kSf05Serial = 0x31AE
inlineconstexpr

Serial number, most significant word: point at it, read one word.

◆ kUnitSccm

constexpr uint16_t sfm::reg::kUnitSccm = 0x0145
inlineconstexpr

The SFM4100 EEPROM flow unit decoded from the sample code: millilitre per minute (sccm).

◆ kUnitSlm

constexpr uint16_t sfm::reg::kUnitSlm = 0x0148
inlineconstexpr

The flow unit word of every SF06 part: standard litre per minute at 20 C (SFM4300 section 4.5.4).