HardFOC Core
API reference
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Fdo2Handler Class Reference

HAL handler wrapping one FDO2-G2 oxygen probe on a BaseUart. More...

#include <Fdo2Handler.h>

Public Types

using DriverType = fdo2::Driver< HalUartFdo2Comm >
 

Public Member Functions

 Fdo2Handler (BaseUart &uart, const Fdo2HandlerConfig &config=Fdo2HandlerConfig{}, RtosMutex *bus_mutex=nullptr) noexcept
 Construct a handler around an already-configured UART.
 
 Fdo2Handler (const Fdo2Handler &)=delete
 
Fdo2Handler & operator= (const Fdo2Handler &)=delete
 
 Fdo2Handler (Fdo2Handler &&)=delete
 
Fdo2Handler & operator= (Fdo2Handler &&)=delete
 
bool EnsureInitialized () noexcept
 Wait the FDO2-G2 power-up settle (kFdo2G2PowerUpSettleMs) and probe the device with #VERS. Caches the returned VersionInfo on success. Idempotent.
 
bool IsPresent () const noexcept
 True once EnsureInitialized() has succeeded.
 
const fdo2::VersionInfo & Identity () const noexcept
 Cached identity (zeroed until probe succeeds).
 
fdo2::DriverResult< fdo2::MoxyReading > MeasureMoxy () noexcept
 One #MOXY round-trip โ€” partial-pressure O2 + temperature + status.
 
fdo2::DriverResult< fdo2::MrawReading > MeasureMraw () noexcept
 
fdo2::DriverResult< fdo2::VersionInfo > ReadVersion () noexcept
 Re-read #VERS (refreshes the cached Identity).
 
fdo2::DriverResult< std::uint64_t > ReadUniqueId () noexcept
 Read the device's 64-bit unique serial via #IDNR.
 

Private Member Functions

bool EnsureInitializedLocked () noexcept
 

Private Attributes

Fdo2HandlerConfig config_
 
HalUartFdo2Comm comm_
 
std::unique_ptr< DriverType > driver_
 
fdo2::VersionInfo identity_ {}
 
std::atomic< bool > initialized_ {false}
 
RtosMutex private_mutex_
 
RtosMutex * bus_mutex_
 

Detailed Description

HAL handler wrapping one FDO2-G2 oxygen probe on a BaseUart.

Ownership: the handler holds a reference to the supplied BaseUart (the host owns the UART instance); the handler owns the CRTP adapter + the templated driver instance.

Member Typedef Documentation

◆ DriverType

Constructor & Destructor Documentation

◆ Fdo2Handler() [1/3]

Fdo2Handler::Fdo2Handler ( BaseUart &  uart,
const Fdo2HandlerConfig &  config = Fdo2HandlerConfig{},
RtosMutex *  bus_mutex = nullptr 
)
explicitnoexcept

Construct a handler around an already-configured UART.

Parameters
uartReference to an already-configured UART. Must outlive the handler.
configPer-instance timeouts + diagnostics index.
bus_mutexOptional shared mutex (non-null) when more than one PSUP device shares the UART. When null, the handler uses its own private mutex.

◆ Fdo2Handler() [2/3]

Fdo2Handler::Fdo2Handler ( const Fdo2Handler &  )
delete

◆ Fdo2Handler() [3/3]

Fdo2Handler::Fdo2Handler ( Fdo2Handler &&  )
delete

Member Function Documentation

◆ EnsureInitialized()

bool Fdo2Handler::EnsureInitialized ( )
noexcept

Wait the FDO2-G2 power-up settle (kFdo2G2PowerUpSettleMs) and probe the device with #VERS. Caches the returned VersionInfo on success. Idempotent.

◆ EnsureInitializedLocked()

bool Fdo2Handler::EnsureInitializedLocked ( )
privatenoexcept

◆ Identity()

const fdo2::VersionInfo & Fdo2Handler::Identity ( ) const
inlinenoexcept

Cached identity (zeroed until probe succeeds).

◆ IsPresent()

bool Fdo2Handler::IsPresent ( ) const
inlinenoexcept

True once EnsureInitialized() has succeeded.

◆ MeasureMoxy()

fdo2::DriverResult< fdo2::MoxyReading > Fdo2Handler::MeasureMoxy ( )
noexcept

One #MOXY round-trip โ€” partial-pressure O2 + temperature + status.

◆ MeasureMraw()

fdo2::DriverResult< fdo2::MrawReading > Fdo2Handler::MeasureMraw ( )
noexcept

One #MRAW round-trip โ€” same as MOXY plus back-side ambient pressure, optical signal, and housing humidity. Use this when the caller wants true volume-percent O2 (100 ยท pO2 / pressure_mbar).

◆ operator=() [1/2]

Fdo2Handler & Fdo2Handler::operator= ( const Fdo2Handler &  )
delete

◆ operator=() [2/2]

Fdo2Handler & Fdo2Handler::operator= ( Fdo2Handler &&  )
delete

◆ ReadUniqueId()

fdo2::DriverResult< std::uint64_t > Fdo2Handler::ReadUniqueId ( )
noexcept

Read the device's 64-bit unique serial via #IDNR.

◆ ReadVersion()

fdo2::DriverResult< fdo2::VersionInfo > Fdo2Handler::ReadVersion ( )
noexcept

Re-read #VERS (refreshes the cached Identity).

Member Data Documentation

◆ bus_mutex_

RtosMutex* Fdo2Handler::bus_mutex_
private

◆ comm_

HalUartFdo2Comm Fdo2Handler::comm_
private

◆ config_

Fdo2HandlerConfig Fdo2Handler::config_
private

◆ driver_

std::unique_ptr<DriverType> Fdo2Handler::driver_
private

◆ identity_

fdo2::VersionInfo Fdo2Handler::identity_ {}
private

◆ initialized_

std::atomic<bool> Fdo2Handler::initialized_ {false}
private

◆ private_mutex_

RtosMutex Fdo2Handler::private_mutex_
private

The documentation for this class was generated from the following files: