2 This file is part of CanFestival, a library implementing CanOpen Stack.
4 Copyright (C): Edouard TISSERANT and Francis DUPIN
6 See COPYING file for copyrights details.
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 /** definitions used for object dictionary access. ie SDO Abort codes . (See DS 301 v.4.02 p.48)
31 #define OD_SUCCESSFUL 0x00000000
32 #define OD_READ_NOT_ALLOWED 0x06010001
33 #define OD_WRITE_NOT_ALLOWED 0x06010002
34 #define OD_NO_SUCH_OBJECT 0x06020000
35 #define OD_NOT_MAPPABLE 0x06040041
36 #define OD_LENGTH_DATA_INVALID 0x06070010
37 #define OD_NO_SUCH_SUBINDEX 0x06090011
38 #define OD_VALUE_RANGE_EXCEEDED 0x06090030 /* Value range test result */
39 #define OD_VALUE_TOO_LOW 0x06090031 /* Value range test result */
40 #define OD_VALUE_TOO_HIGH 0x06090032 /* Value range test result */
41 /* Others SDO abort codes
43 #define SDOABT_TOGGLE_NOT_ALTERNED 0x05030000
44 #define SDOABT_TIMED_OUT 0x05040000
45 #define SDOABT_OUT_OF_MEMORY 0x05040005 /* Size data exceed SDO_MAX_LENGTH_TRANSFERT */
46 #define SDOABT_GENERAL_ERROR 0x08000000 /* Error size of SDO message */
47 #define SDOABT_LOCAL_CTRL_ERROR 0x08000021
49 /******************** CONSTANTS ****************/
51 /** Constantes which permit to define if a PDO frame
52 is a request one or a data one
54 /* Should not be modified */
56 #define NOT_A_REQUEST 0
60 /* Should not be modified */
70 /** Status of the SDO transmission
72 #define SDO_RESET 0x0 /* Transmission not started. Init state. */
73 #define SDO_FINISHED 0x1 /* data are available */
74 #define SDO_ABORTED_RCV 0x80 /* Received an abort message. Data not available */
75 #define SDO_ABORTED_INTERNAL 0x85 /* Aborted but not because of an abort message. */
76 #define SDO_DOWNLOAD_IN_PROGRESS 0x2
77 #define SDO_UPLOAD_IN_PROGRESS 0x3
79 /* Status of the node during the SDO transfert : */
80 #define SDO_SERVER 0x1
81 #define SDO_CLIENT 0x2
82 #define SDO_UNKNOWN 0x3
84 /* SDOrx ccs: client command specifier */
85 #define DOWNLOAD_SEGMENT_REQUEST 0
86 #define INITIATE_DOWNLOAD_REQUEST 1
87 #define INITIATE_UPLOAD_REQUEST 2
88 #define UPLOAD_SEGMENT_REQUEST 3
89 #define ABORT_TRANSFER_REQUEST 4
91 /* SDOtx scs: server command specifier */
92 #define UPLOAD_SEGMENT_RESPONSE 0
93 #define DOWNLOAD_SEGMENT_RESPONSE 1
94 #define INITIATE_DOWNLOAD_RESPONSE 3
95 #define INITIATE_UPLOAD_RESPONSE 2
96 #define ABORT_TRANSFER_REQUEST 4
101 defined in the canopen DS301
105 #define TIME_STAMP 0x2
116 #define NODE_GUARD 0xE
119 /* NMT Command Specifier, sent by master to change a slave state */
120 /* ------------------------------------------------------------- */
121 /* Should not be modified */
122 #define NMT_Start_Node 0x01
123 #define NMT_Stop_Node 0x02
124 #define NMT_Enter_PreOperational 0x80
125 #define NMT_Reset_Node 0x81
126 #define NMT_Reset_Comunication 0x82
128 /** Status of the LSS transmission
130 #define LSS_RESET 0x0 /* Transmission not started. Init state. */
131 #define LSS_FINISHED 0x1 /* data are available */
132 #define LSS_ABORTED_INTERNAL 0x2 /* Aborted but not because of an abort message. */
133 #define LSS_TRANS_IN_PROGRESS 0x3
135 /* constantes used in the different state machines */
136 /* ----------------------------------------------- */
137 /* Must not be modified */
150 #endif /* __def_h__ */