|
ICM42670 Portable Driver
Public API reference for the ICM-42670-P IMU driver
|
STM32 HAL SPI, I2C, and I3C transport adapters. More...

Macros | |
| #define | ICM42670_STM32_SPI_READ_BIT 0x80U |
| #define | ICM42670_STM32_SPI_MAX_TRANSFER_LEN 16U |
Functions | |
| ICM42670_Status_t | ICM42670_STM32_SPI_INIT (ICM42670_Config *config, ICM42670_STM32_SPIBus *bus, SPI_HandleTypeDef *hspi, GPIO_TypeDef *cs_port, uint16_t cs_pin) |
| Configure an ICM42670_Config for STM32 HAL SPI access. | |
| int8_t | ICM42670_STM32_SPI_ReadReg (void *handle, uint8_t reg_addr, uint8_t *data, uint16_t len) |
| STM32 SPI register-read callback for ICM42670_Config. | |
| int8_t | ICM42670_STM32_SPI_WriteReg (void *handle, uint8_t reg_addr, const uint8_t *data, uint16_t len) |
| STM32 SPI register-write callback for ICM42670_Config. | |
STM32 HAL SPI, I2C, and I3C transport adapters.
| ICM42670_Status_t ICM42670_STM32_SPI_INIT | ( | ICM42670_Config * | config, |
| ICM42670_STM32_SPIBus * | bus, | ||
| SPI_HandleTypeDef * | hspi, | ||
| GPIO_TypeDef * | cs_port, | ||
| uint16_t | cs_pin | ||
| ) |
Configure an ICM42670_Config for STM32 HAL SPI access.
This helper stores bus state, drives chip-select high, and installs the SPI read/write callbacks plus HAL_Delay.
| config | Driver configuration to populate. |
| bus | SPI bus state owned by the caller. |
| hspi | Initialized STM32 HAL SPI handle. |
| cs_port | Chip-select GPIO port. |
| cs_pin | Chip-select GPIO pin. |
References ICM42670_STM32_SPIBus::cs_pin, ICM42670_STM32_SPIBus::cs_port, ICM42670_Config::delay_ms, ICM42670_Config::handle, ICM42670_STM32_SPIBus::hspi, ICM42670_ERROR, ICM42670_OK, ICM42670_STM32_SPI_ReadReg(), ICM42670_STM32_SPI_WriteReg(), ICM42670_Config::read_reg, ICM42670_STM32_SPIBus::timeout_ms, and ICM42670_Config::write_reg.
| int8_t ICM42670_STM32_SPI_ReadReg | ( | void * | handle, |
| uint8_t | reg_addr, | ||
| uint8_t * | data, | ||
| uint16_t | len | ||
| ) |
STM32 SPI register-read callback for ICM42670_Config.
| handle | Pointer to ICM42670_STM32_SPIBus. |
| reg_addr | Register address to read from. |
| data | Destination buffer. |
| len | Number of bytes to read. |
References ICM42670_STM32_SPIBus::cs_port, ICM42670_STM32_SPIBus::hspi, ICM42670_ERROR, and ICM42670_OK.
Referenced by ICM42670_STM32_SPI_INIT().
| int8_t ICM42670_STM32_SPI_WriteReg | ( | void * | handle, |
| uint8_t | reg_addr, | ||
| const uint8_t * | data, | ||
| uint16_t | len | ||
| ) |
STM32 SPI register-write callback for ICM42670_Config.
| handle | Pointer to ICM42670_STM32_SPIBus. |
| reg_addr | Register address to write to. |
| data | Source buffer. |
| len | Number of bytes to write. |
References ICM42670_STM32_SPIBus::cs_port, ICM42670_STM32_SPIBus::hspi, ICM42670_ERROR, and ICM42670_OK.
Referenced by ICM42670_STM32_SPI_INIT().