include/ec_rtdm.h
changeset 2068 3001f6523e63
parent 2055 d246ab6b50d2
equal deleted inserted replaced
2067:19732da2cf86 2068:3001f6523e63
       
     1 /******************************************************************************
       
     2  *
       
     3  *  $Id$
       
     4  *
       
     5  *  ec_rtdm.h	Copyright (C) 2009-2010  Moehwald GmbH B.Benner
       
     6  *			                      2011       IgH Andreas Stewering-Bone
       
     7  *
       
     8  *  This file is part of the IgH EtherCAT master 
       
     9  *  
       
    10  *  The IgH EtherCAT master is free software; you can
       
    11  *  redistribute it and/or modify it under the terms of the GNU Lesser General
       
    12  *  Public License as published by the Free Software Foundation; version 2.1
       
    13  *  of the License.
       
    14  *
       
    15  *  The IgH EtherCAT master userspace library is distributed in the hope that
       
    16  *  it will be useful, but WITHOUT ANY WARRANTY; without even the implied
       
    17  *  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    18  *  GNU Lesser General Public License for more details.
       
    19  *
       
    20  *  You should have received a copy of the GNU Lesser General Public License
       
    21  *  along with the IgH EtherCAT master userspace library. If not, see
       
    22  *  <http://www.gnu.org/licenses/>.
       
    23  *  
       
    24  *  The license mentioned above concerns the source code only. Using the
       
    25  *  EtherCAT technology and brand is only permitted in compliance with the
       
    26  *  industrial property and similar rights of Beckhoff Automation GmbH.
       
    27  *
       
    28  *****************************************************************************/
       
    29 #ifndef __ECRT_RTDM_H
       
    30 #define __ECRT_RTDM_H
       
    31 
       
    32 
       
    33 //
       
    34 // Basefilename of RTDM device
       
    35 //
       
    36 #define EC_RTDM_DEV_FILE_NAME  "ec_rtdm"
       
    37 
       
    38 //
       
    39 // IOCTRL Values for RTDM_EXTENSION
       
    40 //
       
    41 // Realtime IOCTRL function
       
    42 #define EC_RTDM_MSTRATTACH                  1   // attach to a running master
       
    43 #define EC_RTDM_MSTRGETMUTNAME              2   // return the mutexname
       
    44 #define EC_RTDM_MASTER_RECEIVE              3   // call the master receive
       
    45 #define EC_RTDM_DOMAIN_PROCESS              4   // process domain data
       
    46 #define EC_RTDM_DOMAIN_QUEQUE               5   // prepare domain data
       
    47 #define EC_RTDM_MASTER_SEND                 6   // call the master send
       
    48 #define EC_RTDM_DOMAINSTATE	                7   // get domain state
       
    49 #define EC_RTDM_MASTERSTATE	                8   // get master state
       
    50 #define EC_RTDM_MASTER_APP_TIME             9   // set app time	
       
    51 #define EC_RTDM_SYNC_REF_CLOCK              10  // sync ref clock
       
    52 #define EC_RTDM_SYNC_SLAVE_CLOCK            11  // sync slave clocks
       
    53 #define EC_RTDM_MASTER_SYNC_MONITOR_QUEQUE  12  // prepare DC sync information
       
    54 #define EC_RTDM_MASTER_SYNC_MONITOR_PROCESS 13  // get DC sync information
       
    55 
       
    56 typedef struct _CstructMstrAttach
       
    57 {
       
    58   unsigned int        domainindex;
       
    59   unsigned int        masterindex;
       
    60 } CstructMstrAttach;
       
    61 
       
    62 
       
    63 #define ecrt_rtdm_master_attach(X,Y)                  rt_dev_ioctl(X, EC_RTDM_MSTRATTACH, Y)
       
    64 #define ecrt_rtdm_master_recieve(X)                   rt_dev_ioctl(X, EC_RTDM_MASTER_RECEIVE)
       
    65 #define ecrt_rtdm_domain_process(X)                   rt_dev_ioctl(X, EC_RTDM_DOMAIN_PROCESS)
       
    66 #define ecrt_rtdm_domain_queque(X)                    rt_dev_ioctl(X, EC_RTDM_DOMAIN_QUEQUE)
       
    67 #define ecrt_rtdm_master_send(X)                      rt_dev_ioctl(X, EC_RTDM_MASTER_SEND)
       
    68 #define ecrt_rtdm_domain_state(X,Y)                   rt_dev_ioctl(X, EC_RTDM_DOMAINSTATE, Y)
       
    69 #define ecrt_rtdm_master_state(X,Y)                   rt_dev_ioctl(X, EC_RTDM_MASTERSTATE, Y)
       
    70 #define ecrt_rtdm_master_application_time(X,Y)        rt_dev_ioctl(X, EC_RTDM_MASTER_APP_TIME, Y)
       
    71 #define ecrt_rtdm_master_sync_reference_clock(X)      rt_dev_ioctl(X, EC_RTDM_SYNC_REF_CLOCK)
       
    72 #define ecrt_rtdm_master_sync_slave_clocks(X)         rt_dev_ioctl(X, EC_RTDM_SYNC_SLAVE_CLOCK)
       
    73 #define ecrt_rtdm_master_sync_monitor_queque(X)       rt_dev_ioctl(X, EC_RTDM_MASTER_MONITOR_QUEQUE)
       
    74 #define ecrt_rtdm_master_sync_monitor_process(X,Y)    rt_dev_ioctl(X, EC_RTDM_MASTER_MONITOR_PROCESS,Y)
       
    75 
       
    76 #endif
       
    77 
       
    78