Lely core libraries  1.9.2
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  union co_val def;
76  void *val;
78  unsigned access : 5;
80  unsigned pdo_mapping : 1;
82  unsigned flags : 26;
86  void *dn_data;
90  void *up_data;
91 };
92 
93 #endif // !LELY_CO_INTERN_OBJ_H_
unsigned access
The access type.
Definition: obj.h:78
A CANopen sub-object.
Definition: obj.h:54
void * dn_data
A pointer to user-specified data for dn_ind.
Definition: obj.h:86
co_obj_t * obj
A pointer to the CANopen object containing this sub-object.
Definition: obj.h:58
co_unsigned16_t type
The data type.
Definition: obj.h:62
co_dev_t * dev
A pointer to the CANopen device containing this object.
Definition: obj.h:36
unsigned flags
The object flags.
Definition: obj.h:82
co_sub_up_ind_t * up_ind
A pointer to the upload indication function.
Definition: obj.h:88
A union of the CANopen static data types.
Definition: val.h:163
co_sub_dn_ind_t * dn_ind
A pointer to the download indication function.
Definition: obj.h:84
This header file is part of the utilities library; it contains the red-black tree declarations...
char * name
A pointer to the name of the sub-object.
Definition: obj.h:65
co_unsigned8_t code
The object code.
Definition: obj.h:40
union co_val max
The upper limit of the object value.
Definition: obj.h:71
struct rbtree tree
The tree containing all the sub-objects.
Definition: obj.h:46
union co_val min
The lower limit of the object value.
Definition: obj.h:69
This header file is part of the CANopen library; it contains the CANopen value declarations.
union co_val def
The default value.
Definition: obj.h:74
void * val
A pointer to the sub-object value.
Definition: obj.h:76
A red-black tree.
Definition: rbtree.h:90
struct rbnode node
The node of this object in the tree of objects.
Definition: obj.h:34
This is the internal header file of the CANopen library.
struct rbnode node
The node of this sub-object in the tree of sub-objects.
Definition: obj.h:56
co_unsigned16_t idx
The object index.
Definition: obj.h:38
void * val
A pointer to the object value.
Definition: obj.h:48
A CANopen device.
Definition: dev.c:38
co_unsigned8_t subidx
The object sub-index.
Definition: obj.h:60
unsigned pdo_mapping
A flag indicating if it is possible to map this object into a PDO.
Definition: obj.h:80
void * up_data
A pointer to user-specified data for up_ind.
Definition: obj.h:90
char * name
A pointer to the name of the object.
Definition: obj.h:43
A CANopen object.
Definition: obj.h:32
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...
Definition: obj.h:150
size_t size
The size (in bytes) of the value at val.
Definition: obj.h:50
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:135
A node in a red-black tree.
Definition: rbtree.h:52