当前位置:网站首页>[Teach you to use the serial port idle interrupt of the STM32HAL library]
[Teach you to use the serial port idle interrupt of the STM32HAL library]
2022-08-04 20:56:00 【xixiaohuanqaq】
I. Test environment
STM32H750VBTX development board
Second, Steps
1, open serial port idle interrupt
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)// Open IDLE in front of the main function, this size is the size of the buffer array you set yourself, the file posted below has the definition of this functionThis function is in stm32h7xx_hal_uart_ex.c, which has already opened the serial port idle interrupt. What I checked before is not correct. Only in a communication group did I know that it was so simple.

2. Use the serial port idle callback function directly
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_tspan> Size){if(huart->Instance == USART1){//Call the serial port idle callback function directly, this size is the number of bytes received by the serial port each time}HAL_UARTEx_ReceiveToIdle_IT() //Open serial port idle interrupt again}3, HAL_UART_IRQHandler(&huart1);
void USART1_IRQHandler(void){/* USER CODE BEGIN USART1_IRQn 0 *//* USER CODE END USART1_IRQn 0 */HAL_UART_IRQHandler(&huart1);//The processing of the flag bit has helped us deal with it. We directly call the callback function, namelyCan!/* USER CODE BEGIN USART1_IRQn 1 *//* USER CODE END USART1_IRQn 1 */}III. Summary
**Using the serial port idle interrupt through the HAL library is so simple. I have checked a lot of information before, but they are not using the HAL library. They are all rewritten.Stuff, it's a lot easier to actually use the HAL library.At present, only the serial port idle interrupt is used, and the update will continue after the subsequent use of DMA.Thank you to the big guys in the group who have carefully guided and answered questions!!!**边栏推荐
- dotnet 使用 lz4net 压缩 Stream 或文件
- js的new Function()常用方法
- After encountering MapStruct, the conversion between PO, DTO and VO objects is no longer handwritten
- 2022-8-4 第七组 ptz 锁与线程池和工具类
- 1、File对象学习
- Tear down the underlying mechanism of the five JOINs of SparkSQL
- LINQ to SQL (Group By/Having/Count/Sum/Min/Max/Avg操作符)
- 零知识证明笔记——私密交易,pederson,区间证明,所有权证明
- 实现菜单拖拽排序
- [Data Mining] Written Exam Questions for Sohu Data Mining Engineers
猜你喜欢

【数据挖掘】搜狐公司数据挖掘工程师笔试题

知识分享|如何设计有效的帮助中心,不妨来看看以下几点

How to carry out AI business diagnosis and quickly identify growth points for cost reduction and efficiency improvement?

【C语言】指针和数组的深入理解(第三期)

After the tester with 10 years of service "naked resignation" from the big factory...

Comic | Two weeks after the boss laid me off, he hired me back and doubled my salary!

搭建MyCat2一主一从的MySQL读写分离

1、File对象学习

STP基本配置及802.1D生成树协议的改进

Tear down the underlying mechanism of the five JOINs of SparkSQL
随机推荐
mdk5.14无法烧录
结构体小结
2022-8-4 第七组 ptz 锁与线程池和工具类
顺序队列
实现菜单拖拽排序
Five Minutes Introductory Text Processing Three Musketeers grep awk sed
2、字符集-编码-解码
Red5搭建直播平台
Qt Designer生成的图形可以自适应窗口的大小变化
composition-api
经验分享|盘点企业进行知识管理时的困惑类型
腾讯云胡启明:Kubernetes云上资源的分析与优化
About the state transfer problem of SAP e-commerce cloud Spartacus UI SSR
多商户商城系统功能拆解22讲-平台端分销商品
暴雨中的人
帝国CMS仿核弹头H5小游戏模板/92game帝国CMS内核仿游戏网整站源码
【手把手教你使用STM32HAL库的串口空闲中断】
五分钟入门文本处理三剑客grep awk sed
【2022牛客多校5 A题 Don‘t Starve】DP
零知识证明——zkSNARK证明体系