Array-backed-FIFO Buffer Manager
Embedded application typically use statically allocated arrays to manage buffers to avoid the complexity of dynamic memory allocations.
To use this, the module can initialize the manager via rs_array_fifo_buf_mgr_init by specifying the way the status member inside each buffer is to be compared along with the value associated with free and in-use status. Then the memory can be set using the rs_array_fifo_buf_mgr_config by passing the starting address of the buffer array, number of buffers, size of each element and offset of the status member in each element. Once done, free buffer can be obtained via rs_array_fifo_buf_mgr_get and and after use the same can be released using rs_array_fifo_buf_mgr_put call.
Note: Since this is a FIFO, the buffers should be submitted back in the same order, it was obtained from.
Array-FIFO Buffer Manager Header
Documentation from the relevant header as follows:
Warning
doxygenfile: Cannot find file “rs_array_fifo_buf_mgr.h