SPI CRTP communication adapter for BNO08x.
More...
#include <Bno08xHandler.h>
|
| | HalSpiBno08xComm (BaseSpi &spi, BaseGpio *reset_gpio=nullptr, BaseGpio *int_gpio=nullptr, BaseGpio *wake_gpio=nullptr) noexcept |
| | Construct SPI 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 |
| |
SPI CRTP communication adapter for BNO08x.
Bridges the HardFOC BaseSpi interface with the bno08x::CommInterface CRTP base.
◆ HalSpiBno08xComm()
| HalSpiBno08xComm::HalSpiBno08xComm |
( |
BaseSpi & | spi, |
|
|
BaseGpio * | reset_gpio = nullptr, |
|
|
BaseGpio * | int_gpio = nullptr, |
|
|
BaseGpio * | wake_gpio = nullptr ) |
|
inlineexplicitnoexcept |
Construct SPI adapter.
- Parameters
-
| spi | Reference to BaseSpi implementation |
| reset_gpio | Optional GPIO for hardware reset (RSTN, active-low) |
| int_gpio | Optional GPIO for interrupt monitoring (INT, active-low) |
| wake_gpio | Optional GPIO for wake control (SPI mode) |
◆ Close()
| void HalSpiBno08xComm::Close |
( |
| ) |
|
|
noexcept |
Release bus (no-op; bus may be shared).
◆ DataAvailable()
| bool HalSpiBno08xComm::DataAvailable |
( |
| ) |
|
|
noexcept |
Check INT pin (active-low).
- Returns
- true if data ready or no INT pin
◆ Delay()
| void HalSpiBno08xComm::Delay |
( |
uint32_t | ms | ) |
|
|
noexcept |
Block for ms milliseconds.
- Parameters
-
◆ GetInterfaceType()
| BNO085Interface HalSpiBno08xComm::GetInterfaceType |
( |
| ) |
|
|
inlinenoexcept |
- Returns
- BNO085Interface::SPI
◆ GetTimeUs()
| uint32_t HalSpiBno08xComm::GetTimeUs |
( |
| ) |
|
|
noexcept |
- Returns
- Monotonic time in microseconds
◆ GpioSet()
| void HalSpiBno08xComm::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 HalSpiBno08xComm::Open |
( |
| ) |
|
|
noexcept |
Initialize SPI bus and optional RSTN/INT/WAKE GPIOs.
- Returns
- true on success
◆ Read()
| int HalSpiBno08xComm::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 HalSpiBno08xComm::Write |
( |
const uint8_t * | data, |
|
|
uint32_t | length ) |
|
noexcept |
- Parameters
-
| data | Buffer to send. |
| length | Byte count. |
- Returns
- Bytes written or -1 on error
◆ int_gpio_
| BaseGpio* HalSpiBno08xComm::int_gpio_ |
|
private |
◆ reset_gpio_
| BaseGpio* HalSpiBno08xComm::reset_gpio_ |
|
private |
◆ spi_
| BaseSpi& HalSpiBno08xComm::spi_ |
|
private |
◆ wake_gpio_
| BaseGpio* HalSpiBno08xComm::wake_gpio_ |
|
private |
The documentation for this class was generated from the following files: