OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 3142|回复: 0

求一份代码?关于环形缓存对串口收发数据的处理代码?

[复制链接]

4

主题

8

帖子

0

精华

初级会员

Rank: 2

积分
50
金钱
50
注册时间
2017-3-15
在线时间
11 小时
发表于 2017-5-12 09:02:55 | 显示全部楼层 |阅读模式
如题:我用咱们的战舰V3版本的开发板处理wifi模块,下面是对接阿里云的函数接口,使用的环形缓存。
整理代码时需要写环形缓存对串口收发数据的处理函数;函数
接口如下:求一份代码参考参考,谢谢!
//#include "RingBufferUtils.h"

#define UART_RX_BUFFER_LEN 2048

static ring_buffer_t  uart_ring_buffer;
static UINT8  uart_ring_data[UART_RX_BUFFER_LEN] = {0};


/*
    send uart data
*/
INT32 aliyun_iot_uart_send(INT8 *pSendBuffer, INT32 bufferLen);
/*
    receive uart data
*/
INT32 aliyun_iot_uart_recv(INT8 *pRecvBuffer, INT32 bufferLen, UINT32 timeOutMs);
/*
    initialize the baud rate of the uart
*/
INT32 aliyun_iot_uart_init();
/*
     the length of the data readable inside uart buffer
*/
INT32 aliyun_iot_uart_buffer_len();
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-8-21 10:53

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表