62 |
67 |
63 void (*master_state)(ec_fsm_t *); /**< master state function */ |
68 void (*master_state)(ec_fsm_t *); /**< master state function */ |
64 unsigned int master_slaves_responding; /**< number of responding slaves */ |
69 unsigned int master_slaves_responding; /**< number of responding slaves */ |
65 ec_slave_state_t master_slave_states; /**< states of responding slaves */ |
70 ec_slave_state_t master_slave_states; /**< states of responding slaves */ |
66 unsigned int master_validation; /**< non-zero, if validation to do */ |
71 unsigned int master_validation; /**< non-zero, if validation to do */ |
|
72 uint16_t sii_offset; /**< current offset for SII access */ |
|
73 ec_sdo_request_t *sdo_request; |
67 |
74 |
68 void (*slave_state)(ec_fsm_t *); /**< slave state function */ |
75 void (*slave_state)(ec_fsm_t *); /**< slave state function */ |
|
76 ec_sdo_data_t *sdodata; /**< SDO configuration data */ |
69 |
77 |
70 void (*sii_state)(ec_fsm_t *); /**< SII state function */ |
78 ec_fsm_sii_t fsm_sii; /**< SII state machine */ |
71 uint16_t sii_offset; /**< input: offset in SII */ |
79 ec_fsm_change_t fsm_change; /**< State change state machine */ |
72 unsigned int sii_mode; /**< SII reading done by APRD (0) or NPRD (1) */ |
80 ec_fsm_coe_t fsm_coe; /**< CoE state machine */ |
73 uint8_t sii_value[4]; /**< raw SII value (32bit) */ |
|
74 cycles_t sii_start; /**< sii start */ |
|
75 |
|
76 void (*change_state)(ec_fsm_t *); /**< slave state change state function */ |
|
77 ec_slave_state_t change_new; /**< input: new state */ |
|
78 unsigned long change_jiffies; /**< change timer */ |
|
79 |
|
80 void (*coe_state)(ec_fsm_t *); /**< CoE state function */ |
|
81 ec_sdo_data_t *sdodata; /**< input/output: SDO data object */ |
|
82 cycles_t coe_start; /**< CoE timestamp */ |
|
83 }; |
81 }; |
84 |
82 |
85 /*****************************************************************************/ |
83 /*****************************************************************************/ |
86 |
84 |
87 int ec_fsm_init(ec_fsm_t *, ec_master_t *); |
85 int ec_fsm_init(ec_fsm_t *, ec_master_t *); |
88 void ec_fsm_clear(ec_fsm_t *); |
86 void ec_fsm_clear(ec_fsm_t *); |
89 void ec_fsm_reset(ec_fsm_t *); |
|
90 void ec_fsm_execute(ec_fsm_t *); |
|
91 |
87 |
92 void ec_fsm_startup(ec_fsm_t *); |
88 int ec_fsm_exec(ec_fsm_t *); |
93 int ec_fsm_startup_running(ec_fsm_t *); |
89 int ec_fsm_running(ec_fsm_t *); |
94 int ec_fsm_startup_success(ec_fsm_t *); |
90 int ec_fsm_success(ec_fsm_t *); |
95 |
91 |
96 void ec_fsm_configuration(ec_fsm_t *); |
92 // TODO: layout slave state machines |
97 int ec_fsm_configuration_running(ec_fsm_t *); |
93 void ec_fsm_slaveconf_state_start(ec_fsm_t *); |
98 int ec_fsm_configuration_success(ec_fsm_t *); |
94 void ec_fsm_slave_state_end(ec_fsm_t *); |
|
95 void ec_fsm_slave_state_error(ec_fsm_t *); |
99 |
96 |
100 /*****************************************************************************/ |
97 /*****************************************************************************/ |
101 |
98 |
102 #endif |
99 #endif |