Showing results for 
Search instead for 
Did you mean: 

Keyboard Interrupt on UART receive

Associate II

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')



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.

If you find my answers useful, click the accept button so that way others can see the solution.