Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
205 | Nick666 | 1 | |
2 | |||
3 | typedef struct |
||
4 | { |
||
5 | unsigned char STATE; |
||
6 | unsigned int DRDY; |
||
7 | unsigned char AXIS; |
||
8 | signed int x_axis; |
||
9 | signed int y_axis; |
||
10 | signed int z_axis; |
||
11 | }MM3_struct; |
||
12 | |||
13 | extern MM3_struct MM3; |
||
14 | |||
15 | void init_spi(void); |
||
16 | void MM3_timer0(void); |
||
17 | |||
18 | #define MM3_RESET 0 |
||
19 | #define MM3_START_TRANSFER 1 |
||
20 | #define MM3_WAIT_DRDY 2 |
||
21 | #define MM3_DRDY 3 |
||
22 | #define MM3_X_BYTE2 4 |
||
23 | #define MM3_Y_BYTE2 5 |
||
24 | #define MM3_Z_BYTE2 6 |
||
25 | #define MM3_X 7 |
||
26 | #define MM3_Y 8 |
||
27 | #define MM3_Z 9 |
||
28 | #define MM3_IDLE 255 |
||
29 | |||
30 | #define PS2 6 |
||
31 | #define PS1 5 |
||
32 | #define PS0 5 |
||
33 | #define AS1 1 |
||
34 | #define AS0 0 |