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

你可能感兴趣的文章
Objective-C实现Linear search线性搜索算法(附完整源码)
查看>>
Objective-C实现LinearSieve线性素数筛选算法 (附完整源码)
查看>>
Objective-C实现LinkedListNode链表节点类算法(附完整源码)
查看>>
Objective-C实现LinkedList链表算法(附完整源码)
查看>>
Objective-C实现local weighted learning局部加权学习算法(附完整源码)
查看>>
Objective-C实现logistic regression逻辑回归算法(附完整源码)
查看>>
Objective-C实现logistic sigmoid函数(附完整源码)
查看>>
Objective-C实现longest Common Substring最长公共子串算法(附完整源码)
查看>>
Objective-C实现longest increasing subsequence最长递增子序列算法(附完整源码)
查看>>
Objective-C实现longestCommonSubsequence最长公共子序列算法(附完整源码)
查看>>
Objective-C实现LongestIncreasingSubsequence最长递增子序列算法(附完整源码)
查看>>
Objective-C实现lorenz transformation 洛伦兹变换算法(附完整源码)
查看>>
Objective-C实现Lower-Upper Decomposition上下分解算法(附完整源码)
查看>>
Objective-C实现LowerCaseConversion小写转换算法(附完整源码)
查看>>
Objective-C实现lowest common ancestor最低共同祖先算法(附完整源码)
查看>>
Objective-C实现LRU 缓存算法(附完整源码)
查看>>
Objective-C实现LRU缓存(附完整源码)
查看>>
Objective-C实现LRU(least recently used)算法(附完整源码)
查看>>
Objective-C实现lstm prediction预测算法(附完整源码)
查看>>
Objective-C实现lucas数列算法(附完整源码)
查看>>