CANopenNode
CO_SRDO.h
Go to the documentation of this file.
1 
26 #ifndef CO_SRDO_H
27 #define CO_SRDO_H
28 
29 #include "301/CO_driver.h"
30 #include "301/CO_SDOserver.h"
31 #include "301/CO_Emergency.h"
32 #include "301/CO_NMT_Heartbeat.h"
33 
34 /* default configuration, see CO_config.h */
35 #ifndef CO_CONFIG_SRDO
36 #define CO_CONFIG_SRDO (0)
37 #endif
38 #ifndef CO_CONFIG_SRDO_MINIMUM_DELAY
39 #define CO_CONFIG_SRDO_MINIMUM_DELAY 0
40 #endif
41 
42 #if ((CO_CONFIG_SRDO) & CO_CONFIG_SRDO_ENABLE) || defined CO_DOXYGEN
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
66 typedef struct{
93 
94 
95 typedef struct{
98  uint8_t numberOfMappedObjects;
104  uint32_t mappedObjects[16];
105 }CO_SRDOMapPar_t;
106 
114 typedef struct{
120 
124 typedef struct{
126  CO_SDO_t *SDO;
129  uint8_t *mapPointer[2][8];
133  uint16_t defaultCOB_ID[2];
137  const CO_SRDOMapPar_t *SRDOMapPar;
141  CO_CANtx_t *CANtxBuff[2];
142  uint16_t CANdevRxIdx[2];
143  uint16_t CANdevTxIdx[2];
147  volatile void *CANrxNew[2];
149  uint8_t CANrxData[2][8];
151  void (*pFunctSignalSafe)(void *object);
154 #if ((CO_CONFIG_SRDO) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
155 
156  void (*pFunctSignalPre)(void *object);
159 #endif
160 }CO_SRDO_t;
161 
177  CO_SRDOGuard_t *SRDOGuard,
178  CO_SDO_t *SDO,
179  CO_NMT_internalState_t *operatingState,
180  uint8_t *configurationValid,
181  uint16_t idx_SRDOvalid,
182  uint16_t idx_SRDOcrc);
183 
193  CO_SRDOGuard_t *SRDOGuard);
194 
223  CO_SRDO_t *SRDO,
224  CO_SRDOGuard_t *SRDOGuard,
225  CO_EM_t *em,
226  CO_SDO_t *SDO,
227  uint8_t nodeId,
228  uint16_t defaultCOB_ID,
229  const CO_SRDOCommPar_t *SRDOCommPar,
230  const CO_SRDOMapPar_t *SRDOMapPar,
231  const uint16_t *checksum,
232  uint16_t idx_SRDOCommPar,
233  uint16_t idx_SRDOMapPar,
234  CO_CANmodule_t *CANdevRx,
235  uint16_t CANdevRxIdxNormal,
236  uint16_t CANdevRxIdxInverted,
237  CO_CANmodule_t *CANdevTx,
238  uint16_t CANdevTxIdxNormal,
239  uint16_t CANdevTxIdxInverted);
240 
241 #if ((CO_CONFIG_SRDO) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
242 
254  CO_SRDO_t *SRDO,
255  void *object,
256  void (*pFunctSignalPre)(void *object));
257 #endif
258 
272  CO_SRDO_t *SRDO,
273  void *object,
274  void (*pFunctSignalSafe)(void *object));
275 
276 
287  CO_SRDO_t *SRDO);
288 
300 void CO_SRDO_process(
301  CO_SRDO_t *SRDO,
302  uint8_t commands,
303  uint32_t timeDifference_us,
304  uint32_t *timerNext_us);
305  /* CO_SRDO */
307 
308 #ifdef __cplusplus
309 }
310 #endif /*__cplusplus*/
311 
312 #endif /* (CO_CONFIG_SRDO) & CO_CONFIG_SRDO_ENABLE */
313 
314 #endif /* CO_SRDO_H */
CO_SRDOGuard_init
CO_ReturnError_t CO_SRDOGuard_init(CO_SRDOGuard_t *SRDOGuard, CO_SDO_t *SDO, CO_NMT_internalState_t *operatingState, uint8_t *configurationValid, uint16_t idx_SRDOvalid, uint16_t idx_SRDOcrc)
Initialize SRDOGuard object.
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_SRDO_t::dataLength
uint8_t dataLength
Data length of the received SRDO message.
Definition: CO_SRDO.h:131
CO_SRDO_t::nodeId
uint8_t nodeId
From CO_SRDO_init()
Definition: CO_SRDO.h:132
CO_SRDO_t::SDO
CO_SDO_t * SDO
From CO_SRDO_init()
Definition: CO_SRDO.h:126
uint16_t
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition: CO_driver.h:153
CO_SRDOGuard_t::operatingStatePrev
CO_NMT_internalState_t operatingStatePrev
last operation state
Definition: CO_SRDO.h:116
CO_ReturnError_t
CO_ReturnError_t
Return values of some CANopen functions.
Definition: CO_driver.h:488
CO_SRDO_t::functSignalObjectPre
void * functSignalObjectPre
From CO_SRDO_initCallbackPre() or NULL.
Definition: CO_SRDO.h:158
CO_SRDOCommPar_t
SRDO communication parameter.
Definition: CO_SRDO.h:66
CO_SRDOCommPar_t::informationDirection
uint8_t informationDirection
Direction of the SRDO.
Definition: CO_SRDO.h:72
CO_SRDO_t::functSignalObjectSafe
void * functSignalObjectSafe
From CO_SRDO_initCallbackEnterSafeState() or NULL.
Definition: CO_SRDO.h:153
CO_SDOserver.h
CANopen Service Data Object - server protocol.
CO_SRDO_t::SRDOGuard
CO_SRDOGuard_t * SRDOGuard
From CO_SRDO_init()
Definition: CO_SRDO.h:127
CO_SRDO_t::CANdevTx
CO_CANmodule_t * CANdevTx
From CO_SRDO_init()
Definition: CO_SRDO.h:140
CO_SRDOCommPar_t::safetyRelatedValidationTime
uint8_t safetyRelatedValidationTime
SRVT.
Definition: CO_SRDO.h:80
CO_SRDO_t::timer
uint32_t timer
transmit timer and receive timeout
Definition: CO_SRDO.h:145
CO_SRDO_t::em
CO_EM_t * em
From CO_SRDO_init()
Definition: CO_SRDO.h:125
CO_SRDO_t::valid
uint8_t valid
0 - invalid, 1 - tx, 2 - rx
Definition: CO_SRDO.h:135
CO_EM_t
Emergency object.
Definition: CO_Emergency.h:369
CO_SRDOCommPar_t::safetyCycleTime
uint16_t safetyCycleTime
Refresh-time / SCT.
Definition: CO_SRDO.h:76
CO_SRDO_init
CO_ReturnError_t CO_SRDO_init(CO_SRDO_t *SRDO, CO_SRDOGuard_t *SRDOGuard, CO_EM_t *em, CO_SDO_t *SDO, uint8_t nodeId, uint16_t defaultCOB_ID, const CO_SRDOCommPar_t *SRDOCommPar, const CO_SRDOMapPar_t *SRDOMapPar, const uint16_t *checksum, uint16_t idx_SRDOCommPar, uint16_t idx_SRDOMapPar, CO_CANmodule_t *CANdevRx, uint16_t CANdevRxIdxNormal, uint16_t CANdevRxIdxInverted, CO_CANmodule_t *CANdevTx, uint16_t CANdevTxIdxNormal, uint16_t CANdevTxIdxInverted)
Initialize SRDO object.
CO_NMT_internalState_t
CO_NMT_internalState_t
Internal network state of the CANopen node.
Definition: CO_NMT_Heartbeat.h:77
CO_SRDO_process
void CO_SRDO_process(CO_SRDO_t *SRDO, uint8_t commands, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process transmitting/receiving SRDO messages.
CO_NMT_Heartbeat.h
CANopen Network management and Heartbeat producer protocol.
CO_SRDOCommPar_t::maxSubIndex
uint8_t maxSubIndex
Equal to 6.
Definition: CO_SRDO.h:67
CO_SRDOCommPar_t::transmissionType
uint8_t transmissionType
Transmission type.
Definition: CO_SRDO.h:83
CO_SRDO_t::toogle
uint8_t toogle
defines the current state
Definition: CO_SRDO.h:144
CO_Emergency.h
CANopen Emergency protocol.
CO_SRDOCommPar_t::COB_ID2_inverted
uint32_t COB_ID2_inverted
Communication object identifier for message received.
Definition: CO_SRDO.h:91
CO_SRDO_t::SRDOMapPar
const CO_SRDOMapPar_t * SRDOMapPar
From CO_SRDO_init()
Definition: CO_SRDO.h:137
CO_SRDO_t::CANdevRx
CO_CANmodule_t * CANdevRx
From CO_SRDO_init()
Definition: CO_SRDO.h:139
CO_SRDO_t::SRDOCommPar
const CO_SRDOCommPar_t * SRDOCommPar
From CO_SRDO_init()
Definition: CO_SRDO.h:136
CO_CANmodule_t
Complete CAN module object.
Definition: CO_driver.h:319
CO_SRDO_initCallbackPre
void CO_SRDO_initCallbackPre(CO_SRDO_t *SRDO, void *object, void(*pFunctSignalPre)(void *object))
Initialize SRDO callback function.
CO_SRDOGuard_process
uint8_t CO_SRDOGuard_process(CO_SRDOGuard_t *SRDOGuard)
Process operation and valid state changes.
CO_SRDOGuard_t::operatingState
CO_NMT_internalState_t * operatingState
pointer to current operation state
Definition: CO_SRDO.h:115
CO_SRDO_t
SRDO object.
Definition: CO_SRDO.h:124
CO_SRDOCommPar_t::COB_ID1_normal
uint32_t COB_ID1_normal
Communication object identifier for message received.
Definition: CO_SRDO.h:87
CO_SRDOGuard_t
Gurad Object for SRDO monitors:
Definition: CO_SRDO.h:114
CO_SRDO_t::checksum
const uint16_t * checksum
From CO_SRDO_init()
Definition: CO_SRDO.h:138
CO_SRDO_initCallbackEnterSafeState
void CO_SRDO_initCallbackEnterSafeState(CO_SRDO_t *SRDO, void *object, void(*pFunctSignalSafe)(void *object))
Initialize SRDO callback function.
CO_SRDO_requestSend
CO_ReturnError_t CO_SRDO_requestSend(CO_SRDO_t *SRDO)
Send SRDO on event.
CO_SRDOGuard_t::checkCRC
uint8_t checkCRC
specifies whether a CRC check should be performed
Definition: CO_SRDO.h:118
CO_CANtx_t
Configuration object for CAN transmit message for specific CANopenNode Object.
Definition: CO_driver.h:299
CO_SRDOGuard_t::configurationValid
uint8_t * configurationValid
pointer to the configuration valid flag in OD
Definition: CO_SRDO.h:117
uint8_t
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition: CO_driver.h:151