author | etisserant |
Tue, 17 Jul 2007 18:20:50 +0200 | |
changeset 241 | 4ecc2f3690f4 |
parent 235 | f812bf6b7237 |
child 288 | 26015ee2c2c9 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
This file is part of CanFestival, a library implementing CanOpen Stack. |
|
3 |
||
4 |
Copyright (C): Edouard TISSERANT and Francis DUPIN |
|
5 |
||
6 |
See COPYING file for copyrights details. |
|
7 |
||
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. |
|
12 |
||
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. |
|
17 |
||
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 |
|
21 |
*/ |
|
22 |
||
23 |
||
24 |
#ifndef __def_h__ |
|
25 |
#define __def_h__ |
|
26 |
||
27 |
#include "config.h" |
|
28 |
||
29 |
/** definitions used for object dictionary access. ie SDO Abort codes . (See DS 301 v.4.02 p.48) |
|
30 |
*/ |
|
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_TOO_LOW 0x06090031 /* Value range test result */ |
|
39 |
#define OD_VALUE_TOO_HIGH 0x06090032 /* Value range test result */ |
|
40 |
/* Others SDO abort codes |
|
41 |
*/ |
|
42 |
#define SDOABT_TOGGLE_NOT_ALTERNED 0x05030000 |
|
43 |
#define SDOABT_TIMED_OUT 0x05040000 |
|
44 |
#define SDOABT_OUT_OF_MEMORY 0x05040005 /* Size data exceed SDO_MAX_LENGTH_TRANSFERT */ |
|
45 |
#define SDOABT_GENERAL_ERROR 0x08000000 /* Error size of SDO message */ |
|
46 |
#define SDOABT_LOCAL_CTRL_ERROR 0x08000021 |
|
47 |
||
48 |
/******************** CONSTANTS ****************/ |
|
49 |
||
50 |
/** Constantes which permit to define if a PDO frame |
|
51 |
is a request one or a data one |
|
52 |
*/ |
|
53 |
/* Should not be modified */ |
|
54 |
#define REQUEST 1 |
|
55 |
#define NOT_A_REQUEST 0 |
|
56 |
||
71 | 57 |
/* Misc constants */ |
58 |
/* -------------- */ |
|
0 | 59 |
/* Should not be modified */ |
60 |
#define Rx 0 |
|
61 |
#define Tx 1 |
|
62 |
#define TRUE 1 |
|
63 |
#define FALSE 0 |
|
64 |
||
235
f812bf6b7237
Preliminary implementation of Event Timer and Inhibit Timer driven TPDO
etisserant
parents:
71
diff
changeset
|
65 |
|
0 | 66 |
/** Status of the SDO transmission |
67 |
*/ |
|
71 | 68 |
#define SDO_RESET 0x0 /* Transmission not started. Init state. */ |
69 |
#define SDO_FINISHED 0x1 /* data are available */ |
|
70 |
#define SDO_ABORTED_RCV 0x80 /* Received an abort message. Data not available */ |
|
71 |
#define SDO_ABORTED_INTERNAL 0x85 /* Aborted but not because of an abort message. */ |
|
0 | 72 |
#define SDO_DOWNLOAD_IN_PROGRESS 0x2 |
73 |
#define SDO_UPLOAD_IN_PROGRESS 0x3 |
|
74 |
||
71 | 75 |
/* Status of the node during the SDO transfert : */ |
0 | 76 |
#define SDO_SERVER 0x1 |
77 |
#define SDO_CLIENT 0x2 |
|
78 |
#define SDO_UNKNOWN 0x3 |
|
79 |
||
80 |
/* Function Codes |
|
71 | 81 |
--------------- |
0 | 82 |
defined in the canopen DS301 |
83 |
*/ |
|
84 |
#define NMT 0x0 |
|
85 |
#define SYNC 0x1 |
|
86 |
#define TIME_STAMP 0x2 |
|
87 |
#define PDO1tx 0x3 |
|
88 |
#define PDO1rx 0x4 |
|
89 |
#define PDO2tx 0x5 |
|
90 |
#define PDO2rx 0x6 |
|
91 |
#define PDO3tx 0x7 |
|
92 |
#define PDO3rx 0x8 |
|
93 |
#define PDO4tx 0x9 |
|
94 |
#define PDO4rx 0xA |
|
95 |
#define SDOtx 0xB |
|
96 |
#define SDOrx 0xC |
|
97 |
#define NODE_GUARD 0xE |
|
98 |
||
71 | 99 |
/* NMT Command Specifier, sent by master to change a slave state */ |
100 |
/* ------------------------------------------------------------- */ |
|
0 | 101 |
/* Should not be modified */ |
102 |
#define NMT_Start_Node 0x01 |
|
103 |
#define NMT_Stop_Node 0x02 |
|
104 |
#define NMT_Enter_PreOperational 0x80 |
|
105 |
#define NMT_Reset_Node 0x81 |
|
106 |
#define NMT_Reset_Comunication 0x82 |
|
107 |
||
71 | 108 |
/* constantes used in the different state machines */ |
109 |
/* ----------------------------------------------- */ |
|
0 | 110 |
/* Must not be modified */ |
111 |
#define state1 0x01 |
|
112 |
#define state2 0x02 |
|
113 |
#define state3 0x03 |
|
114 |
#define state4 0x04 |
|
115 |
#define state5 0x05 |
|
116 |
#define state6 0x06 |
|
117 |
#define state7 0x07 |
|
118 |
#define state8 0x08 |
|
119 |
#define state9 0x09 |
|
120 |
#define state10 0x0A |
|
121 |
#define state11 0x0B |
|
122 |
||
71 | 123 |
#endif /* __def_h__ */ |
0 | 124 |