Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef MAIN_H_
00030 #define MAIN_H_
00031
00032 extern void mainloop(void);
00033 extern void timer0ISR(void);
00034
00035
00036 volatile unsigned int GPS_timeout;
00037 volatile char SYSTEM_initialized;
00038
00039 #define BATTERY_WARNING_VOLTAGE 10600 //10.6V
00040 #define BAT_DIV 6//(BATTERY_WARNING_VOLTAGE-10000)/100
00041
00042
00043 #define ERROR_BEEP //sensor calibration errors signaled by buzzer
00044 #define INIT_BEEP //double beep during system initialization
00045
00046 #define ControllerCyclesPerSecond 1000
00047
00048 #define OFF 0
00049 #define ON 1
00050
00051 #define NORMAL 0
00052
00053
00054
00055 #define PD_IMURAWDATA 0x01
00056 #define PD_LLSTATUS 0x02
00057 #define PD_IMUCALCDATA 0x03
00058 #define PD_HLSTATUS 0x04
00059
00060 #define PD_CTRLOUT 0x11
00061 #define PD_FLIGHTPARAMS 0x12
00062 #define PD_CTRLCOMMANDS 0x13
00063 #define PD_CTRLINTERNAL 0x14
00064 #define PD_RCDATA 0x15
00065 #define PD_CTRLSTATUS 0x16
00066
00067 #define PD_WAYPOINT 0x20
00068 #define PD_CURRENTWAY 0x21
00069 #define PD_NMEADATA 0x22
00070 #define PD_GPSDATA 0x23
00071
00072 #define PD_CAMERACOMMANDS 0x30
00073 #define PD_RO_ALL_DATA 0x90
00074
00075
00076
00077 #define FM_COMPASS_FAILURE 0x10
00078 #define FM_CALIBRATION_ERROR 0x100
00079 #define FM_CALIBRATION_ERROR_GYROS 0x200
00080 #define FM_CALIBRATION_ERROR_ACC 0x400
00081 #define FM_ADC_STARTUP_ERROR 0x800
00082 #define FM_MAG_FIELD_STRENGTH_ERROR 0x4000
00083 #define FM_MAG_INCLINATION_ERROR 0x8000
00084
00085
00086
00087 struct IMU_CALCDATA {
00088
00089 int angle_nick;
00090 int angle_roll;
00091 int angle_yaw;
00092
00093
00094 int angvel_nick;
00095 int angvel_roll;
00096 int angvel_yaw;
00097
00098
00099 short acc_x_calib;
00100 short acc_y_calib;
00101 short acc_z_calib;
00102
00103
00104 short acc_x;
00105 short acc_y;
00106 short acc_z;
00107
00108
00109 int acc_angle_nick;
00110 int acc_angle_roll;
00111
00112
00113 int acc_absolute_value;
00114
00115
00116 int Hx;
00117 int Hy;
00118 int Hz;
00119
00120
00121 int mag_heading;
00122
00123
00124 int speed_x;
00125 int speed_y;
00126 int speed_z;
00127
00128
00129 int height;
00130
00131
00132 int dheight;
00133
00134
00135 int dheight_reference;
00136
00137
00138 int height_reference;
00139 };
00140 extern struct IMU_CALCDATA IMU_CalcData, IMU_CalcData_tmp;
00141
00142
00143
00144 #endif
00145