9 #define MAX_SPEED (7*OLD_POS_NUM)
12 #define LOG_DEF_COL 8000
19 struct rpi_in* spi_dat; /* spi data */
20 sem_t thd_par_sem; /* data metual exlusion access */
21 uint8_t test; /* configuratin byte - pwm enabl. bits etc. */
22 uint32_t tf_count; /* number of transfer*/
24 uint16_t index_dist; /* distance to index position */
25 unsigned char index_ok; /* we have actual index position */
27 uint16_t pwm1, pwm2, pwm3; /* pwm duty cycles*/
28 uint16_t t_pwm1, t_pwm2, t_pwm3;/* debug*/
30 int duty; /* duty cycle of pwm */
31 int desired_pos; /* desired position */
32 int old_pos[OLD_POS_NUM]; /* old positions */
33 int desired_spd; /* desired speed */
36 char commutate; /* zapina prepocet duty na jednotlive pwm */
37 char pos_reg_ena; /* position regulation enable */
38 char spd_reg_ena; /* speed rugulation enable */
40 int spd_err_sum; /* for speed pid regulator */
42 int *logs[LOG_ROWS]; /* logs */
43 int log_col_count; /* number of log columns */
44 int log_col; /* current colimn */
45 char doLogs; /* schall we make logs? */