]> 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 5f63acff8f958a678f4f8e069544edd3c39774ea..b50b25010aeb1edbbd46ba520b96904f48928482 100644 (file)
@@ -4,18 +4,27 @@
 #include <stdint.h>
 #include <semaphore.h>
 
+struct rpi_in;
 
 struct rpi_state{
-       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 */
-}rps;
+       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*/