ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
fifo.h File Reference

Circular buffer as FIFO data structure for buffering measurements. More...

#include <stdio.h>
#include "fram.h"

Go to the source code of this file.

Macros

#define FRAM_BUFFER_START   0
 
#define FRAM_BUFFER_END   1769
 

Functions

fram_status fifo_put (const uint8_t *data, uint8_t num_bytes)
 Puts a measurement into the circular buffer.
 
fram_status fifo_get (uint8_t *data, uint8_t *len)
 Reads a measurement from the queue.
 
fram_status fifo_peek (size_t idx, uint8_t *data, uint8_t *len)
 Peeks at the next measurement in the buffer without removing it.
 
fram_status fifo_drop (void)
 Drops the next measurement in the buffer.
 
uint16_t fifo_buffer_len (void)
 Get the current number of measurements stored in the buffer.
 
fram_status fifo_buffer_clear (void)
 Clears the buffer.
 
fram_status fifo_save_buffer_state (void)
 Saves the buffer state (read address, write address, and buffer length) to FRAM.
 
fram_status fifo_load_buffer_state (void)
 Loads the buffer state (read address, write address, and buffer length) from FRAM.
 
fram_status fifo_init (void)
 Initializes the buffer.
 
int fifo_size (void)
 Gets the total number of bytes in the buffer.
 

Detailed Description

Circular buffer as FIFO data structure for buffering measurements.

Author
Stephen Taylor
John Madden

Ported over to tock on

Date
2026-04-07.
11/17/2023

Definition in file fifo.h.