1 /****************************************************************************
3 (c) SYSTEC electronic GmbH, D-07973 Greiz, August-Bebel-Str. 29
4 www.systec-electronic.com
8 Description: defines objdict dictionary
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions
16 1. Redistributions of source code must retain the above copyright
17 notice, this list of conditions and the following disclaimer.
19 2. Redistributions in binary form must reproduce the above copyright
20 notice, this list of conditions and the following disclaimer in the
21 documentation and/or other materials provided with the distribution.
23 3. Neither the name of SYSTEC electronic GmbH nor the names of its
24 contributors may be used to endorse or promote products derived
25 from this software without prior written permission. For written
26 permission, please contact info@systec-electronic.com.
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32 COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 POSSIBILITY OF SUCH DAMAGE.
43 If a provision of this License is or becomes illegal, invalid or
44 unenforceable in any jurisdiction, that shall not affect:
45 1. the validity or enforceability in that jurisdiction of any other
46 provision of this License; or
47 2. the validity or enforceability in other jurisdictions of that or
48 any other provision of this License.
50 -------------------------------------------------------------------------
52 $RCSfile: EplObjDef.h,v $
56 $Revision: 1.4 $ $Date: 2008/04/17 21:36:32 $
63 -------------------------------------------------------------------------
67 2006/06/06 k.t.: take ObjDef.h from CANopen and modify for EPL
69 ****************************************************************************/
74 //---------------------------------------------------------------------------
76 //---------------------------------------------------------------------------
78 //---------------------------------------------------------------------------
79 // macros to help building OD
80 //---------------------------------------------------------------------------
82 //---------------------------------------------------------------------------
83 #if (defined (EPL_OBD_USE_VARIABLE_SUBINDEX_TAB) && (EPL_OBD_USE_VARIABLE_SUBINDEX_TAB != FALSE))
85 #define CCM_SUBINDEX_RAM_ONLY(a) a;
86 #define CCM_SUBINDEX_RAM_ONEOF(a,b) a
90 #define CCM_SUBINDEX_RAM_ONLY(a)
91 #define CCM_SUBINDEX_RAM_ONEOF(a,b) b
95 //---------------------------------------------------------------------------
96 // To prevent unused memory in subindex tables we need this macro.
97 // But not all compilers support to preset the last struct value followed by a comma.
98 // Compilers which does not support a comma after last struct value has to place in a dummy subindex.
99 #if ((DEV_SYSTEM & _DEV_COMMA_EXT_) != 0)
101 #define EPL_OBD_END_SUBINDEX()
102 #define EPL_OBD_MAX_ARRAY_SUBENTRIES 2
106 #define EPL_OBD_END_SUBINDEX() {0,0,0,NULL,NULL}
107 #define EPL_OBD_MAX_ARRAY_SUBENTRIES 3
111 //---------------------------------------------------------------------------
112 //---------------------------------------------------------------------------
114 //---------------------------------------------------------------------------
115 //---------------------------------------------------------------------------
117 // -------------------------------------------------------------------------
118 // creation of data in ROM memory
119 // -------------------------------------------------------------------------
120 #define EPL_OBD_CREATE_ROM_DATA
122 #undef EPL_OBD_CREATE_ROM_DATA
124 // -------------------------------------------------------------------------
125 // creation of data in RAM memory
126 // -------------------------------------------------------------------------
128 #define EPL_OBD_CREATE_RAM_DATA
130 #undef EPL_OBD_CREATE_RAM_DATA
132 // -------------------------------------------------------------------------
133 // creation of subindex tables in ROM and RAM
134 // -------------------------------------------------------------------------
136 #define EPL_OBD_CREATE_SUBINDEX_TAB
138 #undef EPL_OBD_CREATE_SUBINDEX_TAB
140 // -------------------------------------------------------------------------
141 // creation of index tables for generic, manufacturer and device part
142 // -------------------------------------------------------------------------
144 #define EPL_OBD_CREATE_INDEX_TAB
146 #undef EPL_OBD_CREATE_INDEX_TAB
148 //=========================================================================//
150 // P U B L I C F U N C T I O N S //
152 //=========================================================================//
154 // ----------------------------------------------------------------------------
156 // Function: EPL_OBD_INIT_RAM_NAME()
158 // Description: function to initialize object dictionary
160 // Parameters: pInitParam_p = pointer to init param struct of Epl
162 // Returns: tEplKernel = error code
166 // ----------------------------------------------------------------------------
168 EPLDLLEXPORT tEplKernel PUBLIC EPL_OBD_INIT_RAM_NAME(tEplObdInitParam MEM *
172 tEplObdInitParam MEM *pInitParam = pInitParam_p;
174 // check if pointer to parameter structure is valid
175 // if not then only copy subindex tables below
176 if (pInitParam != NULL) {
177 // at first delete all parameters (all pointers will be set zu NULL)
178 EPL_MEMSET(pInitParam, 0, sizeof(tEplObdInitParam));
180 #define EPL_OBD_CREATE_INIT_FUNCTION
182 // inserts code to init pointer to index tables
185 #undef EPL_OBD_CREATE_INIT_FUNCTION
187 #if (defined (EPL_OBD_USER_OD) && (EPL_OBD_USER_OD != FALSE))
189 // to begin no user OD is defined
190 pInitParam_p->m_pUserPart = NULL;
194 #define EPL_OBD_CREATE_INIT_SUBINDEX
196 // inserts code to copy subindex tables
199 #undef EPL_OBD_CREATE_INIT_SUBINDEX
201 return kEplSuccessful;
205 #endif // _EPLOBJDEF_H_
207 // Die letzte Zeile muß unbedingt eine leere Zeile sein, weil manche Compiler
208 // damit ein Problem haben, wenn das nicht so ist (z.B. GNU oder Borland C++ Builder).