master/slave_config.h
changeset 2589 2b9c78543663
parent 2101 01b30593e942
child 2609 777d1a8b3a27
equal deleted inserted replaced
2415:af21f0bdc7c9 2589:2b9c78543663
     1 /******************************************************************************
     1 /******************************************************************************
     2  *
     2  *
     3  *  $Id$
     3  *  $Id$
     4  *
     4  *
     5  *  Copyright (C) 2006-2008  Florian Pose, Ingenieurgemeinschaft IgH
     5  *  Copyright (C) 2006-2012  Florian Pose, Ingenieurgemeinschaft IgH
     6  *
     6  *
     7  *  This file is part of the IgH EtherCAT Master.
     7  *  This file is part of the IgH EtherCAT Master.
     8  *
     8  *
     9  *  The IgH EtherCAT Master is free software; you can redistribute it and/or
     9  *  The IgH EtherCAT Master is free software; you can redistribute it and/or
    10  *  modify it under the terms of the GNU General Public License version 2, as
    10  *  modify it under the terms of the GNU General Public License version 2, as
    41 
    41 
    42 #include "globals.h"
    42 #include "globals.h"
    43 #include "slave.h"
    43 #include "slave.h"
    44 #include "sync_config.h"
    44 #include "sync_config.h"
    45 #include "fmmu_config.h"
    45 #include "fmmu_config.h"
       
    46 #include "coe_emerg_ring.h"
    46 
    47 
    47 /*****************************************************************************/
    48 /*****************************************************************************/
    48 
    49 
    49 /** Convenience macro for printing configuration-specific information to
    50 /** Convenience macro for printing configuration-specific information to
    50  * syslog.
    51  * syslog.
    95  * This will print the message in \a fmt with a prefixed
    96  * This will print the message in \a fmt with a prefixed
    96  * "EtherCAT <INDEX> <ALIAS>:<POSITION>: ", where INDEX is the master index
    97  * "EtherCAT <INDEX> <ALIAS>:<POSITION>: ", where INDEX is the master index
    97  * and ALIAS and POSITION identify the configuration.
    98  * and ALIAS and POSITION identify the configuration.
    98  *
    99  *
    99  * \param sc EtherCAT slave configuration
   100  * \param sc EtherCAT slave configuration
       
   101  * \param level Debug level. Master's debug level must be >= \a level for
       
   102  * output.
   100  * \param fmt format string (like in printf())
   103  * \param fmt format string (like in printf())
   101  * \param args arguments (optional)
   104  * \param args arguments (optional)
   102  */
   105  */
   103 #define EC_CONFIG_DBG(sc, level, fmt, args...) \
   106 #define EC_CONFIG_DBG(sc, level, fmt, args...) \
   104     do { \
   107     do { \
   124 
   127 
   125     uint16_t watchdog_divider; /**< Watchdog divider as a number of 40ns
   128     uint16_t watchdog_divider; /**< Watchdog divider as a number of 40ns
   126                                  intervals (see spec. reg. 0x0400). */
   129                                  intervals (see spec. reg. 0x0400). */
   127     uint16_t watchdog_intervals; /**< Process data watchdog intervals (see
   130     uint16_t watchdog_intervals; /**< Process data watchdog intervals (see
   128                                    spec. reg. 0x0420). */
   131                                    spec. reg. 0x0420). */
   129     uint8_t allow_overlapping_pdos;	/**< Allow input PDOs use the same frame space
   132 
   130                                       as output PDOs. */
       
   131     ec_slave_t *slave; /**< Slave pointer. This is \a NULL, if the slave is
   133     ec_slave_t *slave; /**< Slave pointer. This is \a NULL, if the slave is
   132                          offline. */
   134                          offline. */
   133 
   135 
   134     ec_sync_config_t sync_configs[EC_MAX_SYNC_MANAGERS]; /**< Sync manager
   136     ec_sync_config_t sync_configs[EC_MAX_SYNC_MANAGERS]; /**< Sync manager
   135                                                    configurations. */
   137                                                    configurations. */
   139     ec_sync_signal_t dc_sync[EC_SYNC_SIGNAL_COUNT]; /**< DC sync signals. */
   141     ec_sync_signal_t dc_sync[EC_SYNC_SIGNAL_COUNT]; /**< DC sync signals. */
   140 
   142 
   141     struct list_head sdo_configs; /**< List of SDO configurations. */
   143     struct list_head sdo_configs; /**< List of SDO configurations. */
   142     struct list_head sdo_requests; /**< List of SDO requests. */
   144     struct list_head sdo_requests; /**< List of SDO requests. */
   143     struct list_head voe_handlers; /**< List of VoE handlers. */
   145     struct list_head voe_handlers; /**< List of VoE handlers. */
       
   146     struct list_head reg_requests; /**< List of register requests. */
   144     struct list_head soe_configs; /**< List of SoE configurations. */
   147     struct list_head soe_configs; /**< List of SoE configurations. */
       
   148 
       
   149     ec_coe_emerg_ring_t emerg_ring; /**< CoE emergency ring buffer. */
   145 };
   150 };
   146 
   151 
   147 /*****************************************************************************/
   152 /*****************************************************************************/
   148 
   153 
   149 void ec_slave_config_init(ec_slave_config_t *, ec_master_t *, uint16_t,
   154 void ec_slave_config_init(ec_slave_config_t *, ec_master_t *, uint16_t,
   161 unsigned int ec_slave_config_idn_count(const ec_slave_config_t *);
   166 unsigned int ec_slave_config_idn_count(const ec_slave_config_t *);
   162 const ec_soe_request_t *ec_slave_config_get_idn_by_pos_const(
   167 const ec_soe_request_t *ec_slave_config_get_idn_by_pos_const(
   163         const ec_slave_config_t *, unsigned int);
   168         const ec_slave_config_t *, unsigned int);
   164 ec_sdo_request_t *ec_slave_config_find_sdo_request(ec_slave_config_t *,
   169 ec_sdo_request_t *ec_slave_config_find_sdo_request(ec_slave_config_t *,
   165         unsigned int);
   170         unsigned int);
       
   171 ec_reg_request_t *ec_slave_config_find_reg_request(ec_slave_config_t *,
       
   172         unsigned int);
   166 ec_voe_handler_t *ec_slave_config_find_voe_handler(ec_slave_config_t *,
   173 ec_voe_handler_t *ec_slave_config_find_voe_handler(ec_slave_config_t *,
   167         unsigned int);
   174         unsigned int);
   168 
   175 
   169 ec_sdo_request_t *ecrt_slave_config_create_sdo_request_err(
   176 ec_sdo_request_t *ecrt_slave_config_create_sdo_request_err(
   170         ec_slave_config_t *, uint16_t, uint8_t, size_t);
   177         ec_slave_config_t *, uint16_t, uint8_t, size_t);
   171 ec_voe_handler_t *ecrt_slave_config_create_voe_handler_err(
   178 ec_voe_handler_t *ecrt_slave_config_create_voe_handler_err(
   172         ec_slave_config_t *, size_t);
   179         ec_slave_config_t *, size_t);
       
   180 ec_reg_request_t *ecrt_slave_config_create_reg_request_err(
       
   181         ec_slave_config_t *, size_t);
   173 
   182 
   174 /*****************************************************************************/
   183 /*****************************************************************************/
   175 
   184 
   176 #endif
   185 #endif