CO_trace.h
Go to the documentation of this file.
#ifndef CO_TRACE_H
#define CO_TRACE_H
#include "301/CO_driver.h"
#include "301/CO_SDOserver.h"
/* default configuration, see CO_config.h */
#ifndef CO_CONFIG_TRACE
#define CO_CONFIG_TRACE (0)
#endif
#if ((CO_CONFIG_TRACE) & CO_CONFIG_TRACE_ENABLE) || defined CO_DOXYGEN
#ifdef __cplusplus
extern "C" {
#endif
#ifndef OD_INDEX_TRACE_CONFIG
#define OD_INDEX_TRACE_CONFIG 0x2301
#define OD_INDEX_TRACE 0x2401
#endif
typedef struct {
int32_t (*pGetValue) (void *OD_variable);
uint32_t (*printPointStart)(char *s, uint32_t size, uint32_t timeStamp, int32_t value);
uint32_t (*printPoint)(char *s, uint32_t size, uint32_t timeStamp, int32_t value);
uint32_t (*printPointEnd)(char *s, uint32_t size, uint32_t timeStamp, int32_t value);
} CO_trace_dataType_t;
typedef struct {
bool_t enabled;
CO_SDO_t *SDO;
uint32_t *timeBuffer;
int32_t *valueBuffer;
uint32_t bufferSize;
volatile uint32_t writePtr;
volatile uint32_t readPtr;
uint32_t lastTimeStamp;
void *OD_variable;
const CO_trace_dataType_t *dt;
int32_t valuePrev;
uint32_t *map;
uint8_t *format;
int32_t *value;
int32_t *minValue;
int32_t *maxValue;
uint32_t *triggerTime;
uint8_t *trigger;
int32_t *threshold;
} CO_trace_t;
void CO_trace_init(
CO_trace_t *trace,
CO_SDO_t *SDO,
uint8_t enabled,
uint32_t *timeBuffer,
int32_t *valueBuffer,
uint32_t bufferSize,
uint32_t *map,
uint8_t *format,
uint8_t *trigger,
int32_t *threshold,
int32_t *value,
int32_t *minValue,
int32_t *maxValue,
uint32_t *triggerTime,
uint16_t idx_OD_traceConfig,
uint16_t idx_OD_trace);
void CO_trace_process(CO_trace_t *trace, uint32_t timestamp);
/* CO_trace */
#ifdef __cplusplus
}
#endif /*__cplusplus*/
#endif /* (CO_CONFIG_TRACE) & CO_CONFIG_TRACE_ENABLE */
#endif /* CO_TRACE_H */
uint32_t
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
CO_driver.h
Interface between CAN hardware and CANopenNode.
CO_trace_t
Trace object.
Definition: CO_trace.h:93
CO_trace_t::minValue
int32_t * minValue
From CO_trace_init().
Definition: CO_trace.h:108
uint16_t
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition: CO_driver.h:153
CO_trace_t::triggerTime
uint32_t * triggerTime
From CO_trace_init().
Definition: CO_trace.h:110
CO_trace_t::valuePrev
int32_t valuePrev
Previous value of value.
Definition: CO_trace.h:104
CO_trace_t::timeBuffer
uint32_t * timeBuffer
From CO_trace_init().
Definition: CO_trace.h:96
CO_trace_t::bufferSize
uint32_t bufferSize
From CO_trace_init().
Definition: CO_trace.h:98
bool_t
unsigned char bool_t
Boolean data type for general use.
Definition: CO_driver.h:141
int32_t
signed long int int32_t
INTEGER32 in CANopen (0004h), 32-bit signed integer.
Definition: CO_driver.h:147
CO_trace_t::format
uint8_t * format
From CO_trace_init().
Definition: CO_trace.h:106
CO_trace_t::threshold
int32_t * threshold
From CO_trace_init().
Definition: CO_trace.h:112
CO_trace_t::writePtr
volatile uint32_t writePtr
Location in buffer, which will be next written.
Definition: CO_trace.h:99
CO_SDOserver.h
CANopen Service Data Object - server protocol.
CO_trace_t::lastTimeStamp
uint32_t lastTimeStamp
Last time stamp.
Definition: CO_trace.h:101
CO_trace_t::OD_variable
void * OD_variable
Pointer to variable, which is monitored.
Definition: CO_trace.h:102
CO_trace_t::SDO
CO_SDO_t * SDO
From CO_trace_init().
Definition: CO_trace.h:95
CO_trace_dataType_t
structure for reading variables and printing points for specific data type.
Definition: CO_trace.h:78
CO_trace_t::readPtr
volatile uint32_t readPtr
Location in buffer, which will be next read.
Definition: CO_trace.h:100
CO_trace_init
void CO_trace_init(CO_trace_t *trace, CO_SDO_t *SDO, uint8_t enabled, uint32_t *timeBuffer, int32_t *valueBuffer, uint32_t bufferSize, uint32_t *map, uint8_t *format, uint8_t *trigger, int32_t *threshold, int32_t *value, int32_t *minValue, int32_t *maxValue, uint32_t *triggerTime, uint16_t idx_OD_traceConfig, uint16_t idx_OD_trace)
Initialize trace object.
CO_trace_t::value
int32_t * value
From CO_trace_init().
Definition: CO_trace.h:107
CO_trace_t::enabled
bool_t enabled
True, if trace is enabled.
Definition: CO_trace.h:94
CO_trace_t::map
uint32_t * map
From CO_trace_init().
Definition: CO_trace.h:105
CO_trace_t::maxValue
int32_t * maxValue
From CO_trace_init().
Definition: CO_trace.h:109
CO_trace_t::trigger
uint8_t * trigger
From CO_trace_init().
Definition: CO_trace.h:111
CO_trace_process
void CO_trace_process(CO_trace_t *trace, uint32_t timestamp)
Process trace object.
CO_trace_t::dt
const CO_trace_dataType_t * dt
Data type specific function pointers.
Definition: CO_trace.h:103
uint8_t
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition: CO_driver.h:151
CO_trace_t::valueBuffer
int32_t * valueBuffer
From CO_trace_init().
Definition: CO_trace.h:97