博客
关于我
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/

你可能感兴趣的文章
nginx 配置https(一)—— 自签名证书
查看>>
nginx 配置~~~本身就是一个静态资源的服务器
查看>>
Nginx 配置清单(一篇够用)
查看>>
Nginx 配置解析:从基础到高级应用指南
查看>>
nginx+php的搭建
查看>>
nginx+tomcat+memcached
查看>>
nginx+Tomcat性能监控
查看>>
nginx+uwsgi+django
查看>>
Nginx-http-flv-module流媒体服务器搭建+模拟推流+flv.js在前端html和Vue中播放HTTP-FLV视频流
查看>>
Nginx下配置codeigniter框架方法
查看>>
Nginx之二:nginx.conf简单配置(参数详解)
查看>>
Nginx代理websocket配置(解决websocket异常断开连接tcp连接不断问题)
查看>>
Nginx代理初探
查看>>
Nginx代理外网映射
查看>>
Nginx代理模式下 log-format 获取客户端真实IP
查看>>
Nginx代理静态资源(gis瓦片图片)实现非固定ip的url适配网络环境映射ip下的资源请求解决方案
查看>>
Nginx反向代理与正向代理配置
查看>>
Nginx多域名,多证书,多服务配置,实用版
查看>>
nginx异常:the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf
查看>>
nginx总结及使用Docker创建nginx教程
查看>>