14 #include <linux/types.h> |
14 #include <linux/types.h> |
15 |
15 |
16 /*****************************************************************************/ |
16 /*****************************************************************************/ |
17 |
17 |
18 // EtherCAT-Protokoll |
18 // EtherCAT-Protokoll |
19 #define EC_MAX_FRAME_SIZE 1500 /**< Maximale Größe eines EtherCAT-Frames ohne |
19 #define EC_MAX_FRAME_SIZE 1500 /**< maximum size of an EtherCAT frame (without |
20 Ethernet-II-Header und -Prüfsumme */ |
20 header and CRC) */ |
21 #define EC_MIN_FRAME_SIZE 46 /** Minimale Größe, s. o. */ |
21 #define EC_MIN_FRAME_SIZE 46 /** ... minimum size */ |
22 #define EC_FRAME_HEADER_SIZE 2 /**< Größe des EtherCAT-Frame-Headers */ |
22 #define EC_FRAME_HEADER_SIZE 2 /**< size of an EtherCAT frame header */ |
23 #define EC_COMMAND_HEADER_SIZE 10 /**< Größe eines EtherCAT-Kommando-Headers */ |
23 #define EC_COMMAND_HEADER_SIZE 10 /**< size of an EtherCAT command header */ |
24 #define EC_COMMAND_FOOTER_SIZE 2 /**< Größe eines EtherCAT-Kommando-Footers */ |
24 #define EC_COMMAND_FOOTER_SIZE 2 /**< size of an EtherCAT command footer */ |
25 #define EC_SYNC_SIZE 8 /**< Größe einer Sync-Manager-Konfigurationsseite */ |
25 #define EC_SYNC_SIZE 8 /**< size of a sync manager configuration page */ |
26 #define EC_FMMU_SIZE 16 /**< Größe einer FMMU-Konfigurationsseite */ |
26 #define EC_FMMU_SIZE 16 /**< size of an FMMU configuration page */ |
27 #define EC_MAX_FMMUS 16 /**< Maximale Anzahl FMMUs pro Slave */ |
27 #define EC_MAX_FMMUS 16 /**< maximum number of FMMUs per slave */ |
28 #define EC_MAX_DATA_SIZE (EC_MAX_FRAME_SIZE \ |
28 #define EC_MAX_DATA_SIZE (EC_MAX_FRAME_SIZE \ |
29 - EC_FRAME_HEADER_SIZE \ |
29 - EC_FRAME_HEADER_SIZE \ |
30 - EC_COMMAND_HEADER_SIZE \ |
30 - EC_COMMAND_HEADER_SIZE \ |
31 - EC_COMMAND_FOOTER_SIZE) /**< Maximale Datengröße |
31 - EC_COMMAND_FOOTER_SIZE) /**< maximum data size of a |
32 bei einem Kommando pro |
32 single command */ |
33 Frame */ |
|
34 |
33 |
35 /*****************************************************************************/ |
34 /*****************************************************************************/ |
36 |
35 |
37 #define EC_INFO(fmt, args...) \ |
36 #define EC_INFO(fmt, args...) \ |
38 printk(KERN_INFO "EtherCAT: " fmt, ##args) |
37 printk(KERN_INFO "EtherCAT: " fmt, ##args) |
57 extern void ec_print_data_diff(const uint8_t *, const uint8_t *, size_t); |
56 extern void ec_print_data_diff(const uint8_t *, const uint8_t *, size_t); |
58 |
57 |
59 /*****************************************************************************/ |
58 /*****************************************************************************/ |
60 |
59 |
61 /** |
60 /** |
62 Code - Message Pair. |
61 Code - Message pair. |
63 |
|
64 Some EtherCAT commands support reading a status code to display a certain |
62 Some EtherCAT commands support reading a status code to display a certain |
65 message. This type allows to map a code to a message string. |
63 message. This type allows to map a code to a message string. |
66 */ |
64 */ |
67 |
65 |
68 typedef struct |
66 typedef struct |
69 { |
67 { |
70 uint32_t code; /**< Code */ |
68 uint32_t code; /**< code */ |
71 const char *message; /**< Message belonging to \a code */ |
69 const char *message; /**< message belonging to \a code */ |
72 } |
70 } |
73 ec_code_msg_t; |
71 ec_code_msg_t; |
74 |
72 |
75 /*****************************************************************************/ |
73 /*****************************************************************************/ |
76 |
74 |
77 #endif |
75 #endif |
78 |
76 |
79 /* Emacs-Konfiguration |
|
80 ;;; Local Variables: *** |
|
81 ;;; c-basic-offset:4 *** |
|
82 ;;; End: *** |
|
83 */ |
|