-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathram_fifo.h
More file actions
45 lines (41 loc) · 1.24 KB
/
Copy pathram_fifo.h
File metadata and controls
45 lines (41 loc) · 1.24 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
/**
* FIFO in RAM.
* (C) Juan Schiavoni 2021
*/
#include <stddef.h>
#include "pico/types.h"
/*! \brief Initialice the FIFO.
* \ingroup ram_fifo
*
* This function don't block until there is space for the data to be insert.
* Use ram_fifo_is_empty() to check if it is possible to inset to the.
*
* \param count quantity of items for FIFO
* @return true if there is enough dynamic memory, false otherwise
*/
bool ram_fifo_init(size_t count);
/*! \brief Check if the FIFO is empty
* \ingroup ram_fifo
*
* @return true if the FIFO has room for more data, false otherwise
*/
bool ram_fifo_is_empty(void);
/*! \brief Push data on to the FIFO.
* \ingroup ram_fifo
*
* This function don't block until there is space for the data to be insert.
* Use ram_fifo_is_empty() to check if it is possible to inset to the.
*
* \param item A 32 bit value to push on to the FIFO
* @return true if the FIFO has room for the data, false otherwise
*/
bool ram_fifo_set(uint32_t item);
/*! \brief Pop data from the FIFO.
* \ingroup ram_fifo
*
* This function don't block until there is data ready to be read
* Use ram_fifo_is_empty() to check if data is ready to be read.
*
* \return 32 bit unsigned data from the FIFO.
*/
uint32_t ram_fifo_get(void);