cancel
Showing results for 
Search instead for 
Did you mean: 

Feature request: Pass arbitrary data pointer in HAL callbacks

tdecker2
Associate III

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;

 

 

 

11 REPLIES 11

 

.

mƎALLEm
ST Employee

Hello all,

Getting back to you regarding this point and the dev team informed us that there is no plan to deploy this feature on the existing STM32CubeFW packages due to the heavy work to do considering the number of HAL drivers and STM32 series to cover.
So customer must rely on his own implementation for such a need. But the point could be addressed for new products in the future.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.