初级会员

- 积分
- 187
- 金钱
- 187
- 注册时间
- 2019-11-13
- 在线时间
- 39 小时
|
1金钱
在写串口的时候发现了两个发射函数HAL_UART_Transmit()和HAL_UART_Transmit_IT(),在工程中注释的解释如下:
(#) There are two mode of transfer:
(+) Blocking mode: The communication is performed in polling mode.
The HAL status of all data processing is returned by the same function
after finishing transfer.
(+) Non-Blocking mode: The communication is performed using Interrupts
or DMA, These API's return the HAL status.
The end of the data processing will be indicated through the
dedicated UART IRQ when using Interrupt mode or the DMA IRQ when
using DMA mode.
The HAL_UART_TxCpltCallback(), HAL_UART_RxCpltCallback() user callbacks
will be executed respectively at the end of the transmit or Receive process
The HAL_UART_ErrorCallback()user callback will be executed when a communication error is detected
(#) Blocking mode API's are :
(+) HAL_UART_Transmit()
(+) HAL_UART_Receive()
(#) Non-Blocking mode API's with Interrupt are :
(+) HAL_UART_Transmit_IT()
(+) HAL_UART_Receive_IT()
(+) HAL_UART_IRQHandler()
但是看得不是很明白(好像是中断和DMA和中断用IT的,其他的用没有IT的)希望大神能解释一下,这两个函数的具体区别。这两个函数分别具体在什么情况下用。
|
|