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

你可能感兴趣的文章
Oracle EBS环境下查找数据源(OAF篇)
查看>>
oracle Extract 函数
查看>>
Oracle GoldenGate Director安装和配置(无图)
查看>>
oracle ogg 单实例双向复制搭建(oracle-oracle)--Oracle GoldenGate
查看>>
oracle scott趣事
查看>>
oracle script
查看>>
Oracle select表要带双引号的原因
查看>>
Oracle SOA Suit Adapter
查看>>
Oracle Spatial GeoRaster 金字塔栅格存储
查看>>
Oracle Spatial空间数据库建立
查看>>
UML— 活动图
查看>>
Oracle Statspack分析报告详解(一)
查看>>
oracle tirger_在Oracle中,临时表和全局临时表有什么区别?
查看>>
oracle where 条件的执行顺序分析1
查看>>
oracle 使用leading, use_nl, rownum调优
查看>>
oracle 修改字段类型方法
查看>>
oracle 内存参数示意图
查看>>
Oracle 写存储过程的一个模板还有一些基本的知识点
查看>>
Oracle 创建 DBLink 的方法
查看>>
oracle 创建双向备份,Materialized View 物化视图实现 Oracle 表双向同步
查看>>