41 #ifndef _EC_PDO_H_ |
41 #ifndef _EC_PDO_H_ |
42 #define _EC_PDO_H_ |
42 #define _EC_PDO_H_ |
43 |
43 |
44 #include <linux/list.h> |
44 #include <linux/list.h> |
45 |
45 |
|
46 #include "../include/ecrt.h" |
|
47 |
46 #include "globals.h" |
48 #include "globals.h" |
47 |
49 |
48 /*****************************************************************************/ |
50 /*****************************************************************************/ |
49 |
51 |
50 /** |
52 /** PDO description. |
51 * PDO type. |
|
52 */ |
53 */ |
53 |
54 typedef struct { |
54 typedef enum |
55 struct list_head list; /**< List item. */ |
55 { |
56 ec_direction_t dir; /**< PDO direction. */ |
56 EC_RX_PDO, /**< Reveive PDO */ |
57 uint16_t index; /**< PDO index. */ |
57 EC_TX_PDO /**< Transmit PDO */ |
58 int8_t sync_index; /**< Assigned sync manager. */ |
58 } |
59 char *name; /**< PDO name. */ |
59 ec_pdo_type_t; |
60 struct list_head entries; /**< List of PDO entries. */ |
|
61 } ec_pdo_t; |
60 |
62 |
61 /*****************************************************************************/ |
63 /*****************************************************************************/ |
62 |
64 |
63 /** |
65 /** PDO entry description. |
64 * PDO description. |
|
65 */ |
66 */ |
66 |
67 typedef struct { |
67 typedef struct |
|
68 { |
|
69 struct list_head list; /**< list item */ |
|
70 ec_pdo_type_t type; /**< PDO type */ |
|
71 uint16_t index; /**< PDO index */ |
|
72 int8_t sync_index; /**< assigned sync manager */ |
|
73 char *name; /**< PDO name */ |
|
74 struct list_head entries; /**< entry list */ |
|
75 } |
|
76 ec_pdo_t; |
|
77 |
|
78 /*****************************************************************************/ |
|
79 |
|
80 /** |
|
81 * PDO entry description. |
|
82 */ |
|
83 |
|
84 typedef struct |
|
85 { |
|
86 struct list_head list; /**< list item */ |
68 struct list_head list; /**< list item */ |
87 uint16_t index; /**< PDO entry index */ |
69 uint16_t index; /**< PDO entry index */ |
88 uint8_t subindex; /**< PDO entry subindex */ |
70 uint8_t subindex; /**< PDO entry subindex */ |
89 char *name; /**< entry name */ |
71 char *name; /**< entry name */ |
90 uint8_t bit_length; /**< entry length in bit */ |
72 uint8_t bit_length; /**< entry length in bit */ |
91 } |
73 } ec_pdo_entry_t; |
92 ec_pdo_entry_t; |
|
93 |
74 |
94 /*****************************************************************************/ |
75 /*****************************************************************************/ |
95 |
76 |
96 void ec_pdo_init(ec_pdo_t *); |
77 void ec_pdo_init(ec_pdo_t *); |
|
78 int ec_pdo_init_copy(ec_pdo_t *, const ec_pdo_t *); |
97 void ec_pdo_clear(ec_pdo_t *); |
79 void ec_pdo_clear(ec_pdo_t *); |
98 int ec_pdo_copy(ec_pdo_t *, const ec_pdo_t *); |
80 int ec_pdo_set_name(ec_pdo_t *, const char *); |
|
81 int ec_pdo_copy_entries(ec_pdo_t *, const ec_pdo_t *); |
|
82 |
|
83 void ec_pdo_entry_init(ec_pdo_entry_t *); |
|
84 int ec_pdo_entry_init_copy(ec_pdo_entry_t *, const ec_pdo_entry_t *); |
|
85 void ec_pdo_entry_clear(ec_pdo_entry_t *); |
|
86 int ec_pdo_entry_set_name(ec_pdo_entry_t *, const char *); |
99 |
87 |
100 /*****************************************************************************/ |
88 /*****************************************************************************/ |
101 |
89 |
102 #endif |
90 #endif |