Skip to content

Commit c8d39e2

Browse files
committed
- updated readme
1 parent 3c9c61c commit c8d39e2

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,21 @@
1-
# ring_buffer
2-
Ring buffer implementation in C for general usage
1+
# Ring buffer
2+
Ring buffer modules is implemented for general used in embedded C code. It support three data types: uint32_t, int32_t and float32_t. Data type is not importatn at initialization point as it is only how stored information are interpreted by C compiler.
3+
4+
Ring buffer memory space is dynamically allocated and success of allocation is taken into consideration before using that instance. Deallocation on exsisting ring buffer instance is not supported as it's not good practice to free memory in C world.
5+
6+
## API
7+
8+
API of ring buffer constist of three blocks, those are: initialization, add element to buffer and get element from buffer. Note that getting element from buffer intakes intiger parameter as support normal and invers access. Invers access meas that get function will return time related element from ring buffer. This feature is specially handy when comes to digital filter calculations.
9+
10+
#### List of functions:
11+
- ring_buffer_status_t **ring_buffer_init** (p_ring_buffer_t * p_ring_buffer, const uint32_t size);
12+
13+
- ring_buffer_status_t **ring_buffer_add_u32** (p_ring_buffer_t buf_inst, const uint32_t data);
14+
- ring_buffer_status_t **ring_buffer_add_i32** (p_ring_buffer_t buf_inst, const int32_t data );
15+
- ring_buffer_status_t **ring_buffer_add_f** (p_ring_buffer_t buf_inst, const float32_t data);
16+
- uint32_t **ring_buffer_get_u32** (p_ring_buffer_t buf_inst, const int32_t idx);
17+
- int32_t **ring_buffer_get_i32** (p_ring_buffer_t buf_inst, const int32_t idx);
18+
- float32_t **ring_buffer_get_f** (p_ring_buffer_t buf_inst, const int32_t idx);
19+
20+
NOTE: Detailed description of fucntion can be found in doxygen!
21+

0 commit comments

Comments
 (0)