Rev 241 | Rev 292 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 241 | Rev 242 | ||
---|---|---|---|
1 | #ifndef __MK3MAG_H |
1 | #ifndef __MK3MAG_H |
2 | #define __MK3MAG_H |
2 | #define __MK3MAG_H |
3 | 3 | ||
4 | typedef struct |
4 | typedef struct |
5 | { |
5 | { |
6 | u8 Major; |
6 | u8 Major; |
7 | u8 Minor; |
7 | u8 Minor; |
8 | u8 Patch; |
8 | u8 Patch; |
9 | u8 Compatible; |
9 | u8 Compatible; |
10 | } __attribute__((packed)) MK3MAG_Version_t; |
10 | } __attribute__((packed)) MK3MAG_Version_t; |
11 | 11 | ||
12 | typedef struct |
12 | typedef struct |
13 | { |
13 | { |
14 | s16 X; |
- | |
15 | s16 Y; |
- | |
16 | s16 Z; |
- | |
17 | } __attribute__((packed)) MK3MAG_MagVector_t; |
- | |
18 | - | ||
19 | typedef struct |
- | |
20 | { |
- | |
21 | s16 Nick; |
- | |
22 | s16 Roll; |
- | |
23 | } __attribute__((packed)) MK3MAG_WriteAttitude_t; |
- | |
24 | - | ||
25 | typedef struct |
- | |
26 | { |
- | |
27 | u8 CalByte; |
14 | u8 CalByte; |
28 | u8 Dummy1; |
15 | u8 Dummy1; |
29 | u8 Dummy2; |
16 | u8 Dummy2; |
30 | } __attribute__((packed)) MK3MAG_Cal_t; |
17 | } __attribute__((packed)) MK3MAG_Cal_t; |
31 | - | ||
32 | typedef struct |
- | |
33 | { |
- | |
34 | s16 Heading; |
18 | |
35 | } __attribute__((packed)) MK3MAG_Heading_t; |
- | |
36 | 19 | extern volatile MK3MAG_Version_t MK3MAG_Version; |
|
37 | 20 | ||
38 | #define MK3MAG_CMD_VERSION 0x01 |
21 | #define MK3MAG_CMD_VERSION 0x01 |
39 | #define MK3MAG_CMD_READ_MAGVECT 0x02 |
22 | #define MK3MAG_CMD_READ_MAGVECT 0x02 |
40 | #define MK3MAG_CMD_READ_HEADING 0x03 |
23 | #define MK3MAG_CMD_READ_HEADING 0x03 |
41 | #define MK3MAG_CMD_WRITE_CAL 0x04 |
24 | #define MK3MAG_CMD_WRITE_CAL 0x04 |
42 | - | ||
43 | extern volatile MK3MAG_Heading_t MK3MAG_Heading; |
- | |
44 | extern volatile MK3MAG_MagVector_t MK3MAG_MagVector; |
- | |
45 | extern volatile MK3MAG_Version_t MK3MAG_Version; |
- | |
46 | 25 | ||
47 | void MK3MAG_Init(void); |
26 | u8 MK3MAG_Init(void); |
48 | void MK3MAG_SendCommand(u8 command); |
- | |
49 | void MK3MAG_GetVersion(void); |
27 | void MK3MAG_SendCommand(u8 command); |
50 | void MK3MAG_UpdateCompass(void); |
28 | void MK3MAG_UpdateCompass(void); |
51 | 29 | ||
52 | #endif // MK3MAG_H |
30 | #endif // __MK3MAG_H |
53 | 31 |