equal
deleted
inserted
replaced
|
1 /**************************************************************** |
|
2 * |
|
3 * e c _ c o m m a n d . c |
|
4 * |
|
5 * Methoden für ein EtherCAT-Kommando. |
|
6 * |
|
7 * $Date$ |
|
8 * $Author$ |
|
9 * |
|
10 ***************************************************************/ |
|
11 |
|
12 #include <linux/slab.h> |
|
13 |
|
14 #include "ec_command.h" |
|
15 |
|
16 /***************************************************************/ |
|
17 |
|
18 /** |
|
19 Kommando-Konstruktor. |
|
20 |
|
21 Initialisiert alle Variablen innerhalb des Kommandos auf die |
|
22 Default-Werte. |
|
23 |
|
24 @param cmd Zeiger auf das zu initialisierende Kommando. |
|
25 */ |
|
26 |
|
27 void EtherCAT_command_init(EtherCAT_command_t *cmd) |
|
28 { |
|
29 cmd->type = ECAT_CMD_NONE; |
|
30 cmd->address.logical = 0x00000000; |
|
31 cmd->data_length = 0; |
|
32 |
|
33 cmd->next = NULL; |
|
34 |
|
35 cmd->state = ECAT_CS_READY; |
|
36 cmd->index = 0; |
|
37 cmd->working_counter = 0; |
|
38 cmd->reserved = 0; //Hm |
|
39 } |
|
40 |
|
41 /***************************************************************/ |
|
42 |
|
43 /** |
|
44 Kommando-Destruktor. |
|
45 |
|
46 Setzt nur den Status auf ECAT_CS_READY und das |
|
47 reserved-Flag auf 0. |
|
48 |
|
49 @param cmd Zeiger auf das zu initialisierende Kommando. |
|
50 */ |
|
51 |
|
52 void EtherCAT_command_clear(EtherCAT_command_t *cmd) |
|
53 { |
|
54 cmd->state = ECAT_CS_READY; |
|
55 cmd->reserved = 0; |
|
56 } |
|
57 |
|
58 /***************************************************************/ |