Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
716 | Nick666 | 1 | |
2 | |||
3 | struct MM3_working_struct |
||
4 | { |
||
5 | uint8_t STATE; |
||
6 | uint8_t AXIS; |
||
728 | Nick666 | 7 | uint16_t DRDY; |
8 | int16_t x_axis; |
||
9 | int16_t y_axis; |
||
10 | int16_t z_axis; |
||
716 | Nick666 | 11 | }; |
12 | |||
13 | |||
14 | struct MM3_calib_struct |
||
15 | { |
||
16 | int8_t X_off; |
||
17 | int8_t Y_off; |
||
18 | int8_t Z_off; |
||
19 | int16_t X_range; |
||
20 | int16_t Y_range; |
||
21 | int16_t Z_range; |
||
22 | }; |
||
23 | |||
24 | extern struct MM3_working_struct MM3; |
||
25 | extern struct MM3_calib_struct MM3_calib; |
||
26 | |||
27 | void init_MM3(void); |
||
28 | void timer0_MM3(void); |
||
29 | void calib_MM3(void); |
||
30 | int heading_MM3(void); |
||
31 | |||
728 | Nick666 | 32 | // MM3-Konfiguration |
33 | #define MM3_X_AXIS 0x01 |
||
34 | #define MM3_Y_AXIS 0x02 |
||
35 | #define MM3_Z_AXIS 0x03 |
||
36 | |||
37 | #define MM3_PERIOD_32 0x00 |
||
38 | #define MM3_PERIOD_64 0x10 |
||
39 | #define MM3_PERIOD_128 0x20 |
||
40 | #define MM3_PERIOD_256 0x30 |
||
41 | #define MM3_PERIOD_512 0x40 |
||
42 | #define MM3_PERIOD_1024 0x50 |
||
43 | #define MM3_PERIOD_2048 0x60 |
||
44 | #define MM3_PERIOD_4096 0x70 |
||
45 | |||
46 | // Spikes Filtern |
||
716 | Nick666 | 47 | #define Max_Axis_Value 500 |
48 | |||
49 | // Die Werte der Statemachine |
||
50 | #define MM3_RESET 0 |
||
51 | #define MM3_START_TRANSFER 1 |
||
52 | #define MM3_WAIT_DRDY 2 |
||
53 | #define MM3_DRDY 3 |
||
54 | #define MM3_BYTE2 4 |
||
55 | #define MM3_X 5 |
||
56 | #define MM3_Y 6 |
||
57 | #define MM3_Z 7 |
||
58 | #define MM3_TILT 8 |
||
59 | #define MM3_IDLE 9 |