Microchip® Advanced Software Framework

ble_host_sdk/services/serial_fifo/serial_fifo.h File Reference

This file controls the software Serial FIFO management.

Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"

Data Structures

struct  ser_fifo_desc
 FIFO descriptor used by FIFO driver. More...
 

Typedefs

typedef struct ser_fifo_desc ser_fifo_desc_t
 

Enumerations

enum  {
  SER_FIFO_OK = 0,
  SER_FIFO_ERROR_OVERFLOW,
  SER_FIFO_ERROR_UNDERFLOW,
  SER_FIFO_ERROR
}
 

Functions

static void ser_fifo_flush (ser_fifo_desc_t *ser_fifo_desc)
 Flushes a software FIFO. More...
 
static uint8_t ser_fifo_get_free_size (ser_fifo_desc_t *ser_fifo_desc)
 Returns the remaining free spaces of the FIFO (in number of elements). More...
 
static uint16_t ser_fifo_get_used_size (ser_fifo_desc_t *ser_fifo_desc)
 Returns the number of elements in the FIFO. More...
 
int ser_fifo_init (ser_fifo_desc_t *ser_fifo_desc, void *buffer, uint16_t size)
 Initializes a new software FIFO for a certain 'size'. More...
 
static bool ser_fifo_is_empty (ser_fifo_desc_t *ser_fifo_desc)
 Tests if a FIFO is empty. More...
 
static bool ser_fifo_is_full (ser_fifo_desc_t *ser_fifo_desc)
 Tests if a FIFO is full. More...
 
static uint16_t ser_fifo_peek_uint16 (ser_fifo_desc_t *ser_fifo_desc)
 Gets a 16-bits element from the FIFO but does not remove it from the FIFO. More...
 
static uint32_t ser_fifo_peek_uint32 (ser_fifo_desc_t *ser_fifo_desc)
 Gets a 32-bits element from the FIFO but does not remove it from the FIFO. More...
 
static uint8_t ser_fifo_peek_uint8 (ser_fifo_desc_t *ser_fifo_desc)
 Gets a 8-bits element from the FIFO but does not remove it from the FIFO. More...
 
static int ser_fifo_pull_uint16 (ser_fifo_desc_t *ser_fifo_desc, uint16_t *item)
 Gets a 16-bits element from the FIFO and checks for a possible underflow. More...
 
static uint16_t ser_fifo_pull_uint16_nocheck (ser_fifo_desc_t *ser_fifo_desc)
 Gets a 16-bits element from the FIFO. More...
 
static int ser_fifo_pull_uint32 (ser_fifo_desc_t *ser_fifo_desc, uint32_t *item)
 Gets a 32-bits element from the FIFO and checks for a possible underflow. More...
 
static uint32_t ser_fifo_pull_uint32_nocheck (ser_fifo_desc_t *ser_fifo_desc)
 Gets a 32-bits element from the FIFO. More...
 
static int ser_fifo_pull_uint8 (ser_fifo_desc_t *ser_fifo_desc, uint8_t *item)
 Gets a 8-bits element from the FIFO and checks for a possible underflow. More...
 
static uint8_t ser_fifo_pull_uint8_nocheck (ser_fifo_desc_t *ser_fifo_desc)
 Gets a 8-bits element from the FIFO. More...
 
static int ser_fifo_push_uint16 (ser_fifo_desc_t *ser_fifo_desc, uint32_t item)
 Puts a new 16-bits element into the FIFO and checks for a possible overflow. More...
 
static void ser_fifo_push_uint16_nocheck (ser_fifo_desc_t *ser_fifo_desc, uint32_t item)
 Puts a new 16-bits element into the FIFO. More...
 
static int ser_fifo_push_uint32 (ser_fifo_desc_t *ser_fifo_desc, uint32_t item)
 Puts a new 32-bits element into the FIFO and checks for a possible overflow. More...
 
static void ser_fifo_push_uint32_nocheck (ser_fifo_desc_t *ser_fifo_desc, uint32_t item)
 Puts a new 32-bits element into the FIFO. More...
 
static int ser_fifo_push_uint8 (ser_fifo_desc_t *ser_fifo_desc, uint32_t item)
 Puts a new 8-bits element into the FIFO and checks for a possible overflow. More...
 
static void ser_fifo_push_uint8_nocheck (ser_fifo_desc_t *ser_fifo_desc, uint32_t item)
 Puts a new 8-bits element into the FIFO. More...