Lely core libraries  2.2.5
obj.h
Go to the documentation of this file.
1 
23 #ifndef LELY_CO_INTERN_OBJ_H_
24 #define LELY_CO_INTERN_OBJ_H_
25 
26 #include "co.h"
27 #include <lely/co/obj.h>
28 #include <lely/co/val.h>
29 #include <lely/util/rbtree.h>
30 
32 struct __co_obj {
34  struct rbnode node;
38  co_unsigned16_t idx;
40  co_unsigned8_t code;
41 #ifndef LELY_NO_CO_OBJ_NAME
43  char *name;
44 #endif
46  struct rbtree tree;
48  void *val;
50  size_t size;
51 };
52 
54 struct __co_sub {
56  struct rbnode node;
60  co_unsigned8_t subidx;
62  co_unsigned16_t type;
63 #ifndef LELY_NO_CO_OBJ_NAME
65  char *name;
66 #endif
67 #ifndef LELY_NO_CO_OBJ_LIMITS
69  union co_val min;
71  union co_val max;
72 #endif
73 #ifndef LELY_NO_CO_OBJ_DEFAULT
75  union co_val def;
76 #endif
78  void *val;
80  unsigned long access : 5;
82  unsigned long pdo_mapping : 1;
84  unsigned long flags : 26;
88  void *dn_data;
89 #ifndef LELY_NO_CO_OBJ_UPLOAD
93  void *up_data;
94 #endif
95 };
96 
97 #endif // !LELY_CO_INTERN_OBJ_H_
This header file is part of the CANopen library; it contains the object dictionary declarations.
co_unsigned32_t co_sub_up_ind_t(const co_sub_t *sub, struct co_sdo_req *req, void *data)
The type of a CANopen sub-object upload indication function, invoked by an SDO upload request or Tran...
Definition: obj.h:151
co_unsigned32_t co_sub_dn_ind_t(co_sub_t *sub, struct co_sdo_req *req, void *data)
The type of a CANopen sub-object download indication function, invoked by an SDO download request or ...
Definition: obj.h:136
This header file is part of the utilities library; it contains the red-black tree declarations.
This is the internal header file of the CANopen library.
A CANopen device.
Definition: dev.c:41
A CANopen object.
Definition: obj.h:32
co_unsigned16_t idx
The object index.
Definition: obj.h:38
co_unsigned8_t code
The object code.
Definition: obj.h:40
size_t size
The size (in bytes) of the value at val.
Definition: obj.h:50
struct rbtree tree
The tree containing all the sub-objects.
Definition: obj.h:46
struct rbnode node
The node of this object in the tree of objects.
Definition: obj.h:34
co_dev_t * dev
A pointer to the CANopen device containing this object.
Definition: obj.h:36
char * name
A pointer to the name of the object.
Definition: obj.h:43
void * val
A pointer to the object value.
Definition: obj.h:48
A CANopen sub-object.
Definition: obj.h:54
unsigned long flags
The object flags.
Definition: obj.h:84
co_sub_dn_ind_t * dn_ind
A pointer to the download indication function.
Definition: obj.h:86
co_unsigned8_t subidx
The object sub-index.
Definition: obj.h:60
struct rbnode node
The node of this sub-object in the tree of sub-objects.
Definition: obj.h:56
co_obj_t * obj
A pointer to the CANopen object containing this sub-object.
Definition: obj.h:58
union co_val def
The default value.
Definition: obj.h:75
unsigned long access
The access type.
Definition: obj.h:80
union co_val min
The lower limit of the object value.
Definition: obj.h:69
co_sub_up_ind_t * up_ind
A pointer to the upload indication function.
Definition: obj.h:91
union co_val max
The upper limit of the object value.
Definition: obj.h:71
char * name
A pointer to the name of the sub-object.
Definition: obj.h:65
co_unsigned16_t type
The data type.
Definition: obj.h:62
void * val
A pointer to the sub-object value.
Definition: obj.h:78
void * dn_data
A pointer to user-specified data for dn_ind.
Definition: obj.h:88
void * up_data
A pointer to user-specified data for up_ind.
Definition: obj.h:93
unsigned long pdo_mapping
A flag indicating if it is possible to map this object into a PDO.
Definition: obj.h:82
A node in a red-black tree.
Definition: rbtree.h:52
A red-black tree.
Definition: rbtree.h:90
A union of the CANopen static data types.
Definition: val.h:163
This header file is part of the CANopen library; it contains the CANopen value declarations.