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