1 /**************************************************************** |
1 /****************************************************************************** |
2 * |
2 * |
3 * e c _ s l a v e . h |
3 * e c _ s l a v e . h |
4 * |
4 * |
5 * Struktur für einen EtherCAT-Slave. |
5 * Struktur für einen EtherCAT-Slave. |
6 * |
6 * |
7 * $Date$ |
7 * $Id$ |
8 * $Author$ |
|
9 * |
8 * |
10 ***************************************************************/ |
9 *****************************************************************************/ |
11 |
10 |
12 #ifndef _EC_SLAVE_H_ |
11 #ifndef _EC_SLAVE_H_ |
13 #define _EC_SLAVE_H_ |
12 #define _EC_SLAVE_H_ |
14 |
13 |
15 #include "ec_types.h" |
14 #include "ec_types.h" |
16 |
15 |
17 /***************************************************************/ |
16 /*****************************************************************************/ |
18 |
17 |
19 /** |
18 /** |
20 EtherCAT-Slave |
19 EtherCAT-Slave |
21 |
20 |
22 Achtung: Bei Änderungen dieser Struktur immer das Define |
21 Achtung: Bei Änderungen dieser Struktur immer das Define |
48 EtherCAT_state_t current_state; /**< Aktueller Zustand */ |
47 EtherCAT_state_t current_state; /**< Aktueller Zustand */ |
49 EtherCAT_state_t requested_state; /**< Angeforderter Zustand */ |
48 EtherCAT_state_t requested_state; /**< Angeforderter Zustand */ |
50 |
49 |
51 unsigned char *process_data; /**< Zeiger auf den Speicherbereich |
50 unsigned char *process_data; /**< Zeiger auf den Speicherbereich |
52 im Prozessdatenspeicher des Masters */ |
51 im Prozessdatenspeicher des Masters */ |
|
52 int error_reported; /**< Ein Zugriffsfehler wurde bereits gemeldet. */ |
53 } |
53 } |
54 EtherCAT_slave_t; |
54 EtherCAT_slave_t; |
55 |
55 |
56 #define ECAT_INIT_SLAVE(TYPE) {0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
56 #define ECAT_INIT_SLAVE(TYPE) {0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
57 TYPE, 0, ECAT_STATE_UNKNOWN, \ |
57 TYPE, 0, ECAT_STATE_UNKNOWN, \ |
58 ECAT_STATE_UNKNOWN, NULL} |
58 ECAT_STATE_UNKNOWN, NULL} |
59 |
59 |
60 /***************************************************************/ |
60 /*****************************************************************************/ |
61 |
61 |
62 // Slave construction and deletion |
62 // Slave construction and deletion |
63 void EtherCAT_slave_init(EtherCAT_slave_t *); |
63 void EtherCAT_slave_init(EtherCAT_slave_t *); |
64 void EtherCAT_slave_clear(EtherCAT_slave_t *); |
64 void EtherCAT_slave_clear(EtherCAT_slave_t *); |
65 |
65 |
66 int EtherCAT_read_value(EtherCAT_slave_t *, unsigned int); |
66 int EtherCAT_read_value(EtherCAT_slave_t *, unsigned int); |
67 void EtherCAT_write_value(EtherCAT_slave_t *, unsigned int, int); |
67 void EtherCAT_write_value(EtherCAT_slave_t *, unsigned int, int); |
68 |
68 |
69 /***************************************************************/ |
69 /*****************************************************************************/ |
70 |
70 |
71 #endif |
71 #endif |