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

CRTP transport bridging sfm::I2cInterface to a BaseI2c device. More...

#include <SfmHandler.h>

Inheritance diagram for HalI2cSfmComm:

Public Member Functions

 HalI2cSfmComm (BaseI2c &i2c_device) noexcept
 
std::uint8_t DeviceAddress () const noexcept
 Address configured on the bound BaseI2c device.
 
CRTP-required methods (static dispatch from sfm::I2cInterface)
bool Write (std::uint8_t addr7, const std::uint8_t *data, std::size_t len) noexcept
 
bool Read (std::uint8_t addr7, std::uint8_t *out, std::size_t len) noexcept
 
void DelayMs (std::uint32_t ms) noexcept
 
bool EnsureInitialized () noexcept
 

Private Attributes

BaseI2c & i2c_device_
 
std::uint8_t tx_scratch_ [8] {}
 
std::uint8_t rx_scratch_ [18] {}
 

Detailed Description

CRTP transport bridging sfm::I2cInterface to a BaseI2c device.

SF06 parts use raw command writes and raw multi-byte reads (no register byte). The adapter validates the driver's 7-bit address against the device's configured address, frames through member scratch buffers (internal SRAM, not task stack), and maps a NACKed read to false so the driver can report NoData.

Note
Does not own the BaseI2c; it must outlive the adapter.

Constructor & Destructor Documentation

◆ HalI2cSfmComm()

HalI2cSfmComm::HalI2cSfmComm ( BaseI2c &  i2c_device)
explicitnoexcept

Member Function Documentation

◆ DelayMs()

void HalI2cSfmComm::DelayMs ( std::uint32_t  ms)
noexcept

◆ DeviceAddress()

std::uint8_t HalI2cSfmComm::DeviceAddress ( ) const
noexcept

Address configured on the bound BaseI2c device.

◆ EnsureInitialized()

bool HalI2cSfmComm::EnsureInitialized ( )
noexcept

◆ Read()

bool HalI2cSfmComm::Read ( std::uint8_t  addr7,
std::uint8_t *  out,
std::size_t  len 
)
noexcept

◆ Write()

bool HalI2cSfmComm::Write ( std::uint8_t  addr7,
const std::uint8_t *  data,
std::size_t  len 
)
noexcept

Member Data Documentation

◆ i2c_device_

BaseI2c& HalI2cSfmComm::i2c_device_
private

◆ rx_scratch_

std::uint8_t HalI2cSfmComm::rx_scratch_[18] {}
private

◆ tx_scratch_

std::uint8_t HalI2cSfmComm::tx_scratch_[8] {}
private

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