|
FDO2 Driver 0.1.0
API reference
|
Public types of the FDO2 driver: errors, Result<T>, the status word, measurements, configuration, firmware capabilities and the pure conversions.
More...
#include <algorithm>#include <array>#include <cstddef>#include <cstdint>#include "fdo2_detail.hpp"#include "fdo2_version.h"Go to the source code of this file.
Classes | |
| struct | fdo2::Result< T > |
| The value of a call, or why there is none. More... | |
| struct | fdo2::Result< void > |
| The result of a call that returns no value. More... | |
| struct | fdo2::Status |
The status word S of #MOXY and #MRAW, decoded (datasheet 4.3, #MOXY). Pure functions of the word; the word is kept whole. More... | |
| struct | fdo2::Oxygen |
#MOXY result: oxygen partial pressure, temperature and status. More... | |
| struct | fdo2::Raw |
#MRAW result: the Oxygen fields plus the raw values. More... | |
| struct | fdo2::Version |
#VERS result (datasheet 4.3, #VERS). More... | |
| struct | fdo2::Capabilities |
What the firmware revision offers (derived from datasheet 5; CapabilitiesFor). More... | |
| struct | fdo2::Identity |
Who the module is: #VERS, #IDNR, the family and what follows from the firmware. More... | |
| struct | fdo2::Counters |
| Counters of what happened on the line; they only grow (docs/non-blocking.md). More... | |
| struct | fdo2::Config |
| Everything the driver needs from the application, with the datasheet defaults. More... | |
| class | fdo2::CheckedConfig |
| A configuration proven valid at build time. More... | |
Namespaces | |
| namespace | fdo2 |
The FDO2 driver: everything it declares lives here; internals in detail. | |
Functions | |
| constexpr const char * | fdo2::ToString (Error error) noexcept |
| The name of an error, for logs. | |
| constexpr Capabilities | fdo2::CapabilitiesFor (Family family, int32_t firmware) noexcept |
| What a firmware revision offers. | |
| constexpr bool | fdo2::HasNoiseErratum (int32_t firmware) noexcept |
| Whether a firmware revision shows the noise erratum (datasheet G2 6.1, G1 6.4). | |
| constexpr bool | fdo2::IsSupportedBaud (uint32_t baud) noexcept |
Whether baud is one of the eleven rates. | |
| constexpr uint32_t | fdo2::AirtimeUs (uint32_t chars, uint32_t baud) noexcept |
Time to send chars characters, 10 bits each at 8N1. | |
| constexpr Error | fdo2::Validate (const Config &config) noexcept |
| Check a configuration without touching the module (zero port traffic). | |
| void | fdo2::ConfigIsInvalid () noexcept |
Reached only when a CheckedConfig is built from an invalid configuration: it is never defined, so the build fails and names it (KB-CPP20-013). | |
| constexpr Result< int32_t > | fdo2::VolumePercentMilli (int32_t o2_mhpa, int32_t pressure_ubar) noexcept |
The oxygen content in volume percent of the gas at the membrane (datasheet 2, p. 6): 100 x pO2 / p, in 10^-3 percent, rounded half up. | |
| constexpr Result< int32_t > | fdo2::AirO2Mhpa (int32_t pressure_ubar, uint32_t fraction_ppm) noexcept |
| The pO2 of dry air at a pressure, for a one-point calibration (A-10). | |
| constexpr Result< int32_t > | fdo2::AirO2Mhpa (int32_t pressure_ubar) noexcept |
AirO2Mhpa() for standard dry air. | |
| constexpr int32_t | fdo2::AmbientLoadMv (const Raw &raw) noexcept |
Sum of ambient light and signal intensity in millivolts, for the 2000 mV advice (datasheet 4.3, #MRAW, ambient light). | |
| constexpr const char * | fdo2::GetDriverVersion () noexcept |
| constexpr uint32_t | fdo2::GetDriverVersionMajor () noexcept |
| constexpr uint32_t | fdo2::GetDriverVersionMinor () noexcept |
| constexpr uint32_t | fdo2::GetDriverVersionPatch () noexcept |
Variables | |
| constexpr int32_t | fdo2::kMinFirmware = 328 |
| Lowest firmware revision any document covers: 3.28 (datasheet G1, 5). | |
| constexpr int32_t | fdo2::kFirmwareBroadcast = 341 |
First revision with the #BCST command, the persistent #CRCE and the broadcast bug fix 3.53. | |
| constexpr int32_t | fdo2::kFirmwareStatusBit0 = 329 |
| First revision with status bit 0. | |
| constexpr int32_t | fdo2::kFirmwareCalibrationError = 351 |
First revision with #ERRO -60. | |
| constexpr int32_t | fdo2::kFirmwareTempFlag = 354 |
| First revision whose temperature-sensor failure sets status bit 5. | |
| constexpr int32_t | fdo2::kFirmwareG2 = 355 |
First revision of the FDO2-G2 (the first with #SETM). | |
| constexpr int32_t | fdo2::kDeviceId = 8 |
| First revision of the FDO2 (the device id of both families). | |
| constexpr int32_t | fdo2::kChannels = 1 |
| Number of oxygen channels. | |
| constexpr int32_t | fdo2::kSensorOxygen = 1 |
#VERS sensor mask bit: oxygen. | |
| constexpr uint32_t | fdo2::kUserMemoryWords = 64 |
Words of user memory (#RDUM, #WRUM). | |
| constexpr uint32_t | fdo2::kBroadcastMinMs = 100 |
Shortest and longest broadcast interval, milliseconds (#BCST). | |
| constexpr uint32_t | fdo2::kBroadcastMaxMs = 10'000 |
| Longest broadcast interval, milliseconds. | |
| constexpr uint32_t | fdo2::kMaxMeasurementMode = 4 |
Highest #SETM mode. | |
| constexpr uint32_t | fdo2::kWarmUpSeconds = 180 |
| Warm-up after power-up, seconds (datasheet 2, Specifications). | |
| constexpr std::array< uint32_t, 11 > | fdo2::kBaudRates |
The baud rates #BAUD accepts, ascending (datasheet 4.3, #BAUD). | |
| constexpr uint32_t | fdo2::kDefaultBaud = 19'200 |
| The rate after every power-up. | |
| constexpr uint32_t | fdo2::kPowerUpMsMin = 1000 |
Bounds of the Config fields, shared by Validate() and the docs. | |
| constexpr uint32_t | fdo2::kPowerUpMsMax = 30'000 |
Largest Config::power_up_ms, ms. | |
| constexpr uint32_t | fdo2::kCommandMsMin = 10 |
Smallest Config::command_ms, ms. | |
| constexpr uint32_t | fdo2::kCommandMsMax = 5000 |
Largest Config::command_ms, ms. | |
| constexpr uint32_t | fdo2::kMeasurementMsMin = 50 |
Smallest Config::measurement_ms, ms. | |
| constexpr uint32_t | fdo2::kMeasurementMsMax = 5000 |
Largest Config::measurement_ms, ms. | |
| constexpr uint32_t | fdo2::kCalibrationMsMin = 10'000 |
Smallest Config::calibration_ms, ms. | |
| constexpr uint32_t | fdo2::kCalibrationMsMax = 60'000 |
Largest Config::calibration_ms, ms. | |
| constexpr uint32_t | fdo2::kFlashMsMin = 100 |
Smallest Config::flash_ms, ms. | |
| constexpr uint32_t | fdo2::kFlashMsMax = 30'000 |
Largest Config::flash_ms, ms. | |
| constexpr uint32_t | fdo2::kLogoMsMin = 100 |
Smallest Config::logo_ms, ms. | |
| constexpr uint32_t | fdo2::kLogoMsMax = 10'000 |
Largest Config::logo_ms, ms. | |
| constexpr uint32_t | fdo2::kMarginMsMax = 1000 |
Largest Config::margin_ms, ms. | |
| constexpr uint32_t | fdo2::kPowerOffMsMin = 10 |
Smallest Config::power_off_ms, ms. | |
| constexpr uint32_t | fdo2::kPowerOffMsMax = 10'000 |
Largest Config::power_off_ms, ms. | |
| constexpr uint8_t | fdo2::kRetriesMax = 3 |
Largest Config::retries. | |
| constexpr uint32_t | fdo2::kBroadcastListenMsMax |
Largest Config::broadcast_listen_ms, ms (covers the longest interval). | |
| constexpr uint8_t | fdo2::kFlashBudgetMax = 64 |
Largest Config::max_flash_writes. | |
| constexpr uint16_t | fdo2::kMinSteadyMax = 3600 |
Largest Config::min_steady_s, s. | |
| constexpr uint8_t | fdo2::kCalWindowPctMax = 100 |
Largest Config::cal_window_pct. | |
| constexpr int32_t | fdo2::kCalWindowMinMhpaMin = 1000 |
Smallest Config::cal_window_min_mhpa. | |
| constexpr int32_t | fdo2::kCalWindowMinMhpaMax = 50'000 |
| constexpr int32_t | fdo2::kCalHighMinMhpa = 10'000 |
| constexpr int32_t | fdo2::kCalHighMaxMhpa = 2'000'000 |
Highest standard #CAHI accepts: the maximum measuring range, 2000 hPa (2, not specified). | |
| constexpr uint32_t | fdo2::kDryAirO2Ppm = 209'500 |
| Fraction of oxygen in dry air, parts per million (standard dry air, assumption A-10). | |
Public types of the FDO2 driver: errors, Result<T>, the status word, measurements, configuration, firmware capabilities and the pure conversions.
Everything here is plain data and constexpr functions with no platform dependency, so handlers, tests and tools can include it without the driver class. Values keep the units the module reports (datasheet section 4.3): 10^-3 hPa, 10^-3 degC, millidegrees, microvolts, microbar and 10^-3 RH, as integers; the unit is part of each name.