X-Git-Url: https://rtime.felk.cvut.cz/gitweb/fpga/rpi-motor-control.git/blobdiff_plain/25e4be86876f738bf5ceae5764a1d0fe42272aef..1a8d767b097d1536b264d8bae3e9d5c16617f835:/pmsm-control/test_sw/pmsm_state.h diff --git a/pmsm-control/test_sw/pmsm_state.h b/pmsm-control/test_sw/pmsm_state.h index 7c631f1..b50b250 100644 --- a/pmsm-control/test_sw/pmsm_state.h +++ b/pmsm-control/test_sw/pmsm_state.h @@ -7,17 +7,24 @@ struct rpi_in; struct rpi_state{ - struct rpi_in* spi_dat; - sem_t thd_par_sem; - uint8_t test; - uint16_t pwm1, pwm2, pwm3; - uint16_t t_pwm1, t_pwm2, t_pwm3; - char commutate; - int duty; /* duty cycle of pwm */ + struct rpi_in* spi_dat; /* spi data */ + sem_t thd_par_sem; /* data metual exlusion access */ + uint8_t test; /* configuratin byte - pwm enabl. bits etc. */ + uint32_t tf_count; /* number of transfer*/ + uint16_t index_dist; /* distance to index position */ - unsigned char index_ok; - uint32_t tf_count; /*number of transfer*/ + unsigned char index_ok; /* we have actual index position */ + + uint16_t pwm1, pwm2, pwm3; /* pwm duty cycles*/ + uint16_t t_pwm1, t_pwm2, t_pwm3;/* debug*/ + + int duty; /* duty cycle of pwm */ int desired_pos; /* desired position */ + int desired_spd; /* desired speed */ + + char commutate; /* zapina prepocet duty na jednotlive pwm */ + char pos_reg_ena; /* position regulation enable */ + char spd_reg_ena; /* speed rugulation enable */ }; #endif /*PMSM_STATE*/