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