STM32 I2C bus — manages the HAL handle and device collection.
More...
#include <StmI2c.h>
STM32 I2C bus — manages the HAL handle and device collection.
One bus instance per I2C peripheral (I2C1, I2C2, etc.). Devices are created via CreateDevice() and accessed via GetDevice().
◆ StmI2cBus() [1/2]
◆ StmI2cBus() [2/2]
| StmI2cBus::StmI2cBus |
( |
I2C_HandleTypeDef * | hal_handle, |
|
|
hf_u32_t | timeout_ms = 1000 ) |
|
explicitnoexcept |
Convenience: construct directly from HAL handle.
◆ ~StmI2cBus()
| StmI2cBus::~StmI2cBus |
( |
| ) |
|
|
noexcept |
◆ CreateDevice()
Create a device on this bus and return its index.
◆ Deinitialize()
| bool StmI2cBus::Deinitialize |
( |
| ) |
|
|
noexcept |
◆ GetConfig()
Get the bus configuration.
◆ GetDevice() [1/2]
| const BaseI2c * StmI2cBus::GetDevice |
( |
int | device_index | ) |
const |
|
noexcept |
◆ GetDevice() [2/2]
| BaseI2c * StmI2cBus::GetDevice |
( |
int | device_index | ) |
|
|
noexcept |
Get device by index (returns nullptr if invalid)
◆ GetDeviceCount()
| std::size_t StmI2cBus::GetDeviceCount |
( |
| ) |
const |
|
noexcept |
Get number of devices on this bus.
◆ GetHalHandle()
| I2C_HandleTypeDef * StmI2cBus::GetHalHandle |
( |
| ) |
const |
|
noexcept |
Get the STM32 HAL I2C handle.
◆ Initialize()
| bool StmI2cBus::Initialize |
( |
| ) |
|
|
noexcept |
◆ IsInitialized()
| bool StmI2cBus::IsInitialized |
( |
| ) |
const |
|
noexcept |
◆ RemoveDevice()
| bool StmI2cBus::RemoveDevice |
( |
int | device_index | ) |
|
|
noexcept |
Remove a device by index.
◆ config_
◆ devices_
| std::vector<std::unique_ptr<StmI2cDevice> > StmI2cBus::devices_ |
|
private |
◆ initialized_
| bool StmI2cBus::initialized_ {false} |
|
private |
The documentation for this class was generated from the following files: