SHARE
TWEET

Untitled

a guest Mar 19th, 2019 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.   * @brief Receive an amount of data in interrupt mode.
  3.   * @param huart UART handle.
  4.   * @param pData pointer to data buffer.
  5.   * @param Size amount of data to be received.
  6.   * @retval HAL status
  7.   */
  8. HAL_StatusTypeDef HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
  9.      
  10. // Start
  11. HAL_UART_Receive_IT(&my_uart_handle, my_buf, 1);
  12.  
  13. ...
  14.  
  15. // Implement the Rx callback
  16. void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {
  17.   // Add the new byte to a circular buffer to be processed by the protocol
  18.  
  19.   // Register another callback the next time we receive a byte
  20.   HAL_UART_Receive_IT(&my_uart_handle, my_buf, 1);
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top