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 **********************************/
nico@215: 00032 #define boolean         0x01
nico@215: 00033 #define int8            0x02
nico@215: 00034 #define int16           0x03
nico@215: 00035 #define int32           0x04
nico@215: 00036 #define uint8           0x05
nico@215: 00037 #define uint16          0x06
nico@215: 00038 #define uint32          0x07
nico@215: 00039 #define real32          0x08
nico@215: 00040 #define visible_string  0x09
nico@215: 00041 #define octet_string    0x0A
nico@215: 00042 #define unicode_string  0x0B
nico@215: 00043 #define time_of_day     0x0C
nico@215: 00044 #define time_difference 0x0D
nico@215: 00045 
nico@215: 00046 #define domain          0x0F
nico@215: 00047 #define int24           0x10
nico@215: 00048 #define real64          0x11
nico@215: 00049 #define int40           0x12
nico@215: 00050 #define int48           0x13
nico@215: 00051 #define int56           0x14
nico@215: 00052 #define int64           0x15
nico@215: 00053 #define uint24          0x16
nico@215: 00054 
nico@215: 00055 #define uint40          0x18
nico@215: 00056 #define uint48          0x19
nico@215: 00057 #define uint56          0x1A
nico@215: 00058 #define uint64          0x1B
nico@215: 00059 
nico@215: 00060 #define pdo_communication_parameter 0x20
nico@215: 00061 #define pdo_mapping                 0x21
nico@215: 00062 #define sdo_parameter               0x22
nico@215: 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 
nico@215: 00070 
nico@215: 00075 #define TRANS_EVERY_N_SYNC(n) (n) /*n = 1 to 240 */
nico@215: 00076 #define TRANS_SYNC_MIN        1    /* Trans after reception of n SYNC. n = 1 to 240 */
nico@215: 00077 #define TRANS_SYNC_MAX        240  /* Trans after reception of n SYNC. n = 1 to 240 */
nico@215: 00078 #define TRANS_RTR_SYNC        252  /* Transmission on request */
nico@215: 00079 #define TRANS_RTR             253  /* Transmission on request */
nico@215: 00080 #define TRANS_EVENT           255  /* Transmission on event */
nico@215: 00081 
nico@215: 00085 #define RW     0x00  
nico@215: 00086 #define WO     0x01
nico@215: 00087 #define RO     0x02
nico@215: 00088 
nico@215: 00089 #define TO_BE_SAVE  0x04
nico@215: 00090 
nico@215: 00091 /************************ STRUCTURES ****************************/
nico@215: 00095 typedef struct td_subindex
nico@215: 00096 {
nico@215: 00097     UNS8                    bAccessType;
nico@215: 00098     UNS8                    bDataType; /* Defines of what datatype the entry is */
nico@215: 00099     UNS8                    size;      /* The size (in Byte) of the variable */
nico@215: 00100     void*                   pObject;   /* This is the pointer of the Variable */
nico@215: 00101 } subindex;
nico@215: 00102 
nico@215: 00105 typedef struct td_indextable
nico@215: 00106 {
nico@215: 00107     subindex*   pSubindex;   /* Pointer to the subindex */
nico@215: 00108     UNS8   bSubCount;   /* the count of valid entries for this subindex
nico@215: 00109                          * This count here defines how many memory has been
nico@215: 00110                          * allocated. this memory does not have to be used.
nico@215: 00111                          */
nico@215: 00112     UNS16   index;
nico@215: 00113 } indextable;
nico@215: 00114 
nico@215: 00115 typedef struct s_quick_index{
nico@215: 00116         UNS16 SDO_SVR;
nico@215: 00117         UNS16 SDO_CLT;
nico@215: 00118         UNS16 PDO_RCV;
nico@215: 00119         UNS16 PDO_RCV_MAP;
nico@215: 00120         UNS16 PDO_TRS;
nico@215: 00121         UNS16 PDO_TRS_MAP;
nico@215: 00122 }quick_index;
nico@215: 00123 
nico@215: 00124 
nico@215: 00125 /*typedef struct struct_CO_Data CO_Data; */
nico@215: 00126 typedef UNS32 (*ODCallback_t)(CO_Data* d, const indextable *, UNS8 bSubindex);
nico@215: 00127 typedef const indextable * (*scanIndexOD_t)(UNS16 wIndex, UNS32 * errorCode, ODCallback_t **Callback);
nico@215: 00128 
nico@215: 00129 /************************** MACROS *********************************/
nico@215: 00130 
nico@215: 00131 /* CANopen usefull helpers */
nico@215: 00132 #define GET_NODE_ID(m)         (m.cob_id.w & 0x7f)
nico@215: 00133 #define GET_FUNCTION_CODE(m)     (m.cob_id.w >> 7)
nico@215: 00134 
nico@215: 00135 #endif /* __objdictdef_h__ */
nico@215: 

Generated on Fri Jun 8 08:51:39 2007 for CanFestival by  nico@215: nico@215: doxygen 1.5.1
nico@215: nico@215: