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
42  char *name;
44 #endif
45  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
64  char *name;
66 #endif
67 #ifndef LELY_NO_CO_OBJ_LIMITS
68  union co_val min;
71  union co_val max;
72 #endif
73 #ifndef LELY_NO_CO_OBJ_DEFAULT
74  union co_val def;
76 #endif
77  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_
__co_sub::obj
co_obj_t * obj
A pointer to the CANopen object containing this sub-object.
Definition: obj.h:58
__co_obj::size
size_t size
The size (in bytes) of the value at val.
Definition: obj.h:50
__co_obj::idx
co_unsigned16_t idx
The object index.
Definition: obj.h:38
rbtree
A red-black tree.
Definition: rbtree.h:90
__co_obj::val
void * val
A pointer to the object value.
Definition: obj.h:48
__co_sub::def
union co_val def
The default value.
Definition: obj.h:75
val.h
__co_obj::code
co_unsigned8_t code
The object code.
Definition: obj.h:40
__co_sub::val
void * val
A pointer to the sub-object value.
Definition: obj.h:78
__co_sub::dn_data
void * dn_data
A pointer to user-specified data for dn_ind.
Definition: obj.h:88
__co_sub::access
unsigned long access
The access type.
Definition: obj.h:80
__co_sub::type
co_unsigned16_t type
The data type.
Definition: obj.h:62
__co_sub::max
union co_val max
The upper limit of the object value.
Definition: obj.h:71
co.h
co_sub_up_ind_t
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_sub::dn_ind
co_sub_dn_ind_t * dn_ind
A pointer to the download indication function.
Definition: obj.h:86
__co_sub::name
char * name
A pointer to the name of the sub-object.
Definition: obj.h:65
__co_sub::min
union co_val min
The lower limit of the object value.
Definition: obj.h:69
__co_sub::up_ind
co_sub_up_ind_t * up_ind
A pointer to the upload indication function.
Definition: obj.h:91
__co_obj::name
char * name
A pointer to the name of the object.
Definition: obj.h:43
__co_sub::pdo_mapping
unsigned long pdo_mapping
A flag indicating if it is possible to map this object into a PDO.
Definition: obj.h:82
__co_obj::dev
co_dev_t * dev
A pointer to the CANopen device containing this object.
Definition: obj.h:36
__co_sub::node
struct rbnode node
The node of this sub-object in the tree of sub-objects.
Definition: obj.h:56
__co_obj::tree
struct rbtree tree
The tree containing all the sub-objects.
Definition: obj.h:46
rbtree.h
co_sub_dn_ind_t
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
rbnode
A node in a red-black tree.
Definition: rbtree.h:52
co_val
A union of the CANopen static data types.
Definition: val.h:163
__co_obj
A CANopen object.
Definition: obj.h:32
__co_dev
A CANopen device.
Definition: dev.c:41
__co_obj::node
struct rbnode node
The node of this object in the tree of objects.
Definition: obj.h:34
__co_sub
A CANopen sub-object.
Definition: obj.h:54
__co_sub::up_data
void * up_data
A pointer to user-specified data for up_ind.
Definition: obj.h:93
obj.h
__co_sub::subidx
co_unsigned8_t subidx
The object sub-index.
Definition: obj.h:60
__co_sub::flags
unsigned long flags
The object flags.
Definition: obj.h:84