cancel
Showing results for 
Search instead for 
Did you mean: 

Keyboard Interrupt on UART receive

StanCosgrove
Associate III

Hi i m using 26 keyboard key to interrupt via UART received, should i coded the 26 interrupt in a single rxcplt callback function or a multiple callback function? Whats the best way? pls advise...

void HAL_UART_RxCpltCallback(UART....)

{

  HAL_UART_Receive_IT(huart, &rx_data....)

  if (rx_data  == 'a')

....

  if (rx_data == 'b')

...

if (rx_data == 'c')

}

10 REPLIES 10

I've updated the code to show how to check for each character, at least for abc. Just do the same for the rest of the alphabet.

Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.