master/sync.h
changeset 879 9b395c5646ab
parent 873 ec01ba291896
child 883 4963e22a267a
equal deleted inserted replaced
878:40c379697ebf 879:9b395c5646ab
    43 #include <linux/list.h>
    43 #include <linux/list.h>
    44 
    44 
    45 #include "../include/ecrt.h"
    45 #include "../include/ecrt.h"
    46 
    46 
    47 #include "globals.h"
    47 #include "globals.h"
    48 #include "pdo_mapping.h"
    48 #include "pdo_list.h"
    49 
    49 
    50 /*****************************************************************************/
    50 /*****************************************************************************/
    51 
    51 
    52 /** EtherCAT sync manager Pdo mapping information source.
    52 /** EtherCAT Pdo assignment source.
    53  */
    53  */
    54 typedef enum {
    54 typedef enum {
    55     EC_SYNC_MAPPING_NONE, /**< No Pdo mapping information. */
    55     EC_ASSIGN_NONE, /**< No Pdos assigned. */
    56     EC_SYNC_MAPPING_SII, /**< Pdo mapping information from SII. */
    56     EC_ASSIGN_SII, /**< Pdo assignment read from SII. */
    57     EC_SYNC_MAPPING_COE, /**< Pdo mapping information from CoE dictionary. */
    57     EC_ASSIGN_COE, /**< Pdo assignment read via CoE. */
    58     EC_SYNC_MAPPING_CUSTOM, /**< Pdo mapping configured externally. */
    58     EC_ASSIGN_CUSTOM, /**< Pdos assignment set by application. */
    59 } ec_sync_mapping_source_t;
    59 } ec_assign_source_t;
    60 
    60 
    61 /*****************************************************************************/
    61 /*****************************************************************************/
    62 
    62 
    63 /** Sync manager.
    63 /** Sync manager.
    64  */
    64  */
    67     unsigned int index; /**< Sync manager index. */
    67     unsigned int index; /**< Sync manager index. */
    68     uint16_t physical_start_address; /**< Physical start address. */
    68     uint16_t physical_start_address; /**< Physical start address. */
    69     uint16_t length; /**< Data length in bytes. */
    69     uint16_t length; /**< Data length in bytes. */
    70     uint8_t control_register; /**< Control register value. */
    70     uint8_t control_register; /**< Control register value. */
    71     uint8_t enable; /**< Enable bit. */
    71     uint8_t enable; /**< Enable bit. */
    72     ec_pdo_mapping_t mapping; /**< Current Pdo mapping. */
    72     ec_pdo_list_t pdos; /**< Current Pdo assignment. */
    73     ec_sync_mapping_source_t mapping_source; /**< Pdo mapping source. */
    73     ec_assign_source_t assign_source; /**< Pdo assignment source. */
    74 } ec_sync_t;
    74 } ec_sync_t;
    75 
    75 
    76 /*****************************************************************************/
    76 /*****************************************************************************/
    77 
    77 
    78 void ec_sync_init(ec_sync_t *, ec_slave_t *, unsigned int);
    78 void ec_sync_init(ec_sync_t *, ec_slave_t *, unsigned int);