g0b1vetx-board/middleware/fifo/fifo-board.h
2023-04-29 09:09:12 +08:00

41 lines
744 B
C

#pragma once
/*
* @Author: zhangpeng
* @Date: 2020-03-05 18:28:46
* @LastEditTime: 2020-03-05 20:11:27
* @LastEditors: zhangpeng
* @Description: New File
* @FilePath: \Firmware\user\fifo.h
* @Copyright (c) 2019-2021 ZhangYeJinZhi.Co.Ltd. All rights reserved.
*/
#ifndef _FIFO_H
#define _FIFO_H
#include <stdlib.h>
#include <string.h>
#define RECERIVRSIZE 6
typedef struct {
int length;
char data[256];
char type;
}data_t;
typedef struct {
int read;
int write;
int count;
char * data;
int max_count;// 最大多少个队列
}Fifo_t, *Fifo_p;
int FifoRead(Fifo_p fifo, char * buf, int length);
int FifoWrite(Fifo_p fifo, char *buf, int length);
void FifoInit(Fifo_p fifo, char * data, int max);
#endif/*_USARTBUF_H*/