drivers/ec_types.c
changeset 39 6965c23a6826
parent 35 ed834aa98f89
equal deleted inserted replaced
38:3213cbbd58b7 39:6965c23a6826
     1 /****************************************************************
     1 /******************************************************************************
     2  *
     2  *
     3  *  e c _ t y p e s . c
     3  *  e c _ t y p e s . c
     4  *
     4  *
     5  *  EtherCAT-Slave-Typen.
     5  *  EtherCAT-Slave-Typen.
     6  *
     6  *
     7  *  $Date: 2005-09-07 17:50:50 +0200 (Mit, 07 Sep 2005) $
     7  *  $Id$
     8  *  $Author: fp $
       
     9  *
     8  *
    10  ***************************************************************/
     9  *****************************************************************************/
    11 
    10 
    12 #include <linux/module.h>
    11 #include <linux/module.h>
    13 
    12 
    14 #include "ec_globals.h"
    13 #include "ec_globals.h"
    15 #include "ec_types.h"
    14 #include "ec_types.h"
    16 
    15 
    17 /***************************************************************/
    16 /*****************************************************************************/
       
    17 
       
    18 /* Konfigurationen der Sync-Manager */
    18 
    19 
    19 unsigned char sm0_multi[] = {0x00, 0x18, 0xF6, 0x00, 0x26, 0x00, 0x01, 0x00};
    20 unsigned char sm0_multi[] = {0x00, 0x18, 0xF6, 0x00, 0x26, 0x00, 0x01, 0x00};
    20 unsigned char sm1_multi[] = {0xF6, 0x18, 0xF6, 0x00, 0x22, 0x00, 0x01, 0x00};
    21 unsigned char sm1_multi[] = {0xF6, 0x18, 0xF6, 0x00, 0x22, 0x00, 0x01, 0x00};
    21 
    22 
    22 unsigned char sm0_1014[] = {0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00};
    23 unsigned char sm0_1014[] = {0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00};
    26 unsigned char sm2_31xx[] = {0x00, 0x10, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00};
    27 unsigned char sm2_31xx[] = {0x00, 0x10, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00};
    27 unsigned char sm3_31xx[] = {0x00, 0x11, 0x06, 0x00, 0x20, 0x00, 0x01, 0x00};
    28 unsigned char sm3_31xx[] = {0x00, 0x11, 0x06, 0x00, 0x20, 0x00, 0x01, 0x00};
    28 
    29 
    29 unsigned char sm2_41xx[] = {0x00, 0x10, 0x04, 0x00, 0x24, 0x00, 0x01, 0x00};
    30 unsigned char sm2_41xx[] = {0x00, 0x10, 0x04, 0x00, 0x24, 0x00, 0x01, 0x00};
    30 
    31 
       
    32 /* Konfigurationen der Memory-Management-Units */
    31 
    33 
    32 unsigned char fmmu0_1014[] = {0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07,
    34 unsigned char fmmu0_1014[] = {0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07,
    33                               0x00, 0x10, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00};
    35                               0x00, 0x10, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00};
    34 
    36 
    35 unsigned char fmmu0_2004[] = {0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07,
    37 unsigned char fmmu0_2004[] = {0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07,
    38 unsigned char fmmu0_31xx[] = {0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x07,
    40 unsigned char fmmu0_31xx[] = {0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x07,
    39                               0x00, 0x11, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00};
    41                               0x00, 0x11, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00};
    40 
    42 
    41 unsigned char fmmu0_41xx[] = {0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07,
    43 unsigned char fmmu0_41xx[] = {0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07,
    42                               0x00, 0x10, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00};
    44                               0x00, 0x10, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00};
       
    45 
       
    46 /*****************************************************************************/
       
    47 
       
    48 /* Lese- und Schreibfunktionen */
    43 
    49 
    44 int read_1014(unsigned char *data, unsigned int channel)
    50 int read_1014(unsigned char *data, unsigned int channel)
    45 {
    51 {
    46   return (data[0] >> channel) & 0x01;
    52   return (data[0] >> channel) & 0x01;
    47 }
    53 }
    67 {
    73 {
    68   data[channel * 3 + 1] = (value & 0xFF00) >> 8;
    74   data[channel * 3 + 1] = (value & 0xFF00) >> 8;
    69   data[channel * 3 + 2] = value & 0xFF;
    75   data[channel * 3 + 2] = value & 0xFF;
    70 }
    76 }
    71 
    77 
    72 /***************************************************************/
    78 /*****************************************************************************/
       
    79 
       
    80 /* Klemmen-Objekte */
    73 
    81 
    74 EtherCAT_slave_desc_t Beckhoff_EK1100[] =
    82 EtherCAT_slave_desc_t Beckhoff_EK1100[] =
    75 {{
    83 {{
    76   "Beckhoff", "EK1100", "Bus Coupler",
    84   "Beckhoff", "EK1100", "Bus Coupler",
    77   ECAT_ST_SIMPLE_NOSYNC,
    85   ECAT_ST_SIMPLE_NOSYNC,
   149   NULL,
   157   NULL,
   150   0, 0,
   158   0, 0,
   151   NULL, NULL
   159   NULL, NULL
   152 }};
   160 }};
   153 
   161 
   154 /***************************************************************/
   162 /*****************************************************************************/
   155 
   163 
   156 unsigned int slave_idents_count = 7;
   164 /**
       
   165    Beziehung zwischen Identifikationsnummern und Klemmen-Objekt.
   157 
   166 
   158 struct slave_ident slave_idents[] =
   167    Diese Tabelle stellt die Beziehungen zwischen bestimmten Kombinationen
       
   168    aus Vendor-IDs und Product-Codes und der entsprechenden Klemme her.
       
   169    Neue Klemmen müssen hier eingetragen werden.
       
   170 */
       
   171 
       
   172 EtherCAT_slave_ident_t slave_idents[] =
   159 {
   173 {
   160   {0x00000002, 0x03F63052, Beckhoff_EL1014},
   174   {0x00000002, 0x03F63052, Beckhoff_EL1014},
   161   {0x00000002, 0x044C2C52, Beckhoff_EK1100},
   175   {0x00000002, 0x044C2C52, Beckhoff_EK1100},
   162   {0x00000002, 0x07D43052, Beckhoff_EL2004},
   176   {0x00000002, 0x07D43052, Beckhoff_EL2004},
   163   {0x00000002, 0x0C1E3052, Beckhoff_EL3102},
   177   {0x00000002, 0x0C1E3052, Beckhoff_EL3102},
   165   {0x00000002, 0x10063052, Beckhoff_EL4102},
   179   {0x00000002, 0x10063052, Beckhoff_EL4102},
   166   {0x00000002, 0x10243052, Beckhoff_EL4132},
   180   {0x00000002, 0x10243052, Beckhoff_EL4132},
   167   {0x00000002, 0x13893052, Beckhoff_EL5001}
   181   {0x00000002, 0x13893052, Beckhoff_EL5001}
   168 };
   182 };
   169 
   183 
   170 /***************************************************************/
   184 unsigned int slave_ident_count = sizeof(slave_idents)
       
   185      / sizeof(EtherCAT_slave_ident_t);
       
   186 
       
   187 
       
   188 /*****************************************************************************/
   171 
   189 
   172 EXPORT_SYMBOL(Beckhoff_EK1100);
   190 EXPORT_SYMBOL(Beckhoff_EK1100);
   173 EXPORT_SYMBOL(Beckhoff_EL1014);
   191 EXPORT_SYMBOL(Beckhoff_EL1014);
   174 EXPORT_SYMBOL(Beckhoff_EL2004);
   192 EXPORT_SYMBOL(Beckhoff_EL2004);
   175 EXPORT_SYMBOL(Beckhoff_EL3102);
   193 EXPORT_SYMBOL(Beckhoff_EL3102);
   176 EXPORT_SYMBOL(Beckhoff_EL3162);
   194 EXPORT_SYMBOL(Beckhoff_EL3162);
   177 EXPORT_SYMBOL(Beckhoff_EL4102);
   195 EXPORT_SYMBOL(Beckhoff_EL4102);
   178 EXPORT_SYMBOL(Beckhoff_EL4132);
   196 EXPORT_SYMBOL(Beckhoff_EL4132);
   179 EXPORT_SYMBOL(Beckhoff_EL5001);
   197 EXPORT_SYMBOL(Beckhoff_EL5001);
       
   198 
       
   199 /*****************************************************************************/