1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/lupyuen-LoRaMac-node-nuttx

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Это зеркальный репозиторий, синхронизируется ежедневно с исходного репозитория.
Клонировать/Скачать
fifo.h 2.1 КБ
Копировать Редактировать Исходные данные Просмотреть построчно История
Julian van Doorn Отправлено 5 лет назад f52af41
/*!
* \file fifo.h
*
* \brief FIFO buffer implementation
*
* \copyright Revised BSD License, see section \ref LICENSE.
*
* \code
* ______ _
* / _____) _ | |
* ( (____ _____ ____ _| |_ _____ ____| |__
* \____ \| ___ | (_ _) ___ |/ ___) _ \
* _____) ) ____| | | || |_| ____( (___| | | |
* (______/|_____)_|_|_| \__)_____)\____)_| |_|
* (C)2013-2017 Semtech
*
* \endcode
*
* \author Miguel Luis ( Semtech )
*
* \author Gregory Cristian ( Semtech )
*/
#ifndef __FIFO_H__
#define __FIFO_H__
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdbool.h>
#include <stdint.h>
/*!
* FIFO structure
*/
typedef struct Fifo_s
{
uint16_t Begin;
uint16_t End;
uint8_t *Data;
uint16_t Size;
}Fifo_t;
/*!
* Initializes the FIFO structure
*
* \param [IN] fifo Pointer to the FIFO object
* \param [IN] buffer Buffer to be used as FIFO
* \param [IN] size Size of the buffer
*/
void FifoInit( Fifo_t *fifo, uint8_t *buffer, uint16_t size );
/*!
* Pushes data to the FIFO
*
* \param [IN] fifo Pointer to the FIFO object
* \param [IN] data Data to be pushed into the FIFO
*/
void FifoPush( Fifo_t *fifo, uint8_t data );
/*!
* Pops data from the FIFO
*
* \param [IN] fifo Pointer to the FIFO object
* \retval data Data popped from the FIFO
*/
uint8_t FifoPop( Fifo_t *fifo );
/*!
* Flushes the FIFO
*
* \param [IN] fifo Pointer to the FIFO object
*/
void FifoFlush( Fifo_t *fifo );
/*!
* Checks if the FIFO is empty
*
* \param [IN] fifo Pointer to the FIFO object
* \retval isEmpty true: FIFO is empty, false FIFO is not empty
*/
bool IsFifoEmpty( Fifo_t *fifo );
/*!
* Checks if the FIFO is full
*
* \param [IN] fifo Pointer to the FIFO object
* \retval isFull true: FIFO is full, false FIFO is not full
*/
bool IsFifoFull( Fifo_t *fifo );
#ifdef __cplusplus
}
#endif
#endif // __FIFO_H__

Комментарий ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/lupyuen-LoRaMac-node-nuttx.git
git@gitlife.ru:oschina-mirror/lupyuen-LoRaMac-node-nuttx.git
oschina-mirror
lupyuen-LoRaMac-node-nuttx
lupyuen-LoRaMac-node-nuttx
v4.5.1