]> rtime.felk.cvut.cz Git - fpga/rpi-motor-control.git/blobdiff - pmsm-control/test_sw/pmsm_state.h
Controll loop now more complex.
[fpga/rpi-motor-control.git] / pmsm-control / test_sw / pmsm_state.h
index 7c631f1c22e42d13dc454ec1014b9ccf0b2d2b6c..b50b25010aeb1edbbd46ba520b96904f48928482 100644 (file)
@@ -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*/