2024-10-04 6:00 AM
It is really sad that ST decided to not implement this requested and really helpful feature: https://github.com/STMicroelectronics/STM32CubeG4/issues/23
Maybe we can change their minds by creating some more attention to this topic here? Leave a comment, when you also find this useful ;)
Example solution for the I²C driver by adding a void* to the handle:
typedef struct __I2C_HandleTypeDef
{
/* Rest of struct... */
#if (USE_HAL_CALLBACK_CONTEXT == 1)
void *UserContext;
#endif /* USE_HAL_CALLBACK_CONTEXT */
} I2C_HandleTypeDef;
2025-03-11 12:55 PM - edited 2025-03-11 12:57 PM
.