master/fsm.h
changeset 260 5fe7df7f2433
parent 251 c1d0b63a9302
child 266 0234b0c26c52
equal deleted inserted replaced
259:87b20532872b 260:5fe7df7f2433
    62     ec_command_t command; /**< command used in the state machine */
    62     ec_command_t command; /**< command used in the state machine */
    63 
    63 
    64     void (*master_state)(ec_fsm_t *); /**< master state function */
    64     void (*master_state)(ec_fsm_t *); /**< master state function */
    65     unsigned int master_slaves_responding; /**< number of responding slaves */
    65     unsigned int master_slaves_responding; /**< number of responding slaves */
    66     ec_slave_state_t master_slave_states; /**< states of responding slaves */
    66     ec_slave_state_t master_slave_states; /**< states of responding slaves */
       
    67     unsigned int master_validation; /**< non-zero, if validation to do */
    67 
    68 
    68     void (*slave_state)(ec_fsm_t *); /**< slave state function */
    69     void (*slave_state)(ec_fsm_t *); /**< slave state function */
    69     uint8_t slave_sii_num; /**< SII value iteration counter */
    70     uint8_t slave_sii_num; /**< SII value iteration counter */
    70     uint8_t *slave_cat_data; /**< temporary memory for category data */
    71     uint8_t *slave_cat_data; /**< temporary memory for category data */
    71     uint16_t slave_cat_offset; /**< current category word offset in EEPROM */
    72     uint16_t slave_cat_offset; /**< current category word offset in EEPROM */
    73     uint16_t slave_cat_type; /**< type of current category */
    74     uint16_t slave_cat_type; /**< type of current category */
    74     uint16_t slave_cat_words; /**< number of words of current category */
    75     uint16_t slave_cat_words; /**< number of words of current category */
    75 
    76 
    76     void (*sii_state)(ec_fsm_t *); /**< SII state function */
    77     void (*sii_state)(ec_fsm_t *); /**< SII state function */
    77     uint16_t sii_offset; /**< input: offset in SII */
    78     uint16_t sii_offset; /**< input: offset in SII */
       
    79     unsigned int sii_mode; /**< SII reading done by APRD (0) or NPRD (1) */
    78     uint32_t sii_result; /**< output: read SII value (32bit) */
    80     uint32_t sii_result; /**< output: read SII value (32bit) */
       
    81     cycles_t sii_start; /**< sii start */
    79 
    82 
    80     void (*change_state)(ec_fsm_t *); /**< slave state change state function */
    83     void (*change_state)(ec_fsm_t *); /**< slave state change state function */
    81     uint8_t change_new; /**< input: new state */
    84     uint8_t change_new; /**< input: new state */
       
    85     cycles_t change_start; /**< change start */
    82 };
    86 };
    83 
    87 
    84 /*****************************************************************************/
    88 /*****************************************************************************/
    85 
    89 
    86 int ec_fsm_init(ec_fsm_t *, ec_master_t *);
    90 int ec_fsm_init(ec_fsm_t *, ec_master_t *);