NNP STM Generic Remote Module git-main
Loading...
Searching...
No Matches
objdictdef.h
Go to the documentation of this file.
1
8#ifndef INC_OBJDICTDEF_H_
9#define INC_OBJDICTDEF_H_
10
11#include "applicfg.h"
12
13/************************* CONSTANTES **********************************/
19#define boolean 0x01
20#define int8 0x02
21#define int16 0x03
22#define int32 0x04
23#define uint8 0x05
24#define uint16 0x06
25#define uint32 0x07
26#define real32 0x08
27#define visible_string 0x09
28#define octet_string 0x0A
29#define unicode_string 0x0B
30#define time_of_day 0x0C
31#define time_difference 0x0D
32
33#define domain 0x0F
34#define int24 0x10
35#define real64 0x11
36#define int40 0x12
37#define int48 0x13
38#define int56 0x14
39#define int64 0x15
40#define uint24 0x16
41
42#define uint40 0x18
43#define uint48 0x19
44#define uint56 0x1A
45#define uint64 0x1B
46
47#define pdo_communication_parameter 0x20
48#define pdo_mapping 0x21
49#define sdo_parameter 0x22
50#define identity 0x23
51
52/* CanFestival is using 0x24 to 0xFF to define some types containing a
53 value range (See how it works in objdict.c)
54 */
55
56
60#define RW 0x00
61#define WO 0x01
62#define RO 0x02
63
64#define TO_BE_SAVE 0x04
65#define DCF_TO_SEND 0x08
66
67/************************ STRUCTURES ****************************/
71typedef struct td_subindex
72{
73 UNS8 bAccessType;
74 UNS8 bDataType; /* Defines of what datatype the entry is */
75 UNS16 size; /* The size (in Byte) of the variable */
76 void* pObject; /* This is the pointer of the Variable */
78
81typedef struct td_indextable
82{
83 subindex* pSubindex; /* Pointer to the subindex */
84 UNS8 bSubCount; /* the count of valid entries for this subindex
85 * This count here defines how many memory has been
86 * allocated. this memory does not have to be used.
87 */
88 UNS16 index;
90
91typedef struct s_quick_index{
92 UNS16 SDO_SVR;
93 UNS16 SDO_CLT;
94 UNS16 PDO_RCV;
95 UNS16 PDO_RCV_MAP;
96 UNS16 PDO_TRS;
97 UNS16 PDO_TRS_MAP;
99
100
101/*typedef struct struct_CO_Data CO_Data; */
102typedef UNS32 (*ODCallback_t)(CO_Data* d, const indextable *, UNS8 bSubindex);
103typedef const indextable * (*scanIndexOD_t)(UNS16 wIndex, UNS32 * errorCode, ODCallback_t **Callback);
104
105/************************** MACROS *********************************/
106
107/* CANopen usefull helpers */
108#define GET_NODE_ID(m) (UNS16_LE(m.cob_id) & 0x7f)
109#define GET_FUNCTION_CODE(m) (UNS16_LE(m.cob_id) >> 7)
110
111#endif /* INC_OBJDICTDEF_H_ */
#define UNS8
Unsigned int8 representation in CANFest.
Definition applicfg.h:25
#define UNS16
Unsigned int16 representation in CANFest.
Definition applicfg.h:26
#define UNS32
Unsigned int32 representation in CANFest.
Definition applicfg.h:27
struct td_indextable indextable
struct td_subindex subindex
This structure contains all necessary informations to define a CANOpen node.
Definition data.h:44