27int32_t
imu_i2c_read_dma(uint8_t reg, uint8_t *buf, uint16_t len, uint32_t timeout_ms);
void imu_i2c_make_bus(sensor_bus_t *bus, I2C_HandleTypeDef *hi2c, uint8_t addr7)
void imu_i2c_error_isr(I2C_HandleTypeDef *hi2c)
void imu_i2c_rx_cplt_isr(I2C_HandleTypeDef *hi2c)
To be called from HAL_I2C_MemRxCpltCallback / HAL_I2C_ErrorCallback.
int32_t imu_i2c_read_dma(uint8_t reg, uint8_t *buf, uint16_t len, uint32_t timeout_ms)
Starts the DMA read and blocks the calling task until completion.
int imu_i2c_lock(void)
0 = taken (or no kernel yet), -1 = timeout
void imu_i2c_unlock(void)
void imu_i2c_bus_init(I2C_HandleTypeDef *hi2c)
Creates the bus lock: call once before starting the tasks that use the bus.
I2C_HandleTypeDef * imu_i2c_handle(void)
Platform-independent bus interface.