Rev 449 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 449 | Rev 450 | ||
---|---|---|---|
1 | #ifndef COPTER_H |
1 | #ifndef COPTER_H |
2 | #define COPTER_H |
2 | #define COPTER_H |
3 | 3 | ||
4 | /** |
4 | /** |
5 | * This file contains informations and configurations from the Mikrokopter |
5 | * This file contains informations and configurations from the Mikrokopter |
6 | */ |
6 | */ |
7 | 7 | ||
8 | #define MAX_DATA_SIZE 150 |
8 | #define MAX_DATA_SIZE 150 |
9 | 9 | ||
10 | // version information for the serial connection |
10 | // version information for the serial connection |
11 | #define VERSION_SERIAL_MAJOR 10 |
11 | #define VERSION_SERIAL_MAJOR 10 |
12 | #define VERSION_SERIAL_MINOR 0 |
12 | #define VERSION_SERIAL_MINOR 0 |
13 | 13 | ||
14 | // Basis-Adresses for different hardware components |
14 | // Basis-Adresses for different hardware components |
15 | #define ADDRESS_ALL 0 |
15 | #define ADDRESS_ALL 0 |
16 | #define ADDRESS_FC 1 |
16 | #define ADDRESS_FC 1 |
17 | #define ADDRESS_NC 2 |
17 | #define ADDRESS_NC 2 |
18 | #define ADDRESS_MK3MAG 3 |
18 | #define ADDRESS_MK3MAG 3 |
19 | 19 | ||
20 | //maximum amount of motors |
20 | //maximum amount of motors |
21 | #define MAX_MOTORS 12 |
21 | #define MAX_MOTORS 12 |
22 | 22 | ||
23 | // settings ID |
23 | // settings ID |
24 | #define SETTINGS_ID 2 |
24 | #define SETTINGS_ID 2 |
- | 25 | ||
- | 26 | //TODO: use enum? |
|
- | 27 | /* |
|
- | 28 | enum HardwareType { |
|
- | 29 | Default, |
|
- | 30 | FlightCtrl, |
|
- | 31 | NaviCtrl, |
|
- | 32 | MK3Mag |
|
- | 33 | }; |
|
25 | 34 | */ |
|
26 | static const char * HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"}; |
35 | static const char * HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"}; |
27 | 36 | ||
28 | static const int MaxTickerEvents = 5; |
37 | static const int MaxTickerEvents = 5; |
29 | 38 | ||
30 | static const int MaxAnalog = 32; |
39 | static const int MaxAnalog = 32; |
31 | static const int MaxPlot = 50000; |
40 | static const int MaxPlot = 50000; |
32 | 41 | ||
33 | static const int MaxNaviPos = 2000; |
42 | static const int MaxNaviPos = 2000; |
34 | 43 | ||
35 | struct sMotorData |
44 | struct sMotorData |
36 | { |
45 | { |
37 | int mixer_gas[MAX_MOTORS]; |
46 | int mixer_gas[MAX_MOTORS]; |
38 | int mixer_nick[MAX_MOTORS]; |
47 | int mixer_nick[MAX_MOTORS]; |
39 | int mixer_roll[MAX_MOTORS]; |
48 | int mixer_roll[MAX_MOTORS]; |
40 | int mixer_yaw[MAX_MOTORS]; |
49 | int mixer_yaw[MAX_MOTORS]; |
41 | int desired_speed[MAX_MOTORS]; |
50 | int desired_speed[MAX_MOTORS]; |
42 | char * mixer_name; |
51 | char * mixer_name; |
43 | int mixer_version; |
52 | int mixer_version; |
44 | }; |
53 | }; |
45 | 54 | ||
46 | struct sMode |
55 | struct sMode |
47 | { |
56 | { |
48 | int id; |
57 | int id; |
49 | int version_major; |
58 | int version_major; |
50 | int version_minor; |
59 | int version_minor; |
51 | int version_patch; |
60 | int version_patch; |
52 | int version_serial_major; |
61 | int version_serial_major; |
53 | int version_serial_minor; |
62 | int version_serial_minor; |
54 | char * hardware; |
63 | char * hardware; |
55 | char * version; |
64 | char * version; |
56 | }; |
65 | }; |
57 | 66 | ||
58 | struct sGPS_Pos |
67 | struct sGPS_Pos |
59 | { |
68 | { |
60 | long Longitude; |
69 | long Longitude; |
61 | long Latitude; |
70 | long Latitude; |
62 | long Altitude; |
71 | long Altitude; |
63 | }; |
72 | }; |
64 | 73 | ||
65 | struct sNaviData |
74 | struct sNaviData |
66 | { |
75 | { |
67 | sGPS_Pos Current; |
76 | sGPS_Pos Current; |
68 | sGPS_Pos Target; |
77 | sGPS_Pos Target; |
69 | sGPS_Pos Home; |
78 | sGPS_Pos Home; |
70 | 79 | ||
71 | long Longitude; |
80 | long Longitude; |
72 | long Latitude; |
81 | long Latitude; |
73 | long Altitude; |
82 | long Altitude; |
74 | }; |
83 | }; |
75 | 84 | ||
76 | struct sWayPoint |
85 | struct sWayPoint |
77 | { |
86 | { |
78 | double Longitude; |
87 | double Longitude; |
79 | double Latitude; |
88 | double Latitude; |
80 | double Altitude; |
89 | double Altitude; |
81 | int Time; |
90 | int Time; |
82 | }; |
91 | }; |
83 | 92 | ||
84 | /** |
93 | /** |
85 | * The KopterData class represents the current state of the MikroKopter. |
94 | * The KopterData class represents the current state of the MikroKopter. |
86 | * It containes all data that was sent from the Mikrokopter |
95 | * It containes all data that was sent from the Mikrokopter |
87 | */ |
96 | */ |
88 | class KopterData { |
97 | class KopterData { |
89 | public: |
98 | public: |
90 | sMode mode; |
99 | sMode mode; |
91 | sNaviData navi; |
100 | sNaviData navi; |
92 | sMotorData motor; |
101 | sMotorData motor; |
93 | int analogData[MaxAnalog]; |
102 | int analogData[MaxAnalog]; |
94 | // current LCD page |
103 | // current LCD page |
95 | int lcd_cur; |
104 | int lcd_cur; |
96 | //max count of LCD pages |
105 | //max count of LCD pages |
97 | int lcd_max; |
106 | int lcd_max; |
98 | }; |
107 | }; |
99 | 108 | ||
100 | #endif |
109 | #endif |