HF-BNO08x  0.1.0-dev
Loading...
Searching...
No Matches
esp32_bno08x_bus.hpp File Reference

ESP32 I2C communication interface implementation for BNO08x driver. More...

#include <cstdint>
#include <memory>
#include "driver/gpio.h"
#include "driver/i2c_master.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_timer.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "../../../inc/bno08x_comm_interface.hpp"
Include dependency graph for esp32_bno08x_bus.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Esp32Bno08xI2cBus
 ESP32 implementation of bno08x::CommInterface using ESP-IDF I2C master driver. More...
 
struct  Esp32Bno08xI2cBus::I2CConfig
 I2C bus and device configuration structure. More...
 

Functions

std::unique_ptr< Esp32Bno08xI2cBusCreateEsp32Bno08xI2cBus (const Esp32Bno08xI2cBus::I2CConfig &config=Esp32Bno08xI2cBus::I2CConfig{})
 Factory function to create an ESP32 BNO08x I2C bus instance.
 

Detailed Description

ESP32 I2C communication interface implementation for BNO08x driver.

This file provides the ESP32-specific implementation of the bno08x::CommInterface interface using ESP-IDF's I2C master driver.

Note
This implementation mirrors the proven esp32_pca9685_bus.hpp / esp32_pcal95555_bus.hpp pattern for consistent, working I2C communication across HardFOC drivers. The BNO08x uses the SH-2 packet protocol which requires raw I2C transfers (no register addressing), so the CommInterface methods differ from the register-addressed I2cInterface used by the PCAL95555 and PCA9685 drivers, but the underlying ESP-IDF bus setup, device handle caching, and resource management are identical.
Author
Nebiyu Tadesse
Date
2025

Function Documentation

◆ CreateEsp32Bno08xI2cBus()

std::unique_ptr< Esp32Bno08xI2cBus > CreateEsp32Bno08xI2cBus ( const Esp32Bno08xI2cBus::I2CConfig & config = Esp32Bno08xI2cBus::I2CConfig{})
inline

Factory function to create an ESP32 BNO08x I2C bus instance.

Creates and initializes the bus. Returns nullptr on failure.

Parameters
configI2C configuration (optional, uses defaults if not provided)
Returns
Unique pointer to Esp32Bno08xI2cBus instance, or nullptr on failure