|
IgH EtherCAT Master
1.6.9
|
EtherCAT master structure. More...
Go to the source code of this file.
Data Structures | |
| struct | ec_stats_t |
| Cyclic statistics. More... | |
| struct | ec_device_stats_t |
| Device statistics. More... | |
| struct | ec_master |
| EtherCAT master. More... | |
Macros | |
| #define | EC_MASTER_INFO(master, fmt, args...) |
| Convenience macro for printing master-specific information to syslog. | |
| #define | EC_MASTER_ERR(master, fmt, args...) |
| Convenience macro for printing master-specific errors to syslog. | |
| #define | EC_MASTER_WARN(master, fmt, args...) |
| Convenience macro for printing master-specific warnings to syslog. | |
| #define | EC_MASTER_DBG(master, level, fmt, args...) |
| Convenience macro for printing master-specific debug messages to syslog. | |
| #define | EC_EXT_RING_SIZE 32 |
| Size of the external datagram ring. | |
| #define | EC_MAX_MASTERS 32 |
| Maximum number of masters. | |
| #define | ec_master_num_devices(MASTER) |
| Number of Ethernet devices. | |
Enumerations | |
| enum | ec_master_phase_t { EC_ORPHANED , EC_IDLE , EC_OPERATION } |
| EtherCAT master phase. More... | |
Functions | |
| void | ec_master_init_static (void) |
| Static variables initializer. | |
| int | ec_master_init (ec_master_t *, unsigned int, const uint8_t *, const uint8_t *, dev_t, struct class *, unsigned int, unsigned int) |
| Master constructor. | |
| void | ec_master_clear (ec_master_t *) |
| Destructor. | |
| int | ec_master_enter_idle_phase (ec_master_t *) |
| Transition function from ORPHANED to IDLE phase. | |
| void | ec_master_leave_idle_phase (ec_master_t *) |
| Transition function from IDLE to ORPHANED phase. | |
| int | ec_master_enter_operation_phase (ec_master_t *) |
| Transition function from IDLE to OPERATION phase. | |
| void | ec_master_leave_operation_phase (ec_master_t *) |
| Transition function from OPERATION to IDLE phase. | |
| void | ec_master_eoe_start (ec_master_t *) |
| Starts Ethernet over EtherCAT processing on demand. | |
| void | ec_master_eoe_stop (ec_master_t *) |
| Stops the Ethernet over EtherCAT processing. | |
| void | ec_master_receive_datagrams (ec_master_t *, ec_device_t *, const uint8_t *, size_t) |
| Processes a received frame. | |
| void | ec_master_queue_datagram (ec_master_t *, ec_datagram_t *) |
| Places a datagram in the datagram queue. | |
| void | ec_master_queue_datagram_ext (ec_master_t *, ec_datagram_t *) |
| Places a datagram in the non-application datagram queue. | |
| void | ec_master_set_send_interval (ec_master_t *, unsigned int) |
| Sets the expected interval between calls to ecrt_master_send and calculates the maximum amount of data to queue. | |
| void | ec_master_attach_slave_configs (ec_master_t *) |
| Attaches the slave configurations to the slaves. | |
| ec_slave_t * | ec_master_find_slave (ec_master_t *, uint16_t, uint16_t) |
| Finds a slave in the bus, given the alias and position. | |
| const ec_slave_t * | ec_master_find_slave_const (const ec_master_t *, uint16_t, uint16_t) |
| Finds a slave in the bus, given the alias and position. | |
| void | ec_master_output_stats (ec_master_t *) |
| Output master statistics. | |
| void | ec_master_clear_eoe_handlers (ec_master_t *) |
| Clear and free all EoE handlers. | |
| void | ec_master_clear_slaves (ec_master_t *) |
| Clear all slaves. | |
| unsigned int | ec_master_config_count (const ec_master_t *) |
| Get the number of slave configurations provided by the application. | |
| ec_slave_config_t * | ec_master_get_config (const ec_master_t *, unsigned int) |
| Get a slave configuration via its position in the list. | |
| const ec_slave_config_t * | ec_master_get_config_const (const ec_master_t *, unsigned int) |
| Get a slave configuration via its position in the list. | |
| unsigned int | ec_master_domain_count (const ec_master_t *) |
| Get the number of domains. | |
| ec_domain_t * | ec_master_find_domain (ec_master_t *, unsigned int) |
| Get a domain via its position in the list. | |
| const ec_domain_t * | ec_master_find_domain_const (const ec_master_t *, unsigned int) |
| Get a domain via its position in the list. | |
| uint16_t | ec_master_eoe_handler_count (const ec_master_t *) |
| Get the number of EoE handlers. | |
| const ec_eoe_t * | ec_master_get_eoe_handler_const (const ec_master_t *, uint16_t) |
| Get an EoE handler via its position in the list. | |
| int | ec_master_debug_level (ec_master_t *, unsigned int) |
| Set the debug level. | |
| ec_domain_t * | ecrt_master_create_domain_err (ec_master_t *) |
| Same as ecrt_master_create_domain(), but with ERR_PTR() return value. | |
| ec_slave_config_t * | ecrt_master_slave_config_err (ec_master_t *, uint16_t, uint16_t, uint32_t, uint32_t) |
| Same as ecrt_master_slave_config(), but with ERR_PTR() return value. | |
| void | ec_master_calc_dc (ec_master_t *) |
| Distributed-clocks calculations. | |
| void | ec_master_request_op (ec_master_t *) |
| Request OP state for configured slaves. | |
| void | ec_master_internal_send_cb (void *) |
| Internal sending callback. | |
| void | ec_master_internal_receive_cb (void *) |
| Internal receiving callback. | |
Variables | |
| const unsigned int | rate_intervals [EC_RATE_COUNT] |
| List of intervals for statistics [s]. | |
EtherCAT master structure.
Definition in file master.h.
| #define EC_MASTER_INFO | ( | master, | |
| fmt, | |||
| args... ) |
Convenience macro for printing master-specific information to syslog.
This will print the message in fmt with a prefixed "EtherCAT <INDEX>: ", where INDEX is the master index.
| master | EtherCAT master |
| fmt | format string (like in printf()) |
| args | arguments (optional) |
| #define EC_MASTER_ERR | ( | master, | |
| fmt, | |||
| args... ) |
Convenience macro for printing master-specific errors to syslog.
This will print the message in fmt with a prefixed "EtherCAT <INDEX>: ", where INDEX is the master index.
| master | EtherCAT master |
| fmt | format string (like in printf()) |
| args | arguments (optional) |
| #define EC_MASTER_WARN | ( | master, | |
| fmt, | |||
| args... ) |
Convenience macro for printing master-specific warnings to syslog.
This will print the message in fmt with a prefixed "EtherCAT <INDEX>: ", where INDEX is the master index.
| master | EtherCAT master |
| fmt | format string (like in printf()) |
| args | arguments (optional) |
| #define EC_MASTER_DBG | ( | master, | |
| level, | |||
| fmt, | |||
| args... ) |
Convenience macro for printing master-specific debug messages to syslog.
This will print the message in fmt with a prefixed "EtherCAT <INDEX>: ", where INDEX is the master index.
| master | EtherCAT master |
| level | Debug level. Master's debug level must be >= level for output. |
| fmt | format string (like in printf()) |
| args | arguments (optional) |
| #define EC_EXT_RING_SIZE 32 |
| #define ec_master_num_devices | ( | MASTER | ) |
| enum ec_master_phase_t |
| void ec_master_init_static | ( | void | ) |
| int ec_master_init | ( | ec_master_t * | master, |
| unsigned int | index, | ||
| const uint8_t * | main_mac, | ||
| const uint8_t * | backup_mac, | ||
| dev_t | device_number, | ||
| struct class * | class, | ||
| unsigned int | debug_level, | ||
| unsigned int | run_on_cpu ) |
Master constructor.
| master | EtherCAT master |
| index | master index |
| main_mac | MAC address of main device |
| backup_mac | MAC address of backup device |
| device_number | Character device number. |
| class | Device class. |
| debug_level | Debug level (module parameter). |
| run_on_cpu | bind created kernel threads to a cpu |
| void ec_master_clear | ( | ec_master_t * | master | ) |
| int ec_master_enter_idle_phase | ( | ec_master_t * | master | ) |
| void ec_master_leave_idle_phase | ( | ec_master_t * | master | ) |
| int ec_master_enter_operation_phase | ( | ec_master_t * | master | ) |
| void ec_master_leave_operation_phase | ( | ec_master_t * | master | ) |
| void ec_master_eoe_start | ( | ec_master_t * | master | ) |
| void ec_master_eoe_stop | ( | ec_master_t * | master | ) |
| void ec_master_receive_datagrams | ( | ec_master_t * | master, |
| ec_device_t * | device, | ||
| const uint8_t * | frame_data, | ||
| size_t | size ) |
| void ec_master_queue_datagram | ( | ec_master_t * | master, |
| ec_datagram_t * | datagram ) |
| void ec_master_queue_datagram_ext | ( | ec_master_t * | master, |
| ec_datagram_t * | datagram ) |
| void ec_master_set_send_interval | ( | ec_master_t * | master, |
| unsigned int | send_interval ) |
| void ec_master_attach_slave_configs | ( | ec_master_t * | master | ) |
| ec_slave_t * ec_master_find_slave | ( | ec_master_t * | master, |
| uint16_t | alias, | ||
| uint16_t | position ) |
| const ec_slave_t * ec_master_find_slave_const | ( | const ec_master_t * | master, |
| uint16_t | alias, | ||
| uint16_t | position ) |
| void ec_master_output_stats | ( | ec_master_t * | master | ) |
| void ec_master_clear_eoe_handlers | ( | ec_master_t * | master | ) |
| void ec_master_clear_slaves | ( | ec_master_t * | master | ) |
| unsigned int ec_master_config_count | ( | const ec_master_t * | master | ) |
| ec_slave_config_t * ec_master_get_config | ( | const ec_master_t * | master, |
| unsigned int | pos ) |
| const ec_slave_config_t * ec_master_get_config_const | ( | const ec_master_t * | master, |
| unsigned int | pos ) |
| unsigned int ec_master_domain_count | ( | const ec_master_t * | master | ) |
| ec_domain_t * ec_master_find_domain | ( | ec_master_t * | master, |
| unsigned int | index ) |
| const ec_domain_t * ec_master_find_domain_const | ( | const ec_master_t * | master, |
| unsigned int | index ) |
| uint16_t ec_master_eoe_handler_count | ( | const ec_master_t * | master | ) |
| const ec_eoe_t * ec_master_get_eoe_handler_const | ( | const ec_master_t * | master, |
| uint16_t | index ) |
| int ec_master_debug_level | ( | ec_master_t * | master, |
| unsigned int | level ) |
| ec_domain_t * ecrt_master_create_domain_err | ( | ec_master_t * | master | ) |
Same as ecrt_master_create_domain(), but with ERR_PTR() return value.
| master | master |
| ec_slave_config_t * ecrt_master_slave_config_err | ( | ec_master_t * | master, |
| uint16_t | alias, | ||
| uint16_t | position, | ||
| uint32_t | vendor_id, | ||
| uint32_t | product_code ) |
Same as ecrt_master_slave_config(), but with ERR_PTR() return value.
| void ec_master_calc_dc | ( | ec_master_t * | master | ) |
| void ec_master_request_op | ( | ec_master_t * | master | ) |
| void ec_master_internal_send_cb | ( | void * | cb_data | ) |
| void ec_master_internal_receive_cb | ( | void * | cb_data | ) |
|
extern |