author | greg |
Mon, 02 Mar 2009 09:30:08 +0100 | |
changeset 531 | f912f8d26e98 |
parent 529 | c171e11707c5 |
child 539 | 187058b4a4b8 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
This file is part of CanFestival, a library implementing CanOpen Stack. |
|
3 |
||
4 |
Copyright (C): Edouard TISSERANT and Francis DUPIN |
|
5 |
||
6 |
See COPYING file for copyrights details. |
|
7 |
||
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. |
|
12 |
||
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. |
|
17 |
||
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 |
|
21 |
*/ |
|
22 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
23 |
/** @file |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
24 |
* @brief Responsible for accessing the object dictionary. |
0 | 25 |
* |
26 |
* This file contains functions for accessing the object dictionary and |
|
27 |
* variables that are contained by the object dictionary. |
|
28 |
* Accessing the object dictionary contains setting local variables |
|
29 |
* as PDOs and accessing (read/write) all entries of the object dictionary |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
30 |
* @warning Only the basic entries of an object dictionary are included |
0 | 31 |
* at the moment. |
32 |
*/ |
|
33 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
34 |
/** @defgroup od Object Dictionary Management |
529
c171e11707c5
Second time, Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
528
diff
changeset
|
35 |
* @brief The Object Dictionary is the heart of each CANopen device containing all communication and application objects. |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
36 |
* @ingroup userapi |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
37 |
*/ |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
38 |
|
0 | 39 |
#ifndef __objacces_h__ |
40 |
#define __objacces_h__ |
|
41 |
||
42 |
#include <applicfg.h> |
|
43 |
||
44 |
typedef UNS32 (*valueRangeTest_t)(UNS8 typeValue, void *Value); |
|
378
d2abf6c8c27b
As requested long ago, added CoData* parameter to all this applications callback, let application designer use identical callback for multiple nodes, and reduce source code length.
etisserant
parents:
175
diff
changeset
|
45 |
typedef void (* storeODSubIndex_t)(CO_Data* d, UNS16 wIndex, UNS8 bSubindex); |
d2abf6c8c27b
As requested long ago, added CoData* parameter to all this applications callback, let application designer use identical callback for multiple nodes, and reduce source code length.
etisserant
parents:
175
diff
changeset
|
46 |
void _storeODSubIndex (CO_Data* d, UNS16 wIndex, UNS8 bSubindex); |
0 | 47 |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
48 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
49 |
* @ingroup od |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
50 |
* @brief Print MSG_WAR (s) if error to the access to the object dictionary occurs. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
51 |
* |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
52 |
* You must uncomment the lines in the file objaccess.c :\n |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
53 |
* //#define DEBUG_CAN\n |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
54 |
* //#define DEBUG_WAR_CONSOLE_ON\n |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
55 |
* //#define DEBUG_ERR_CONSOLE_ON\n\n |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
56 |
* Beware that sometimes, we force the sizeDataDict or sizeDataGiven to 0, when we wants to use |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
57 |
* this function but we do not have the access to the right value. One example is |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
58 |
* getSDOerror(). So do not take attention to these variables if they are null. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
59 |
* @param index |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
60 |
* @param subIndex |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
61 |
* @param sizeDataDict Size of the data defined in the dictionary |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
62 |
* @param sizeDataGiven Size data given by the user. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
63 |
* @param code error code to print. (SDO abort code. See file def.h) |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
64 |
* @return |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
65 |
*/ |
0 | 66 |
UNS8 accessDictionaryError(UNS16 index, UNS8 subIndex, |
67 |
UNS8 sizeDataDict, UNS8 sizeDataGiven, UNS32 code); |
|
75
debc68b124b7
compiler compatibility : accessDictionaryError contains nothing out of debogue mode
frdupin
parents:
71
diff
changeset
|
68 |
|
0 | 69 |
|
469
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
70 |
/* _getODentry() Reads an entry from the object dictionary.\n |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
71 |
* |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
72 |
* use getODentry() macro to read from object and endianize |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
73 |
* use readLocalDict() macro to read from object and not endianize |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
74 |
* |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
75 |
* @code |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
76 |
* // Example usage: |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
77 |
* UNS8 *pbData; |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
78 |
* UNS8 length; |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
79 |
* UNS32 returnValue; |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
80 |
* |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
81 |
* returnValue = getODentry( (UNS16)0x100B, (UNS8)1, |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
82 |
* (void * *)&pbData, (UNS8 *)&length ); |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
83 |
* if( returnValue != SUCCESSFUL ) |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
84 |
* { |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
85 |
* // error handling |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
86 |
* } |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
87 |
* @endcode |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
88 |
* @param *d Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
89 |
* @param wIndex The index in the object dictionary where you want to read |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
90 |
* an entry |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
91 |
* @param bSubindex The subindex of the Index. e.g. mostly subindex 0 is |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
92 |
* used to tell you how many valid entries you can find |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
93 |
* in this index. Look at the canopen standard for further |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
94 |
* information |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
95 |
* @param *pDestData Pointer to the pointer which points to the variable where |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
96 |
* the value of this object dictionary entry should be copied |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
97 |
* @param pExpectedSize This function writes the size of the copied value (in Byte) |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
98 |
* into this variable. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
99 |
* @param *pDataType Pointer on the type of the data. See objdictdef.h |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
100 |
* @param CheckAccess if other than 0, do not read if the data is Write Only |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
101 |
* [Not used today. Put always 0]. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
102 |
* @param Endianize When not 0, data is endianized into network byte order |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
103 |
* when 0, data is not endianized and copied in machine native |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
104 |
* endianness |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
105 |
* @return OD_SUCCESSFUL or SDO abort code. (See file def.h) |
0 | 106 |
*/ |
469
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
107 |
UNS32 _getODentry( CO_Data* d, |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
108 |
UNS16 wIndex, |
0 | 109 |
UNS8 bSubindex, |
110 |
void * pDestData, |
|
111 |
UNS8 * pExpectedSize, |
|
112 |
UNS8 * pDataType, |
|
469
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
113 |
UNS8 checkAccess, |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
114 |
UNS8 endianize); |
0 | 115 |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
116 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
117 |
* @ingroup od |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
118 |
* @brief getODentry() to read from object and endianize |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
119 |
* @param OD Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
120 |
* @param wIndex The index in the object dictionary where you want to read |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
121 |
* an entry |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
122 |
* @param bSubindex The subindex of the Index. e.g. mostly subindex 0 is |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
123 |
* used to tell you how many valid entries you can find |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
124 |
* in this index. Look at the canopen standard for further |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
125 |
* information |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
126 |
* @param *pDestData Pointer to the pointer which points to the variable where |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
127 |
* the value of this object dictionary entry should be copied |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
128 |
* @param pExpectedSize This function writes the size of the copied value (in Byte) |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
129 |
* into this variable. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
130 |
* @param *pDataType Pointer on the type of the data. See objdictdef.h |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
131 |
* @param checkAccess if other than 0, do not read if the data is Write Only |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
132 |
* [Not used today. Put always 0]. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
133 |
* @param endianize Set to 1 : endianized into network byte order |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
134 |
* @return OD_SUCCESSFUL or SDO abort code. (See file def.h) |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
135 |
*/ |
469
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
136 |
#define getODentry( OD, wIndex, bSubindex, pDestData, pExpectedSize, \ |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
137 |
pDataType, checkAccess) \ |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
138 |
_getODentry( OD, wIndex, bSubindex, pDestData, pExpectedSize, \ |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
139 |
pDataType, checkAccess, 1) |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
140 |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
141 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
142 |
* @ingroup od |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
143 |
* @brief readLocalDict() reads an entry from the object dictionary, but in |
469
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
144 |
* contrast to getODentry(), readLocalDict() doesn't endianize entry and reads |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
145 |
* entry in machine native endianness. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
146 |
* @param OD Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
147 |
* @param wIndex The index in the object dictionary where you want to read |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
148 |
* an entry |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
149 |
* @param bSubindex The subindex of the Index. e.g. mostly subindex 0 is |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
150 |
* used to tell you how many valid entries you can find |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
151 |
* in this index. Look at the canopen standard for further |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
152 |
* information |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
153 |
* @param *pDestData Pointer to the pointer which points to the variable where |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
154 |
* the value of this object dictionary entry should be copied |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
155 |
* @param pExpectedSize This function writes the size of the copied value (in Byte) |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
156 |
* into this variable. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
157 |
* @param *pDataType Pointer on the type of the data. See objdictdef.h |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
158 |
* @param checkAccess if other than 0, do not read if the data is Write Only |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
159 |
* [Not used today. Put always 0]. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
160 |
* @param endianize Set to 0, data is not endianized and copied in machine native |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
161 |
* endianness |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
162 |
* @return OD_SUCCESSFUL or SDO abort code. (See file def.h) |
469
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
163 |
*/ |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
164 |
#define readLocalDict( OD, wIndex, bSubindex, pDestData, pExpectedSize, \ |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
165 |
pDataType, checkAccess) \ |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
166 |
_getODentry( OD, wIndex, bSubindex, pDestData, pExpectedSize, \ |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
167 |
pDataType, checkAccess, 0) |
0 | 168 |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
169 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
170 |
* @brief By this function you can write an entry into the object dictionary |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
171 |
* @param *d Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
172 |
* @param wIndex The index in the object dictionary where you want to write |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
173 |
* an entry |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
174 |
* @param bSubindex The subindex of the Index. e.g. mostly subindex 0 is |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
175 |
* used to tell you how many valid entries you can find |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
176 |
* in this index. Look at the canopen standard for further |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
177 |
* information |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
178 |
* @param *pSourceData Pointer to the variable that holds the value that should |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
179 |
* be copied into the object dictionary |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
180 |
* @param *pExpectedSize The size of the value (in Byte). |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
181 |
* @param checkAccess if other than 0, do not read if the data is Read Only or Constant |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
182 |
* @param endianize When not 0, data is endianized into network byte order |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
183 |
* when 0, data is not endianized and copied in machine native |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
184 |
* endianness |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
185 |
* @return OD_SUCCESSFUL or SDO abort code. (See file def.h) |
0 | 186 |
*/ |
469
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
187 |
UNS32 _setODentry( CO_Data* d, |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
188 |
UNS16 wIndex, |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
189 |
UNS8 bSubindex, |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
190 |
void * pSourceData, |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
191 |
UNS8 * pExpectedSize, |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
192 |
UNS8 checkAccess, |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
193 |
UNS8 endianize); |
0 | 194 |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
195 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
196 |
* @ingroup od |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
197 |
* @brief setODentry converts SourceData from network byte order to machine native |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
198 |
* format, and writes that to OD. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
199 |
* @code |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
200 |
* // Example usage: |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
201 |
* UNS8 B; |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
202 |
* B = 0xFF; // set transmission type |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
203 |
* |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
204 |
* retcode = setODentry( (UNS16)0x1800, (UNS8)2, &B, sizeof(UNS8), 1 ); |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
205 |
* @endcode |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
206 |
* @param d Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
207 |
* @param wIndex The index in the object dictionary where you want to write |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
208 |
* an entry |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
209 |
* @param bSubindex The subindex of the Index. e.g. mostly subindex 0 is |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
210 |
* used to tell you how many valid entries you can find |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
211 |
* in this index. Look at the canopen standard for further |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
212 |
* information |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
213 |
* @param *pSourceData Pointer to the variable that holds the value that should |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
214 |
* be copied into the object dictionary |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
215 |
* @param *pExpectedSize The size of the value (in Byte). |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
216 |
* @param checkAccess if other than 0, do not read if the data is Read Only or Constant |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
217 |
* @param endianize Set to 1 : endianized into network byte order |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
218 |
* @return OD_SUCCESSFUL or SDO abort code. (See file def.h) |
469
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
219 |
*/ |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
220 |
#define setODentry( d, wIndex, bSubindex, pSourceData, pExpectedSize, checkAccess) \ |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
221 |
_setODentry( d, wIndex, bSubindex, pSourceData, pExpectedSize, checkAccess, 1) |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
222 |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
223 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
224 |
* @ingroup od |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
225 |
* @brief Writes machine native SourceData to OD. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
226 |
* @code |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
227 |
* // Example usage: |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
228 |
* UNS8 B; |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
229 |
* B = 0xFF; // set transmission type |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
230 |
* |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
231 |
* retcode = writeLocalDict( (UNS16)0x1800, (UNS8)2, &B, sizeof(UNS8), 1 ); |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
232 |
* @endcode |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
233 |
* @param d Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
234 |
* @param wIndex The index in the object dictionary where you want to write |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
235 |
* an entry |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
236 |
* @param bSubindex The subindex of the Index. e.g. mostly subindex 0 is |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
237 |
* used to tell you how many valid entries you can find |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
238 |
* in this index. Look at the canopen standard for further |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
239 |
* information |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
240 |
* @param *pSourceData Pointer to the variable that holds the value that should |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
241 |
* be copied into the object dictionary |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
242 |
* @param *pExpectedSize The size of the value (in Byte). |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
243 |
* @param checkAccess if other than 0, do not read if the data is Read Only or Constant |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
244 |
* @param endianize Data is not endianized and copied in machine native endianness |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
245 |
* @return OD_SUCCESSFUL or SDO abort code. (See file def.h) |
469
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
246 |
*/ |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
247 |
#define writeLocalDict( d, wIndex, bSubindex, pSourceData, pExpectedSize, checkAccess) \ |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
248 |
_setODentry( d, wIndex, bSubindex, pSourceData, pExpectedSize, checkAccess, 0) |
f2b07ea215b5
Applied edward's patch for OD acces macros (optimization) and boudaries check (safety).
etisserant
parents:
378
diff
changeset
|
249 |
|
175
e255529b6f7d
Added writeLocalDict and readLocalDict, that have to be called from application instead of getODEntry and setODEntry. Fix potential endianization problem.
etisserant
parents:
161
diff
changeset
|
250 |
|
0 | 251 |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
252 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
253 |
* @brief Scan the index of object dictionary. Used only by setODentry and getODentry. |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
254 |
* @param *d Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
255 |
* @param wIndex |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
256 |
* @param *errorCode : OD_SUCCESSFUL if index foundor SDO abort code. (See file def.h) |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
257 |
* @param **Callback |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
469
diff
changeset
|
258 |
* @return NULL if index not found. Else : return the table part of the object dictionary. |
0 | 259 |
*/ |
260 |
const indextable * scanIndexOD (CO_Data* d, UNS16 wIndex, UNS32 *errorCode, ODCallback_t **Callback); |
|
261 |
||
262 |
UNS32 RegisterSetODentryCallBack(CO_Data* d, UNS16 wIndex, UNS8 bSubindex, ODCallback_t Callback); |
|
263 |
||
71 | 264 |
#endif /* __objacces_h__ */ |