OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 2854|回复: 3

HAL_UART_Transmit与HAL_UART_Transmit_IT()的区别

[复制链接]

33

主题

51

帖子

0

精华

初级会员

Rank: 2

积分
187
金钱
187
注册时间
2019-11-13
在线时间
39 小时
发表于 2020-2-6 11:43:06 | 显示全部楼层 |阅读模式
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的)希望大神能解释一下,这两个函数的具体区别。这两个函数分别具体在什么情况下用。

最佳答案

查看完整内容[请看2#楼]

你理解是对的! 一个用于查询方式,一个是中断方式(含DMA中断)
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

4

主题

178

帖子

0

精华

高级会员

Rank: 4

积分
665
金钱
665
注册时间
2019-7-28
在线时间
60 小时
发表于 2020-2-6 11:43:07 | 显示全部楼层
你理解是对的!
一个用于查询方式,一个是中断方式(含DMA中断)
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165475
金钱
165475
注册时间
2010-12-1
在线时间
2115 小时
发表于 2020-2-10 22:36:18 | 显示全部楼层
帮顶
回复

使用道具 举报

1

主题

8

帖子

0

精华

初级会员

Rank: 2

积分
162
金钱
162
注册时间
2019-9-3
在线时间
18 小时
发表于 2020-3-4 15:22:10 | 显示全部楼层
看看楼
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-5-7 15:32

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表