Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
333 | 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 x_axis_last_valid; |
||
12 | signed int y_axis_last_valid; |
||
13 | signed int z_axis_last_valid; |
||
14 | signed int NickGrad; |
||
15 | signed int RollGrad; |
||
16 | }MM3_struct; |
||
17 | |||
18 | extern MM3_struct MM3; |
||
19 | |||
20 | void init_spi(void); |
||
21 | void MM3_timer0(void); |
||
22 | signed int MM3_heading(void); |
||
23 | |||
24 | #define Int2Grad_Faktor 1024 |
||
25 | |||
26 | // Die Werte der Statemachine |
||
27 | #define MM3_RESET 0 |
||
28 | #define MM3_START_TRANSFER 1 |
||
29 | #define MM3_WAIT_DRDY 2 |
||
30 | #define MM3_DRDY 4 |
||
31 | #define MM3_BYTE2 8 |
||
32 | #define MM3_X 16 |
||
33 | #define MM3_Y 32 |
||
34 | #define MM3_Z 64 |
||
35 | #define MM3_TILT 128 |
||
36 | |||
37 | |||
38 | // Die Werte der Kompasskalibrierung |
||
39 | |||
40 | #define MM3_Xmin -806 |
||
41 | #define MM3_Xmax 784 |
||
42 | #define MM3_Ymin -865 |
||
43 | #define MM3_Ymax 925 |
||
44 | #define MM3_Zmin -813 |
||
45 | #define MM3_Zmax 849 |
||
46 | |||
47 | |||
48 | |||
49 | // Die Werte der Kompasskalibrierung |
||
50 | |||
51 | // OFFSET: (Maximaler Wert + minimaler Wert) / 2 |
||
52 | #define OFF_X (MM3_Xmax + MM3_Xmin) /2 //-11 |
||
53 | #define OFF_Y (MM3_Ymax + MM3_Ymin) /2 //30 |
||
54 | #define OFF_Z (MM3_Zmax + MM3_Zmin) /2 //18 |