HF-FDO2 Driver 0.1.0-dev
UART driver for PyroScience FDO2-G2 (data sheet v5 §4: #MOXY, #MRAW, #VERS)
Loading...
Searching...
No Matches
fdo2 Namespace Reference

Namespaces

namespace  detail
 
namespace  moxy_status
 

Classes

class  Driver
 FDO2-G2 UART client. More...
 
struct  DriverResult
 
struct  DriverResult< void >
 
struct  MoxyReading
 Decoded #MOXY O T S sample (data sheet §4.3). More...
 
struct  MrawReading
 Decoded #MRAW O T S D I A P H (data sheet §4.3). More...
 
class  UartInterface
 CRTP base for PSUP serial transport. More...
 
struct  VersionInfo
 #VERS D N R S fields (FDO2-G2 data sheet §4.3). More...
 

Enumerations

enum class  DriverError : uint8_t {
  None = 0 , InvalidParameter , Timeout , BufferOverflow ,
  ProtocolError , DeviceError
}
 Driver-level error codes (stable for logging / telemetry). More...
 

Functions

const char * GetDriverVersion () noexcept
 Driver version string (from generated fdo2_version.h).
 
constexpr std::string_view ToString (DriverError e) noexcept
 
constexpr double FirmwareRevisionToDouble (int32_t r) noexcept
 
constexpr bool MoxyStatusOkForOxygen (uint32_t s) noexcept
 Data sheet: normal operation implies S is 0 or 1 only.
 
MoxyReading DecodeMoxy (int32_t o_raw, int32_t t_raw, uint32_t s) noexcept
 
MrawReading DecodeMraw (int32_t o_raw, int32_t t_raw, uint32_t s, int32_t d_raw, int32_t i_raw, int32_t a_raw, int32_t p_raw, int32_t h_raw) noexcept
 
double VolumePercentO2 (double p_o2_hpa, double p_air_mbar) noexcept
 Volume % O₂ when p_air at the sensing membrane equals back-side pressure P.
 

Variables

constexpr uint32_t kFdo2G2DefaultBaud = 19200U
 Default UART speed after power-up per FDO2-G2 data sheet §4.
 
constexpr uint32_t kFdo2G2PowerUpSettleMs = 1100U
 Typical boot delay before the module accepts commands (data sheet: ~1 s).
 

Enumeration Type Documentation

◆ DriverError

enum class fdo2::DriverError : uint8_t
strong

Driver-level error codes (stable for logging / telemetry).

Enumerator
None 
InvalidParameter 
Timeout 
BufferOverflow 
ProtocolError 
DeviceError 

Function Documentation

◆ DecodeMoxy()

MoxyReading fdo2::DecodeMoxy ( int32_t o_raw,
int32_t t_raw,
uint32_t s )
inlinenoexcept

◆ DecodeMraw()

MrawReading fdo2::DecodeMraw ( int32_t o_raw,
int32_t t_raw,
uint32_t s,
int32_t d_raw,
int32_t i_raw,
int32_t a_raw,
int32_t p_raw,
int32_t h_raw )
inlinenoexcept

◆ FirmwareRevisionToDouble()

constexpr double fdo2::FirmwareRevisionToDouble ( int32_t r)
constexprnoexcept
Returns
Firmware as major.minor (R / 100.0).

◆ GetDriverVersion()

const char * fdo2::GetDriverVersion ( )
inlinenoexcept

Driver version string (from generated fdo2_version.h).

◆ MoxyStatusOkForOxygen()

constexpr bool fdo2::MoxyStatusOkForOxygen ( uint32_t s)
constexprnoexcept

Data sheet: normal operation implies S is 0 or 1 only.

◆ ToString()

constexpr std::string_view fdo2::ToString ( DriverError e)
constexprnoexcept

◆ VolumePercentO2()

double fdo2::VolumePercentO2 ( double p_o2_hpa,
double p_air_mbar )
inlinenoexcept

Volume % O₂ when p_air at the sensing membrane equals back-side pressure P.

Parameters
p_o2_hpaPartial pressure O₂ [hPa] (from #MOXY / #MRAW O scaling).
p_air_mbarAmbient / vent-path pressure [mbar] (from #MRAW P scaling; mbar ≈ hPa for this ratio per data sheet §2).

Variable Documentation

◆ kFdo2G2DefaultBaud

constexpr uint32_t fdo2::kFdo2G2DefaultBaud = 19200U
constexpr

Default UART speed after power-up per FDO2-G2 data sheet §4.

◆ kFdo2G2PowerUpSettleMs

constexpr uint32_t fdo2::kFdo2G2PowerUpSettleMs = 1100U
constexpr

Typical boot delay before the module accepts commands (data sheet: ~1 s).