master/master.h
changeset 199 04ecf40fc2e9
parent 197 b9a6e2c22745
child 204 5ab50514d9b2
equal deleted inserted replaced
198:f7dff1ed01ba 199:04ecf40fc2e9
     1 /******************************************************************************
     1 /******************************************************************************
     2  *
       
     3  *  m a s t e r . h
       
     4  *
       
     5  *  EtherCAT master structure.
       
     6  *
     2  *
     7  *  $Id$
     3  *  $Id$
     8  *
     4  *
     9  *  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
     5  *  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
    10  *
     6  *
    23  *  along with the IgH EtherCAT Master; if not, write to the Free Software
    19  *  along with the IgH EtherCAT Master; if not, write to the Free Software
    24  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    20  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    25  *
    21  *
    26  *****************************************************************************/
    22  *****************************************************************************/
    27 
    23 
       
    24 /**
       
    25    \file
       
    26    EtherCAT master structure.
       
    27 */
       
    28 
       
    29 /*****************************************************************************/
       
    30 
    28 #ifndef _EC_MASTER_H_
    31 #ifndef _EC_MASTER_H_
    29 #define _EC_MASTER_H_
    32 #define _EC_MASTER_H_
    30 
    33 
    31 #include <linux/list.h>
    34 #include <linux/list.h>
    32 #include <linux/sysfs.h>
    35 #include <linux/sysfs.h>
    33 #include <linux/timer.h>
    36 #include <linux/timer.h>
    34 
    37 
    35 #include "device.h"
    38 #include "device.h"
    36 #include "domain.h"
    39 #include "domain.h"
    37 
       
    38 /*****************************************************************************/
       
    39 
       
    40 /**
       
    41    \defgroup Master EtherCAT master
       
    42    Data types and functions of the EtherCAT master.
       
    43    \{
       
    44 */
       
    45 
    40 
    46 /*****************************************************************************/
    41 /*****************************************************************************/
    47 
    42 
    48 /**
    43 /**
    49    EtherCAT master mode.
    44    EtherCAT master mode.
    58 ec_master_mode_t;
    53 ec_master_mode_t;
    59 
    54 
    60 /*****************************************************************************/
    55 /*****************************************************************************/
    61 
    56 
    62 /**
    57 /**
    63    Cyclic EtherCAT statistics.
    58    Cyclic statistics.
    64 */
    59 */
    65 
    60 
    66 typedef struct
    61 typedef struct
    67 {
    62 {
    68     unsigned int timeouts; /**< command timeouts */
    63     unsigned int timeouts; /**< command timeouts */
    75 ec_stats_t;
    70 ec_stats_t;
    76 
    71 
    77 /*****************************************************************************/
    72 /*****************************************************************************/
    78 
    73 
    79 /**
    74 /**
    80    EtherCAT-Master.
    75    EtherCAT master.
    81    Manages slaves, domains and IO.
    76    Manages slaves, domains and IO.
    82 */
    77 */
    83 
    78 
    84 struct ec_master
    79 struct ec_master
    85 {
    80 {
   103     unsigned int reserved; /**< true, if the master is reserved for RT */
    98     unsigned int reserved; /**< true, if the master is reserved for RT */
   104     struct timer_list freerun_timer; /**< timer object for free run mode */
    99     struct timer_list freerun_timer; /**< timer object for free run mode */
   105     ec_master_mode_t mode; /**< master mode */
   100     ec_master_mode_t mode; /**< master mode */
   106 };
   101 };
   107 
   102 
   108 /** \} */
       
   109 
       
   110 /*****************************************************************************/
   103 /*****************************************************************************/
   111 
   104 
   112 // master creation and deletion
   105 // master creation and deletion
   113 int ec_master_init(ec_master_t *, unsigned int);
   106 int ec_master_init(ec_master_t *, unsigned int);
   114 void ec_master_clear(struct kobject *);
   107 void ec_master_clear(struct kobject *);
   125 
   118 
   126 // slave management
   119 // slave management
   127 int ec_master_bus_scan(ec_master_t *);
   120 int ec_master_bus_scan(ec_master_t *);
   128 
   121 
   129 // misc.
   122 // misc.
   130 void ec_master_debug(const ec_master_t *);
       
   131 void ec_master_output_stats(ec_master_t *);
   123 void ec_master_output_stats(ec_master_t *);
   132 void ec_master_run_eoe(ec_master_t *);
   124 void ec_master_run_eoe(ec_master_t *);
   133 
   125 
   134 /*****************************************************************************/
   126 /*****************************************************************************/
   135 
   127