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
42  char *name;
43 #endif
45  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
64  char *name;
65 #endif
66 #if !LELY_NO_CO_OBJ_LIMITS
68  union co_val min;
70  union co_val max;
71 #endif
72 #if !LELY_NO_CO_OBJ_DEFAULT
74  union co_val def;
75 #endif
77  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_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_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
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:157
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
This header file is part of the utilities library; it contains the red-black tree declarations.
A CANopen device.
Definition: dev.h:30
A CANopen object.
Definition: obj.h:31
co_unsigned16_t idx
The object index.
Definition: obj.h:37
co_unsigned8_t code
The object code.
Definition: obj.h:39
size_t size
The size (in bytes) of the value at val.
Definition: obj.h:49
struct rbtree tree
The tree containing all the sub-objects.
Definition: obj.h:45
struct rbnode node
The node of this object in the tree of objects.
Definition: obj.h:33
co_dev_t * dev
A pointer to the CANopen device containing this object.
Definition: obj.h:35
char * name
A pointer to the name of the object.
Definition: obj.h:42
void * val
A pointer to the object value.
Definition: obj.h:47
A CANopen sub-object.
Definition: obj.h:53
uint_least32_t pdo_mapping
A flag indicating if it is possible to map this object into a PDO.
Definition: obj.h:81
co_sub_dn_ind_t * dn_ind
A pointer to the download indication function.
Definition: obj.h:85
co_unsigned8_t subidx
The object sub-index.
Definition: obj.h:59
struct rbnode node
The node of this sub-object in the tree of sub-objects.
Definition: obj.h:55
co_obj_t * obj
A pointer to the CANopen object containing this sub-object.
Definition: obj.h:57
union co_val def
The default value.
Definition: obj.h:74
union co_val min
The lower limit of the object value.
Definition: obj.h:68
co_sub_up_ind_t * up_ind
A pointer to the upload indication function.
Definition: obj.h:90
union co_val max
The upper limit of the object value.
Definition: obj.h:70
uint_least32_t access
The access type.
Definition: obj.h:79
char * name
A pointer to the name of the sub-object.
Definition: obj.h:64
co_unsigned16_t type
The data type.
Definition: obj.h:61
void * val
A pointer to the sub-object value.
Definition: obj.h:77
void * dn_data
A pointer to user-specified data for dn_ind.
Definition: obj.h:87
void * up_data
A pointer to user-specified data for up_ind.
Definition: obj.h:92
uint_least32_t flags
The object flags.
Definition: obj.h:83
A CANopen SDO upload/download request.
Definition: sdo.h:181
A node in a red-black tree.
Definition: rbtree.h:53
A red-black tree.
Definition: rbtree.h:91
A union of the CANopen static data types.
Definition: val.h:273
This header file is part of the CANopen library; it contains the CANopen value declarations.