Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_WallbotBLE_Challenge by
FIFO implementation
FIFO implementation. More...
Data Structures | |
struct | app_fifo_t |
A FIFO instance structure. More... | |
Functions | |
uint32_t | app_fifo_init (app_fifo_t *p_fifo, uint8_t *p_buf, uint16_t buf_size) |
Function for initializing the FIFO. | |
uint32_t | app_fifo_put (app_fifo_t *p_fifo, uint8_t byte) |
Function for adding an element to the FIFO. | |
uint32_t | app_fifo_get (app_fifo_t *p_fifo, uint8_t *p_byte) |
Function for getting the next element from the FIFO. | |
uint32_t | app_fifo_flush (app_fifo_t *p_fifo) |
Function for flushing the FIFO. |
Detailed Description
FIFO implementation.
Function Documentation
uint32_t app_fifo_flush | ( | app_fifo_t * | p_fifo ) |
Function for flushing the FIFO.
- Parameters:
-
[in] p_fifo Pointer to the FIFO.
- Return values:
-
NRF_SUCCESS If the FIFO flushed successfully.
uint32_t app_fifo_get | ( | app_fifo_t * | p_fifo, |
uint8_t * | p_byte | ||
) |
Function for getting the next element from the FIFO.
- Parameters:
-
[in] p_fifo Pointer to the FIFO. [out] p_byte Byte fetched from the FIFO.
- Return values:
-
NRF_SUCCESS If an element was returned. NRF_ERROR_NOT_FOUND If there is no more elements in the queue.
uint32_t app_fifo_init | ( | app_fifo_t * | p_fifo, |
uint8_t * | p_buf, | ||
uint16_t | buf_size | ||
) |
Function for initializing the FIFO.
- Parameters:
-
[out] p_fifo FIFO object. [in] p_buf FIFO buffer for storing data. The buffer size has to be a power of two. [in] buf_size Size of the FIFO buffer provided, has to be a power of 2.
- Return values:
-
NRF_SUCCESS If initialization was successful. NRF_ERROR_NULL If a NULL pointer is provided as buffer. NRF_ERROR_INVALID_LENGTH If size of buffer provided is not a power of two.
uint32_t app_fifo_put | ( | app_fifo_t * | p_fifo, |
uint8_t | byte | ||
) |
Function for adding an element to the FIFO.
- Parameters:
-
[in] p_fifo Pointer to the FIFO. [in] byte Data byte to add to the FIFO.
- Return values:
-
NRF_SUCCESS If an element has been successfully added to the FIFO. NRF_ERROR_NO_MEM If the FIFO is full.
Generated on Tue Jul 12 2022 13:52:31 by
