master/slave_config.h
changeset 995 54149a703c47
parent 990 4f223f3df05a
child 1009 6012e1414bec
equal deleted inserted replaced
994:e29edcced328 995:54149a703c47
    40 
    40 
    41 #ifndef __EC_SLAVE_CONFIG_H__
    41 #ifndef __EC_SLAVE_CONFIG_H__
    42 #define __EC_SLAVE_CONFIG_H__
    42 #define __EC_SLAVE_CONFIG_H__
    43 
    43 
    44 #include <linux/list.h>
    44 #include <linux/list.h>
    45 #include <linux/kobject.h>
       
    46 
    45 
    47 #include "../include/ecrt.h"
    46 #include "../include/ecrt.h"
    48 
    47 
    49 #include "globals.h"
    48 #include "globals.h"
    50 #include "slave.h"
    49 #include "slave.h"
    55 
    54 
    56 /** EtherCAT slave configuration.
    55 /** EtherCAT slave configuration.
    57  */
    56  */
    58 struct ec_slave_config {
    57 struct ec_slave_config {
    59     struct list_head list; /**< List item. */
    58     struct list_head list; /**< List item. */
    60     struct kobject kobj; /**< kobject. */
       
    61     ec_master_t *master; /**< Master owning the slave configuration. */
    59     ec_master_t *master; /**< Master owning the slave configuration. */
    62 
    60 
    63     uint16_t alias; /**< Slave alias. */
    61     uint16_t alias; /**< Slave alias. */
    64     uint16_t position; /**< Index after alias. If alias is zero, this is the
    62     uint16_t position; /**< Index after alias. If alias is zero, this is the
    65                          ring position. */
    63                          ring position. */
    78     uint8_t used_fmmus; /**< Number of FMMUs used. */
    76     uint8_t used_fmmus; /**< Number of FMMUs used. */
    79 };
    77 };
    80 
    78 
    81 /*****************************************************************************/
    79 /*****************************************************************************/
    82 
    80 
    83 int ec_slave_config_init(ec_slave_config_t *, ec_master_t *, uint16_t,
    81 void ec_slave_config_init(ec_slave_config_t *, ec_master_t *, uint16_t,
    84         uint16_t, uint32_t, uint32_t);
    82         uint16_t, uint32_t, uint32_t);
    85 void ec_slave_config_destroy(ec_slave_config_t *);
    83 void ec_slave_config_clear(ec_slave_config_t *);
    86 
    84 
    87 int ec_slave_config_attach(ec_slave_config_t *);
    85 int ec_slave_config_attach(ec_slave_config_t *);
    88 void ec_slave_config_detach(ec_slave_config_t *);
    86 void ec_slave_config_detach(ec_slave_config_t *);
    89 
    87 
    90 void ec_slave_config_load_default_assignment(ec_slave_config_t *);
    88 void ec_slave_config_load_default_assignment(ec_slave_config_t *);