master/types.h
changeset 73 9f4ea66d89a3
parent 61 cd014255f94f
child 75 aae1b9520e4d
equal deleted inserted replaced
72:7c986b717411 73:9f4ea66d89a3
     9  *****************************************************************************/
     9  *****************************************************************************/
    10 
    10 
    11 #ifndef _EC_TYPES_H_
    11 #ifndef _EC_TYPES_H_
    12 #define _EC_TYPES_H_
    12 #define _EC_TYPES_H_
    13 
    13 
       
    14 #include <linux/types.h>
       
    15 
    14 #include "../include/EtherCAT_rt.h"
    16 #include "../include/EtherCAT_rt.h"
       
    17 
       
    18 /*****************************************************************************/
       
    19 
       
    20 #define EC_MAX_FIELDS 10
       
    21 #define EC_MAX_SYNC   16
    15 
    22 
    16 /*****************************************************************************/
    23 /*****************************************************************************/
    17 
    24 
    18 /**
    25 /**
    19    Features eines EtherCAT-Slaves.
    26    Features eines EtherCAT-Slaves.
    30 ec_slave_features_t;
    37 ec_slave_features_t;
    31 
    38 
    32 /*****************************************************************************/
    39 /*****************************************************************************/
    33 
    40 
    34 /**
    41 /**
       
    42    Prozessdatenfeld.
       
    43 */
       
    44 
       
    45 typedef struct
       
    46 {
       
    47     ec_field_type_t type;
       
    48     unsigned int size;
       
    49 }
       
    50 ec_field_t;
       
    51 
       
    52 /*****************************************************************************/
       
    53 
       
    54 /**
       
    55    Sync-Manager.
       
    56 */
       
    57 
       
    58 typedef struct
       
    59 {
       
    60     uint16_t physical_start_address;
       
    61     uint16_t size;
       
    62     uint8_t control_byte;
       
    63     const ec_field_t *fields[EC_MAX_FIELDS];
       
    64 }
       
    65 ec_sync_t;
       
    66 
       
    67 /*****************************************************************************/
       
    68 
       
    69 /**
    35    Beschreibung eines EtherCAT-Slave-Typs.
    70    Beschreibung eines EtherCAT-Slave-Typs.
    36 
    71 
    37    Diese Beschreibung dient zur Konfiguration einer bestimmten
    72    Diese Beschreibung dient zur Konfiguration einer bestimmten
    38    Slave-Art. Sie enthält die Konfigurationsdaten für die
    73    Slave-Art. Sie enthält die Konfigurationsdaten für die
    39    Slave-internen Sync-Manager und FMMU's.
    74    Slave-internen Sync-Manager und FMMU's.
    40 */
    75 */
    41 
    76 
    42 struct ec_slave_type
    77 typedef struct ec_slave_type
    43 {
    78 {
    44     const char *vendor_name; /**< Name des Herstellers */
    79     const char *vendor_name; /**< Name des Herstellers */
    45     const char *product_name; /**< Name des Slaves-Typs */
    80     const char *product_name; /**< Name des Slaves-Typs */
    46     const char *product_desc; /**< Genauere Beschreibung des Slave-Typs */
    81     const char *description; /**< Genauere Beschreibung des Slave-Typs */
    47 
       
    48     ec_slave_features_t features; /**< Features des Slave-Typs */
    82     ec_slave_features_t features; /**< Features des Slave-Typs */
    49 
    83     const ec_sync_t *sync_managers[EC_MAX_SYNC]; /**< Sync-Manager
    50     const unsigned char *sm0; /**< Konfigurationsdaten des
    84                                                     Konfigurationen */
    51                                  ersten Sync-Managers */
    85 }
    52     const unsigned char *sm1; /**< Konfigurationsdaten des
    86 ec_slave_type_t;
    53                                  zweiten Sync-Managers */
       
    54     const unsigned char *sm2; /**< Konfigurationsdaten des
       
    55                                  dritten Sync-Managers */
       
    56     const unsigned char *sm3; /**< Konfigurationsdaten des
       
    57                                  vierten Sync-Managers */
       
    58 
       
    59     const unsigned char *fmmu0; /**< Konfigurationsdaten
       
    60                                    der ersten FMMU */
       
    61 
       
    62     unsigned int process_data_size; /**< Länge der Prozessdaten in Bytes */
       
    63 };
       
    64 
    87 
    65 /*****************************************************************************/
    88 /*****************************************************************************/
    66 
    89 
    67 /**
    90 /**
    68    Identifikation eines Slave-Typs.
    91    Identifikation eines Slave-Typs.
    79 }
   102 }
    80 ec_slave_ident_t;
   103 ec_slave_ident_t;
    81 
   104 
    82 extern ec_slave_ident_t slave_idents[]; /**< Statisches Array der
   105 extern ec_slave_ident_t slave_idents[]; /**< Statisches Array der
    83                                            Slave-Identifikationen */
   106                                            Slave-Identifikationen */
    84 extern unsigned int slave_ident_count; /**< Anzahl der vorhandenen
       
    85                                           Slave-Identifikationen */
       
    86 
   107 
    87 /*****************************************************************************/
   108 /*****************************************************************************/
    88 
   109 
    89 #endif
   110 #endif
       
   111 
       
   112 /* Emacs-Konfiguration
       
   113 ;;; Local Variables: ***
       
   114 ;;; c-basic-offset:4 ***
       
   115 ;;; End: ***
       
   116 */