]> rtime.felk.cvut.cz Git - fpga/rpi-motor-control.git/blobdiff - pmsm-control/test_sw/pmsm_state.h
State structure moved to separate file. Cmd poll function moved to separate file.
[fpga/rpi-motor-control.git] / 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
new file mode 100644 (file)
index 0000000..5f63acf
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef PMSM_STATE
+#define PMSM_STATE
+
+#include <stdint.h>
+#include <semaphore.h>
+
+
+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 */
+       uint16_t index_dist;            /* distance to index position */
+       unsigned char index_ok;
+       uint32_t tf_count;              /*number of transfer*/
+       int desired_pos;                /* desired position */
+}rps;
+
+#endif /*PMSM_STATE*/