master/master.h
changeset 293 14aeb79aa992
parent 286 f3352378b4d4
child 298 d491d1f84ebc
child 1715 e675450f2174
equal deleted inserted replaced
292:2cf6ae0a2419 293:14aeb79aa992
    69    Cyclic statistics.
    69    Cyclic statistics.
    70 */
    70 */
    71 
    71 
    72 typedef struct
    72 typedef struct
    73 {
    73 {
    74     unsigned int timeouts; /**< command timeouts */
    74     unsigned int timeouts; /**< datagram timeouts */
    75     unsigned int delayed; /**< delayed commands */
    75     unsigned int delayed; /**< delayed datagrams */
    76     unsigned int corrupted; /**< corrupted frames */
    76     unsigned int corrupted; /**< corrupted frames */
    77     unsigned int unmatched; /**< unmatched commands */
    77     unsigned int unmatched; /**< unmatched datagrams */
    78     cycles_t t_last; /**< time of last output */
    78     cycles_t t_last; /**< time of last output */
    79 }
    79 }
    80 ec_stats_t;
    80 ec_stats_t;
    81 
    81 
    82 /*****************************************************************************/
    82 /*****************************************************************************/
    97     struct list_head slaves; /**< list of slaves on the bus */
    97     struct list_head slaves; /**< list of slaves on the bus */
    98     unsigned int slave_count; /**< number of slaves on the bus */
    98     unsigned int slave_count; /**< number of slaves on the bus */
    99 
    99 
   100     ec_device_t *device; /**< EtherCAT device */
   100     ec_device_t *device; /**< EtherCAT device */
   101 
   101 
   102     struct list_head command_queue; /**< command queue */
   102     struct list_head datagram_queue; /**< datagram queue */
   103     uint8_t command_index; /**< current command index */
   103     uint8_t datagram_index; /**< current datagram index */
   104 
   104 
   105     struct list_head domains; /**< list of domains */
   105     struct list_head domains; /**< list of domains */
   106 
   106 
   107     ec_command_t simple_command; /**< command structure for initialization */
   107     ec_datagram_t simple_datagram; /**< datagram structure for initialization */
   108     unsigned int timeout; /**< timeout in synchronous IO */
   108     unsigned int timeout; /**< timeout in synchronous IO */
   109 
   109 
   110     int debug_level; /**< master debug level */
   110     int debug_level; /**< master debug level */
   111     ec_stats_t stats; /**< cyclic statistics */
   111     ec_stats_t stats; /**< cyclic statistics */
   112 
   112 
   141 void ec_master_eoe_start(ec_master_t *);
   141 void ec_master_eoe_start(ec_master_t *);
   142 void ec_master_eoe_stop(ec_master_t *);
   142 void ec_master_eoe_stop(ec_master_t *);
   143 
   143 
   144 // IO
   144 // IO
   145 void ec_master_receive(ec_master_t *, const uint8_t *, size_t);
   145 void ec_master_receive(ec_master_t *, const uint8_t *, size_t);
   146 void ec_master_queue_command(ec_master_t *, ec_command_t *);
   146 void ec_master_queue_datagram(ec_master_t *, ec_datagram_t *);
   147 int ec_master_simple_io(ec_master_t *, ec_command_t *);
   147 int ec_master_simple_io(ec_master_t *, ec_datagram_t *);
   148 
   148 
   149 // slave management
   149 // slave management
   150 int ec_master_bus_scan(ec_master_t *);
   150 int ec_master_bus_scan(ec_master_t *);
   151 
   151 
   152 // misc.
   152 // misc.