diff -r f04e93b8af0f -r 1b5aea4d5147 drivers/ec_master.h --- a/drivers/ec_master.h Fri Nov 18 09:35:04 2005 +0000 +++ b/drivers/ec_master.h Fri Nov 18 09:51:50 2005 +0000 @@ -31,10 +31,6 @@ mit Slave-Informationen */ unsigned int slave_count; /**< Anzahl der Slaves in slaves */ -#if 0 - EtherCAT_command_t *first_command; /**< Zeiger auf das erste - Kommando in der Liste */ -#endif EtherCAT_command_t process_data_command; /**< Kommando zum Senden und Empfangen der Prozessdaten */ @@ -52,12 +48,6 @@ unsigned char *process_data; /**< Zeiger auf Speicher mit Prozessdaten */ unsigned int process_data_length; /**< Länge der Prozessdaten */ -#if 0 - EtherCAT_command_t cmd_ring[ECAT_COMMAND_RING_SIZE]; /**< Statischer Kommandoring */ - int cmd_reserved[ECAT_COMMAND_RING_SIZE]; /**< Reservierungsflags für die Kommandos */ - unsigned int cmd_ring_index; /**< Index des nächsten Kommandos im Ring */ -#endif - int debug_level; /**< Debug-Level im Master-Code */ } EtherCAT_master_t; @@ -68,81 +58,30 @@ int EtherCAT_master_init(EtherCAT_master_t *, EtherCAT_device_t *); void EtherCAT_master_clear(EtherCAT_master_t *); +// Sending and receiving +int EtherCAT_simple_send_receive(EtherCAT_master_t *, EtherCAT_command_t *); +int EtherCAT_simple_send(EtherCAT_master_t *, EtherCAT_command_t *); +int EtherCAT_simple_receive(EtherCAT_master_t *, EtherCAT_command_t *); + // Slave management int EtherCAT_check_slaves(EtherCAT_master_t *, EtherCAT_slave_t *, unsigned int); void EtherCAT_clear_slaves(EtherCAT_master_t *); +int EtherCAT_read_slave_information(EtherCAT_master_t *, + unsigned short int, + unsigned short int, + unsigned int *); int EtherCAT_activate_slave(EtherCAT_master_t *, EtherCAT_slave_t *); int EtherCAT_deactivate_slave(EtherCAT_master_t *, EtherCAT_slave_t *); int EtherCAT_activate_all_slaves(EtherCAT_master_t *); int EtherCAT_deactivate_all_slaves(EtherCAT_master_t *); +int EtherCAT_state_change(EtherCAT_master_t *, EtherCAT_slave_t *, unsigned char); -// Sending and receiving -#if 0 -int EtherCAT_async_send_receive(EtherCAT_master_t *); -int EtherCAT_send(EtherCAT_master_t *); -int EtherCAT_receive(EtherCAT_master_t *); -#endif -int EtherCAT_simple_send_receive(EtherCAT_master_t *, EtherCAT_command_t *); -int EtherCAT_simple_send(EtherCAT_master_t *, EtherCAT_command_t *); -int EtherCAT_simple_receive(EtherCAT_master_t *, EtherCAT_command_t *); - +// Process data int EtherCAT_write_process_data(EtherCAT_master_t *); int EtherCAT_read_process_data(EtherCAT_master_t *); void EtherCAT_clear_process_data(EtherCAT_master_t *); -/***************************************************************/ - -// Slave information interface -int EtherCAT_read_slave_information(EtherCAT_master_t *, - unsigned short int, - unsigned short int, - unsigned int *); - -// EtherCAT commands -#if 0 -EtherCAT_command_t *EtherCAT_read(EtherCAT_master_t *, - unsigned short, - unsigned short, - unsigned int); -EtherCAT_command_t *EtherCAT_write(EtherCAT_master_t *, - unsigned short, - unsigned short, - unsigned int, - const unsigned char *); -EtherCAT_command_t *EtherCAT_position_read(EtherCAT_master_t *, - short, - unsigned short, - unsigned int); -EtherCAT_command_t *EtherCAT_position_write(EtherCAT_master_t *, - short, - unsigned short, - unsigned int, - const unsigned char *); -EtherCAT_command_t *EtherCAT_broadcast_read(EtherCAT_master_t *, - unsigned short, - unsigned int); -EtherCAT_command_t *EtherCAT_broadcast_write(EtherCAT_master_t *, - unsigned short, - unsigned int, - const unsigned char *); -EtherCAT_command_t *EtherCAT_logical_read_write(EtherCAT_master_t *, - unsigned int, - unsigned int, - unsigned char *); - -void EtherCAT_remove_command(EtherCAT_master_t *, EtherCAT_command_t *); -#endif - -// Slave states -int EtherCAT_state_change(EtherCAT_master_t *, EtherCAT_slave_t *, unsigned char); - -/***************************************************************/ - // Private functions -#if 0 -EtherCAT_command_t *alloc_cmd(EtherCAT_master_t *); -int add_command(EtherCAT_master_t *, EtherCAT_command_t *); -#endif void set_byte(unsigned char *, unsigned int, unsigned char); void set_word(unsigned char *, unsigned int, unsigned int); void output_debug_data(unsigned char *, unsigned int);