2 This file is part of CanFestival, a library implementing CanOpen Stack.
4 Copyright (C): Edouard TISSERANT and Francis DUPIN
6 See COPYING file for copyrights details.
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef __objdictdef_h__
24 #define __objdictdef_h__
26 /************************* CONSTANTES **********************************/
27 /** this are static defined datatypes taken fCODE the canopen standard. They
28 * are located at index 0x0001 to 0x001B. As described in the standard, they
29 * are in the object dictionary for definition purpose only. a device does not
30 * to support all of this datatypes.
40 #define visible_string 0x09
41 #define octet_string 0x0A
42 #define unicode_string 0x0B
43 #define time_of_day 0x0C
44 #define time_difference 0x0D
60 #define pdo_communication_parameter 0x20
61 #define pdo_mapping 0x21
62 #define sdo_parameter 0x22
65 /* CanFestival is using 0x24 to 0xFF to define some types containing a
66 value range (See how it works in objdict.c)
70 /** Each entry of the object dictionary can be READONLY (RO), READ/WRITE (RW),
77 #define TO_BE_SAVE 0x04
79 /************************ STRUCTURES ****************************/
80 /** This are some structs which are neccessary for creating the entries
81 * of the object dictionary.
83 typedef struct td_subindex
86 UNS8 bDataType; /* Defines of what datatype the entry is */
87 UNS8 size; /* The size (in Byte) of the variable */
88 void* pObject; /* This is the pointer of the Variable */
91 /** Struct for creating entries in the communictaion profile
93 typedef struct td_indextable
95 subindex* pSubindex; /* Pointer to the subindex */
96 UNS8 bSubCount; /* the count of valid entries for this subindex
97 * This count here defines how many memory has been
98 * allocated. this memory does not have to be used.
103 typedef struct s_quick_index{
113 /*typedef struct struct_CO_Data CO_Data; */
114 typedef UNS32 (*ODCallback_t)(CO_Data* d, const indextable *, UNS8 bSubindex);
115 typedef const indextable * (*scanIndexOD_t)(UNS16 wIndex, UNS32 * errorCode, ODCallback_t **Callback);
117 /************************** MACROS *********************************/
119 /* CANopen usefull helpers */
120 #define GET_NODE_ID(m) (m.cob_id.w & 0x7f)
121 #define GET_FUNCTION_CODE(m) (m.cob_id.w >> 7)
123 #endif /* __objdictdef_h__ */