STM32 I2C Bus+Device wrapper — wraps STM32 HAL I2C via CubeMX handle.
More...
#include "BaseI2c.h"
#include "StmTypes.h"
#include <vector>
#include <memory>
Go to the source code of this file.
STM32 I2C Bus+Device wrapper — wraps STM32 HAL I2C via CubeMX handle.
Bus/Device architecture matching the ESP32 pattern:
Usage
extern I2C_HandleTypeDef hi2c1;
i2cBus.Initialize();
int idx = i2cBus.CreateDevice(dev_cfg);
BaseI2c* mpu = i2cBus.GetDevice(idx);
uint8_t who_am_i = 0;
Abstract base class for I2C device implementations.
Definition BaseI2c.h:196
virtual bool Initialize() noexcept=0
Initialize the I2C bus.
virtual bool ReadRegister(hf_u8_t reg_addr, hf_u8_t &data) noexcept
Read from a register on the I2C device.
Definition BaseI2c.h:375
STM32 I2C bus — manages the HAL handle and device collection.
Definition StmI2c.h:87
Platform-agnostic I2C bus configuration for STM32. Users pass their CubeMX-generated I2C_HandleTypeDe...
Definition StmTypes.h:249
I2C device configuration structure.
Definition EspTypes_I2C.h:225
uint16_t device_address
7-bit or 10-bit device address
Definition EspTypes_I2C.h:226
- Author
- HardFOC
- Date
- 2025
- Copyright
- HardFOC — Licensed under GPL v3.0 or later.