AM263x Motor Control SDK  09.02.00

Introduction

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.

An example of initialization and use is shown below:
uint32_t fdlog_size = 400;
#pragma DATA_SECTION(r_Array, "DataLogSection") //Not necessary but helpful for debugging
float32_t r_Array[fdlog_size];
DCL_FDLOG rBuf;
DCL_initLog(&rBuf, r_Array, fdlog_size);
DCL_clearLog(&rBuf);
DCL_writeFDLOG(&rBuf, some_results);
output = readFDLOG(&rBuf);

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 FDLOG_DEFAULTS   {0x0,0x0,0x0,0}
 Default initialization of DCL_FDLOG. More...
 
#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)   ((int32_t)((buf)->lptr - (buf)->dptr))
 Remaining space left from indexed pointer to end of buffer. More...
 
#define DCL_clearLog(buf)   DCL_fillLog(buf,0.0f)
 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
 
typedef _DCL_VOLATILE struct dcl_fdlog 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 size. More...
 
DCL_initLog
_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 a...
Definition: dcl_fdlog.h:165
DCL_clearLog
#define DCL_clearLog(buf)
Clears the buffer contents by writing 0 to all elements and resets the data index pointer to the star...
Definition: dcl_fdlog.h:155
DCL_FDLOG
_DCL_VOLATILE struct dcl_fdlog DCL_FDLOG
float32_t
float float32_t
Definition: dcl_common.h:58