-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFiFo.h
55 lines (47 loc) · 1.17 KB
/
FiFo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* FiFo.h
*
* Created on: 6 июл. 2022 г.
* Author: Steppefort
* @file FiFo.h
* @brief This file contains all the function prototypes for
* the FiFo.c file
******************************************************************************
* @attention
*
* Copyright (c) 07.2022 Steppefort.
* All rights reserved.
*
* This software is private.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
#ifndef FIFO_H_
#define FIFO_H_
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/*BFIFO - buffer with 1B size of data*/
#define defaultlng 128
#define overflow 0x0100
#define nothing 0x0200
#define wrongObject 0x0300
#define luckey 0x0000
typedef struct BFIFO{
uint32_t blength;
uint32_t head;
uint32_t tail;
uint32_t contain;
uint32_t isoverflow;
uint8_t body[defaultlng];
}Bring;
unsigned int pullB(Bring *there);
unsigned int pushB(Bring *there, uint8_t Data);
unsigned int ringReset(Bring *there);
#ifdef __cplusplus
}
#endif
#endif /* FIFO_H_ */