fp@0: /**************************************************************** fp@0: * fp@0: * e c _ g l o b a l s . h fp@0: * fp@0: * Globale Definitionen und Makros für das EtherCAT-Protokoll. fp@0: * fp@0: * $Date$ fp@0: * $Author$ fp@0: * fp@0: ***************************************************************/ fp@0: fp@0: #ifndef _EC_GLOBALS_ fp@0: #define _EC_GLOBALS_ fp@0: fp@0: /** fp@0: Maximale Größe eines EtherCAT-Frames fp@0: */ fp@0: #define ECAT_FRAME_BUFFER_SIZE 1600 fp@0: fp@0: /** fp@0: Anzahl der Kommandos in einem Master-Kommandoring fp@0: */ fp@0: #define ECAT_COMMAND_RING_SIZE 10 fp@0: fp@0: /** fp@0: Anzahl der Versuche beim Asynchronen Senden/Empfangen fp@0: */ fp@0: #define ECAT_NUM_RETRIES 10 fp@0: fp@0: /** fp@0: NULL-Define, falls noch nicht definiert. fp@0: */ fp@0: fp@0: #ifndef NULL fp@0: #define NULL ((void *) 0) fp@0: #endif fp@0: fp@0: /** fp@0: EtherCAT-Kommando-Typ fp@0: */ fp@0: fp@0: typedef enum fp@0: { fp@0: ECAT_CMD_NONE = 0x00, /**< Dummy */ fp@0: ECAT_CMD_APRD = 0x01, /**< Auto-increment physical read */ fp@0: ECAT_CMD_APWR = 0x02, /**< Auto-increment physical write */ fp@0: ECAT_CMD_NPRD = 0x04, /**< Node-addressed physical read */ fp@0: ECAT_CMD_NPWR = 0x05, /**< Node-addressed physical write */ fp@0: ECAT_CMD_BRD = 0x07, /**< Broadcast read */ fp@0: ECAT_CMD_BWR = 0x08, /**< Broadcast write */ fp@0: ECAT_CMD_LRW = 0x0C /**< Logical read/write */ fp@0: } fp@0: EtherCAT_cmd_type_t; fp@0: fp@0: /** fp@0: Zustand eines EtherCAT-Slaves fp@0: */ fp@0: fp@0: typedef enum fp@0: { fp@0: ECAT_STATE_UNKNOWN = 0x00, /**< Status unbekannt */ fp@0: ECAT_STATE_INIT = 0x01, /**< Init-Zustand (Keine Mailbox- fp@0: Kommunikation, Kein I/O) */ fp@0: ECAT_STATE_PREOP = 0x02, /**< Pre-Operational (Mailbox- fp@0: Kommunikation, Kein I/O) */ fp@0: ECAT_STATE_SAVEOP = 0x04, /**< Save-Operational (Mailbox- fp@0: Kommunikation und Input Update) */ fp@0: ECAT_STATE_OP = 0x08, /**< Operational, (Mailbox- fp@0: Kommunikation und Input/Output Update) */ fp@0: ECAT_ACK_STATE = 0x10 /**< Acknoledge-Bit beim Zustandswechsel fp@0: (dies ist kein eigener Zustand) */ fp@0: } fp@0: EtherCAT_state_t; fp@0: fp@0: /***************************************************************/ fp@0: fp@0: #endif