Rev 741 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 741 | Rev 754 | ||
---|---|---|---|
1 | #ifndef _MM3_H |
1 | #ifndef _MM3_H |
2 | #define _MM3_H |
2 | #define _MM3_H |
3 | 3 | ||
4 | #include <inttypes.h> |
4 | #include <inttypes.h> |
5 | 5 | ||
6 | typedef struct |
6 | typedef struct |
7 | { |
7 | { |
8 | int8_t X_off; |
8 | int8_t X_off; |
9 | int8_t Y_off; |
9 | int8_t Y_off; |
10 | int8_t Z_off; |
10 | int8_t Z_off; |
11 | int16_t X_range; |
11 | int16_t X_range; |
12 | int16_t Y_range; |
12 | int16_t Y_range; |
13 | int16_t Z_range; |
13 | int16_t Z_range; |
14 | } MM3_calib_t; |
14 | } MM3_calib_t; |
15 | 15 | ||
16 | extern MM3_calib_t MM3_calib; |
16 | extern MM3_calib_t MM3_calib; |
17 | 17 | ||
18 | // Initialization of the MM3 communication |
18 | // Initialization of the MM3 communication |
19 | void MM3_Init(void); |
19 | void MM3_Init(void); |
- | 20 | ||
20 | // should be called cyclic to get actual compass reading |
21 | // should be called cyclic to get actual compass reading |
21 | void MM3_Update(void); |
22 | void MM3_Update(void); |
22 | // this function calibrates the MM3 |
23 | // this function calibrates the MM3 |
23 | // and returns immediately if the communication to the MM3-Board is broken. |
24 | // and returns immediately if the communication to the MM3-Board is broken. |
24 | void MM3_Calibrate(void); |
25 | void MM3_Calibrate(void); |
- | 26 | ||
25 | // calculates the current compass heading in a range from 0 to 360 deg. |
27 | // calculates the current compass heading in a range from 0 to 360 deg. |
26 | // returns -1 of no compass data are available |
28 | // returns -1 if no compass data are available |
27 | int16_t MM3_Heading(void); |
29 | int16_t MM3_Heading(void); |
28 | 30 | ||
29 | #endif //_MM3_H |
31 | #endif //_MM3_H |
30 | 32 | ||
31 | 33 |