master/types.c
changeset 325 7833cf70c4f2
parent 324 9aa51cbdbfae
child 326 ddb48b173680
equal deleted inserted replaced
324:9aa51cbdbfae 325:7833cf70c4f2
     1 /******************************************************************************
       
     2  *
       
     3  *  $Id$
       
     4  *
       
     5  *  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
       
     6  *
       
     7  *  This file is part of the IgH EtherCAT Master.
       
     8  *
       
     9  *  The IgH EtherCAT Master is free software; you can redistribute it
       
    10  *  and/or modify it under the terms of the GNU General Public License
       
    11  *  as published by the Free Software Foundation; either version 2 of the
       
    12  *  License, or (at your option) any later version.
       
    13  *
       
    14  *  The IgH EtherCAT Master is distributed in the hope that it will be
       
    15  *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    17  *  GNU General Public License for more details.
       
    18  *
       
    19  *  You should have received a copy of the GNU General Public License
       
    20  *  along with the IgH EtherCAT Master; if not, write to the Free Software
       
    21  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
       
    22  *
       
    23  *  The right to use EtherCAT Technology is granted and comes free of
       
    24  *  charge under condition of compatibility of product made by
       
    25  *  Licensee. People intending to distribute/sell products based on the
       
    26  *  code, have to sign an agreement to guarantee that products using
       
    27  *  software based on IgH EtherCAT master stay compatible with the actual
       
    28  *  EtherCAT specification (which are released themselves as an open
       
    29  *  standard) as the (only) precondition to have the right to use EtherCAT
       
    30  *  Technology, IP and trade marks.
       
    31  *
       
    32  *****************************************************************************/
       
    33 
       
    34 /**
       
    35    \file
       
    36    EtherCAT slave descriptions.
       
    37    \cond
       
    38 */
       
    39 
       
    40 /*****************************************************************************/
       
    41 
       
    42 #include <linux/module.h>
       
    43 
       
    44 #include "globals.h"
       
    45 #include "types.h"
       
    46 
       
    47 /*****************************************************************************/
       
    48 
       
    49 const ec_sync_t mailbox_sm0 = {0x1800, 246, 0x26, {NULL}};
       
    50 const ec_sync_t mailbox_sm1 = {0x18F6, 246, 0x22, {NULL}};
       
    51 
       
    52 /******************************************************************************
       
    53  *  slave objects
       
    54  *****************************************************************************/
       
    55 
       
    56 const ec_slave_type_t Beckhoff_EK1100 = {
       
    57     "Beckhoff", "EK1100", "Bus Coupler", EC_TYPE_BUS_COUPLER,
       
    58     {NULL} // no sync managers
       
    59 };
       
    60 
       
    61 /*****************************************************************************/
       
    62 
       
    63 const ec_slave_type_t Beckhoff_EK1110 = {
       
    64     "Beckhoff", "EK1110", "Extension terminal", EC_TYPE_INFRA,
       
    65     {NULL} // no sync managers
       
    66 };
       
    67 
       
    68 /*****************************************************************************/
       
    69 
       
    70 const ec_field_t bk1120_out = {"Outputs", 0}; // variable size
       
    71 const ec_field_t bk1120_in = {"Inputs", 0}; // variable size
       
    72 
       
    73 const ec_sync_t bk1120_sm0 = {0x1C00, 264, 0x26, {NULL}};
       
    74 const ec_sync_t bk1120_sm1 = {0x1E00, 264, 0x22, {NULL}};
       
    75 
       
    76 const ec_sync_t bk1120_sm2 = { // outputs
       
    77     0x1000, 0, 0x24, // variable size
       
    78     {&bk1120_out, NULL}
       
    79 };
       
    80 
       
    81 const ec_sync_t bk1120_sm3 = { // inputs
       
    82     0x1600, 0, 0x00, // variable size
       
    83     {&bk1120_in, NULL}
       
    84 };
       
    85 
       
    86 const ec_slave_type_t Beckhoff_BK1120 = {
       
    87     "Beckhoff", "BK1120", "KBUS Coupler", EC_TYPE_NORMAL,
       
    88     {&bk1120_sm0, &bk1120_sm1, &bk1120_sm2, &bk1120_sm3, NULL}
       
    89 };
       
    90 
       
    91 /*****************************************************************************/
       
    92 
       
    93 const ec_field_t el1004_in = {"InputValue", 1};
       
    94 
       
    95 const ec_sync_t el1004_sm0 = { // inputs
       
    96     0x1000, 1, 0x00,
       
    97     {&el1004_in, NULL}
       
    98 };
       
    99 
       
   100 const ec_slave_type_t Beckhoff_EL1004 = {
       
   101     "Beckhoff", "EL1004", "4x Digital Input, 3ms", EC_TYPE_NORMAL,
       
   102     {&el1004_sm0, NULL}
       
   103 };
       
   104 
       
   105 /*****************************************************************************/
       
   106 
       
   107 const ec_field_t el1014_in = {"InputValue", 1};
       
   108 
       
   109 const ec_sync_t el1014_sm0 = { // inputs
       
   110     0x1000, 1, 0x00,
       
   111     {&el1014_in, NULL}
       
   112 };
       
   113 
       
   114 const ec_slave_type_t Beckhoff_EL1014 = {
       
   115     "Beckhoff", "EL1014", "4x Digital Input, 10us", EC_TYPE_NORMAL,
       
   116     {&el1014_sm0, NULL}
       
   117 };
       
   118 
       
   119 /*****************************************************************************/
       
   120 
       
   121 const ec_field_t el20XX_out = {"OutputValue", 1};
       
   122 
       
   123 const ec_sync_t el20XX_sm0 = {
       
   124     0x0F00, 1, 0x46,
       
   125     {&el20XX_out, NULL}
       
   126 };
       
   127 
       
   128 const ec_slave_type_t Beckhoff_EL2004 = {
       
   129     "Beckhoff", "EL2004", "4x Digital Output", EC_TYPE_NORMAL,
       
   130     {&el20XX_sm0, NULL}
       
   131 };
       
   132 
       
   133 const ec_slave_type_t Beckhoff_EL2032 = {
       
   134     "Beckhoff", "EL2032", "2x Digital Output (2A)", EC_TYPE_NORMAL,
       
   135     {&el20XX_sm0, NULL}
       
   136 };
       
   137 
       
   138 /*****************************************************************************/
       
   139 
       
   140 const ec_field_t el31X2_st1 = {"Status",     1};
       
   141 const ec_field_t el31X2_ip1 = {"InputValue", 2};
       
   142 const ec_field_t el31X2_st2 = {"Status",     1};
       
   143 const ec_field_t el31X2_ip2 = {"InputValue", 2};
       
   144 
       
   145 const ec_sync_t el31X2_sm2 = {0x1000, 4, 0x24, {NULL}};
       
   146 
       
   147 const ec_sync_t el31X2_sm3 = {
       
   148     0x1100, 6, 0x20,
       
   149     {&el31X2_st1, &el31X2_ip1, &el31X2_st2, &el31X2_ip2, NULL}
       
   150 };
       
   151 
       
   152 const ec_slave_type_t Beckhoff_EL3102 = {
       
   153     "Beckhoff", "EL3102", "2x Analog Input diff.", EC_TYPE_NORMAL,
       
   154     {&mailbox_sm0, &mailbox_sm1, &el31X2_sm2, &el31X2_sm3, NULL}
       
   155 };
       
   156 
       
   157 const ec_slave_type_t Beckhoff_EL3162 = {
       
   158     "Beckhoff", "EL3162", "2x Analog Input", EC_TYPE_NORMAL,
       
   159     {&mailbox_sm0, &mailbox_sm1, &el31X2_sm2, &el31X2_sm3, NULL}
       
   160 };
       
   161 
       
   162 /*****************************************************************************/
       
   163 
       
   164 const ec_field_t el41X2_op = {"OutputValue", 2};
       
   165 
       
   166 const ec_sync_t el41X2_sm2 = {
       
   167     0x1000, 4, 0x24,
       
   168     {&el41X2_op, &el41X2_op, NULL}
       
   169 };
       
   170 
       
   171 const ec_slave_type_t Beckhoff_EL4102 = {
       
   172     "Beckhoff", "EL4102", "2x Analog Output", EC_TYPE_NORMAL,
       
   173     {&mailbox_sm0, &mailbox_sm1, &el41X2_sm2, NULL}
       
   174 };
       
   175 
       
   176 const ec_slave_type_t Beckhoff_EL4132 = {
       
   177     "Beckhoff", "EL4132", "2x Analog Output diff.", EC_TYPE_NORMAL,
       
   178     {&mailbox_sm0, &mailbox_sm1, &el41X2_sm2, NULL}
       
   179 };
       
   180 
       
   181 /*****************************************************************************/
       
   182 
       
   183 const ec_field_t el5001_st = {"Status",     1};
       
   184 const ec_field_t el5001_ip = {"InputValue", 4};
       
   185 
       
   186 const ec_sync_t el5001_sm2 = {
       
   187     0x1000, 4, 0x24,
       
   188     {NULL}
       
   189 };
       
   190 
       
   191 const ec_sync_t el5001_sm3 = {
       
   192     0x1100, 5, 0x20,
       
   193     {&el5001_st, &el5001_ip, NULL}
       
   194 };
       
   195 
       
   196 const ec_slave_type_t Beckhoff_EL5001 = {
       
   197     "Beckhoff", "EL5001", "SSI-Interface", EC_TYPE_NORMAL,
       
   198     {&mailbox_sm0, &mailbox_sm1, &el5001_sm2, &el5001_sm3, NULL}
       
   199 };
       
   200 
       
   201 /*****************************************************************************/
       
   202 
       
   203 const ec_field_t el5101_ct = {"Control",     1};
       
   204 const ec_field_t el5101_op = {"OutputValue", 2};
       
   205 const ec_field_t el5101_st = {"Status",      1};
       
   206 const ec_field_t el5101_ip = {"InputValue",  2};
       
   207 const ec_field_t el5101_la = {"LatchValue",  2};
       
   208 
       
   209 const ec_sync_t el5101_sm2 = {
       
   210     0x1000, 3, 0x24,
       
   211     {&el5101_ct, &el5101_op, NULL}
       
   212 };
       
   213 
       
   214 const ec_sync_t el5101_sm3 = {
       
   215     0x1100, 5, 0x20,
       
   216     {&el5101_st, &el5101_ip, &el5101_la, NULL}
       
   217 };
       
   218 
       
   219 const ec_slave_type_t Beckhoff_EL5101 = {
       
   220     "Beckhoff", "EL5101", "Incremental Encoder Interface", EC_TYPE_NORMAL,
       
   221     {&mailbox_sm0, &mailbox_sm1, &el5101_sm2, &el5101_sm3, NULL}
       
   222 };
       
   223 
       
   224 /*****************************************************************************/
       
   225 
       
   226 const ec_sync_t el6601_sm0 = {0x1800, 522, 0x26, {NULL}};
       
   227 const ec_sync_t el6601_sm1 = {0x1C00, 522, 0x22, {NULL}};
       
   228 
       
   229 const ec_slave_type_t Beckhoff_EL6601 = {
       
   230     "Beckhoff", "EL6601", "1-Port Ethernet Switch Terminal", EC_TYPE_EOE,
       
   231     {&el6601_sm0, &el6601_sm1, NULL, NULL, NULL}
       
   232 };
       
   233 
       
   234 /*****************************************************************************/
       
   235 
       
   236 const ec_field_t trlinenc2_st = {"Status",     1};
       
   237 const ec_field_t trlinenc2_ip = {"InputValue", 4};
       
   238 
       
   239 const ec_sync_t trlinenc2_sm0 = {0x1800, 192, 0x26, {NULL}};
       
   240 const ec_sync_t trlinenc2_sm1 = {0x1C00, 192, 0x22, {NULL}};
       
   241 const ec_sync_t trlinenc2_sm2 = {0x1000,   4, 0x24, {NULL}};
       
   242 
       
   243 const ec_sync_t trlinenc2_sm3 = {
       
   244     0x1100, 5, 0x20,
       
   245     {&trlinenc2_st, &trlinenc2_ip, NULL}
       
   246 };
       
   247 
       
   248 const ec_slave_type_t TR_Electronic_LinEnc2 = {
       
   249     "TR-Electronic", "LinEnc2", "SSI-Encoder", EC_TYPE_NORMAL,
       
   250     {&trlinenc2_sm0, &trlinenc2_sm1, &trlinenc2_sm2, &trlinenc2_sm3, NULL}
       
   251 };
       
   252 
       
   253 /** \endcond */
       
   254 
       
   255 /*****************************************************************************/
       
   256 
       
   257 /**
       
   258    Mapping between vendor IDs and product codes <=> slave objects.
       
   259 */
       
   260 
       
   261 ec_slave_ident_t slave_idents[] = {
       
   262     {0x00000002, 0x03EC3052, &Beckhoff_EL1004},
       
   263     {0x00000002, 0x03F63052, &Beckhoff_EL1014},
       
   264     {0x00000002, 0x044C2C52, &Beckhoff_EK1100},
       
   265     {0x00000002, 0x04562C52, &Beckhoff_EK1110},
       
   266     {0x00000002, 0x04602C22, &Beckhoff_BK1120},
       
   267     {0x00000002, 0x07D43052, &Beckhoff_EL2004},
       
   268     {0x00000002, 0x07F03052, &Beckhoff_EL2032},
       
   269     {0x00000002, 0x0C1E3052, &Beckhoff_EL3102},
       
   270     {0x00000002, 0x0C5A3052, &Beckhoff_EL3162},
       
   271     {0x00000002, 0x10063052, &Beckhoff_EL4102},
       
   272     {0x00000002, 0x10243052, &Beckhoff_EL4132},
       
   273     {0x00000002, 0x13893052, &Beckhoff_EL5001},
       
   274     {0x00000002, 0x13ED3052, &Beckhoff_EL5101},
       
   275     {0x00000002, 0x19C93052, &Beckhoff_EL6601},
       
   276     {0x000000D4, 0x00000017, &TR_Electronic_LinEnc2},
       
   277     {}
       
   278 };
       
   279 
       
   280 /*****************************************************************************/