Go to the documentation of this file.
32 #ifndef CO_CONFIG_HB_CONS
33 #define CO_CONFIG_HB_CONS (CO_CONFIG_HB_CONS_ENABLE)
35 #ifndef CO_CONFIG_HB_CONS_SIZE
36 #define CO_CONFIG_HB_CONS_SIZE 8
39 #if ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_ENABLE) || defined CO_DOXYGEN
93 #if ((CO_CONFIG_HB_CONS) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
95 void (*pFunctSignalPre)(
void *object);
99 #if ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_CALLBACK_CHANGE) \
100 || ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_CALLBACK_MULTI) \
101 || defined CO_DOXYGEN
105 #if ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_CALLBACK_MULTI) || defined CO_DOXYGEN
152 #if ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_CALLBACK_CHANGE) || defined CO_DOXYGEN
189 uint8_t numberOfMonitoredNodes,
213 #if ((CO_CONFIG_HB_CONS) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
228 void (*pFunctSignal)(
void *
object));
231 #if ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_CALLBACK_CHANGE) \
232 || ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_CALLBACK_MULTI) \
233 || defined CO_DOXYGEN
249 #
if ((
CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_CALLBACK_MULTI) || defined CO_DOXYGEN
258 #if ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_CALLBACK_MULTI) || defined CO_DOXYGEN
326 bool_t NMTisPreOrOperational,
331 #if ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_QUERY_FUNCT) || defined CO_DOXYGEN
void * functSignalObjectPre
From CO_HBconsumer_initCallbackPre() or NULL.
Definition: CO_HBconsumer.h:97
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
Interface between CAN hardware and CANopenNode.
void CO_HBconsumer_initCallbackPre(CO_HBconsumer_t *HBcons, void *object, void(*pFunctSignal)(void *object))
Initialize Heartbeat consumer callback function.
int8_t CO_HBconsumer_getNmtState(CO_HBconsumer_t *HBcons, uint8_t idx, CO_NMT_internalState_t *nmtState)
Get the current NMT state of a heartbeat producer by the index in OD 0x1016.
CO_ReturnError_t CO_HBconsumer_initEntry(CO_HBconsumer_t *HBcons, uint8_t idx, uint8_t nodeId, uint16_t consumerTime_ms)
Initialize one Heartbeat consumer entry.
uint16_t CANdevRxIdxStart
From CO_HBconsumer_init()
Definition: CO_HBconsumer.h:151
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition: CO_driver.h:153
CO_HBconsNode_t * monitoredNodes
From CO_HBconsumer_init()
Definition: CO_HBconsumer.h:141
CO_ReturnError_t
Return values of some CANopen functions.
Definition: CO_driver.h:488
unsigned char bool_t
Boolean data type for general use.
Definition: CO_driver.h:141
@ CO_HBconsumer_UNKNOWN
Consumer enabled, but no heartbeat received yet.
Definition: CO_HBconsumer.h:71
void CO_HBconsumer_initCallbackRemoteReset(CO_HBconsumer_t *HBcons, uint8_t idx, void *object, void(*pFunctSignal)(uint8_t nodeId, uint8_t idx, void *object))
Initialize Heartbeat consumer remote reset detected callback function.
CO_HBconsumer_state_t
Heartbeat state of a node.
Definition: CO_HBconsumer.h:69
@ CO_HBconsumer_TIMEOUT
No heatbeat received for set time.
Definition: CO_HBconsumer.h:73
void CO_HBconsumer_initCallbackTimeout(CO_HBconsumer_t *HBcons, uint8_t idx, void *object, void(*pFunctSignal)(uint8_t nodeId, uint8_t idx, void *object))
Initialize Heartbeat consumer timeout callback function.
signed char int8_t
INTEGER8 in CANopen (0002h), 8-bit signed integer.
Definition: CO_driver.h:143
int8_t CO_HBconsumer_getIdxByNodeId(CO_HBconsumer_t *HBcons, uint8_t nodeId)
Get the heartbeat producer object index by node ID.
CANopen Service Data Object - server protocol.
void * pFunctSignalObjectNmtChanged
Pointer to object.
Definition: CO_HBconsumer.h:159
void * functSignalObjectRemoteReset
Pointer to object.
Definition: CO_HBconsumer.h:127
@ CO_HBconsumer_UNCONFIGURED
Consumer entry inactive.
Definition: CO_HBconsumer.h:70
uint32_t time_us
Consumer heartbeat time from OD.
Definition: CO_HBconsumer.h:90
void * functSignalObjectHbStarted
Pointer to object.
Definition: CO_HBconsumer.h:117
Heartbeat consumer object.
Definition: CO_HBconsumer.h:138
CO_EM_t * em
From CO_HBconsumer_init()
Definition: CO_HBconsumer.h:139
bool_t allMonitoredActive
True, if all monitored nodes are active or no node is monitored.
Definition: CO_HBconsumer.h:145
uint32_t timeoutTimer
Time since last heartbeat received.
Definition: CO_HBconsumer.h:88
CO_ReturnError_t CO_HBconsumer_init(CO_HBconsumer_t *HBcons, CO_EM_t *em, CO_SDO_t *SDO, const uint32_t HBconsTime[], CO_HBconsNode_t monitoredNodes[], uint8_t numberOfMonitoredNodes, CO_CANmodule_t *CANdevRx, uint16_t CANdevRxIdxStart)
Initialize Heartbeat consumer object.
void CO_HBconsumer_process(CO_HBconsumer_t *HBcons, bool_t NMTisPreOrOperational, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process Heartbeat consumer object.
bool_t NMTisPreOrOperationalPrev
previous state of var
Definition: CO_HBconsumer.h:149
#define CO_CONFIG_HB_CONS
Configuration of Heartbeat consumer.
Definition: CO_config.h:153
Emergency object.
Definition: CO_Emergency.h:369
CO_NMT_internalState_t NMTstatePrev
Previous value of the remote node (Heartbeat payload)
Definition: CO_HBconsumer.h:103
CO_NMT_internalState_t
Internal network state of the CANopen node.
Definition: CO_NMT_Heartbeat.h:77
void CO_HBconsumer_initCallbackHeartbeatStarted(CO_HBconsumer_t *HBcons, uint8_t idx, void *object, void(*pFunctSignal)(uint8_t nodeId, uint8_t idx, void *object))
Initialize Heartbeat consumer started callback function.
CO_CANmodule_t * CANdevRx
From CO_HBconsumer_init()
Definition: CO_HBconsumer.h:150
CO_HBconsumer_state_t CO_HBconsumer_getState(CO_HBconsumer_t *HBcons, uint8_t idx)
Get the current state of a heartbeat producer by the index in OD 0x1016.
uint8_t allMonitoredOperational
True, if all monitored nodes are NMT operational or no node is monitored.
Definition: CO_HBconsumer.h:148
void * pFunctSignalObjectNmtChanged
Pointer to object.
Definition: CO_HBconsumer.h:112
void * functSignalObjectTimeout
Pointer to object.
Definition: CO_HBconsumer.h:122
uint8_t nodeId
Node Id of the monitored node.
Definition: CO_HBconsumer.h:82
uint8_t numberOfMonitoredNodes
From CO_HBconsumer_init()
Definition: CO_HBconsumer.h:142
Complete CAN module object.
Definition: CO_driver.h:319
CO_NMT_internalState_t NMTstate
Of the remote node (Heartbeat payload)
Definition: CO_HBconsumer.h:84
const uint32_t * HBconsTime
From CO_HBconsumer_init()
Definition: CO_HBconsumer.h:140
void CO_HBconsumer_initCallbackNmtChanged(CO_HBconsumer_t *HBcons, uint8_t idx, void *object, void(*pFunctSignal)(uint8_t nodeId, uint8_t idx, CO_NMT_internalState_t state, void *object))
Initialize Heartbeat consumer NMT changed callback function.
volatile void * CANrxNew
Indication if new Heartbeat message received from the CAN bus.
Definition: CO_HBconsumer.h:92
One monitored node inside CO_HBconsumer_t.
Definition: CO_HBconsumer.h:80
CO_HBconsumer_state_t HBstate
Current heartbeat state.
Definition: CO_HBconsumer.h:86
@ CO_HBconsumer_ACTIVE
Heartbeat received within set time.
Definition: CO_HBconsumer.h:72
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition: CO_driver.h:151