author | Florian Pose <fp@igh-essen.com> |
Fri, 16 Dec 2005 15:41:49 +0000 | |
changeset 37 | 481faf8a5f93 |
parent 5 | 6f2508af550c |
child 39 | 6965c23a6826 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************** |
2 |
* |
|
3 |
* e c _ s l a v e . h |
|
4 |
* |
|
5 |
* Struktur für einen EtherCAT-Slave. |
|
6 |
* |
|
7 |
* $Date$ |
|
8 |
* $Author$ |
|
9 |
* |
|
10 |
***************************************************************/ |
|
11 |
||
12 |
#ifndef _EC_SLAVE_H_ |
|
13 |
#define _EC_SLAVE_H_ |
|
14 |
||
15 |
#include "ec_types.h" |
|
16 |
||
17 |
/***************************************************************/ |
|
18 |
||
19 |
/** |
|
20 |
EtherCAT-Slave |
|
5
6f2508af550c
Alle ?nderungen aus den Branches no_rtai und no_int nach Trunk portiert.
Florian Pose <fp@igh-essen.com>
parents:
0
diff
changeset
|
21 |
|
6f2508af550c
Alle ?nderungen aus den Branches no_rtai und no_int nach Trunk portiert.
Florian Pose <fp@igh-essen.com>
parents:
0
diff
changeset
|
22 |
Achtung: Bei Änderungen dieser Struktur immer das Define |
6f2508af550c
Alle ?nderungen aus den Branches no_rtai und no_int nach Trunk portiert.
Florian Pose <fp@igh-essen.com>
parents:
0
diff
changeset
|
23 |
ECAT_INIT_SLAVE anpassen! |
0 | 24 |
*/ |
25 |
||
26 |
typedef struct |
|
27 |
{ |
|
28 |
// Base data |
|
29 |
unsigned char type; /**< Slave-Typ */ |
|
30 |
unsigned char revision; /**< Revision */ |
|
31 |
unsigned short build; /**< Build-Nummer */ |
|
32 |
||
33 |
// Addresses |
|
34 |
short ring_position; /**< (Negative) Position des Slaves im Bus */ |
|
35 |
unsigned short station_address; /**< Konfigurierte Slave-Adresse */ |
|
36 |
||
37 |
// Slave information interface |
|
38 |
unsigned int vendor_id; /**< Identifikationsnummer des Herstellers */ |
|
39 |
unsigned int product_code; /**< Herstellerspezifischer Produktcode */ |
|
40 |
unsigned int revision_number; /**< Revisionsnummer */ |
|
5
6f2508af550c
Alle ?nderungen aus den Branches no_rtai und no_int nach Trunk portiert.
Florian Pose <fp@igh-essen.com>
parents:
0
diff
changeset
|
41 |
unsigned int serial_number; /**< Seriennummer der Klemme */ |
0 | 42 |
|
43 |
const EtherCAT_slave_desc_t *desc; /**< Zeiger auf die Beschreibung |
|
44 |
des Slave-Typs */ |
|
45 |
||
46 |
unsigned int logical_address0; /**< Konfigurierte, logische adresse */ |
|
47 |
||
48 |
EtherCAT_state_t current_state; /**< Aktueller Zustand */ |
|
49 |
EtherCAT_state_t requested_state; /**< Angeforderter Zustand */ |
|
50 |
||
51 |
unsigned char *process_data; /**< Zeiger auf den Speicherbereich |
|
52 |
im Prozessdatenspeicher des Masters */ |
|
53 |
} |
|
54 |
EtherCAT_slave_t; |
|
55 |
||
5
6f2508af550c
Alle ?nderungen aus den Branches no_rtai und no_int nach Trunk portiert.
Florian Pose <fp@igh-essen.com>
parents:
0
diff
changeset
|
56 |
#define ECAT_INIT_SLAVE(TYPE) {0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
0 | 57 |
TYPE, 0, ECAT_STATE_UNKNOWN, \ |
58 |
ECAT_STATE_UNKNOWN, NULL} |
|
59 |
||
60 |
/***************************************************************/ |
|
61 |
||
62 |
// Slave construction and deletion |
|
63 |
void EtherCAT_slave_init(EtherCAT_slave_t *); |
|
64 |
void EtherCAT_slave_clear(EtherCAT_slave_t *); |
|
65 |
||
66 |
int EtherCAT_read_value(EtherCAT_slave_t *, unsigned int); |
|
67 |
void EtherCAT_write_value(EtherCAT_slave_t *, unsigned int, int); |
|
68 |
||
69 |
/***************************************************************/ |
|
70 |
||
71 |
#endif |