Go to the documentation of this file.
21 #ifndef STM32H747I_DISCO_BUS_H
22 #define STM32H747I_DISCO_BUS_H
32 #if defined(BSP_USE_CMSIS_OS)
50 #if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
66 #define BUS_I2C4_CLK_ENABLE() __HAL_RCC_I2C4_CLK_ENABLE()
67 #define BUS_I2C4_CLK_DISABLE() __HAL_RCC_I2C4_CLK_DISABLE()
68 #define BUS_I2C4_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
69 #define BUS_I2C4_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
70 #define BUS_I2C4_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
71 #define BUS_I2C4_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
73 #define BUS_I2C4_FORCE_RESET() __HAL_RCC_I2C4_FORCE_RESET()
74 #define BUS_I2C4_RELEASE_RESET() __HAL_RCC_I2C4_RELEASE_RESET()
77 #define BUS_I2C4_SCL_PIN GPIO_PIN_12
78 #define BUS_I2C4_SDA_PIN GPIO_PIN_13
79 #define BUS_I2C4_SCL_GPIO_PORT GPIOD
80 #define BUS_I2C4_SDA_GPIO_PORT GPIOD
81 #define BUS_I2C4_SCL_AF GPIO_AF4_I2C4
82 #define BUS_I2C4_SDA_AF GPIO_AF4_I2C4
84 #ifndef BUS_I2C4_FREQUENCY
85 #define BUS_I2C4_FREQUENCY 100000U
105 int32_t
BSP_I2C4_WriteReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
106 int32_t
BSP_I2C4_ReadReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
107 int32_t
BSP_I2C4_WriteReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
108 int32_t
BSP_I2C4_ReadReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
111 #if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
112 int32_t BSP_I2C4_RegisterDefaultMspCallbacks (
void);
113 int32_t BSP_I2C4_RegisterMspCallbacks (BSP_I2C_Cb_t *Callback);
HAL_StatusTypeDef
HAL Status structures definition
int32_t BSP_I2C4_ReadReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Read a 8bit register of the device through BUS.
I2C_HandleTypeDef hbus_i2c4
int32_t BSP_GetTick(void)
Delay function.
int32_t BSP_I2C4_ReadReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Read a 16bit register of the device through BUS.
__weak HAL_StatusTypeDef MX_I2C4_Init(I2C_HandleTypeDef *hI2c, uint32_t timing)
MX I2C4 initialization.
int32_t BSP_I2C4_WriteReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Write a 16bit value in a register of the device through BUS.
int32_t BSP_I2C4_DeInit(void)
DeInitializes I2C HAL.
int32_t BSP_I2C4_WriteReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length)
Write a 8bit value in a register of the device through BUS.
int32_t BSP_I2C4_IsReady(uint16_t DevAddr, uint32_t Trials)
Checks if target device is ready for communication.
int32_t BSP_I2C4_Init(void)
Initializes I2C HAL.