STS_E2/Air_Quality_LORAWAN_WINEXT_.../User/fifo.h

27 lines
459 B
C

#ifndef __FIFO_H
#define __FIFO_H
#include "main.h"
#define RINGBUFF_LEN 1024
#define FLASE 0
#define TRUE 1
typedef struct
{
uint16_t Head;
uint16_t Tail;
uint16_t Lenght;
uint16_t Ring_Buff[RINGBUFF_LEN];
}RingBuff_t;
//extern RingBuff_t ringBuff;//创建一个ringBuff的缓冲区
void RingBuff_Init(void); //初始化
uint8_t Write_RingBuff(uint8_t data); //写入
uint8_t Read_RingBuff(uint8_t *rData);//读取
#endif /* __FIFO_H */