Hello @LGjes.1 ,
Let me first welcome you to the STM32 Community and apologize for the the somewhat late reply :smiling_face_with_smiling_eyes:
When enabling SMBus mode through STM32CubeMX interface, #define HAL_SMBUS_MODULE_ENABLED will be uncommented, so the stm32f4xx_hal_smbus.h file will be included and there's no need to enable the HAL_I2C_MODULE.
Furthermore, the I2C_TypeDef structure (in stm32f4xx_hal_smbus.h file) is defined in the stm32f401xe.h which is the CMSIS STM32F401xE Device Peripheral Access Layer Header File containing :
- Data structures and the address mapping for all peripherals
- peripherals registers declarations and bits definition
- Macros to access peripheral’s registers hardware
Noting that I'm executing a simple test case using STM32F401RETx MCU, but this is generic for all MCUs supporting SMBus peripheral.
> This leads to compile errors in stm32f4xx_hal_smbus.h, which needs typedef I2C_TypeDef.
Could you please precise which compilation errors are getting? If it is possible, it will be more helpful to attach your .ioc to check from our side.
Hope my answer helps you.
Khouloud.