]> rtime.felk.cvut.cz Git - fpga/rpi-motor-control.git/blob - pmsm-control/test_sw/rp_spi.h
Setters made inline.
[fpga/rpi-motor-control.git] / pmsm-control / test_sw / rp_spi.h
1 /**
2  * \file rp_spi.h
3  */
4 #ifndef RP_SPI
5 #define RP_SPI
6 #include <stdint.h> /*uint32_t*/
7
8 /**
9  * \brief Struktura pro prichozi data z fpga.
10  */
11 struct rpi_in{
12         signed long int pozice;         /*continue with normal size and test it..*/
13         uint32_t pozice_raw;            /*with offset*/
14         uint32_t ch0, ch1, ch2;
15         int8_t hal1,hal2,hal3;          /* bool values */
16         int8_t en1, en2, en3;           /*(bool)last read pwm-enable values - !they are changed after reading ! */
17         int8_t shdn1,shdn2,shdn3;       /*(bool)last read shutdown values - !they are changed after reading ! */
18         uint16_t adc_m_count;           /*current measurments count*/
19         uint8_t debug_rx[16];
20         uint16_t index_position;        /* raw position of irc_i */
21 };
22
23 struct rpi_state;
24
25 /**
26  * \brief Testovaci funkce.
27  */
28 void transfer(void);
29
30 /**
31  * \brief Inicializace pro spi.
32  */
33 int spi_init(void);
34
35 /**
36  * \brief Uzavreni spi.
37  */
38 void spi_disable(void);
39
40 void spi_read(struct rpi_state*);
41
42 #endif /*RP_SPI*/