master/fsm.h
changeset 433 100f51f28cf2
parent 430 74754f45d5fa
child 434 0180d8277311
equal deleted inserted replaced
432:5e883e0ef95f 433:100f51f28cf2
    45 #include "../include/ecrt.h"
    45 #include "../include/ecrt.h"
    46 #include "datagram.h"
    46 #include "datagram.h"
    47 #include "slave.h"
    47 #include "slave.h"
    48 #include "canopen.h"
    48 #include "canopen.h"
    49 
    49 
       
    50 #include "fsm_sii.h"
       
    51 
    50 /*****************************************************************************/
    52 /*****************************************************************************/
    51 
    53 
    52 typedef struct ec_fsm ec_fsm_t; /**< \see ec_fsm */
    54 typedef struct ec_fsm ec_fsm_t; /**< \see ec_fsm */
    53 
    55 
    54 /**
    56 /**
    63 
    65 
    64     void (*master_state)(ec_fsm_t *); /**< master state function */
    66     void (*master_state)(ec_fsm_t *); /**< master state function */
    65     unsigned int master_slaves_responding; /**< number of responding slaves */
    67     unsigned int master_slaves_responding; /**< number of responding slaves */
    66     ec_slave_state_t master_slave_states; /**< states of responding slaves */
    68     ec_slave_state_t master_slave_states; /**< states of responding slaves */
    67     unsigned int master_validation; /**< non-zero, if validation to do */
    69     unsigned int master_validation; /**< non-zero, if validation to do */
       
    70     uint16_t sii_offset; /**< current offset for SII access */
    68 
    71 
    69     void (*slave_state)(ec_fsm_t *); /**< slave state function */
    72     void (*slave_state)(ec_fsm_t *); /**< slave state function */
    70 
    73 
    71     void (*sii_state)(ec_fsm_t *); /**< SII state function */
    74     ec_fsm_sii_t fsm_sii; /**< SII state machine */
    72     uint16_t sii_offset; /**< input: offset in SII */
       
    73     unsigned int sii_mode; /**< SII reading done by APRD (0) or NPRD (1) */
       
    74     uint8_t sii_value[4]; /**< raw SII value (32bit) */
       
    75     cycles_t sii_start; /**< sii start */
       
    76     uint8_t sii_check_once_more; /**< one more try after timeout */
       
    77 
    75 
    78     void (*change_state)(ec_fsm_t *); /**< slave state change state function */
    76     void (*change_state)(ec_fsm_t *); /**< slave state change state function */
    79     ec_slave_state_t change_new; /**< input: new state */
    77     ec_slave_state_t change_new; /**< input: new state */
    80     unsigned long change_jiffies; /**< change timer */
    78     unsigned long change_jiffies; /**< change timer */
    81     uint8_t change_take_time; /**< take sending timestamp */
    79     uint8_t change_take_time; /**< take sending timestamp */