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

你可能感兴趣的文章
OA系统选型:选择好的工作流引擎
查看>>
OA让企业业务流程管理科学有“据”
查看>>
OA项目之会议通知(查询&是否参会&反馈详情)
查看>>
OA项目之我的会议(会议排座&送审)
查看>>
OA项目之我的会议(查询)
查看>>
OA项目之我的审批(会议查询&会议签字)
查看>>
OA项目之项目简介&会议发布
查看>>
Object c将一个double值转换为时间格式
查看>>
object detection之Win10配置
查看>>
object detection训练自己数据
查看>>
object detection错误Message type "object_detection.protos.SsdFeatureExtractor" has no field named "bat
查看>>
object detection错误之Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
查看>>
object detection错误之no module named nets
查看>>
Object of type 'ndarray' is not JSON serializable
查看>>
Object Oriented Programming in JavaScript
查看>>
object references an unsaved transient instance - save the transient instance before flushing
查看>>
Object.assign用法
查看>>
Object.create
查看>>
Object.keys()的详解和用法
查看>>
objectForKey与valueForKey在NSDictionary中的差异
查看>>