master/fsm_soe.h
changeset 2066 b544025bd696
parent 2045 ff2a13a4603c
child 2589 2b9c78543663
equal deleted inserted replaced
2065:4d8c9a441ef6 2066:b544025bd696
    48 
    48 
    49 /** Finite state machines for the Sercos over EtherCAT protocol.
    49 /** Finite state machines for the Sercos over EtherCAT protocol.
    50  */
    50  */
    51 struct ec_fsm_soe {
    51 struct ec_fsm_soe {
    52     ec_slave_t *slave; /**< slave the FSM runs on */
    52     ec_slave_t *slave; /**< slave the FSM runs on */
    53     ec_datagram_t *datagram; /**< datagram used in the state machine */
    53     ec_mailbox_t *mbox; /**< mailbox used in the state machine */
    54     unsigned int retries; /**< retries upon datagram timeout */
    54     unsigned int retries; /**< retries upon datagram timeout */
    55 
    55 
    56     void (*state)(ec_fsm_soe_t *); /**< CoE state function */
    56     void (*state)(ec_fsm_soe_t *); /**< CoE state function */
    57     unsigned long jiffies_start; /**< CoE timestamp. */
    57     unsigned long jiffies_start; /**< CoE timestamp. */
    58     ec_soe_request_t *request; /**< SoE request */
    58     ec_soe_request_t *request; /**< SoE request */
    59     off_t offset; /**< IDN data offset during fragmented write. */
    59     off_t offset; /**< IDN data offset during fragmented write. */
    60 };
    60 };
    61 
    61 
    62 /*****************************************************************************/
    62 /*****************************************************************************/
    63 
    63 
    64 void ec_fsm_soe_init(ec_fsm_soe_t *, ec_datagram_t *);
    64 void ec_fsm_soe_init(ec_fsm_soe_t *, ec_mailbox_t *);
    65 void ec_fsm_soe_clear(ec_fsm_soe_t *);
    65 void ec_fsm_soe_clear(ec_fsm_soe_t *);
    66 
    66 
    67 void ec_fsm_soe_transfer(ec_fsm_soe_t *, ec_slave_t *, ec_soe_request_t *);
    67 void ec_fsm_soe_transfer(ec_fsm_soe_t *, ec_slave_t *, ec_soe_request_t *);
    68 
    68 
    69 int ec_fsm_soe_exec(ec_fsm_soe_t *);
    69 int ec_fsm_soe_exec(ec_fsm_soe_t *);