I2C CRTP communication adapter for BNO08x.
More...
#include <Bno08xHandler.h>
|
| | 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 |
| |
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.
◆ HalI2cBno08xComm()
| HalI2cBno08xComm::HalI2cBno08xComm |
( |
BaseI2c & | i2c, |
|
|
BaseGpio * | reset_gpio = nullptr, |
|
|
BaseGpio * | int_gpio = nullptr ) |
|
inlineexplicitnoexcept |
Construct I2C adapter.
- Parameters
-
| i2c | Reference to BaseI2c implementation (address pre-configured) |
| reset_gpio | Optional GPIO for hardware reset (RSTN, active-low) |
| int_gpio | Optional GPIO for interrupt monitoring (INT, active-low) |
◆ 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
-
◆ 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
-
| pin | CtrlPin to drive |
| signal | ACTIVE 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
-
| data | Buffer to fill. |
| length | Max bytes. |
- Returns
- Bytes read, 0 if no data, -1 on error
◆ Write()
| int HalI2cBno08xComm::Write |
( |
const uint8_t * | data, |
|
|
uint32_t | length ) |
|
noexcept |
- Parameters
-
| data | Buffer to send. |
| length | Byte count. |
- Returns
- Bytes written or -1 on error
◆ 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: