NNP STM Generic Remote Module
git-main
Loading...
Searching...
No Matches
def.h
Go to the documentation of this file.
1
9
#ifndef INC_DEF_H_
10
#define INC_DEF_H_
11
12
#include "
config.h
"
13
16
#define OD_SUCCESSFUL 0x00000000
17
#define OD_READ_NOT_ALLOWED 0x06010001
18
#define OD_WRITE_NOT_ALLOWED 0x06010002
19
#define OD_NO_SUCH_OBJECT 0x06020000
20
#define OD_NOT_MAPPABLE 0x06040041
21
#define OD_LENGTH_DATA_INVALID 0x06070010
22
#define OD_NO_SUCH_SUBINDEX 0x06090011
23
#define OD_VALUE_RANGE_EXCEEDED 0x06090030
/* Value range test result */
24
#define OD_VALUE_TOO_LOW 0x06090031
/* Value range test result */
25
#define OD_VALUE_TOO_HIGH 0x06090032
/* Value range test result */
26
/* Others SDO abort codes
27
*/
28
#define SDOABT_TOGGLE_NOT_ALTERNED 0x05030000
29
#define SDOABT_TIMED_OUT 0x05040000
30
#define SDOABT_OUT_OF_MEMORY 0x05040005
/* Size data exceed SDO_MAX_LENGTH_TRANSFERT */
31
#define SDOABT_GENERAL_ERROR 0x08000000
/* Error size of SDO message */
32
#define SDOABT_LOCAL_CTRL_ERROR 0x08000021
33
#define SDOABT_APP_TIMEOUT 0x08000040
34
35
/******************** CONSTANTS ****************/
36
40
/* Should not be modified */
41
#define REQUEST 1
42
#define NOT_A_REQUEST 0
43
44
/* Misc constants */
45
/* -------------- */
46
/* Should not be modified */
47
#define Rx 0
48
#define Tx 1
49
#ifndef TRUE
50
#define TRUE 1
51
#endif
52
#ifndef FALSE
53
#define FALSE 0
54
#endif
55
56
#define ERR_NOERROR 0
57
60
#define SDO_RESET 0x0
/* Transmission not started. Init state. */
61
#define SDO_FINISHED 0x1
/* data are available */
62
#define SDO_ABORTED_RCV 0x80
/* Received an abort message. Data not available */
63
#define SDO_ABORTED_INTERNAL 0x85
/* Aborted but not because of an abort message (Timeout) */
64
#define SDO_DOWNLOAD_IN_PROGRESS 0x2
65
#define SDO_UPLOAD_IN_PROGRESS 0x3
66
67
68
/* Status of the node during the SDO transfer : */
69
#define SDO_SERVER 0x1
70
#define SDO_CLIENT 0x2
71
#define SDO_UNKNOWN 0x3
72
73
/* SDOrx ccs: client command specifier */
74
#define DOWNLOAD_SEGMENT_REQUEST 0
75
#define INITIATE_DOWNLOAD_REQUEST 1
76
#define INITIATE_UPLOAD_REQUEST 2
77
#define UPLOAD_SEGMENT_REQUEST 3
78
#define ABORT_TRANSFER_REQUEST 4
79
80
/* SDOtx scs: server command specifier */
81
#define UPLOAD_SEGMENT_RESPONSE 0
82
#define DOWNLOAD_SEGMENT_RESPONSE 1
83
#define INITIATE_DOWNLOAD_RESPONSE 3
84
#define INITIATE_UPLOAD_RESPONSE 2
85
#define ABORT_TRANSFER_REQUEST 4
86
87
88
/* Function Codes
89
---------------
90
91
*/
92
#define NMT 0x0
93
#define SYNC 0x1
94
#define BOOT 0x2
95
#define PDO1tx 0x3
96
#define PDO1rx 0x4
97
#define PDO2tx 0x5
98
#define PDO2rx 0x6
99
#define PDO3tx 0x7
100
#define PDO3rx 0x8
101
#define PDO4tx 0x9
102
#define PDO4rx 0xA
103
#define SDOtx 0xB
104
#define SDOrx 0xC
105
#define NODE_GUARD 0xE
106
#define LSS 0xF
107
108
/* NMT Command Specifier, implemented by a master device */
109
/* ------------------------------------------------------------- */
110
/* Broadcast Network command */
111
#define NMT_Start_Nodes 0x01
112
#define NMT_Stop_Nodes 0x02
113
#define NMT_Enter_Patient_Operation 0x03
114
#define NMT_Enter_X_Manual 0x04
115
#define NMT_Enter_Y_Manual 0x05
116
#define NMT_Enter_Stop_Stim 0x06
117
#define NMT_Enter_Wait_Mode 0x07
/* Command to return to waiting for next */
118
#define NMT_Enter_Patient_Manual 0x08
/* corresponds to 'Test Patient Mode ' */
119
#define NMT_Enter_Produce_X_Manual 0x09
120
#define NMT_Do_Save_Cmd 0x0A
121
#define NMT_Do_Restore_Cmd 0x0B
122
#define NMT_Enter_Record_X 0x0C
123
#define NMT_Net_PDO_On 0x0D
124
#define NMT_Net_PDO_Off 0x0E
125
126
/* Broadcast Network management */
127
#define NMT_Return_Node_Table 0x10
128
#define NMT_Return_Single_Node 0x11
129
130
/* Group Management */
131
#define NMT_Group_On 0x20
132
#define NMT_Group_Off 0x21
133
#define NMT_All_Groups_Off 0x22
134
135
136
/* Local Node command */
137
#define NMT_Reset_Node 0x81
138
#define NMT_Reset_Comunication 0x82
139
#define NMT_Enter_Bootloader 0x83
140
#define NMT_Start_Sync 0x84
141
#define NMT_Stop_Sync 0x85
142
#define NMT_Start_PDO 0x86
143
#define NMT_Stop_PDO 0x87
144
#define NMT_Set_RTC 0x88
145
#define NMT_Set_Alarm 0x89
146
#define NMT_Reset_Watchdog 0x8A
147
#define NMT_Radio_WOR_ON 0x8B
148
#define NMT_Radio_WOR_OFF 0x8C
149
#define NMT_Run_Script 0x8D
150
#define NMT_Enable_Script 0x8E
151
#define NMT_Disable_Script 0x8F
152
#define NMT_Erase_Serial_Eprom 0x90
153
#define NMT_Reset_Block_Counter 0x91
154
#define NMT_Radio_Address 0x92
155
#define NMT_Wake_Remote_Modules 0x93
156
#define NMT_WOR_Start_POLL 0x94
157
#define NMT_Network_On 0x95
158
#define NMT_Network_Off 0x96
159
#define NMT_Halt_RTC 0x97
160
#define NMT_Clear_CAN_Errors 0x98
161
#define NMT_Set_Radio_Power 0x99
162
#define NMT_Init_NV_Memory 0x9A
163
#define NMT_Init_CAN 0x9B
164
#define NMT_Reset_Radio_Counters 0x9C
165
#define NMT_Reset_OD_Defaults 0x9D
166
#define NMT_Reset_Module 0x9E
167
#define NMT_Enter_Low_Power 0x9F
168
#define NMT_Start_SDO_Graph 0xA1
169
#define NMT_Stop_SDO_Graph 0xA2
170
#define NMT_Start_HS_Graph 0xA3
171
#define NMT_Stop_HS_Graph 0xA4
172
173
/* Local Node command (module implementation) */
174
#define NMT_Set_IMU_Mode 0xC3
175
178
#define LSS_RESET 0x0
/* Transmission not started. Init state. */
179
#define LSS_FINISHED 0x1
/* data are available */
180
#define LSS_ABORTED_INTERNAL 0x2
/* Aborted but not because of an abort message. */
181
#define LSS_TRANS_IN_PROGRESS 0x3
182
183
/* constantes used in the different state machines */
184
/* ----------------------------------------------- */
185
/* Must not be modified -- used in PDO.c */
186
#define state1 0x01
187
#define state2 0x02
188
#define state3 0x03
189
#define state4 0x04
190
#define state5 0x05
191
#define state6 0x06
192
#define state7 0x07
193
#define state8 0x08
194
#define state9 0x09
195
#define state10 0x0A
196
#define state11 0x0B
197
198
#endif
/* INC_DEF_H_ */
config.h
Core
Inc
def.h
Generated by
1.12.0