SFM Flow Meter Driver 1.0.0
API reference
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sfm::I2cInterface< Derived > Class Template Reference

CRTP base for the SF06 I2C transport. More...

#include <sfm_i2c_interface.hpp>

Public Member Functions

bool Write (uint8_t addr7, const uint8_t *data, std::size_t len) noexcept
 Raw write of len bytes to 7-bit address addr7 (no register byte).
 
bool Read (uint8_t addr7, uint8_t *out, std::size_t len) noexcept
 Raw read of len bytes from 7-bit address addr7.
 
void DelayMs (uint32_t ms) noexcept
 Blocking delay used for start-up (12 ms) and reset (20 ms) waits.
 
bool EnsureInitialized () noexcept
 Lazy bus bring-up; must return true before any transfer.
 
bool WriteGeneralCall (uint8_t byte) noexcept
 Optional I2C general-call write (address 0x00). Default: unsupported.
 

Detailed Description

template<typename Derived>
class sfm::I2cInterface< Derived >

CRTP base for the SF06 I2C transport.

Template Parameters
DerivedConcrete adapter type (e.g. EspI2cAdapter).

Member Function Documentation

◆ DelayMs()

template<typename Derived >
void sfm::I2cInterface< Derived >::DelayMs ( uint32_t  ms)
inlinenoexcept

Blocking delay used for start-up (12 ms) and reset (20 ms) waits.

◆ EnsureInitialized()

template<typename Derived >
bool sfm::I2cInterface< Derived >::EnsureInitialized ( )
inlinenoexcept

Lazy bus bring-up; must return true before any transfer.

◆ Read()

template<typename Derived >
bool sfm::I2cInterface< Derived >::Read ( uint8_t  addr7,
uint8_t *  out,
std::size_t  len 
)
inlinenoexcept

Raw read of len bytes from 7-bit address addr7.

◆ Write()

template<typename Derived >
bool sfm::I2cInterface< Derived >::Write ( uint8_t  addr7,
const uint8_t *  data,
std::size_t  len 
)
inlinenoexcept

Raw write of len bytes to 7-bit address addr7 (no register byte).

◆ WriteGeneralCall()

template<typename Derived >
bool sfm::I2cInterface< Derived >::WriteGeneralCall ( uint8_t  byte)
inlinenoexcept

Optional I2C general-call write (address 0x00). Default: unsupported.


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