NNP STM Generic Remote Module git-main
Loading...
Searching...
No Matches
emcy.h
Go to the documentation of this file.
1
8#ifndef INC_EMCY_H_
9#define INC_EMCY_H_
10
11#include <applicfg.h>
12
13/* The error states
14 * ----------------- */
15typedef enum enum_errorState {
16 Error_free = 0x00,
17 Error_occurred = 0x01
18} e_errorState;
19
20typedef struct {
21 UNS16 errCode;
22 UNS8 errRegMask;
23 UNS8 active;
24} s_errors;
25
26#include "data.h"
27
28
29typedef void (*post_emcy_t)(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg);
30void _post_emcy(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg);
31
32/*************************************************************************
33 * Functions
34 *************************************************************************/
35
36UNS8 EMCY_setError(CO_Data* d, UNS16 errCode, UNS8 errRegMask, UNS16 addInfo);
37void EMCY_errorRecovered(CO_Data* d, UNS16 errCode);
38void emergencyInit(CO_Data* d);
39void emergencyStop(CO_Data* d);
40void proceedEMCY(CO_Data* d, Message* m);
41
42#endif /* INC_EMCY_H_ */
#define UNS8
Unsigned int8 representation in CANFest.
Definition applicfg.h:25
#define UNS16
Unsigned int16 representation in CANFest.
Definition applicfg.h:26
UNS8 EMCY_setError(CO_Data *d, UNS16 errCode, UNS8 errRegMask, UNS16 addInfo)
Sets a new error with code errCode. Also sets corresponding bits in Error register (1001h)
Definition emcy.c:105
void proceedEMCY(CO_Data *d, Message *m)
This function is responsible to process an EMCY canopen-message.
Definition emcy.c:202
void EMCY_errorRecovered(CO_Data *d, UNS16 errCode)
Indicates it has recovered from error errCode. Also clears corresponding bits in Error register (1001...
Definition emcy.c:162
void _post_emcy(CO_Data *d, UNS8 nodeID, UNS16 errCode, UNS8 errReg)
<BRIEF> _post_emcy
Definition emcy.c:231
void emergencyStop(CO_Data *d)
Stop EMCY producer and consumer.
Definition emcy.c:62
void emergencyInit(CO_Data *d)
Start EMCY consumer and producer.
Definition emcy.c:50
Definition can.h:13
This structure contains all necessary informations to define a CANOpen node.
Definition data.h:44