47 #include "datagram.h" |
47 #include "datagram.h" |
48 #include "slave.h" |
48 #include "slave.h" |
49 #include "fsm_sii.h" |
49 #include "fsm_sii.h" |
50 #include "fsm_change.h" |
50 #include "fsm_change.h" |
51 #include "fsm_coe.h" |
51 #include "fsm_coe.h" |
|
52 #include "fsm_coe_map.h" |
52 #include "fsm_pdo_mapping.h" |
53 #include "fsm_pdo_mapping.h" |
53 #include "fsm_pdo_config.h" |
54 #include "fsm_pdo_config.h" |
54 |
55 |
55 /*****************************************************************************/ |
56 /*****************************************************************************/ |
56 |
57 |
61 */ |
62 */ |
62 struct ec_fsm_slave_scan |
63 struct ec_fsm_slave_scan |
63 { |
64 { |
64 ec_slave_t *slave; /**< Slave the FSM runs on. */ |
65 ec_slave_t *slave; /**< Slave the FSM runs on. */ |
65 ec_datagram_t *datagram; /**< Datagram used in the state machine. */ |
66 ec_datagram_t *datagram; /**< Datagram used in the state machine. */ |
|
67 ec_fsm_slave_config_t *fsm_slave_config; /**< Slave configuration state |
|
68 machine to use. */ |
|
69 ec_fsm_coe_map_t *fsm_coe_map; /**< Pdo mapping state machine to use. */ |
66 unsigned int retries; /**< Retries on datagram timeout. */ |
70 unsigned int retries; /**< Retries on datagram timeout. */ |
67 |
71 |
68 void (*state)(ec_fsm_slave_scan_t *); /**< State function. */ |
72 void (*state)(ec_fsm_slave_scan_t *); /**< State function. */ |
69 uint16_t sii_offset; /**< SII offset in words. */ |
73 uint16_t sii_offset; /**< SII offset in words. */ |
70 |
74 |
71 ec_fsm_sii_t fsm_sii; /**< SII state machine. */ |
75 ec_fsm_sii_t fsm_sii; /**< SII state machine. */ |
72 }; |
76 }; |
73 |
77 |
74 /*****************************************************************************/ |
78 /*****************************************************************************/ |
75 |
79 |
76 void ec_fsm_slave_scan_init(ec_fsm_slave_scan_t *, ec_datagram_t *); |
80 void ec_fsm_slave_scan_init(ec_fsm_slave_scan_t *, ec_datagram_t *, |
|
81 ec_fsm_slave_config_t *, ec_fsm_coe_map_t *); |
77 void ec_fsm_slave_scan_clear(ec_fsm_slave_scan_t *); |
82 void ec_fsm_slave_scan_clear(ec_fsm_slave_scan_t *); |
78 |
83 |
79 void ec_fsm_slave_scan_start(ec_fsm_slave_scan_t *, ec_slave_t *); |
84 void ec_fsm_slave_scan_start(ec_fsm_slave_scan_t *, ec_slave_t *); |
80 |
85 |
81 int ec_fsm_slave_scan_exec(ec_fsm_slave_scan_t *); |
86 int ec_fsm_slave_scan_exec(ec_fsm_slave_scan_t *); |