Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1734 | - | 1 | /***************************************************************************** |
2 | * Copyright (C) 2008 Thomas Kaiser, thomas@ft-fanpage.de * |
||
3 | * Copyright (C) 2009 Peter "woggle" Mack, mac@denich.net * |
||
4 | * Copyright (C) 2011 Christian "Cebra" Brandtner, brandtner@brandtner.net * |
||
5 | * Copyright (C) 2011 Harald Bongartz * |
||
6 | * * |
||
7 | * This program is free software; you can redistribute it and/or modify * |
||
8 | * it under the terms of the GNU General Public License as published by * |
||
9 | * the Free Software Foundation; either version 2 of the License. * |
||
10 | * * |
||
11 | * This program is distributed in the hope that it will be useful, * |
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||
14 | * GNU General Public License for more details. * |
||
15 | * * |
||
16 | * You should have received a copy of the GNU General Public License * |
||
17 | * along with this program; if not, write to the * |
||
18 | * Free Software Foundation, Inc., * |
||
19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||
20 | * * |
||
21 | * * |
||
22 | * Credits to: * |
||
23 | * Holger Buss & Ingo Busker from mikrokopter.de for the MK project + SVN * |
||
24 | * http://www.mikrokopter.de * |
||
25 | * Gregor "killagreg" Stobrawa for his version of the MK code * |
||
26 | * Thomas Kaiser "thkais" for the original project. See * |
||
27 | * http://www.ft-fanpage.de/mikrokopter/ * |
||
28 | * http://forum.mikrokopter.de/topic-4061-1.html * |
||
29 | * Claas Anders "CaScAdE" Rathje for providing the font and his C-OSD code * |
||
30 | * http://www.mylifesucks.de/oss/c-osd/ * |
||
31 | * Harald Bongartz "HaraldB" for providing his Ideas and Code for usibility* |
||
32 | *****************************************************************************/ |
||
33 | |||
34 | |||
35 | #ifndef _EEPROM_H |
||
36 | #define _EEPROM_H |
||
37 | |||
38 | #include <stdbool.h> |
||
39 | #include "mk-data-structs.h" |
||
40 | #include "connect.h" |
||
41 | |||
42 | |||
43 | |||
44 | |||
45 | //[General] |
||
46 | //FileVersion = 2 |
||
47 | //NumberOfWaypoints = 15 |
||
48 | //UsePOI = 0 |
||
49 | //POI_CAM_NICK_CTRL = 0 |
||
50 | |||
51 | //[POI] |
||
52 | //Altitude = 1 |
||
53 | //Latitude = 46.7140763 |
||
54 | //Longitude = 19.2507334 |
||
55 | |||
56 | //[Waypoint1] |
||
57 | //Latitude = 46.7145686 |
||
58 | //Longitude = 19.2515702 |
||
59 | //Radius = 10 |
||
60 | //Altitude = 15 |
||
61 | //ClimbRate = 0 |
||
62 | //DelayTime = 4 |
||
63 | //WP_Event_Channel_Value = 96 |
||
64 | //Heading = 180 |
||
65 | |||
66 | |||
67 | #define EEpromVersion 0x70 //wird nach jeder Parametererweiterung hochgezählt |
||
68 | |||
69 | #define NumberOfWaypoints 55 //Anzahl der Waypoints in der EEPromliste |
||
70 | #define NumberOfWPLists 5 //Anzahl WP Listen im PKT |
||
71 | #define bt_pin_length 4 |
||
72 | #define bt_name_length 10 |
||
73 | |||
74 | |||
75 | #define POINT_TYPE_INVALID 255 |
||
76 | #define POINT_TYPE_WP 0 |
||
77 | #define POINT_TYPE_POI 1 |
||
78 | #define INVALID 0x00 |
||
79 | #define MAX_WPLIST_LEN 31 |
||
80 | |||
81 | |||
82 | |||
83 | |||
84 | |||
85 | typedef struct |
||
86 | { |
||
87 | uint8_t WPIndex; // Index in der EEpromliste |
||
88 | Point_t Waypoint; // Waypoint |
||
89 | } WayPoints; |
||
90 | |||
91 | typedef struct |
||
92 | { |
||
93 | uint8_t WPListnumber; // Nummer der WP Liste im PKT |
||
94 | uint8_t WPListAktiv; // Liste aktiv |
||
95 | uint8_t WPDirectory[31]; // Enthält die Indexe der Waypoints im EEPROM |
||
96 | uint8_t UsePOI; |
||
97 | uint8_t POI_CAM_NICK_CTR; |
||
98 | |||
99 | } WPListHeader; |
||
100 | |||
101 | typedef struct |
||
102 | { |
||
103 | WPListHeader WPList; // Waypointliste im PKT |
||
104 | } WPListDirectory; |
||
105 | |||
106 | |||
107 | |||
108 | |||
109 | |||
110 | |||
111 | void ReadParameter (void); |
||
112 | void WriteParameter (void); |
||
113 | void ReadLastPosition(void); |
||
114 | void WriteLastPosition(uint32_t ELongitude,uint32_t ELatitude); |
||
115 | void WriteWiInitFlag(void); |
||
116 | void WriteBTInitFlag(void); |
||
117 | void WriteBTSlaveFlag(void); |
||
118 | void WriteBTMasterFlag(void); |
||
119 | void Delete_EEPROM(void); |
||
120 | void EEWayPointList_Clear(void); // l�schen der Waypointliste im EEProm |
||
121 | |||
122 | |||
123 | uint8_t MK_LowBat; |
||
124 | extern volatile uint8_t LCD_ORIENTATION; |
||
125 | extern volatile uint8_t LCD_DisplayMode; |
||
126 | extern volatile uint8_t LCD_Kontrast; |
||
127 | extern volatile uint8_t LCD_Helligkeit; |
||
128 | extern volatile uint8_t DisplayTimeout; |
||
129 | extern volatile uint8_t DisplayLanguage; |
||
130 | extern volatile uint8_t WiTXRXChannel; |
||
131 | extern volatile uint8_t WiNetworkGroup; |
||
132 | extern volatile uint8_t WiNetworkMode; |
||
133 | extern volatile uint8_t WiTXTO; |
||
134 | extern volatile uint8_t WiUartMTU; |
||
135 | extern volatile uint8_t USBBT; |
||
136 | extern volatile uint8_t U02SV2; |
||
137 | extern volatile uint8_t Debug; |
||
138 | extern volatile uint8_t UseWi; // Wi232 wird genutzt |
||
139 | extern volatile uint8_t UseBT; // BT wird genutzt |
||
140 | extern volatile uint8_t WiIsSet; // Wi232 ist initialisiert |
||
141 | extern volatile uint8_t BTIsSet; // BT ist initialisiert |
||
142 | extern volatile uint8_t BTIsSlave; // BT ist Slave |
||
143 | extern char bt_pin[bt_pin_length + 1]; // BT Pinnummer |
||
144 | extern char bt_name[bt_name_length + 1]; // BT Name |
||
145 | extern char gps_UsedDevName[20]; // benutztes GPS Device Name |
||
146 | extern char gps_UsedMac[14]; // benutztes GPS Device Mac Adresse |
||
147 | extern volatile uint8_t gps_UseGPS; // ist GPS aktiv? |
||
148 | extern volatile uint8_t gps_UsedGPSMouse; |
||
149 | extern volatile uint32_t LastLongitude; |
||
150 | extern volatile uint32_t LastLatitude; |
||
151 | extern volatile uint8_t PKT_IdleBeep; |
||
152 | extern volatile uint8_t PKT_StartInfo; |
||
153 | extern volatile uint16_t Lipo_UOffset; // Offset für die Lipospannugsmessung |
||
154 | extern volatile uint8_t PKT_Accutyp; |
||
155 | extern volatile uint8_t OSD_RCErrorbeep; |
||
156 | extern volatile uint8_t OSD_InvertOut; // Out1/2 invertiert anzeigen |
||
157 | extern volatile uint8_t OSD_LEDform; // Form der Anzeige ( + oder schwarz) |
||
158 | extern volatile uint8_t OSD_SendOSD; // OSD Daten an SV2 senden |
||
159 | extern volatile uint8_t OSD_Fallspeed; // maximale Sinkrate |
||
160 | extern volatile uint8_t OSD_VarioBeep; // Vario Beep im OSD Screen |
||
161 | extern volatile uint8_t OSD_HomeMKView; // Home Circle from MK-View |
||
162 | extern volatile uint16_t OSD_mAh_Warning; // mAh Warnschwelle |
||
163 | extern volatile uint8_t OSD_ScreenMode; //Variante des OSD-Screen |
||
164 | extern volatile uint8_t OSD_LipoBar; //Bargraphanzeige für MK Lipo |
||
165 | extern volatile uint8_t PKT_Baudrate; // Baudrate für BT und Wi232 |
||
166 | extern volatile uint16_t FM_Refresh; // FollowMe interval |
||
167 | extern volatile uint16_t FM_Speed; // FollowMe Speed in m/s *0.1 |
||
168 | extern volatile uint16_t FM_Radius; // Waypoint Tolerance Radius in meter |
||
169 | |||
170 | |||
171 | |||
172 | #endif |