nico@215: nico@215: nico@215: CanFestival: include/def.h Source File nico@215: nico@215: nico@215: nico@215: nico@215:
nico@215:
nico@215:
nico@215:
nico@215: nico@215:

def.h

Go to the documentation of this file.
00001 /*
nico@215: 00002 This file is part of CanFestival, a library implementing CanOpen Stack. 
nico@215: 00003 
nico@215: 00004 Copyright (C): Edouard TISSERANT and Francis DUPIN
nico@215: 00005 
nico@215: 00006 See COPYING file for copyrights details.
nico@215: 00007 
nico@215: 00008 This library is free software; you can redistribute it and/or
nico@215: 00009 modify it under the terms of the GNU Lesser General Public
nico@215: 00010 License as published by the Free Software Foundation; either
nico@215: 00011 version 2.1 of the License, or (at your option) any later version.
nico@215: 00012 
nico@215: 00013 This library is distributed in the hope that it will be useful,
nico@215: 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
nico@215: 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
nico@215: 00016 Lesser General Public License for more details.
nico@215: 00017 
nico@215: 00018 You should have received a copy of the GNU Lesser General Public
nico@215: 00019 License along with this library; if not, write to the Free Software
nico@215: 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
nico@215: 00021 */
nico@215: 00022 
nico@215: 00023 
nico@215: 00024 #ifndef __def_h__
nico@215: 00025 #define __def_h__
nico@215: 00026 
nico@215: 00027 #include "config.h"
nico@215: 00028 
etisserant@240: 00031 #define OD_SUCCESSFUL                0x00000000
etisserant@240: 00032 #define OD_READ_NOT_ALLOWED          0x06010001
etisserant@240: 00033 #define OD_WRITE_NOT_ALLOWED         0x06010002
etisserant@240: 00034 #define OD_NO_SUCH_OBJECT            0x06020000
etisserant@240: 00035 #define OD_NOT_MAPPABLE              0x06040041
etisserant@240: 00036 #define OD_LENGTH_DATA_INVALID       0x06070010
etisserant@240: 00037 #define OD_NO_SUCH_SUBINDEX          0x06090011
etisserant@240: 00038 #define OD_VALUE_TOO_LOW             0x06090031 /* Value range test result */
etisserant@240: 00039 #define OD_VALUE_TOO_HIGH            0x06090032 /* Value range test result */
nico@215: 00040 /* Others SDO abort codes 
nico@215: 00041  */
etisserant@240: 00042 #define SDOABT_TOGGLE_NOT_ALTERNED   0x05030000
etisserant@240: 00043 #define SDOABT_TIMED_OUT             0x05040000
etisserant@240: 00044 #define SDOABT_OUT_OF_MEMORY         0x05040005 /* Size data exceed SDO_MAX_LENGTH_TRANSFERT */
etisserant@240: 00045 #define SDOABT_GENERAL_ERROR         0x08000000 /* Error size of SDO message */
etisserant@240: 00046 #define SDOABT_LOCAL_CTRL_ERROR      0x08000021 
nico@215: 00047 
nico@215: 00048 /******************** CONSTANTS ****************/
nico@215: 00049 
nico@215: 00053 /* Should not be modified */
etisserant@240: 00054 #define REQUEST 1
etisserant@240: 00055 #define NOT_A_REQUEST 0
nico@215: 00056 
nico@215: 00057 /* Misc constants */
nico@215: 00058 /* -------------- */
nico@215: 00059 /* Should not be modified */
etisserant@240: 00060 #define Rx 0
etisserant@240: 00061 #define Tx 1
etisserant@240: 00062 #define TRUE  1
etisserant@240: 00063 #define FALSE 0
nico@215: 00064 
etisserant@240: 00065     
etisserant@240: 00068 #define SDO_RESET                0x0      /* Transmission not started. Init state. */
etisserant@240: 00069 #define SDO_FINISHED             0x1      /* data are available */                          
etisserant@240: 00070 #define SDO_ABORTED_RCV          0x80     /* Received an abort message. Data not available */
etisserant@240: 00071 #define SDO_ABORTED_INTERNAL     0x85     /* Aborted but not because of an abort message. */
etisserant@240: 00072 #define SDO_DOWNLOAD_IN_PROGRESS 0x2 
etisserant@240: 00073 #define SDO_UPLOAD_IN_PROGRESS   0x3   
etisserant@240: 00074 
etisserant@240: 00075 /* Status of the node during the SDO transfert : */
etisserant@240: 00076 #define SDO_SERVER  0x1
etisserant@240: 00077 #define SDO_CLIENT  0x2
etisserant@240: 00078 #define SDO_UNKNOWN 0x3             
etisserant@240: 00079 
etisserant@240: 00080 /*  Function Codes 
etisserant@240: 00081    ---------------
etisserant@240: 00082   defined in the canopen DS301 
etisserant@240: 00083 */
etisserant@240: 00084 #define NMT        0x0
etisserant@240: 00085 #define SYNC       0x1
etisserant@240: 00086 #define TIME_STAMP 0x2
etisserant@240: 00087 #define PDO1tx     0x3
etisserant@240: 00088 #define PDO1rx     0x4
etisserant@240: 00089 #define PDO2tx     0x5
etisserant@240: 00090 #define PDO2rx     0x6
etisserant@240: 00091 #define PDO3tx     0x7
etisserant@240: 00092 #define PDO3rx     0x8
etisserant@240: 00093 #define PDO4tx     0x9
etisserant@240: 00094 #define PDO4rx     0xA
etisserant@240: 00095 #define SDOtx      0xB
etisserant@240: 00096 #define SDOrx      0xC
etisserant@240: 00097 #define NODE_GUARD 0xE
etisserant@240: 00098 
etisserant@240: 00099 /* NMT Command Specifier, sent by master to change a slave state */
etisserant@240: 00100 /* ------------------------------------------------------------- */
etisserant@240: 00101 /* Should not be modified */
etisserant@240: 00102 #define NMT_Start_Node              0x01
etisserant@240: 00103 #define NMT_Stop_Node               0x02
etisserant@240: 00104 #define NMT_Enter_PreOperational    0x80
etisserant@240: 00105 #define NMT_Reset_Node              0x81
etisserant@240: 00106 #define NMT_Reset_Comunication      0x82
etisserant@240: 00107 
etisserant@240: 00108 /* constantes used in the different state machines */
etisserant@240: 00109 /* ----------------------------------------------- */
etisserant@240: 00110 /* Must not be modified */
etisserant@240: 00111 #define state1  0x01
etisserant@240: 00112 #define state2  0x02
etisserant@240: 00113 #define state3  0x03
etisserant@240: 00114 #define state4  0x04
etisserant@240: 00115 #define state5  0x05
etisserant@240: 00116 #define state6  0x06
etisserant@240: 00117 #define state7  0x07
etisserant@240: 00118 #define state8  0x08
etisserant@240: 00119 #define state9  0x09
etisserant@240: 00120 #define state10 0x0A
etisserant@240: 00121 #define state11 0x0B
etisserant@240: 00122 
etisserant@240: 00123 #endif /* __def_h__ */
etisserant@240: 00124 
etisserant@240: 

Generated on Mon Jul 2 19:10:16 2007 for CanFestival by  nico@215: nico@215: doxygen 1.5.1
nico@215: nico@215: