]> rtime.felk.cvut.cz Git - fpga/rpi-motor-control.git/blobdiff - pmsm-control/test_sw/pmsm_state.h
Function Init_logs moved to right place.
[fpga/rpi-motor-control.git] / pmsm-control / test_sw / pmsm_state.h
index b3a3125e5e8b03543a58431fe4e42a72f52f3be8..583eb73cdc253a1ded565a4ba9a7667d19e83380 100644 (file)
@@ -16,6 +16,8 @@
 struct rpi_in;
 
 struct rpi_state{
+       //const unsigned MAX_DUTY;      /*Max duty*/
+
        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. */
@@ -44,8 +46,31 @@ struct rpi_state{
        int log_col_count;              /* number of log columns */
        int log_col;                    /* current colimn */
        char doLogs;                    /* schall we make logs? */
+
+       void (*main_commutator)(struct rpi_state*);     /* primarni komutator */
+       void (*main_controller)(struct rpi_state*);     /* primarni regulator */
+
+       char error;                     /* detekce chyboveho stavu */
 };
 
-void freeLogs();
+/**
+ * Index OK.
+ */
+inline void setIndexOK(struct rpi_state*);
+
+/**
+ * Index Lost.
+ */
+inline void setIndexLost(struct rpi_state*);
+
+/**
+ * Turn commutation on.
+ */
+inline void setCommutationOn(struct rpi_state*);
+
+/**
+ * Turn commutation off.
+ */
+inline void setCommutationOff(struct rpi_state*);
 
 #endif /*PMSM_STATE*/