-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcircular-buffer.h
More file actions
69 lines (57 loc) · 2.42 KB
/
Copy pathcircular-buffer.h
File metadata and controls
69 lines (57 loc) · 2.42 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
/**\cond
******************************************************************************
* ______ _ ___ ___ _
* | ___ \(_) | \/ | | |
* | |_/ / _ _ __ __ _ _ __ _ _ | . . | __ _ | | __ ___ _ __
* | ___ \| || '_ \ / _` || '__|| | | | | |\/| | / _` || |/ // _ \| '__|
* | |_/ /| || | | || (_| || | | |_| | | | | || (_| || <| __/| |
* \____/ |_||_| |_| \__,_||_| \__, | \_| |_/ \__,_||_|\_\\___||_|
* __/ |
* |___/
*
* Copyright (C) 2020 Binary Maker - All Rights Reserved
*
* This program and the accompanying materials are made available
* under the terms described in the LICENSE file which accompanies
* this distribution.
* Written by Binary Maker <https://github.com/binarymaker>
******************************************************************************
\endcond*/
#ifndef CIRCULAR_BUFFER_db7f0a9a_368a_11ea_94b0_705a0f25cb51
#define CIRCULAR_BUFFER_db7f0a9a_368a_11ea_94b0_705a0f25cb51
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Source file version tag
*
* version info: [15:8] main [7:0] beta
*/
#define __CIRCULAR_BUFFER_VERSION (0x0001u)
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
/* Exported types ------------------------------------------------------------*/
typedef struct circularBuffer_s
{
void * buffer_ptr;
uint8_t data_size_u8;
uint8_t size_u8;
uint8_t head_u8;
uint8_t tail_u8;
} circularBuffer_st;
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void
CIRCULAR_BUFFER_Init(circularBuffer_st * self, void * buffer_ptr,
uint32_t data_size_u8,uint32_t size_u8);
void
CIRCULAR_BUFFER_Write(circularBuffer_st * self, void * data_ptr);
void
CIRCULAR_BUFFER_Read(circularBuffer_st * self, void * data_ptr);
uint8_t
CIRCULAR_BUFFER_Available(circularBuffer_st * self);
#ifdef __cplusplus
}
#endif
#endif /* CIRCULAR_BUFFER_db7f0a9a_368a_11ea_94b0_705a0f25cb51 */