How can I pass pointer info from hal_uart_receive_it into the callback function?
I am trying to port over some code from PIC to STM32. In the pic code, the ISR took the pointer data from the received uart message (1 byte) and then sent that pointer data to a circular_buffer_put function (effectively putting it into the circular buffer).
The wall I'm running into is that the callback function is defined as only having one parameter - the huart handle - so I can't really do it the same way as before. All the examples I've seen online have the pointer data stored as a modular variable, which I'd really prefer not to do, and so the pointer data can be accessed in any function, including that of the callback.
Do any of you have a good idea on how to solve this problem?
Here's some example code of effectively what I'd like to do...
void HAL_UART_RxCpltCallback(uart_device_t *uart_struct, uint8_t *data)
{
circular_buf_put(&RxBuffer, *data);
HAL_UART_Receive_IT(uart_struct->huart, *data, 1);
}