CANopenNode
CANopen protocol stack
Loading...
Searching...
No Matches
CO_trace.h
Go to the documentation of this file.
1
21#ifndef CO_TRACE_H
22#define CO_TRACE_H
23
24#include "301/CO_driver.h"
25#include "301/CO_SDOserver.h"
26
27/* default configuration, see CO_config.h */
28#ifndef CO_CONFIG_TRACE
29#define CO_CONFIG_TRACE (0)
30#endif
31
32#if ((CO_CONFIG_TRACE) & CO_CONFIG_TRACE_ENABLE) || defined CO_DOXYGEN
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
63#ifndef OD_INDEX_TRACE_CONFIG
64#define OD_INDEX_TRACE_CONFIG 0x2301
65#define OD_INDEX_TRACE 0x2401
66#endif
67
68
72typedef struct {
74 int32_t (*pGetValue) (void *OD_variable);
76 uint32_t (*printPointStart)(char *s, uint32_t size, uint32_t timeStamp, int32_t value);
78 uint32_t (*printPoint)(char *s, uint32_t size, uint32_t timeStamp, int32_t value);
80 uint32_t (*printPointEnd)(char *s, uint32_t size, uint32_t timeStamp, int32_t value);
82
83
108
109
133 CO_trace_t *trace,
134 CO_SDO_t *SDO,
135 uint8_t enabled,
136 uint32_t *timeBuffer,
137 int32_t *valueBuffer,
138 uint32_t bufferSize,
139 uint32_t *map,
140 uint8_t *format,
141 uint8_t *trigger,
142 int32_t *threshold,
143 int32_t *value,
144 int32_t *minValue,
145 int32_t *maxValue,
146 uint32_t *triggerTime,
147 uint16_t idx_OD_traceConfig,
148 uint16_t idx_OD_trace);
149
150
159void CO_trace_process(CO_trace_t *trace, uint32_t timestamp);
160
161 /* CO_trace */
162
163#ifdef __cplusplus
164}
165#endif /* __cplusplus */
166
167#endif /* (CO_CONFIG_TRACE) & CO_CONFIG_TRACE_ENABLE */
168
169#endif /* CO_TRACE_H */
CANopen Service Data Object - server protocol.
Interface between CAN hardware and CANopenNode.
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition CO_driver.h:132
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition CO_driver.h:133
uint_fast8_t bool_t
Boolean data type for general use.
Definition CO_driver.h:126
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition CO_driver.h:131
signed long int int32_t
INTEGER32 in CANopen (0004h), 32-bit signed integer.
Definition CO_driver.h:129
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.
void CO_trace_process(CO_trace_t *trace, uint32_t timestamp)
Process trace object.
structure for reading variables and printing points for specific data type.
Definition CO_trace.h:72
Trace object.
Definition CO_trace.h:87
int32_t * minValue
From CO_trace_init().
Definition CO_trace.h:102
uint32_t * triggerTime
From CO_trace_init().
Definition CO_trace.h:104
int32_t * value
From CO_trace_init().
Definition CO_trace.h:101
void * OD_variable
Pointer to variable, which is monitored.
Definition CO_trace.h:96
const CO_trace_dataType_t * dt
Data type specific function pointers.
Definition CO_trace.h:97
CO_SDO_t * SDO
From CO_trace_init().
Definition CO_trace.h:89
uint32_t bufferSize
From CO_trace_init().
Definition CO_trace.h:92
uint8_t * format
From CO_trace_init().
Definition CO_trace.h:100
int32_t * threshold
From CO_trace_init().
Definition CO_trace.h:106
int32_t * maxValue
From CO_trace_init().
Definition CO_trace.h:103
uint32_t * timeBuffer
From CO_trace_init().
Definition CO_trace.h:90
uint8_t * trigger
From CO_trace_init().
Definition CO_trace.h:105
int32_t * valueBuffer
From CO_trace_init().
Definition CO_trace.h:91
int32_t valuePrev
Previous value of value.
Definition CO_trace.h:98
uint32_t * map
From CO_trace_init().
Definition CO_trace.h:99
volatile uint32_t writePtr
Location in buffer, which will be next written.
Definition CO_trace.h:93
bool_t enabled
True, if trace is enabled.
Definition CO_trace.h:88
uint32_t lastTimeStamp
Last time stamp.
Definition CO_trace.h:95
volatile uint32_t readPtr
Location in buffer, which will be next read.
Definition CO_trace.h:94