source: trunk/Cosy/incl/mcal.h@ 12656

Last change on this file since 12656 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 16.3 KB
Line 
1/*-----------------------------------------------------------------------------
2mcal.h -- CAL Message Specifications
3
4Copyright (c) 1994 JANZ Computer AG
5All Rights Reserved
6
7Created 94/10/11 by Soenke Hansen
8Version 1.48 of 00/02/17
9
10Definitions of message specifiers for message exchanged between
11CAL and a CAL User (Application).
12
13-----------------------------------------------------------------------------*/
14
15#ifndef mcal_DEFINED
16#define mcal_DEFINED
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/* Message specifiers (User -- DBT Slave) */
23#define M_DBTS_CREATE 0x80 /* create user definition */
24#define M_DBTS_CREATE_ALL 0x81 /* create all user definitions */
25#define M_DBTS_DELETE 0x82 /* delete user definition */
26#define M_DBTS_VERIFY 0x83 /* verify COB definition */
27#define M_DBTS_CHECKSUM 0x84 /* get checksum */
28
29/* Message specifiers (User -- NMT Slave) */
30#define M_NMTS_STATE_ind 0x90 /* indicate NMT state change to user */
31#define M_NMTS_PREPARE_ind 0x91 /* ask user to initiate preparation */
32#define M_NMTS_IDENTIFY_ind 0x92 /* ind. for this node to identify */
33#define M_NMTS_EVENT_ind 0x93 /* Node Event indication */
34#define M_NMTS_RESET_NODE_ind 0x94 /* CANopen Reset Node indication */
35#define M_NMTS_RESET_COMMUNICATION_ind 0x95
36 /* CANopen Reset Communication indication */
37#define M_NMTS_CONF_ind 0x96 /* config. services (with subspec!) */
38#define M_NMTS_CONF_DATA_ind 0x97 /* config. data services (w. subspec!) */
39
40/* Message "sub-specifiers" with M_NMTS_CONF_[DATA_]ind */
41#define M_NMTS_CONF_DL_DATA_ind 0x0001 /* config. download data ind. */
42#define M_NMTS_CONF_DL_DATA_CONT_ind 0x0002 /* config. download data ind. */
43#define M_NMTS_CONF_DL_FAIL_ind 0x0003 /* config. download fail. ind.*/
44#define M_NMTS_CONF_DL_SUCC_ind 0x0004 /* config. download succ. ind.*/
45#define M_NMTS_CONF_ABORT_ind 0x0005 /* config. transfer abort ind.*/
46#define M_NMTS_CONF_VERIFY_ind 0x0006 /* config. protocol verify ind.*/
47
48/* Failure codes (nmtm/ nmts configuration) */
49#define NMT_CONFIG_NO_ERR 0 /* no error */
50#define NMT_CONFIG_TOGGLE_ERR 1 /* toggle error */
51#define NMT_CONFIG_SIZE_ERR 2 /* mismatch of data size */
52#define NMT_CONFIG_PROTOCOL_ERR 3 /* nomen est omen */
53#define NMT_CONFIG_MEM_ERR 4 /* no more mem free */
54#define NMT_CONFIG_RESTART_ERR 5 /* current up-/down-load will */
55 /* be restarted */
56
57/* Message specifiers (User -- LMT Slave) */
58#define M_LMTS_MODE_ind 0x98 /* change of LMT mode */
59#define M_LMTS_BUSON_ind 0x99 /* activate bit timing completed */
60#define M_LMTS_BUSOFF_ind 0x9a /* activate bit timing started */
61#define M_LMTS_NMTADDR_ind 0x9b /* new NMT address (partial) */
62#define M_LMTS_BTR_ind 0x9c /* new Bit Timing */
63#define M_LMTS_STORE_ind 0x9d /* Store Configuration */
64
65/* Message specifiers (User -- NMT Master) */
66#define M_NMTM_CONNECT_ind 0xa0 /* indicate end of Node Connect svc */
67#define M_NMTM_PREPARE_ind 0xa1 /* indicate end of Node Prepare svc */
68#define M_NMTM_IDENTIFY_ind 0xa2 /* Identify Node indication */
69#define M_NMTM_EVENT_ind 0xa3 /* Network Event indication */
70#define M_NMTM_CONF_ind 0xa4 /* config. services (with subspec!) */
71
72/* Message "sub-specifiers" with M_NMTM_CONF_ind */
73#define M_NMTM_CONF_DL_CONT_ind 0x0001 /* config. download continue ind. */
74#define M_NMTM_CONF_DL_SUC_con 0x0002 /* config. download success conf. */
75#define M_NMTM_CONF_DL_FAIL_con 0x0003 /* config. download failure conf. */
76#define M_NMTM_CONF_UL_DATA_ind 0x0004 /* config. upload data ind. */
77#define M_NMTM_CONF_UL_DACO_ind 0x0005 /* config. upload data continue ind. */
78#define M_NMTM_CONF_UL_FAIL_con 0x0006 /* config. upload failure conf. */
79#define M_NMTM_CONF_ABORT_ind 0x0007 /* config. transfer abort indication */
80#define M_NMTM_CONF_VERIFY_con 0x0008 /* config. protocol verify conf.*/
81
82
83/* Message specifiers (User -- CAL) */
84#define M_NMTS 0xb0 /* user <--> NMT slave */
85#define M_NMTM 0xb1 /* user <--> NMT master */
86#define M_DBTS 0xb2 /* user <--> DBT slave */
87#define M_DBTM 0xb3 /* user <--> DBT master */
88#define M_LMTS 0xb4 /* user <--> LMT slave */
89#define M_LMTM 0xb5 /* user <--> LMT master */
90#define M_CMS_DEF 0xb6 /* user <--> CMS definition services */
91#define M_CMS_DATA 0xb7 /* user <--> CMS data transfer */
92
93/* CANopen (hardware-timer (TPU) dependant) timer configuration */
94/* Message specifiers (User -- CANopen) */
95#define M_CANOPEN 0xb8 /* user <--> CANopen */
96
97#define HI_RES_TIMER 0x0001 /* handle HiRes timestamping */
98#define TIME_OF_DAY_TIMER 0x0002 /* handle TimeOfDay timestamping */
99#define SYNC_TIMER 0x0004 /* handle SYNC timer */
100
101/* Start of timestamp/sync messaging */
102#define MS_CANOPEN_START_HI_RES_TS_req 0x0001 /* start HiRes timestamping (CANopen master) */
103#define MS_CANOPEN_START_TOD_TS_req 0x0002 /* start TimeOfDay timestamping (CANopen master) */
104#define MS_CANOPEN_START_SYNC_req 0x0003 /* start SYNC timer (CANopen master) */
105
106/* single shot of timestamp/sync messaging */
107#define MS_CANOPEN_TRIGGER_SINGLE_HI_RES_TS_req 0x0004 /* trigger HiRes (TIME-server) stamp once */
108#define MS_CANOPEN_TRIGGER_SINGLE_TOD_TS_req 0x0005 /* trigger TimeOfDay (TIME-server) stamp once */
109
110/* mapping the high resolution timestamp into a PDO */
111#define MS_CANOPEN_MAP_HI_RES_TIMESTAMP_req 0x0006 /* map HiRes timestamp (TIME-server) into PDO */
112
113#define MS_CANOPEN_DELETE_ALL_PDO_MAPPINGS_req 0x0007 /* PDO mapping configuration (CANopen slave) */
114#define MS_CANOPEN_ADD_PDO_MAPPING_req 0x0008 /* PDO mapping configuration (CANopen slave) */
115#define MS_CANOPEN_ADD_PDO_LENGTH_req 0x0009 /* PDO length configuration (CANopen slave) */
116#define MS_CANOPEN_ADD_PDO_TRANS_TYPE_req 0x000a /* PDO transm. type configuration (CANopen slave) */
117#define MS_CANOPEN_CONTROL_PDO_req 0x000b /* PDO dis-/enabling (CANopen slave) */
118#define MS_CANOPEN_ADJUST_COB_ID_req 0x000c /* PDO COB-Id configuration (CANopen slave) */
119#define MS_CANOPEN_ADD_PDO_INHIB_TIME_req 0x000d /* PDO inhibit-time configuration (CANopen slave) */
120#define MS_CANOPEN_TRIGGER_TPDO_req 0x000e /* triggering of PDO for sending (CANopen slave) */
121#define MS_CANOPEN_TRIGGER_RPDO_req 0x000f /* triggering of PDO for receiption (CANopen slave) */
122
123/* Message sub-specifiers with M_NMTS */
124#define MS_NMTS_CREATE_NODE_req 0x0000 /* create slave node */
125#define MS_NMTS_DELETE_NODE_req 0x0001 /* delete slave node */
126#define MS_NMTS_IDENTIFY_NODE_req 0x0002 /* send identify node */
127#define MS_NMTS_CONNECT_NODE_req 0x0003 /* connect node */
128#define MS_NMTS_DISCONNECT_NODE_req 0x0004 /* disconnect node */
129#define MS_NMTS_PREPARE_REMOTE_NODE_res 0x0005 /* send prepare remote node response */
130#define MS_NMTS_PREPARE_REMOTE_NODE_ind 0x0006 /* indicate prepare remote node request */
131#define MS_NMTS_IDENTIFY_REMOTE_NODES_ind 0x0007 /* indicate request for nodes to identify */
132#define MS_NMTS_STATE_ind 0x0008 /* indicate NMT state change */
133#define MS_NMTS_EVENT_ind 0x0009 /* node event indication */
134/* Definitions for CANopen relevant functions */
135#define MS_NMTS_CREATE_COP_NODE_req 0x000a /* create CANopen slave node */
136#define MS_NMTS_RESET_NODE_ind 0x000b /* CANopen reset node indication */
137#define MS_NMTS_RESET_COMMUNICATION_ind 0x000c /* CANopen reset communication indication */
138#define MS_NMTS_CONFIG_COP_NODE_req 0x000d /* conf. dflt. guard par. of CANopen slave */
139#define MS_NMTS_CONFIG_DOWNLOAD_ind 0x000e /* configuration download indication */
140#define MS_NMTS_CONFIG_DOWNLOAD_CONT_ind 0x000f /* configuration download continue indication */
141#define MS_NMTS_CONFIG_DOWNLOAD_FAIL_ind 0x0011 /* configuration download failure indication */
142#define MS_NMTS_CONFIG_NODE_req 0x0012 /* general purpose configuration of NMT slave */
143#define MS_NMTS_CONFIG_ACK_res 0x0013 /* generate acknowledge for configuration download */
144#define MS_NMTS_CONFIG_ABORT_TRANSFER_ind 0x0014 /* abort configuration transfer indication */
145#define MS_NMTS_CONFIG_ABORT_TRANSFER_req 0x0015 /* abort configuration transfer indication */
146#define MS_NMTS_CONFIG_VERIFY_ind 0x0016 /* verify configuration transfer indication */
147#define MS_NMTS_CONFIG_VERIFY_res 0x0017 /* verify configuration transfer response */
148
149/* Message sub-specifiers with M_DBTS */
150#define MS_DBTS_DELETE_USERDEF_req 0x0000 /* delete user definition */
151#define MS_DBTS_DELETE_USERDEF_con 0x0001 /* confirmation */
152#define MS_DBTS_CREATE_ALL_USERDEF_req 0x0002 /* create all user definitions */
153#define MS_DBTS_CREATE_ALL_USERDEF_con 0x0003 /* confirmation */
154#define MS_DBTS_VERIFY_COBCLASS_req 0x0004 /* verify cob class */
155#define MS_DBTS_VERIFY_COBCLASS_con 0x0005 /* confirmation */
156#define MS_DBTS_GET_CHECKSUM_req 0x0006 /* get checksum */
157#define MS_DBTS_GET_CHECKSUM_con 0x0007 /* confirmation */
158
159/* Message sub-specifiers with M_LMTS */
160#define MS_LMTS_BUSON_req 0x0000 /* switch to bus on state */
161#define MS_LMTS_BUSOFF_req 0x0001 /* switch to bus off state */
162#define MS_LMTS_CANCONF_req 0x0002 /* configure CANbus parameter */
163
164/* Subrequests for CANCONF */
165#define MS_LMTS_CANCONF_BERR 0x00 /* Configure bus-error detection */
166#define MS_LMTS_CANCONF_EWL 0x01 /* Configure error warning limit */
167#define MS_LMTS_CANCONF_LOM 0x02 /* Configure listen only mode */
168#define MS_LMTS_CANCONF_STM 0x03 /* Configure self test mode */
169
170/* Message sub-specifiers with M_NMTM */
171#define MS_NMTM_ADD_REMOTE_NODE_req 0x0000 /* add remote node */
172#define MS_NMTM_ADD_REMOTE_NODE_con 0x0001 /* confirmation */
173#define MS_NMTM_REMOVE_REMOTE_NODE_req 0x0002 /* remove remote node */
174#define MS_NMTM_CONNECT_REMOTE_NODE_req 0x0003 /* connect remote node */
175#define MS_NMTM_CONNECT_REMOTE_NODE_con 0x0004 /* confirmation */
176#define MS_NMTM_PREPARE_REMOTE_NODE_req 0x0005 /* prepare remote node */
177#define MS_NMTM_PREPARE_REMOTE_NODE_con 0x0006 /* confirmation */
178#define MS_NMTM_START_REMOTE_NODE_req 0x0007 /* start remote node */
179#define MS_NMTM_STOP_REMOTE_NODE_req 0x0008 /* stop remote node */
180#define MS_NMTM_DISCONNECT_REMOTE_NODE_req 0x0009 /* disconnect remote node */
181#define MS_NMTM_IDENTIFY_REMOTE_NODES_req 0x000a /* identify remote nodes */
182#define MS_NMTM_IDENTIFY_ind 0x000b /* identify node indication */
183#define MS_NMTM_EVENT_ind 0x000c /* network event indication */
184#define MS_NMTM_GET_RNODES_req 0x000d /* get remote nodes */
185#define MS_NMTM_GET_RNODES_con 0x000e /* confirmation */
186#define MS_NMTM_CONFIG_req 0x000f /* configuration */
187/* Definitions for CANopen relevant functions */
188#define MS_NMTM_ADD_REMOTE_COP_NODE_req 0x0010 /* add CANopen remote node */
189#define MS_NMTM_ADD_REMOTE_COP_NODE_con 0x0011 /* confirmation */
190#define MS_NMTM_ENTER_PRE_OPERATIONAL_STATE_req 0x0012 /* enter pre-operational state request */
191#define MS_NMTM_RESET_NODE_req 0x0013 /* reset node request */
192#define MS_NMTM_RESET_COMMUNICATION_req 0x0014 /* reset communication request */
193#define MS_NMTM_START_GUARD_REMOTE_NODE_req 0x0015 /* start CANopen remote node guarding request */
194#define MS_NMTM_ADD_REMOTE_COP_NODE_GID_req 0x0016 /* add CANopen remote node with guard ID */
195
196#define MS_NMTM_CONF_DOWNLOAD_START_req 0x0017 /* start config. download request */
197#define MS_NMTM_CONF_DOWNLOAD_CONT_res 0x0018 /* continue config. download response */
198#define MS_NMTM_CONF_UPLOAD_START_req 0x0019 /* start config. upload request */
199#define MS_NMTM_CONF_ACKNOWLEDGE_res 0x001a /* config. data acknowledge (from host) */
200#define MS_NMTM_CONF_DOWNLOAD_CONT_ind 0x001b /* config. download continue indication */
201#define MS_NMTM_CONF_DOWNLOAD_SUC_con 0x001c /* config. download success confirmation */
202#define MS_NMTM_CONF_DOWNLOAD_FAIL_con 0x001d /* config. download failure confirmation */
203#define MS_NMTM_CONF_ABORT_TRANSFER_ind 0x001e /* config. transfer abort indication */
204#define MS_NMTM_CONF_ABORT_TRANSFER_req 0x001f /* config. transfer abort indication */
205#define MS_NMTM_CONF_VERIFY_req 0x0020 /* verify configuration transfer request */
206#define MS_NMTM_CONF_VERIFY_con 0x0021 /* verify configuration transfer confirmation */
207
208
209/* Message sub-specifiers with M_DBTM */
210#define MS_DBTM_CREATE_COB_DEF_req 0x0000 /* create COB definitions */
211#define MS_DBTM_DELETE_COB_DEF_req 0x0001 /* delete COB definitions */
212#define MS_DBTM_CREATE_PRE_DEF_req 0x0002 /* create predefinitons */
213#define MS_DBTM_DELETE_PRE_DEF_req 0x0003 /* delete predefinitons */
214#define MS_DBTM_ENABLE_DIST_req 0x0004 /* enable COB database */
215#define MS_DBTM_DISABLE_DIST_req 0x0005 /* disable COB database */
216#define MS_DBTM_GET_COB_DB_req 0x0006 /* get COB database */
217#define MS_DBTM_GET_COB_DB_con 0x0007 /* confirmation */
218#define MS_DBTM_CONFIG_req 0x0008 /* configuration */
219
220/* COB database list element specifiers */
221#define CDB_STATE 1 /* ./. */
222#define CDB_COB_DEF 2 /* ./. */
223#define CDB_USR_DEF 3 /* ./. */
224#define CDB_PRE_DEF 4 /* ./. */
225
226
227/* Message sub-specifiers with M_CMS_DEF */
228#define MS_CMS_DEFINITION_req 0x0000 /* CMS Definition */
229#define MS_CMS_DEFINITION_con 0x0001 /* confirmation */
230#define MS_CMS_OBJECT_CONF_req 0x0002 /* CMS Object configuration */
231#define MS_CMS_SERVICE_CONF_req 0x0004 /* CMS service configuration */
232#define MS_CMS_OBJECT_CHG_ID_req 0x0005 /* CMS Object change ID (SDO) */
233
234
235/* Message sub-specifiers (mask: 0xff) with M_CMS_DATA */
236#define MS_CMS_UPDATE_VAR 0x0001 /* update variable */
237#define MS_CMS_WRITE_VAR_req 0x0002 /* write variable */
238#define MS_CMS_READ_VAR_req 0x0003 /* read variable */
239#define MS_CMS_NOTIFY_EVT_req 0x0004 /* notify event */
240#define MS_CMS_STORE_EVT_req 0x0005 /* store event */
241#define MS_CMS_STORE_I_EVT_req 0x0006 /* store event and notify */
242#define MS_CMS_READ_EVT_req 0x0007 /* read data from stored event */
243#define MS_CMS_DATA_ind 0x0009 /* data indication*/
244
245#define MS_CMS_CONTROL_EVT_req 0x0008 /* set event state request */
246#define MS_CMS_CONTROL_EVT_ind 0x000a /* set event state indication */
247#define MS_CMS_CONTROL_EVT_res 0x000b /* set event state response */
248#define MS_CMS_CONTROL_EVT_con 0x000c /* set event state confirm. */
249
250#define MS_CMS_WRITE_VAR_ind 0x000d /* write variable indication */
251#define MS_CMS_WRITE_VAR_res 0x000e /* write variable response */
252#define MS_CMS_WRITE_VAR_con 0x000f /* write variable confirmation */
253
254#define MS_CMS_READ_VAR_ind 0x0010 /* read variable indication */
255#define MS_CMS_READ_VAR_res 0x0011 /* read variable response */
256#define MS_CMS_READ_VAR_con 0x0012 /* read variable confirmation */
257
258#define MS_CMS_FAIL_ind 0x0013 /* failure indication */
259
260#define MS_CMS_WRITE_MUX_VAR_req 0x0014 /* write a mux variable */
261#define MS_CMS_READ_MUX_VAR_req 0x0015 /* read a mux variable */
262
263
264
265
266/* Domain sub specifiers (mask: 0xff00) with M_CMS_DATA */
267#define MS_CMS_DOWNLOAD_START_req 0x0100 /* start domain download */
268#define MS_CMS_DOWNLOAD_CONT_res 0x0200 /* continue domain download */
269#define MS_CMS_UPLOAD_START_req 0x0300 /* start domain upload */
270#define MS_CMS_UPLOAD_res 0x0400 /* begin upload */
271#define MS_CMS_UPLOAD_CONT_res 0x0500 /* continue upload */
272#define MS_CMS_DOM_ABORT_req 0x0600 /* abort domain transfer */
273
274#define MS_CMS_DOM_DOWNLOAD_CONT_ind 0x0700 /* domain continue indication */
275#define MS_CMS_DOM_SUCCESS_con 0x0800 /* domain success confirmation */
276#define MS_CMS_DOM_SUCCESS_ind 0x0900 /* domain success indication */
277#define MS_CMS_DOM_FAILURE_con 0x0a00 /* domain failure confirmation */
278#define MS_CMS_DOM_FAILURE_ind 0x0b00 /* domain failure indication */
279#define MS_CMS_DOM_DATA_ind 0x0c00 /* domain data indication*/
280#define MS_CMS_DOM_EXPDATA_ind 0x0d00 /* ./. */
281#define MS_CMS_DOM_DATA_CONT_ind 0x0e00 /* domain data cont. indication */
282#define MS_CMS_DOM_UPLOAD_ind 0x0f00 /* domain upload indication */
283#define MS_CMS_DOM_UPLOAD_CONT_ind 0x1000 /* domain upload cont. indication */
284#define MS_CMS_DOM_ACKNOWLEDGE_res 0x2000 /* domain acknowledge (from host) */
285#define MS_CMS_DOM_RCPT_ACKNOWLEDGE_res 0x2100 /* domain receipt acknowledge (from host) */
286#define MS_CMS_DOM_RESOLV_DELAY_ind 0x2000 /* internally used */
287
288/* Failure codes (MS_CMS_FAIL_ind and MS_DOM_FAILURE) */
289#define TRANSMIT_FAIL 1 /* transmitt failure */
290#define DOM_PROT_ERR 2 /* domain protocol error */
291#define NO_BUFFER 3 /* no free buffer (memory problem) */
292#define ABORTED_BY_PEER 4 /* service aborted by peer object */
293#define DATA_SIZE_ERR 5 /* wrong data size */
294#define TIMED_OUT_ON_CON 6 /* timed out waiting for confirmation */
295#define PROTOCOL_ERROR 7 /* protocol error */
296
297/* some strategy codes concerning the host-guarding-stuff */
298/* at failed guarding conditions */
299#define DISABLE_COB_DATABASE 0x01
300#define DISABLE_NODE_GUARDING 0x02
301#define DISCONNECT_REMOTE_NODES 0x04
302
303#ifdef __cplusplus
304}
305#endif
306
307#endif /* !mcal_DEFINED */
Note: See TracBrowser for help on using the repository browser.