SFM_FLOW_METER Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Namespaces | Typedefs | Functions | Variables
sfm_flow_meter_registers.hpp File Reference

Command codes, status-word helpers and the CRC-8 of the SFM flow meters. More...

#include <array>
#include <cstddef>
#include <cstdint>
#include "sfm_flow_meter_detail.hpp"

Go to the source code of this file.

Namespaces

namespace  sfm
 The SFM flow meter driver: everything it declares lives here; internals in detail.
 
namespace  sfm::reg
 Command codes and field helpers.
 

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, status-word helpers and the CRC-8 of the SFM flow meters.

The SF06 families and the SFx6000 have no register map: a transaction is a 16-bit command, an optional 16-bit argument with its CRC, and a read of 16-bit words that each end in a CRC-8. The SF05 family uses 16-bit pointer codes, the SF04 family 8-bit commands. The same code can mean different gases on different parts (0x3615 is nitrous oxide on the SFM4300-20, heliox on the SFM3013-300-CLM and carbon dioxide on the SFM6000D), so start codes live in the part table, never here as a gas.