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

objdictdef.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 #ifndef __objdictdef_h__
nico@215: 00024 #define __objdictdef_h__
nico@215: 00025 
nico@215: 00026 /************************* CONSTANTES **********************************/
etisserant@240: 00032 #define boolean         0x01
etisserant@240: 00033 #define int8            0x02
etisserant@240: 00034 #define int16           0x03
etisserant@240: 00035 #define int32           0x04
etisserant@240: 00036 #define uint8           0x05
etisserant@240: 00037 #define uint16          0x06
etisserant@240: 00038 #define uint32          0x07
etisserant@240: 00039 #define real32          0x08
etisserant@240: 00040 #define visible_string  0x09
etisserant@240: 00041 #define octet_string    0x0A
etisserant@240: 00042 #define unicode_string  0x0B
etisserant@240: 00043 #define time_of_day     0x0C
etisserant@240: 00044 #define time_difference 0x0D
nico@215: 00045 
etisserant@240: 00046 #define domain          0x0F
etisserant@240: 00047 #define int24           0x10
etisserant@240: 00048 #define real64          0x11
etisserant@240: 00049 #define int40           0x12
etisserant@240: 00050 #define int48           0x13
etisserant@240: 00051 #define int56           0x14
etisserant@240: 00052 #define int64           0x15
etisserant@240: 00053 #define uint24          0x16
nico@215: 00054 
etisserant@240: 00055 #define uint40          0x18
etisserant@240: 00056 #define uint48          0x19
etisserant@240: 00057 #define uint56          0x1A
etisserant@240: 00058 #define uint64          0x1B
nico@215: 00059 
etisserant@240: 00060 #define pdo_communication_parameter 0x20
etisserant@240: 00061 #define pdo_mapping                 0x21
etisserant@240: 00062 #define sdo_parameter               0x22
etisserant@240: 00063 #define identity                    0x23
nico@215: 00064 
nico@215: 00065 /* CanFestival is using 0x24 to 0xFF to define some types containing a 
nico@215: 00066  value range (See how it works in objdict.c)
nico@215: 00067  */
nico@215: 00068 
nico@215: 00069 
etisserant@240: 00073 #define RW     0x00  
etisserant@240: 00074 #define WO     0x01
etisserant@240: 00075 #define RO     0x02
etisserant@240: 00076 
etisserant@240: 00077 #define TO_BE_SAVE  0x04
etisserant@240: 00078 
etisserant@240: 00079 /************************ STRUCTURES ****************************/
etisserant@240: 00083 typedef struct td_subindex
etisserant@240: 00084 {
etisserant@240: 00085     UNS8                    bAccessType;
etisserant@240: 00086     UNS8                    bDataType; /* Defines of what datatype the entry is */
etisserant@240: 00087     UNS8                    size;      /* The size (in Byte) of the variable */
etisserant@240: 00088     void*                   pObject;   /* This is the pointer of the Variable */
etisserant@240: 00089 } subindex;
etisserant@240: 00090 
etisserant@240: 00093 typedef struct td_indextable
etisserant@240: 00094 {
etisserant@240: 00095     subindex*   pSubindex;   /* Pointer to the subindex */
etisserant@240: 00096     UNS8   bSubCount;   /* the count of valid entries for this subindex
etisserant@240: 00097                          * This count here defines how many memory has been
etisserant@240: 00098                          * allocated. this memory does not have to be used.
etisserant@240: 00099                          */
etisserant@240: 00100     UNS16   index;
etisserant@240: 00101 } indextable;
nico@215: 00102 
etisserant@240: 00103 typedef struct s_quick_index{
etisserant@240: 00104         UNS16 SDO_SVR;
etisserant@240: 00105         UNS16 SDO_CLT;
etisserant@240: 00106         UNS16 PDO_RCV;
etisserant@240: 00107         UNS16 PDO_RCV_MAP;
etisserant@240: 00108         UNS16 PDO_TRS;
etisserant@240: 00109         UNS16 PDO_TRS_MAP;
etisserant@240: 00110 }quick_index;
etisserant@240: 00111 
etisserant@240: 00112 
etisserant@240: 00113 /*typedef struct struct_CO_Data CO_Data; */
etisserant@240: 00114 typedef UNS32 (*ODCallback_t)(CO_Data* d, const indextable *, UNS8 bSubindex);
etisserant@240: 00115 typedef const indextable * (*scanIndexOD_t)(UNS16 wIndex, UNS32 * errorCode, ODCallback_t **Callback);
etisserant@240: 00116 
etisserant@240: 00117 /************************** MACROS *********************************/
etisserant@240: 00118 
etisserant@240: 00119 /* CANopen usefull helpers */
etisserant@240: 00120 #define GET_NODE_ID(m)         (m.cob_id.w & 0x7f)
etisserant@240: 00121 #define GET_FUNCTION_CODE(m)     (m.cob_id.w >> 7)
etisserant@240: 00122 
etisserant@240: 00123 #endif /* __objdictdef_h__ */
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: