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

你可能感兴趣的文章
Netty工作笔记0011---Channel应用案例2
查看>>
Netty工作笔记0014---Buffer类型化和只读
查看>>
Netty工作笔记0050---Netty核心模块1
查看>>
Netty工作笔记0084---通过自定义协议解决粘包拆包问题2
查看>>
Netty常见组件二
查看>>
netty底层源码探究:启动流程;EventLoop中的selector、线程、任务队列;监听处理accept、read事件流程;
查看>>
Netty核心模块组件
查看>>
Netty框架的服务端开发中创建EventLoopGroup对象时线程数量源码解析
查看>>
Netty源码—2.Reactor线程模型一
查看>>
Netty源码—4.客户端接入流程一
查看>>
Netty源码—4.客户端接入流程二
查看>>
Netty源码—5.Pipeline和Handler一
查看>>
Netty源码—6.ByteBuf原理二
查看>>
Netty源码—7.ByteBuf原理三
查看>>
Netty源码—7.ByteBuf原理四
查看>>
Netty源码—8.编解码原理二
查看>>
Netty源码解读
查看>>
Netty的Socket编程详解-搭建服务端与客户端并进行数据传输
查看>>
Netty相关
查看>>
Network Dissection:Quantifying Interpretability of Deep Visual Representations(深层视觉表征的量化解释)
查看>>