博客
关于我
32单片机串口DMA接收
阅读量:329 次
发布时间:2019-03-04

本文共 603 字,大约阅读时间需要 2 分钟。

串口接收初始化完毕,准备接收数据。以下是串口DMA接收函数的实现:

void recWIFI(void){    if(Uart3_Seriadef.ReciveSta) {        Uart3_Seriadef.ReciveSta = 0; //清空接收标志位    }}

发送功能实现

void sendByte(uint8_t s){    uint8_t send[1] = {0};    send[0] = s;    HAL_UART_Transmit(&huart3, send, 1, 1000);}
void sendDtring(char * c){    while(*c){        sendByte(*c++);    }}
void sendFigre(uint16_t F , uint8_t B){    if(B >= 5) sendByte('0' + F/10000 % 10);    if(B >= 4) sendByte('0' + F/1000 % 10);    if(B >= 3) sendByte('0' + F/100 % 10);    if(B >= 2) sendByte('0' + F/10 % 10);    sendByte('0' + F/1 % 10);}

这些函数实现了串口数据的发送和接收功能,适用于串口通信场景。

转载地址:http://cbrq.baihongyu.com/

你可能感兴趣的文章
npm的常用配置项---npm工作笔记004
查看>>
npm的问题:config global `--global`, `--local` are deprecated. Use `--location=global` instead 的解决办法
查看>>
npm编译报错You may need an additional loader to handle the result of these loaders
查看>>
npm设置淘宝镜像、升级等
查看>>
npm设置源地址,npm官方地址
查看>>
npm设置镜像如淘宝:http://npm.taobao.org/
查看>>
npm配置安装最新淘宝镜像,旧镜像会errror
查看>>
NPM酷库052:sax,按流解析XML
查看>>
npm错误 gyp错误 vs版本不对 msvs_version不兼容
查看>>
npm错误Error: Cannot find module ‘postcss-loader‘
查看>>
npm,yarn,cnpm 的区别
查看>>
NPOI之Excel——合并单元格、设置样式、输入公式
查看>>
NPOI初级教程
查看>>
NPOI利用多任务模式分批写入多个Excel
查看>>
NPOI在Excel中插入图片
查看>>
NPOI将某个程序段耗时插入Excel
查看>>
NPOI格式设置
查看>>
NPOI设置单元格格式
查看>>
Npp删除选中行的Macro录制方式
查看>>
NR,NF,FNR
查看>>