Lely core libraries  2.3.4
obj.h
Go to the documentation of this file.
1 
23 #ifndef LELY_CO_DETAIL_OBJ_H_
24 #define LELY_CO_DETAIL_OBJ_H_
25 
26 #include <lely/co/obj.h>
27 #include <lely/co/val.h>
28 #include <lely/util/rbtree.h>
29 
31 struct __co_obj {
33  struct rbnode node;
37  co_unsigned16_t idx;
39  co_unsigned8_t code;
40 #if !LELY_NO_CO_OBJ_NAME
41  char *name;
43 #endif
44  struct rbtree tree;
47  void *val;
49  size_t size;
50 };
51 
53 struct __co_sub {
55  struct rbnode node;
59  co_unsigned8_t subidx;
61  co_unsigned16_t type;
62 #if !LELY_NO_CO_OBJ_NAME
63  char *name;
65 #endif
66 #if !LELY_NO_CO_OBJ_LIMITS
67  union co_val min;
70  union co_val max;
71 #endif
72 #if !LELY_NO_CO_OBJ_DEFAULT
73  union co_val def;
75 #endif
76  void *val;
79  uint_least32_t access : 5;
81  uint_least32_t pdo_mapping : 1;
83  uint_least32_t flags : 26;
87  void *dn_data;
88 #if !LELY_NO_CO_OBJ_UPLOAD
92  void *up_data;
93 #endif
94 };
95 
96 #ifdef __cplusplus
97 extern "C" {
98 #endif
99 
101 co_unsigned32_t co_sub_default_dn_ind(
102  co_sub_t *sub, struct co_sdo_req *req, void *data);
103 
105 co_unsigned32_t co_sub_default_up_ind(
106  const co_sub_t *sub, struct co_sdo_req *req, void *data);
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #endif // !LELY_CO_DETAIL_OBJ_H_
__co_sub::obj
co_obj_t * obj
A pointer to the CANopen object containing this sub-object.
Definition: obj.h:57
__co_obj::size
size_t size
The size (in bytes) of the value at val.
Definition: obj.h:49
__co_obj::idx
co_unsigned16_t idx
The object index.
Definition: obj.h:37
rbtree
A red-black tree.
Definition: rbtree.h:91
__co_obj::val
void * val
A pointer to the object value.
Definition: obj.h:47
__co_sub::def
union co_val def
The default value.
Definition: obj.h:74
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:142
val.h
__co_obj::code
co_unsigned8_t code
The object code.
Definition: obj.h:39
__co_sub::val
void * val
A pointer to the sub-object value.
Definition: obj.h:77
__co_sub::dn_data
void * dn_data
A pointer to user-specified data for dn_ind.
Definition: obj.h:87
__co_sub::type
co_unsigned16_t type
The data type.
Definition: obj.h:61
__co_sub::max
union co_val max
The upper limit of the object value.
Definition: obj.h:70
__co_sub::dn_ind
co_sub_dn_ind_t * dn_ind
A pointer to the download indication function.
Definition: obj.h:85
__co_sub::name
char * name
A pointer to the name of the sub-object.
Definition: obj.h:64
__co_sub::min
union co_val min
The lower limit of the object value.
Definition: obj.h:68
__co_sub::up_ind
co_sub_up_ind_t * up_ind
A pointer to the upload indication function.
Definition: obj.h:90
__co_obj::name
char * name
A pointer to the name of the object.
Definition: obj.h:42
co_sub_default_up_ind
co_unsigned32_t co_sub_default_up_ind(const co_sub_t *sub, struct co_sdo_req *req, void *data)
The default upload indication function.
Definition: obj.c:1096
__co_obj::dev
co_dev_t * dev
A pointer to the CANopen device containing this object.
Definition: obj.h:35
co_sdo_req
A CANopen SDO upload/download request.
Definition: sdo.h:181
__co_sub::node
struct rbnode node
The node of this sub-object in the tree of sub-objects.
Definition: obj.h:55
__co_obj::tree
struct rbtree tree
The tree containing all the sub-objects.
Definition: obj.h:45
rbtree.h
__co_sub::pdo_mapping
uint_least32_t pdo_mapping
A flag indicating if it is possible to map this object into a PDO.
Definition: obj.h:81
rbnode
A node in a red-black tree.
Definition: rbtree.h:53
__co_sub::flags
uint_least32_t flags
The object flags.
Definition: obj.h:83
co_val
A union of the CANopen static data types.
Definition: val.h:273
__co_obj
A CANopen object.
Definition: obj.h:31
__co_sub::access
uint_least32_t access
The access type.
Definition: obj.h:79
__co_dev
A CANopen device.
Definition: dev.h:30
__co_obj::node
struct rbnode node
The node of this object in the tree of objects.
Definition: obj.h:33
co_sub_default_dn_ind
co_unsigned32_t co_sub_default_dn_ind(co_sub_t *sub, struct co_sdo_req *req, void *data)
The default download indication function.
Definition: obj.c:1086
obj.h
__co_sub
A CANopen sub-object.
Definition: obj.h:53
__co_sub::up_data
void * up_data
A pointer to user-specified data for up_ind.
Definition: obj.h:92
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:157
__co_sub::subidx
co_unsigned8_t subidx
The object sub-index.
Definition: obj.h:59