HF-Core Platform 0.1.0-dev
Hardware-Agnostic Handler Layer & RTOS Utilities for HardFOC
Loading...
Searching...
No Matches
HalI2cBno08xComm Class Reference

I2C CRTP communication adapter for BNO08x. More...

#include <Bno08xHandler.h>

Inheritance diagram for HalI2cBno08xComm:
[legend]
Collaboration diagram for HalI2cBno08xComm:
[legend]

Public Member Functions

 HalI2cBno08xComm (BaseI2c &i2c, BaseGpio *reset_gpio=nullptr, BaseGpio *int_gpio=nullptr) noexcept
 Construct I2C adapter.
 
BNO085Interface GetInterfaceType () noexcept
 
bool Open () noexcept
 
void Close () noexcept
 
int Write (const uint8_t *data, uint32_t length) noexcept
 
int Read (uint8_t *data, uint32_t length) noexcept
 
bool DataAvailable () noexcept
 
void Delay (uint32_t ms) noexcept
 
uint32_t GetTimeUs () noexcept
 
void GpioSet (bno08x::CtrlPin pin, bno08x::GpioSignal signal) noexcept
 

Private Attributes

BaseI2c & i2c_
 
BaseGpio * reset_gpio_
 
BaseGpio * int_gpio_
 

Detailed Description

I2C CRTP communication adapter for BNO08x.

Bridges the HardFOC BaseI2c interface with the bno08x::CommInterface CRTP base. The I2C device address is pre-configured on the BaseI2c instance.

Constructor & Destructor Documentation

◆ HalI2cBno08xComm()

HalI2cBno08xComm::HalI2cBno08xComm ( BaseI2c & i2c,
BaseGpio * reset_gpio = nullptr,
BaseGpio * int_gpio = nullptr )
inlineexplicitnoexcept

Construct I2C adapter.

Parameters
i2cReference to BaseI2c implementation (address pre-configured)
reset_gpioOptional GPIO for hardware reset (RSTN, active-low)
int_gpioOptional GPIO for interrupt monitoring (INT, active-low)

Member Function Documentation

◆ Close()

void HalI2cBno08xComm::Close ( )
noexcept

Release bus (no-op; bus may be shared).

◆ DataAvailable()

bool HalI2cBno08xComm::DataAvailable ( )
noexcept

Check INT pin (active-low).

Returns
true if data ready or no INT pin

◆ Delay()

void HalI2cBno08xComm::Delay ( uint32_t ms)
noexcept

Block for ms milliseconds.

Parameters
msDelay in ms

◆ GetInterfaceType()

BNO085Interface HalI2cBno08xComm::GetInterfaceType ( )
inlinenoexcept
Returns
BNO085Interface::I2C

◆ GetTimeUs()

uint32_t HalI2cBno08xComm::GetTimeUs ( )
noexcept
Returns
Monotonic time in microseconds

◆ GpioSet()

void HalI2cBno08xComm::GpioSet ( bno08x::CtrlPin pin,
bno08x::GpioSignal signal )
noexcept

Set control pin to specified signal state.

Parameters
pinCtrlPin to drive
signalACTIVE or INACTIVE

◆ Open()

bool HalI2cBno08xComm::Open ( )
noexcept

Initialize I2C bus and optional RSTN/INT GPIOs.

Returns
true on success

◆ Read()

int HalI2cBno08xComm::Read ( uint8_t * data,
uint32_t length )
noexcept
Parameters
dataBuffer to fill.
lengthMax bytes.
Returns
Bytes read, 0 if no data, -1 on error

◆ Write()

int HalI2cBno08xComm::Write ( const uint8_t * data,
uint32_t length )
noexcept
Parameters
dataBuffer to send.
lengthByte count.
Returns
Bytes written or -1 on error

Member Data Documentation

◆ i2c_

BaseI2c& HalI2cBno08xComm::i2c_
private

◆ int_gpio_

BaseGpio* HalI2cBno08xComm::int_gpio_
private

◆ reset_gpio_

BaseGpio* HalI2cBno08xComm::reset_gpio_
private

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