Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
308 | osiair | 1 | |
2 | |||
3 | typedef struct |
||
4 | { |
||
5 | uint8_t STATE; |
||
6 | unsigned int DRDY; |
||
7 | uint8_t AXIS; |
||
8 | signed int x_axis; |
||
9 | signed int y_axis; |
||
10 | signed int z_axis; |
||
11 | signed int NickGrad; |
||
12 | signed int RollGrad; |
||
13 | }MM3_struct; |
||
14 | |||
15 | extern MM3_struct MM3; |
||
16 | |||
17 | void init_spi(void); |
||
18 | void MM3_timer0(void); |
||
19 | signed int MM3_heading(void); |
||
20 | |||
21 | #define Int2Grad_Faktor 1024 |
||
22 | |||
23 | // Die Werte der Statemachine |
||
24 | #define MM3_RESET 0 |
||
25 | #define MM3_START_TRANSFER 1 |
||
26 | #define MM3_WAIT_DRDY 2 |
||
27 | #define MM3_DRDY 4 |
||
28 | #define MM3_BYTE2 8 |
||
29 | #define MM3_X 16 |
||
30 | #define MM3_Y 32 |
||
31 | #define MM3_Z 64 |
||
32 | #define MM3_TILT 128 |
||
33 | |||
34 | |||
35 | // Die Werte der Kompasskalibrierung |
||
36 | |||
37 | // OFFSET: (Maximaler Wert + minimaler Wert) / 2 |
||
38 | #define OFF_X -11 |
||
39 | #define OFF_Y 30 |
||
40 | #define OFF_Z 18 |
||
41 |