00001 /* 00002 This file is part of CanFestival, a library implementing CanOpen Stack. 00003 00004 Copyright (C): Edouard TISSERANT and Francis DUPIN 00005 00006 See COPYING file for copyrights details. 00007 00008 This library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Lesser General Public 00010 License as published by the Free Software Foundation; either 00011 version 2.1 of the License, or (at your option) any later version. 00012 00013 This library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public 00019 License along with this library; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 */ 00022 00023 #ifndef __objdictdef_h__ 00024 #define __objdictdef_h__ 00025 00026 /************************* CONSTANTES **********************************/ 00032 #define boolean 0x01 00033 #define int8 0x02 00034 #define int16 0x03 00035 #define int32 0x04 00036 #define uint8 0x05 00037 #define uint16 0x06 00038 #define uint32 0x07 00039 #define real32 0x08 00040 #define visible_string 0x09 00041 #define octet_string 0x0A 00042 #define unicode_string 0x0B 00043 #define time_of_day 0x0C 00044 #define time_difference 0x0D 00045 00046 #define domain 0x0F 00047 #define int24 0x10 00048 #define real64 0x11 00049 #define int40 0x12 00050 #define int48 0x13 00051 #define int56 0x14 00052 #define int64 0x15 00053 #define uint24 0x16 00054 00055 #define uint40 0x18 00056 #define uint48 0x19 00057 #define uint56 0x1A 00058 #define uint64 0x1B 00059 00060 #define pdo_communication_parameter 0x20 00061 #define pdo_mapping 0x21 00062 #define sdo_parameter 0x22 00063 #define identity 0x23 00064 00065 /* CanFestival is using 0x24 to 0xFF to define some types containing a 00066 value range (See how it works in objdict.c) 00067 */ 00068 00069 00073 #define RW 0x00 00074 #define WO 0x01 00075 #define RO 0x02 00076 00077 #define TO_BE_SAVE 0x04 00078 00079 /************************ STRUCTURES ****************************/ 00083 typedef struct td_subindex 00084 { 00085 UNS8 bAccessType; 00086 UNS8 bDataType; /* Defines of what datatype the entry is */ 00087 UNS8 size; /* The size (in Byte) of the variable */ 00088 void* pObject; /* This is the pointer of the Variable */ 00089 } subindex; 00090 00093 typedef struct td_indextable 00094 { 00095 subindex* pSubindex; /* Pointer to the subindex */ 00096 UNS8 bSubCount; /* the count of valid entries for this subindex 00097 * This count here defines how many memory has been 00098 * allocated. this memory does not have to be used. 00099 */ 00100 UNS16 index; 00101 } indextable; 00102 00103 typedef struct s_quick_index{ 00104 UNS16 SDO_SVR; 00105 UNS16 SDO_CLT; 00106 UNS16 PDO_RCV; 00107 UNS16 PDO_RCV_MAP; 00108 UNS16 PDO_TRS; 00109 UNS16 PDO_TRS_MAP; 00110 }quick_index; 00111 00112 00113 /*typedef struct struct_CO_Data CO_Data; */ 00114 typedef UNS32 (*ODCallback_t)(CO_Data* d, const indextable *, UNS8 bSubindex); 00115 typedef const indextable * (*scanIndexOD_t)(UNS16 wIndex, UNS32 * errorCode, ODCallback_t **Callback); 00116 00117 /************************** MACROS *********************************/ 00118 00119 /* CANopen usefull helpers */ 00120 #define GET_NODE_ID(m) (m.cob_id.w & 0x7f) 00121 #define GET_FUNCTION_CODE(m) (m.cob_id.w >> 7) 00122 00123 #endif /* __objdictdef_h__ */