Defines a 32-bit floating-point data logger strcture and related functions.
The FDLOG structure describes a continuous memory block which is characterized by its start index pointer, current index pointer, and size of the buffer.
Overfilling the data logger would result in a warp-around in a similar fashion as circular buffers.
Go to the source code of this file.
Data Structures | |
struct | dcl_fdlog |
Defines the data logger strcture for 32-bit float. More... | |
Macros | |
#define | DCL_getLogSize(buf) ((buf)->size) |
Obtain the total size of buffer. More... | |
#define | DCL_getLogIndex(buf) ((uint32_t)((buf)->dptr - (buf)->fptr)) |
Index of the current pointer (zero-indexed) More... | |
#define | DCL_getLogRemain(buf) ((buf)->size - DCL_getLogIndex(buf)) |
Remaining space left from indexed pointer to end of buffer. More... | |
#define | DCL_clearLog(buf) DCL_fillLog(buf,0) |
Clears the buffer contents by writing 0 to all elements and resets the data index pointer to the start of the buffer. More... | |
Typedefs | |
typedef _DCL_VOLATILE struct dcl_fdlog | DCL_FDLOG |
Functions | |
_DCL_CODE_ACCESS void | DCL_setLogIndex (DCL_FDLOG *buf, uint32_t idx) |
Sets index of the current pointer (zero-indexed) More... | |
_DCL_CODE_ACCESS void | DCL_deleteLog (DCL_FDLOG *buf) |
Resets all structure pointers to null value. More... | |
_DCL_CODE_ACCESS void | DCL_resetLog (DCL_FDLOG *buf) |
Resets the data index pointer to start of buffer. More... | |
_DCL_CODE_ACCESS void | DCL_fillLog (DCL_FDLOG *buf, float32_t data) |
Fills the buffer with a given data value and resets the data index pointer to the start of the buffer. More... | |
_DCL_CODE_ACCESS void | DCL_initLog (DCL_FDLOG *buf, float32_t *addr, uint32_t size) |
Assigns the buffer pointers to a memory block or array and sets the data index pointer to the first address. More... | |
_DCL_CODE_ACCESS float32_t | DCL_writeLog (DCL_FDLOG *buf, float32_t data) |
Writes a data point into the buffer and advances the indexing pointer, wrapping if necessary. Returns the over-written data value for delay line or FIFO implementation. More... | |
_DCL_CODE_ACCESS float32_t | DCL_readLog (DCL_FDLOG *buf) |
Reads a data point from the buffer and then advances the indexing pointer, wrapping if necessary. More... | |
_DCL_CODE_ACCESS void | DCL_copyLog (DCL_FDLOG *src, DCL_FDLOG *dst) |
Copies the contents of one log (src) into another (dst). Both logs must have the same length. More... | |