Internal Interface Wrap
API reference
Loading...
Searching...
No Matches
Classes
StmI2c.h File Reference

STM32 I2C Bus+Device wrapper — wraps STM32 HAL I2C via CubeMX handle. More...

#include "BaseI2c.h"
#include "PlatformMutex.h"
#include "StmTypes.h"
#include <vector>
#include <memory>
Include dependency graph for StmI2c.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  StmI2cDevice
 STM32 I2C device — inherits BaseI2c, delegates I/O to parent bus HAL handle. More...
 
class  StmI2cBus
 STM32 I2C bus — manages the HAL handle and device collection. More...
 

Detailed Description

STM32 I2C Bus+Device wrapper — wraps STM32 HAL I2C via CubeMX handle.

Bus/Device architecture matching the ESP32 pattern:

Usage

i2cBus.Initialize();
dev_cfg.device_address = 0x68; // MPU6050
int idx = i2cBus.CreateDevice(dev_cfg);
BaseI2c* mpu = i2cBus.GetDevice(idx);
mpu->Initialize();
mpu->ReadRegister(0x75, who_am_i);
Abstract base class for I2C device implementations.
Definition BaseI2c.h:196
RAII soft-CS: runs assert_fn on construction and deassert_fn on destruction (including early return /...
Definition SoftChipSelectGuard.h:32
STM32 I2C bus — manages the HAL handle and device collection.
Definition StmI2c.h:112
Platform-agnostic I2C bus configuration for STM32. Users pass their CubeMX-generated I2C_HandleTypeDe...
Definition StmTypes.h:293
I2C device configuration structure.
Definition EspTypes_I2C.h:225
Author
HardFOC
Date
2025