Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1515 | - | 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 0x58 //Summe aus Soft.vers. ohne erste Ziffer zB 3.5.5 = 55 |
||
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 Delete_EEPROM(void); |
||
118 | void EEWayPointList_Clear(void); // l�schen der Waypointliste im EEProm |
||
119 | |||
120 | |||
121 | uint8_t MK_LowBat; |
||
122 | extern volatile uint8_t LCD_ORIENTATION; |
||
123 | extern volatile uint8_t LCD_DisplayMode; |
||
124 | extern volatile uint8_t LCD_Kontrast; |
||
125 | extern volatile uint8_t LCD_Helligkeit; |
||
126 | extern volatile uint8_t DisplayTimeout; |
||
127 | extern volatile uint8_t DisplayLanguage; |
||
128 | extern volatile uint8_t WiTXRXChannel; |
||
129 | extern volatile uint8_t WiNetworkGroup; |
||
130 | extern volatile uint8_t WiNetworkMode; |
||
131 | extern volatile uint8_t WiTXTO; |
||
132 | extern volatile uint8_t WiUartMTU; |
||
133 | extern volatile uint8_t USBBT; |
||
134 | extern volatile uint8_t U02SV2; |
||
135 | extern volatile uint8_t Debug; |
||
136 | extern volatile uint8_t UseWi; // Wi232 wird genutzt |
||
137 | extern volatile uint8_t UseBT; // BT wird genutzt |
||
138 | extern volatile uint8_t WiIsSet; // Wi232 ist initialisiert |
||
139 | extern volatile uint8_t BTIsSet; // BT ist initialisiert |
||
140 | extern char bt_pin[bt_pin_length + 1]; // BT Pinnummer |
||
141 | extern char bt_name[bt_name_length + 1]; // BT Name |
||
142 | extern volatile uint32_t LastLongitude; |
||
143 | extern volatile uint32_t LastLatitude; |
||
144 | extern volatile uint8_t PKT_IdleBeep; |
||
145 | extern volatile uint8_t PKT_StartInfo; |
||
146 | extern volatile uint16_t Lipo_UOffset; // Offset für die Lipospannugsmessung |
||
147 | extern volatile uint8_t PKT_Accutyp; |
||
148 | #endif |