Rev 699 | Rev 734 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 699 | Rev 723 | ||
---|---|---|---|
1 | #ifndef _SPI_SLAVE_H |
1 | #ifndef _SPI_SLAVE_H |
2 | #define _SPI_SLAVE_H |
2 | #define _SPI_SLAVE_H |
3 | 3 | ||
4 | #include "fifo.h" |
4 | #include "fifo.h" |
5 | #include "gps.h" |
5 | #include "gps.h" |
6 | #include "main.h" |
6 | #include "main.h" |
7 | 7 | ||
8 | #define SPEAK_ERR_CALIBARTION 1 |
8 | #define SPEAK_ERR_CALIBARTION 1 |
9 | #define SPEAK_ERR_RECEICER 2 |
9 | #define SPEAK_ERR_RECEICER 2 |
10 | #define SPEAK_ERR_DATABUS 3 |
10 | #define SPEAK_ERR_DATABUS 3 |
11 | #define SPEAK_ERR_NAVI 4 |
11 | #define SPEAK_ERR_NAVI 4 |
12 | #define SPEAK_ERROR 5 |
12 | #define SPEAK_ERROR 5 |
13 | #define SPEAK_ERR_COMPASS 6 |
13 | #define SPEAK_ERR_COMPASS 6 |
14 | #define SPEAK_ERR_SENSOR 7 |
14 | #define SPEAK_ERR_SENSOR 7 |
15 | #define SPEAK_ERR_GPS 8 |
15 | #define SPEAK_ERR_GPS 8 |
16 | #define SPEAK_ERR_MOTOR 9 |
16 | #define SPEAK_ERR_MOTOR 9 |
17 | #define SPEAK_MAX_TEMPERAT 10 |
17 | #define SPEAK_MAX_TEMPERAT 10 |
18 | #define SPEAK_ALTI_REACHED 11 |
18 | #define SPEAK_ALTI_REACHED 11 |
19 | #define SPEAK_WP_REACHED 12 |
19 | #define SPEAK_WP_REACHED 12 |
20 | #define SPEAK_NEXT_WP 13 |
20 | #define SPEAK_NEXT_WP 13 |
21 | #define SPEAK_LANDING 14 |
21 | #define SPEAK_LANDING 14 |
22 | #define SPEAK_GPS_FIX 15 |
22 | #define SPEAK_GPS_FIX 15 |
23 | #define SPEAK_UNDERVOLTAGE 16 |
23 | #define SPEAK_UNDERVOLTAGE 16 |
24 | #define SPEAK_GPS_HOLD 17 |
24 | #define SPEAK_GPS_HOLD 17 |
25 | #define SPEAK_GPS_HOME 18 |
25 | #define SPEAK_GPS_HOME 18 |
26 | #define SPEAK_GPS_OFF 19 |
26 | #define SPEAK_GPS_OFF 19 |
27 | #define SPEAK_BEEP 20 |
27 | #define SPEAK_BEEP 20 |
28 | #define SPEAK_MIKROKOPTER 21 |
28 | #define SPEAK_MIKROKOPTER 21 |
29 | #define SPEAK_CAPACITY 22 |
29 | #define SPEAK_CAPACITY 22 |
30 | #define SPEAK_CF_OFF 23 |
30 | #define SPEAK_CF_OFF 23 |
31 | #define SPEAK_CALIBRATE 24 |
31 | #define SPEAK_CALIBRATE 24 |
32 | #define SPEAK_MAX_RANGE 25 |
32 | #define SPEAK_MAX_RANGE 25 |
33 | #define SPEAK_MAX_ALTITUD 26 |
33 | #define SPEAK_MAX_ALTITUD 26 |
34 | 34 | ||
35 | #define SPEAK_20M 37 // ? |
35 | #define SPEAK_20M 37 // ? |
36 | #define SPEAK_MK_OFF 38 |
36 | #define SPEAK_MK_OFF 38 |
37 | #define SPEAK_ALTITUDE_ON 39 |
37 | #define SPEAK_ALTITUDE_ON 39 |
38 | #define SPEAK_ALTITUDE_OFF 40 |
38 | #define SPEAK_ALTITUDE_OFF 40 |
39 | #define SPEAK_100M 41 // ? |
39 | #define SPEAK_100M 41 // ? |
40 | #define SPEAK_CONNECTED 42 |
40 | #define SPEAK_CONNECTED 42 |
41 | #define SPEAK_CF_ON 46 |
41 | #define SPEAK_CF_ON 46 |
42 | #define SPEAK_SINKING 47 // ? |
42 | #define SPEAK_SINKING 47 // ? |
43 | #define SPEAK_RISING 48 |
43 | #define SPEAK_RISING 48 |
44 | #define SPEAK_HOLDING 49 // ? |
44 | #define SPEAK_HOLDING 49 // ? |
45 | #define SPEAK_GPS_ON 50 // ? |
45 | #define SPEAK_GPS_ON 50 // ? |
46 | #define SPEAK_FOLLWING 51 // ? |
46 | #define SPEAK_FOLLWING 51 // ? |
47 | #define SPEAK_STARTING 52 |
47 | #define SPEAK_STARTING 52 |
48 | 48 | ||
49 | 49 | ||
50 | #define SS_PIN GPIO_ReadBit(GPIO2, GPIO_Pin_7) |
50 | #define SS_PIN GPIO_ReadBit(GPIO2, GPIO_Pin_7) |
51 | 51 | ||
52 | #define SPI_FCCMD_USER 10 |
52 | #define SPI_FCCMD_USER 10 |
53 | #define SPI_FCCMD_STICK 11 |
53 | #define SPI_FCCMD_STICK 11 |
54 | #define SPI_FCCMD_MISC 12 |
54 | #define SPI_FCCMD_MISC 12 |
55 | #define SPI_FCCMD_PARAMETER1 13 |
55 | #define SPI_FCCMD_PARAMETER1 13 |
56 | #define SPI_FCCMD_VERSION 14 |
56 | #define SPI_FCCMD_VERSION 14 |
57 | #define SPI_FCCMD_SLOW3 15 |
57 | #define SPI_FCCMD_SLOW3 15 |
58 | #define SPI_FCCMD_BL_ACCU 16 |
58 | #define SPI_FCCMD_BL_ACCU 16 |
59 | #define SPI_FCCMD_PARAMETER2 17 |
59 | #define SPI_FCCMD_PARAMETER2 17 |
60 | #define SPI_FCCMD_NEUTRAL 18 |
60 | #define SPI_FCCMD_NEUTRAL 18 |
61 | #define SPI_FCCMD_SLOW 19 // kommt nicht vor |
61 | #define SPI_FCCMD_SLOW 19 // kommt nicht vor |
62 | #define SPI_FCCMD_SLOW2 20 |
62 | #define SPI_FCCMD_SLOW2 20 |
63 | #define SPI_FCCMD_STICK2 21 |
63 | #define SPI_FCCMD_STICK2 21 |
64 | 64 | ||
65 | #define CHK_POTI(b,a) { if(a < 248) b = a; else b = FC.Poti[255 - a]; } |
65 | #define CHK_POTI(b,a) { if(a < 248) b = a; else b = FC.Poti[255 - a]; } |
66 | #define CHK_POTI_MM(b,a,min,max) {CHK_POTI(b,a); LIMIT_MIN_MAX(b, min, max); } |
66 | #define CHK_POTI_MM(b,a,min,max) {CHK_POTI(b,a); LIMIT_MIN_MAX(b, min, max); } |
67 | 67 | ||
68 | // devides only the Poti-value |
68 | // devides only the Poti-value |
69 | #define CHK_POTI_DIV(b,a,div) { if(a < 248) b = a; else b = FC.Poti[255 - a] / div; } |
69 | #define CHK_POTI_DIV(b,a,div) { if(a < 248) b = a; else b = FC.Poti[255 - a] / div; } |
70 | #define CHK_POTI_MM_DIV(b,a,min,max,div) {CHK_POTI_DIV(b,a,div); LIMIT_MIN_MAX(b, min, max); } |
70 | #define CHK_POTI_MM_DIV(b,a,min,max,div) {CHK_POTI_DIV(b,a,div); LIMIT_MIN_MAX(b, min, max); } |
71 | 71 | ||
72 | extern s32 Kalman_K; |
72 | extern s32 Kalman_K; |
73 | extern s32 Kalman_Kompass ; |
73 | extern s32 Kalman_Kompass ; |
74 | extern s32 Kalman_MaxDrift; |
74 | extern s32 Kalman_MaxDrift; |
75 | extern s32 Kalman_MaxFusion; |
75 | extern s32 Kalman_MaxFusion; |
76 | extern s32 ToFcGpsZ; |
76 | extern s32 ToFcGpsZ; |
77 | extern s32 ToFC_Rotate_C, ToFC_Rotate_S; |
77 | extern s32 ToFC_Rotate_C, ToFC_Rotate_S; |
78 | extern s32 HeadFreeStartAngle,CompassDirectionAtMotorStart; |
78 | extern s32 HeadFreeStartAngle,CompassDirectionAtMotorStart; |
79 | extern s16 FC_WP_EventChannel,LogFC_WP_EventChannel,FC_WP_EventChannel_Processed; |
79 | extern s16 FC_WP_EventChannel,LogFC_WP_EventChannel,FC_WP_EventChannel_Processed; |
80 | extern u32 ToFC_AltitudeRate; |
80 | extern u32 ToFC_AltitudeRate; |
81 | extern s32 ToFC_AltitudeSetpoint; |
81 | extern s32 ToFC_AltitudeSetpoint; |
82 | extern u8 NC_GPS_ModeCharacter; |
82 | extern u8 NC_GPS_ModeCharacter; |
83 | extern u8 FC_is_Calibrated; |
83 | extern u8 FC_is_Calibrated; |
84 | extern u8 FCCalibActive; |
84 | extern u8 FCCalibActive; |
85 | extern u8 SpeakHoTT; |
85 | extern u8 SpeakHoTT; |
86 | extern u8 NC_Wait_for_LED; |
86 | extern u8 NC_Wait_for_LED; |
87 | 87 | ||
88 | #define MAX_RC_IN 16+12+3+4 // 16ch + 12ser + 3stages + 4 reserved |
88 | #define MAX_RC_IN 16+12+3+4 // 16ch + 12ser + 3stages + 4 reserved |
89 | extern s8 PPM_In[MAX_RC_IN]; |
89 | extern s8 PPM_In[MAX_RC_IN]; |
90 | 90 | ||
91 | extern u8 BL_MinOfMaxPWM; // indication if all BL-controllers run on full power |
91 | extern u8 BL_MinOfMaxPWM; // indication if all BL-controllers run on full power |
92 | extern u8 Logging_BL_MinOfMaxPWM; |
92 | extern u8 Logging_BL_MinOfMaxPWM; |
93 | extern u8 ErrorCheck_BL_MinOfMaxPWM; |
93 | extern u8 ErrorCheck_BL_MinOfMaxPWM; |
94 | extern u32 FC_I2C_ErrorConter; |
94 | extern u32 FC_I2C_ErrorConter; |
95 | extern u8 FromFC_VarioCharacter; |
95 | extern u8 FromFC_VarioCharacter; |
96 | extern u8 Logging_FCStatusFlags1,Logging_FCStatusFlags2; |
96 | extern u8 Logging_FCStatusFlags1,Logging_FCStatusFlags2; |
97 | extern s16 POI_KameraNick; |
97 | extern s16 POI_KameraNick; |
98 | extern u16 FlugMinutenGesamt; |
98 | extern u16 FlugMinutenGesamt; |
99 | extern u32 LoggingGasFilter, LoggingGasCnt; |
99 | extern u32 LoggingGasFilter, LoggingGasCnt; |
100 | extern u8 HoverGas; |
100 | extern u8 HoverGas; |
101 | extern s16 FromFlightCtrl_AccNick,FromFlightCtrl_AccRoll,FromFlightCtrl_GyroNick,FromFlightCtrl_GyroRoll; |
101 | extern s16 FromFlightCtrl_AccNick,FromFlightCtrl_AccRoll,FromFlightCtrl_GyroNick,FromFlightCtrl_GyroRoll; |
102 | extern u8 RequestConfigFromFC; |
102 | extern u8 RequestConfigFromFC; |
- | 103 | extern u8 CamCtrlCharacter; |
|
103 | 104 | ||
104 | typedef struct |
105 | typedef struct |
105 | { |
106 | { |
106 | u8 Command; |
107 | u8 Command; |
107 | s16 AngleNick; // NickAngle in 0.1 deg |
108 | s16 AngleNick; // NickAngle in 0.1 deg |
108 | s16 AngleRoll; // RollAngle in 0.1 deg |
109 | s16 AngleRoll; // RollAngle in 0.1 deg |
109 | s16 GyroHeading; // Heading in 0.1 deg |
110 | s16 GyroHeading; // Heading in 0.1 deg |
110 | s16 GyroYaw; |
111 | s16 GyroYaw; |
111 | u16 FCStatus; |
112 | u16 FCStatus; |
112 | union |
113 | union |
113 | { |
114 | { |
114 | u8 Byte[20]; |
115 | u8 Byte[20]; |
115 | s8 sByte[20]; |
116 | s8 sByte[20]; |
116 | u16 Int[10]; |
117 | u16 Int[10]; |
117 | s16 sInt[10]; |
118 | s16 sInt[10]; |
118 | u32 Long[5]; |
119 | u32 Long[5]; |
119 | s32 sLong[5]; |
120 | s32 sLong[5]; |
120 | float Float[5]; |
121 | float Float[5]; |
121 | } __attribute__((packed)) Param; |
122 | } __attribute__((packed)) Param; |
122 | u8 Chksum; |
123 | u8 Chksum; |
123 | } __attribute__((packed)) FromFlightCtrl_t; |
124 | } __attribute__((packed)) FromFlightCtrl_t; |
124 | 125 | ||
125 | #define SPI_NCCMD_OSD_DATA 100 |
126 | #define SPI_NCCMD_OSD_DATA 100 |
126 | #define SPI_NCCMD_GPS_POS 101 |
127 | #define SPI_NCCMD_GPS_POS 101 |
127 | #define SPI_NCCMD_GPS_TARGET 102 |
128 | #define SPI_NCCMD_GPS_TARGET 102 |
128 | #define SPI_NCCMD_KALMAN 103 |
129 | #define SPI_NCCMD_KALMAN 103 |
129 | #define SPI_NCCMD_VERSION 104 |
130 | #define SPI_NCCMD_VERSION 104 |
130 | #define SPI_NCCMD_GPSINFO 105 |
131 | #define SPI_NCCMD_GPSINFO 105 |
131 | #define SPI_NCCMD_HOTT_INFO 106 |
132 | #define SPI_NCCMD_HOTT_INFO 106 |
132 | #define SPI_MISC 107 |
133 | #define SPI_MISC 107 |
133 | #define SPI_SERIAL_CH 108 |
134 | #define SPI_SERIAL_CH 108 |
134 | 135 | ||
135 | #define HOTT_VARIO_PACKET_ID 0x89 |
136 | #define HOTT_VARIO_PACKET_ID 0x89 |
136 | #define HOTT_GPS_PACKET_ID 0x8A |
137 | #define HOTT_GPS_PACKET_ID 0x8A |
137 | #define HOTT_ELECTRIC_AIR_PACKET_ID 0x8E |
138 | #define HOTT_ELECTRIC_AIR_PACKET_ID 0x8E |
138 | #define HOTT_GENERAL_PACKET_ID 0x8D |
139 | #define HOTT_GENERAL_PACKET_ID 0x8D |
139 | #define JETI_GPS_PACKET_ID1 0x01 |
140 | #define JETI_GPS_PACKET_ID1 0x01 |
140 | #define JETI_GPS_PACKET_ID2 0x02 |
141 | #define JETI_GPS_PACKET_ID2 0x02 |
141 | #define HOTT_WPL_NAME 0x03 |
142 | #define HOTT_WPL_NAME 0x03 |
142 | 143 | ||
143 | typedef struct |
144 | typedef struct |
144 | { |
145 | { |
145 | u8 Command; |
146 | u8 Command; |
146 | GPS_Stick_t GPSStick; |
147 | GPS_Stick_t GPSStick; |
147 | s16 CompassHeading; |
148 | s16 CompassHeading; |
148 | s16 AccErrorN; |
149 | s16 AccErrorN; |
149 | s16 AccErrorR; |
150 | s16 AccErrorR; |
150 | union |
151 | union |
151 | { |
152 | { |
152 | u8 Byte[20]; |
153 | u8 Byte[20]; |
153 | s8 sByte[20]; |
154 | s8 sByte[20]; |
154 | u16 Int[10]; |
155 | u16 Int[10]; |
155 | s16 sInt[10]; |
156 | s16 sInt[10]; |
156 | u32 Long[5]; |
157 | u32 Long[5]; |
157 | s32 sLong[5]; |
158 | s32 sLong[5]; |
158 | float Float[5]; |
159 | float Float[5]; |
159 | } __attribute__((packed)) Param; |
160 | } __attribute__((packed)) Param; |
160 | u8 Chksum; |
161 | u8 Chksum; |
161 | } __attribute__((packed)) ToFlightCtrl_t; |
162 | } __attribute__((packed)) ToFlightCtrl_t; |
162 | 163 | ||
163 | typedef struct |
164 | typedef struct |
164 | { |
165 | { |
165 | unsigned char Sync1,Sync2; |
166 | unsigned char Sync1,Sync2; |
166 | unsigned char WhoAmI; |
167 | unsigned char WhoAmI; |
167 | unsigned char Data[240]; |
168 | unsigned char Data[240]; |
168 | unsigned char Chksum; |
169 | unsigned char Chksum; |
169 | }__attribute__((packed)) str_HugeBlockFromFC; |
170 | }__attribute__((packed)) str_HugeBlockFromFC; |
170 | extern str_HugeBlockFromFC HugeBlockFromFC; |
171 | extern str_HugeBlockFromFC HugeBlockFromFC; |
171 | 172 | ||
172 | typedef struct |
173 | typedef struct |
173 | { |
174 | { |
174 | unsigned char Sync1,Sync2; |
175 | unsigned char Sync1,Sync2; |
175 | unsigned char WhoAmI; |
176 | unsigned char WhoAmI; |
176 | unsigned char Data[240]; |
177 | unsigned char Data[240]; |
177 | unsigned char Chksum; |
178 | unsigned char Chksum; |
178 | }__attribute__((packed)) str_HugeBlockToFC; |
179 | }__attribute__((packed)) str_HugeBlockToFC; |
179 | extern str_HugeBlockToFC HugeBlockToFC; |
180 | extern str_HugeBlockToFC HugeBlockToFC; |
180 | 181 | ||
181 | typedef struct |
182 | typedef struct |
182 | { |
183 | { |
183 | u8 Current; |
184 | u8 Current; |
184 | u8 Temperature; |
185 | u8 Temperature; |
185 | u8 MaxPWM; |
186 | u8 MaxPWM; |
186 | u8 State; |
187 | u8 State; |
187 | u8 NotReadyCnt; |
188 | u8 NotReadyCnt; |
188 | } __attribute__((packed)) Motor_t; |
189 | } __attribute__((packed)) Motor_t; |
189 | 190 | ||
190 | extern Motor_t Motor[MAX_MOTORS]; |
191 | extern Motor_t Motor[MAX_MOTORS]; |
191 | 192 | ||
192 | #define MOTOR_STATE_NEW_PROTOCOL_MASK 0x01 |
193 | #define MOTOR_STATE_NEW_PROTOCOL_MASK 0x01 |
193 | #define MOTOR_STATE_FAST_MODE 0x02 |
194 | #define MOTOR_STATE_FAST_MODE 0x02 |
194 | #define MOTOR_STATE_BL30 0x04 // extended Current measurement -> 200 = 20A 201 = 21A 255 = 75A (20+55) |
195 | #define MOTOR_STATE_BL30 0x04 // extended Current measurement -> 200 = 20A 201 = 21A 255 = 75A (20+55) |
195 | extern u8 Motor_Version[MAX_MOTORS]; // das kann nicht in die struct, weil der PC die Struktur bekommt |
196 | extern u8 Motor_Version[MAX_MOTORS]; // das kann nicht in die struct, weil der PC die Struktur bekommt |
196 | 197 | ||
197 | 198 | ||
198 | typedef struct |
199 | typedef struct |
199 | { |
200 | { |
200 | u8 Major; |
201 | u8 Major; |
201 | u8 Minor; |
202 | u8 Minor; |
202 | u8 Patch; |
203 | u8 Patch; |
203 | u8 Compatible; |
204 | u8 Compatible; |
204 | u8 Hardware; |
205 | u8 Hardware; |
205 | } __attribute__((packed)) SPI_Version_t; |
206 | } __attribute__((packed)) SPI_Version_t; |
206 | 207 | ||
207 | 208 | ||
208 | extern FromFlightCtrl_t FromFlightCtrl; |
209 | extern FromFlightCtrl_t FromFlightCtrl; |
209 | extern ToFlightCtrl_t ToFlightCtrl; |
210 | extern ToFlightCtrl_t ToFlightCtrl; |
210 | extern volatile u32 SPI0_Timeout; |
211 | extern volatile u32 SPI0_Timeout; |
211 | extern SPI_Version_t FC_Version; |
212 | extern SPI_Version_t FC_Version; |
212 | extern s16 GPS_Aid_StickMultiplikator; |
213 | extern s16 GPS_Aid_StickMultiplikator; |
213 | extern u8 CompassCalState; |
214 | extern u8 CompassCalState; |
214 | extern u8 Out1TriggerUpdateNewData; |
215 | extern u8 Out1TriggerUpdateNewData; |
215 | extern u8 LowVoltageLandingActive; |
216 | extern u8 LowVoltageLandingActive; |
216 | 217 | ||
217 | void SPI0_Init(void); |
218 | void SPI0_Init(void); |
218 | void SPI0_GetFlightCtrlVersion(void); |
219 | void SPI0_GetFlightCtrlVersion(void); |
219 | void SPI0_UpdateBuffer(void); |
220 | void SPI0_UpdateBuffer(void); |
220 | u16 BL3_Current(u8 who); // in 0.1A |
221 | u16 BL3_Current(u8 who); // in 0.1A |
221 | 222 | ||
222 | typedef struct |
223 | typedef struct |
223 | { |
224 | { |
224 | unsigned char Revision; |
225 | unsigned char Revision; |
225 | unsigned char Kanalbelegung[12]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
226 | unsigned char Kanalbelegung[12]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
226 | unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
227 | unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
227 | unsigned char Hoehe_MinGas; // Wert : 0-100 |
228 | unsigned char Hoehe_MinGas; // Wert : 0-100 |
228 | unsigned char Luftdruck_D; // Wert : 0-250 |
229 | unsigned char Luftdruck_D; // Wert : 0-250 |
229 | unsigned char HoeheChannel; // Wert : 0-32 |
230 | unsigned char HoeheChannel; // Wert : 0-32 |
230 | unsigned char Hoehe_P; // Wert : 0-32 |
231 | unsigned char Hoehe_P; // Wert : 0-32 |
231 | unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
232 | unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
232 | unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
233 | unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
233 | unsigned char Hoehe_HoverBand; // Wert : 0-250 |
234 | unsigned char Hoehe_HoverBand; // Wert : 0-250 |
234 | unsigned char Hoehe_TiltCompensation; // Wert : 0-250 |
235 | unsigned char Hoehe_TiltCompensation; // Wert : 0-250 |
235 | unsigned char Hoehe_StickNeutralPoint;// Wert : 0-250 |
236 | unsigned char Hoehe_StickNeutralPoint;// Wert : 0-250 |
236 | unsigned char Stick_P; // Wert : 1-6 |
237 | unsigned char Stick_P; // Wert : 1-6 |
237 | unsigned char Stick_D; // Wert : 0-64 |
238 | unsigned char Stick_D; // Wert : 0-64 |
238 | unsigned char StickGier_P; // Wert : 1-20 |
239 | unsigned char StickGier_P; // Wert : 1-20 |
239 | unsigned char Gas_Min; // Wert : 0-32 |
240 | unsigned char Gas_Min; // Wert : 0-32 |
240 | unsigned char Gas_Max; // Wert : 33-250 |
241 | unsigned char Gas_Max; // Wert : 33-250 |
241 | unsigned char GyroAccFaktor; // Wert : 1-64 |
242 | unsigned char GyroAccFaktor; // Wert : 1-64 |
242 | unsigned char KompassWirkung; // Wert : 0-32 |
243 | unsigned char KompassWirkung; // Wert : 0-32 |
243 | unsigned char Gyro_P; // Wert : 10-250 |
244 | unsigned char Gyro_P; // Wert : 10-250 |
244 | unsigned char Gyro_I; // Wert : 0-250 |
245 | unsigned char Gyro_I; // Wert : 0-250 |
245 | unsigned char Gyro_D; // Wert : 0-250 |
246 | unsigned char Gyro_D; // Wert : 0-250 |
246 | unsigned char Gyro_Gier_P; // Wert : 10-250 |
247 | unsigned char Gyro_Gier_P; // Wert : 10-250 |
247 | unsigned char Gyro_Gier_I; // Wert : 0-250 |
248 | unsigned char Gyro_Gier_I; // Wert : 0-250 |
248 | unsigned char Gyro_Stability; // Wert : 0-16 |
249 | unsigned char Gyro_Stability; // Wert : 0-16 |
249 | unsigned char UnterspannungsWarnung; // Wert : 0-250 |
250 | unsigned char UnterspannungsWarnung; // Wert : 0-250 |
250 | unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
251 | unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
251 | unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
252 | unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
252 | unsigned char Receiver; // 0= Summensignal, 1= Spektrum, 2 =Jeti, 3=ACT DSL, 4=ACT S3D |
253 | unsigned char Receiver; // 0= Summensignal, 1= Spektrum, 2 =Jeti, 3=ACT DSL, 4=ACT S3D |
253 | unsigned char I_Faktor; // Wert : 0-250 |
254 | unsigned char I_Faktor; // Wert : 0-250 |
254 | unsigned char UserParam1; // Wert : 0-250 |
255 | unsigned char UserParam1; // Wert : 0-250 |
255 | unsigned char UserParam2; // Wert : 0-250 |
256 | unsigned char UserParam2; // Wert : 0-250 |
256 | unsigned char UserParam3; // Wert : 0-250 |
257 | unsigned char UserParam3; // Wert : 0-250 |
257 | unsigned char UserParam4; // Wert : 0-250 |
258 | unsigned char UserParam4; // Wert : 0-250 |
258 | unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
259 | unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
259 | unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
260 | unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
260 | unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
261 | unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
261 | unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
262 | unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
262 | //--- Seit V0.75 |
263 | //--- Seit V0.75 |
263 | unsigned char ServoRollControl; // Wert : 0-250 // Stellung des Servos |
264 | unsigned char ServoRollControl; // Wert : 0-250 // Stellung des Servos |
264 | unsigned char ServoRollComp; // Wert : 0-250 |
265 | unsigned char ServoRollComp; // Wert : 0-250 |
265 | unsigned char ServoRollMin; // Wert : 0-250 |
266 | unsigned char ServoRollMin; // Wert : 0-250 |
266 | unsigned char ServoRollMax; // Wert : 0-250 |
267 | unsigned char ServoRollMax; // Wert : 0-250 |
267 | //--- |
268 | //--- |
268 | unsigned char ServoNickRefresh; // Speed of the Servo |
269 | unsigned char ServoNickRefresh; // Speed of the Servo |
269 | unsigned char ServoManualControlSpeed;// |
270 | unsigned char ServoManualControlSpeed;// |
270 | unsigned char CamOrientation; // |
271 | unsigned char CamOrientation; // |
271 | unsigned char Servo3; // Value or mapping of the Servo Output |
272 | unsigned char Servo3; // Value or mapping of the Servo Output |
272 | unsigned char Servo4; // Value or mapping of the Servo Output |
273 | unsigned char Servo4; // Value or mapping of the Servo Output |
273 | unsigned char Servo5; // Value or mapping of the Servo Output |
274 | unsigned char Servo5; // Value or mapping of the Servo Output |
274 | unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
275 | unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
275 | unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
276 | unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
276 | unsigned char LoopHysterese; // Wert: 0-250 Hysterese für Stickausschlag |
277 | unsigned char LoopHysterese; // Wert: 0-250 Hysterese für Stickausschlag |
277 | unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung) |
278 | unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung) |
278 | unsigned char AchsKopplung2; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden |
279 | unsigned char AchsKopplung2; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden |
279 | unsigned char CouplingYawCorrection; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden |
280 | unsigned char CouplingYawCorrection; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden |
280 | unsigned char WinkelUmschlagNick; // Wert: 0-250 180°-Punkt |
281 | unsigned char WinkelUmschlagNick; // Wert: 0-250 180°-Punkt |
281 | unsigned char WinkelUmschlagRoll; // Wert: 0-250 180°-Punkt |
282 | unsigned char WinkelUmschlagRoll; // Wert: 0-250 180°-Punkt |
282 | unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung) |
283 | unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung) |
283 | unsigned char Driftkomp; |
284 | unsigned char Driftkomp; |
284 | unsigned char DynamicStability; |
285 | unsigned char DynamicStability; |
285 | unsigned char UserParam5; // Wert : 0-250 |
286 | unsigned char UserParam5; // Wert : 0-250 |
286 | unsigned char UserParam6; // Wert : 0-250 |
287 | unsigned char UserParam6; // Wert : 0-250 |
287 | unsigned char UserParam7; // Wert : 0-250 |
288 | unsigned char UserParam7; // Wert : 0-250 |
288 | unsigned char UserParam8; // Wert : 0-250 |
289 | unsigned char UserParam8; // Wert : 0-250 |
289 | //---Output --------------------------------------------- |
290 | //---Output --------------------------------------------- |
290 | unsigned char J16Bitmask; // for the J16 Output |
291 | unsigned char J16Bitmask; // for the J16 Output |
291 | unsigned char J16Timing; // for the J16 Output |
292 | unsigned char J16Timing; // for the J16 Output |
292 | unsigned char J17Bitmask; // for the J17 Output |
293 | unsigned char J17Bitmask; // for the J17 Output |
293 | unsigned char J17Timing; // for the J17 Output |
294 | unsigned char J17Timing; // for the J17 Output |
294 | // seit version V0.75c |
295 | // seit version V0.75c |
295 | unsigned char WARN_J16_Bitmask; // for the J16 Output |
296 | unsigned char WARN_J16_Bitmask; // for the J16 Output |
296 | unsigned char WARN_J17_Bitmask; // for the J17 Output |
297 | unsigned char WARN_J17_Bitmask; // for the J17 Output |
297 | //---NaviCtrl--------------------------------------------- |
298 | //---NaviCtrl--------------------------------------------- |
298 | unsigned char AutoPhotoDistance; // Auto Photo |
299 | unsigned char AutoPhotoDistance; // Auto Photo |
299 | unsigned char NaviGpsModeChannel; // Parameters for the Naviboard |
300 | unsigned char NaviGpsModeChannel; // Parameters for the Naviboard |
300 | unsigned char NaviGpsGain; |
301 | unsigned char NaviGpsGain; |
301 | unsigned char NaviGpsP; |
302 | unsigned char NaviGpsP; |
302 | unsigned char NaviGpsI; |
303 | unsigned char NaviGpsI; |
303 | unsigned char NaviGpsD; |
304 | unsigned char NaviGpsD; |
304 | unsigned char NaviGpsPLimit; |
305 | unsigned char NaviGpsPLimit; |
305 | unsigned char NaviGpsILimit; |
306 | unsigned char NaviGpsILimit; |
306 | unsigned char NaviGpsDLimit; |
307 | unsigned char NaviGpsDLimit; |
307 | unsigned char NaviGpsA; |
308 | unsigned char NaviGpsA; |
308 | unsigned char NaviGpsMinSat; |
309 | unsigned char NaviGpsMinSat; |
309 | unsigned char NaviStickThreshold; |
310 | unsigned char NaviStickThreshold; |
310 | unsigned char NaviWindCorrection; |
311 | unsigned char NaviWindCorrection; |
311 | unsigned char NaviAccCompensation; // New since 0.86 -> was: SpeedCompensation |
312 | unsigned char NaviAccCompensation; // New since 0.86 -> was: SpeedCompensation |
312 | unsigned char NaviMaxFlyingRange; // in 10m |
313 | unsigned char NaviMaxFlyingRange; // in 10m |
313 | unsigned char NaviAngleLimitation; |
314 | unsigned char NaviAngleLimitation; |
314 | unsigned char NaviPH_LoginTime; |
315 | unsigned char NaviPH_LoginTime; |
315 | unsigned char NaviDescendRange; |
316 | unsigned char NaviDescendRange; |
316 | //---Ext.Ctrl--------------------------------------------- |
317 | //---Ext.Ctrl--------------------------------------------- |
317 | unsigned char ExternalControl; // for serial Control |
318 | unsigned char ExternalControl; // for serial Control |
318 | //---CareFree--------------------------------------------- |
319 | //---CareFree--------------------------------------------- |
319 | unsigned char OrientationAngle; // Where is the front-direction? |
320 | unsigned char OrientationAngle; // Where is the front-direction? |
320 | unsigned char CareFreeChannel; // switch for CareFree |
321 | unsigned char CareFreeChannel; // switch for CareFree |
321 | unsigned char MotorSafetySwitch; |
322 | unsigned char MotorSafetySwitch; |
322 | unsigned char MotorSmooth; |
323 | unsigned char MotorSmooth; |
323 | unsigned char ComingHomeAltitude; |
324 | unsigned char ComingHomeAltitude; |
324 | unsigned char FailSafeTime; |
325 | unsigned char FailSafeTime; |
325 | unsigned char MaxAltitude; |
326 | unsigned char MaxAltitude; |
326 | unsigned char FailsafeChannel; // if the value of this channel is > 100, the MK reports "RC-Lost" |
327 | unsigned char FailsafeChannel; // if the value of this channel is > 100, the MK reports "RC-Lost" |
327 | unsigned char ServoFilterNick; |
328 | unsigned char ServoFilterNick; |
328 | unsigned char ServoFilterRoll; |
329 | unsigned char ServoFilterRoll; |
329 | unsigned char Servo3OnValue; |
330 | unsigned char Servo3OnValue; |
330 | unsigned char Servo3OffValue; |
331 | unsigned char Servo3OffValue; |
331 | unsigned char Servo4OnValue; |
332 | unsigned char Servo4OnValue; |
332 | unsigned char Servo4OffValue; |
333 | unsigned char Servo4OffValue; |
333 | unsigned char ServoFS_Pos[5]; |
334 | unsigned char ServoFS_Pos[5]; |
334 | unsigned char StartLandChannel; |
335 | unsigned char StartLandChannel; |
335 | unsigned char LandingSpeed; |
336 | unsigned char LandingSpeed; |
336 | unsigned char CompassOffset; |
337 | unsigned char CompassOffset; |
337 | unsigned char AutoLandingVoltage; // in 0,1V 0 -> disabled |
338 | unsigned char AutoLandingVoltage; // in 0,1V 0 -> disabled |
338 | unsigned char ComingHomeVoltage; // in 0,1V 0 -> disabled |
339 | unsigned char ComingHomeVoltage; // in 0,1V 0 -> disabled |
339 | unsigned char AutoPhotoAtitudes; |
340 | unsigned char AutoPhotoAtitudes; |
340 | unsigned char SingleWpSpeed; |
341 | unsigned char SingleWpSpeed; |
341 | unsigned char LandingPulse; |
342 | unsigned char LandingPulse; |
342 | unsigned char SingleWpControlChannel; |
343 | unsigned char SingleWpControlChannel; |
343 | unsigned char MenuKeyChannel; |
344 | unsigned char MenuKeyChannel; |
- | 345 | unsigned char CamCtrlModeChannel; |
|
- | 346 | unsigned char CamCtrlZoomChannel; |
|
344 | //------------------------------------------------ |
347 | //------------------------------------------------ |
345 | unsigned char BitConfig; // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
348 | unsigned char BitConfig; // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
346 | unsigned char ServoCompInvert; // // 0x01 = Nick, 0x02 = Roll, 0x04 = relative moving // WICHTIG!!! am Ende lassen |
349 | unsigned char ServoCompInvert; // // 0x01 = Nick, 0x02 = Roll, 0x04 = relative moving // WICHTIG!!! am Ende lassen |
347 | unsigned char ExtraConfig; // bitcodiert |
350 | unsigned char ExtraConfig; // bitcodiert |
348 | unsigned char GlobalConfig3; // bitcodiert |
351 | unsigned char GlobalConfig3; // bitcodiert |
349 | char Name[12]; |
352 | char Name[12]; |
350 | unsigned char crc; // must be the last byte! |
353 | unsigned char crc; // must be the last byte! |
351 | } __attribute__((packed)) paramset_t; // 150 bytes |
354 | } __attribute__((packed)) paramset_t; // 150 bytes |
352 | 355 | ||
353 | extern paramset_t EE_Parameter; |
356 | extern paramset_t EE_Parameter; |
354 | 357 | ||
355 | #endif //_SPI_SLAVE_H |
358 | #endif //_SPI_SLAVE_H |
356 | 359 |