Rev 330 | Rev 340 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 330 | Rev 338 | ||
---|---|---|---|
1 | #ifndef _COMPASS_H |
1 | #ifndef _COMPASS_H |
2 | #define _COMPASS_H |
2 | #define _COMPASS_H |
3 | 3 | ||
4 | typedef struct |
4 | typedef struct |
5 | { |
5 | { |
6 | s16 X; |
6 | s16 X; |
7 | s16 Y; |
7 | s16 Y; |
8 | s16 Z; |
8 | s16 Z; |
9 | } __attribute__((packed)) s16vec_t; |
9 | } __attribute__((packed)) s16vec_t; |
10 | 10 | ||
11 | extern volatile s16vec_t MagVector; // current magnetic field vector |
11 | extern volatile s16vec_t MagVector; // current magnetic field vector |
12 | extern volatile s16 Compass_Heading; // current heading direction |
12 | extern volatile s16 Compass_Heading; // current heading direction |
13 | extern volatile u8 Compass_CalState; // current calibration state |
13 | extern volatile u8 Compass_CalState; // current calibration state |
14 | extern s32 EarthMagneticField; |
14 | extern s32 EarthMagneticField; |
15 | extern s32 EarthMagneticInclination; |
15 | extern s32 EarthMagneticInclination; |
- | 16 | extern s32 EarthMagneticInclinationTheoretic; |
|
16 | extern s32 EarthMagneticFieldFiltered; |
17 | extern s32 EarthMagneticFieldFiltered; |
17 | extern u8 ErrorDisturbedEarthMagnetField; |
18 | extern u8 ErrorDisturbedEarthMagnetField; |
18 | extern s16 Hx, Hy; |
19 | extern s16 Hx, Hy; |
19 | 20 | ||
20 | #define COMPASS_NONE 0 |
21 | #define COMPASS_NONE 0 |
21 | #define COMPASS_MK3MAG 1 |
22 | #define COMPASS_MK3MAG 1 |
22 | #define COMPASS_NCMAG 2 |
23 | #define COMPASS_NCMAG 2 |
23 | extern u8 Compass_Device; |
24 | extern u8 Compass_Device; |
24 | 25 | ||
25 | void Compass_Init(void); |
26 | void Compass_Init(void); |
26 | void Compass_Update(void); |
27 | void Compass_Update(void); |
27 | void Compass_CalcHeading(void); |
28 | void Compass_CalcHeading(void); |
28 | void Compass_SetCalState(u8 CalState); |
29 | void Compass_SetCalState(u8 CalState); |
29 | void Compass_UpdateCalState(void); |
30 | void Compass_UpdateCalState(void); |
30 | 31 | ||
31 | #endif // _COMPASS_H |
32 | #endif // _COMPASS_H |
32 | 33 |