syouichi imamori
/
MulticopterQuadX
Quad X Type Multicopter
config.h@0:cca1c4e84da4, 2013-07-11 (annotated)
- Committer:
- komaida424
- Date:
- Thu Jul 11 19:18:44 2013 +0000
- Revision:
- 0:cca1c4e84da4
- Child:
- 2:59ac9df97701
version1.03
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
komaida424 | 0:cca1c4e84da4 | 1 | #ifndef CONFIG_H |
komaida424 | 0:cca1c4e84da4 | 2 | #define CONFIG_H |
komaida424 | 0:cca1c4e84da4 | 3 | |
komaida424 | 0:cca1c4e84da4 | 4 | #define SERIAL_LCD |
komaida424 | 0:cca1c4e84da4 | 5 | //#define LPCXpresso |
komaida424 | 0:cca1c4e84da4 | 6 | //#define LocalFileOut |
komaida424 | 0:cca1c4e84da4 | 7 | |
komaida424 | 0:cca1c4e84da4 | 8 | #define TX_TYPE 0 // 0:FM 1:IR |
komaida424 | 0:cca1c4e84da4 | 9 | #define Thro_Min 25 |
komaida424 | 0:cca1c4e84da4 | 10 | #define Thro_Lo 75 |
komaida424 | 0:cca1c4e84da4 | 11 | #define Thro_Hi 950 |
komaida424 | 0:cca1c4e84da4 | 12 | #define Pulse_Min 1000 |
komaida424 | 0:cca1c4e84da4 | 13 | #define Pulse_Max 2000 |
komaida424 | 0:cca1c4e84da4 | 14 | #define Stick_Limit 150 |
komaida424 | 0:cca1c4e84da4 | 15 | #define M1 M[0] |
komaida424 | 0:cca1c4e84da4 | 16 | #define M2 M[1] |
komaida424 | 0:cca1c4e84da4 | 17 | #define M3 M[2] |
komaida424 | 0:cca1c4e84da4 | 18 | #define M4 M[3] |
komaida424 | 0:cca1c4e84da4 | 19 | #define M5 M[4] |
komaida424 | 0:cca1c4e84da4 | 20 | #define M6 M[5] |
komaida424 | 0:cca1c4e84da4 | 21 | #define THR CH[0] |
komaida424 | 0:cca1c4e84da4 | 22 | #define AIL CH[1] |
komaida424 | 0:cca1c4e84da4 | 23 | #define ELE CH[2] |
komaida424 | 0:cca1c4e84da4 | 24 | #define RUD CH[3] |
komaida424 | 0:cca1c4e84da4 | 25 | #define AUX CH[4] |
komaida424 | 0:cca1c4e84da4 | 26 | #define _ITG3200 0x00 |
komaida424 | 0:cca1c4e84da4 | 27 | #define _L3GD20 0x01 |
komaida424 | 0:cca1c4e84da4 | 28 | |
komaida424 | 0:cca1c4e84da4 | 29 | //enum PortNum{Port_THR=1,Port_AIL=3,Port_ELE=5,Port_RUD=7,Port_AUX=6}; |
komaida424 | 0:cca1c4e84da4 | 30 | enum IRNum{IR_THR=1,IR_AIL,IR_ELE,IR_RUD,IR_AUX}; //Input Pulse Sequence |
komaida424 | 0:cca1c4e84da4 | 31 | enum channel{ROL=0,PIT,YAW,COL,GAIN}; |
komaida424 | 0:cca1c4e84da4 | 32 | |
komaida424 | 0:cca1c4e84da4 | 33 | |
komaida424 | 0:cca1c4e84da4 | 34 | struct config { |
komaida424 | 0:cca1c4e84da4 | 35 | float Revision; |
komaida424 | 0:cca1c4e84da4 | 36 | int Struct_Size; |
komaida424 | 0:cca1c4e84da4 | 37 | int Stick_Ref[5]; //Stick Neutral Position |
komaida424 | 0:cca1c4e84da4 | 38 | float Stick_Mix[3]; //Mixing ratio of stick operation |
komaida424 | 0:cca1c4e84da4 | 39 | signed char Gyro_Dir[4]; |
komaida424 | 0:cca1c4e84da4 | 40 | float Gyro_Gain[6]; |
komaida424 | 0:cca1c4e84da4 | 41 | signed char Accel_Dir[4]; |
komaida424 | 0:cca1c4e84da4 | 42 | float Accel_Gain[3]; |
komaida424 | 0:cca1c4e84da4 | 43 | int Gyro_Gain_Setting; |
komaida424 | 0:cca1c4e84da4 | 44 | int Gyro_Divider; |
komaida424 | 0:cca1c4e84da4 | 45 | int Gyro_LPF_Value; |
komaida424 | 0:cca1c4e84da4 | 46 | int Gyro_SamplRate_Divider; |
komaida424 | 0:cca1c4e84da4 | 47 | int LCD_Contrast; |
komaida424 | 0:cca1c4e84da4 | 48 | int PWM_Mode; |
komaida424 | 0:cca1c4e84da4 | 49 | float Gyro_Stick_offset_effect; |
komaida424 | 0:cca1c4e84da4 | 50 | int PWM_Interval; |
komaida424 | 0:cca1c4e84da4 | 51 | // int Accel_Rang; |
komaida424 | 0:cca1c4e84da4 | 52 | // int Accel_Rate; |
komaida424 | 0:cca1c4e84da4 | 53 | // int PWM_Resolution; |
komaida424 | 0:cca1c4e84da4 | 54 | char StartMode; |
komaida424 | 0:cca1c4e84da4 | 55 | char Gyro_Type; |
komaida424 | 0:cca1c4e84da4 | 56 | public: |
komaida424 | 0:cca1c4e84da4 | 57 | config() { |
komaida424 | 0:cca1c4e84da4 | 58 | Revision = 1.03; |
komaida424 | 0:cca1c4e84da4 | 59 | Struct_Size = sizeof(config); |
komaida424 | 0:cca1c4e84da4 | 60 | Stick_Ref[0] = 1500; |
komaida424 | 0:cca1c4e84da4 | 61 | Stick_Ref[1] = 1500; |
komaida424 | 0:cca1c4e84da4 | 62 | Stick_Ref[2] = 1500; |
komaida424 | 0:cca1c4e84da4 | 63 | Stick_Ref[3] = 1100; |
komaida424 | 0:cca1c4e84da4 | 64 | Stick_Ref[4] = 1500; |
komaida424 | 0:cca1c4e84da4 | 65 | Stick_Mix[0] = 0.5; |
komaida424 | 0:cca1c4e84da4 | 66 | Stick_Mix[1] = 0.5; |
komaida424 | 0:cca1c4e84da4 | 67 | Stick_Mix[2] = 1.0; |
komaida424 | 0:cca1c4e84da4 | 68 | Gyro_Dir[0] = 1; |
komaida424 | 0:cca1c4e84da4 | 69 | Gyro_Dir[1] = 1; |
komaida424 | 0:cca1c4e84da4 | 70 | Gyro_Dir[2] = 1; |
komaida424 | 0:cca1c4e84da4 | 71 | Gyro_Dir[3] = -1; |
komaida424 | 0:cca1c4e84da4 | 72 | Gyro_Gain[0] = 0.40; |
komaida424 | 0:cca1c4e84da4 | 73 | Gyro_Gain[1] = 0.40; |
komaida424 | 0:cca1c4e84da4 | 74 | Gyro_Gain[2] = 0.40; |
komaida424 | 0:cca1c4e84da4 | 75 | Gyro_Gain[3] = 0.00; |
komaida424 | 0:cca1c4e84da4 | 76 | Gyro_Gain[4] = 0.00; |
komaida424 | 0:cca1c4e84da4 | 77 | Gyro_Gain[5] = 0.00; |
komaida424 | 0:cca1c4e84da4 | 78 | Accel_Dir[0] = 1; |
komaida424 | 0:cca1c4e84da4 | 79 | Accel_Dir[1] = 1; |
komaida424 | 0:cca1c4e84da4 | 80 | Accel_Dir[2] = 1; |
komaida424 | 0:cca1c4e84da4 | 81 | Accel_Dir[3] = 1; |
komaida424 | 0:cca1c4e84da4 | 82 | Accel_Gain[0] = 0.50; |
komaida424 | 0:cca1c4e84da4 | 83 | Accel_Gain[1] = 0.50; |
komaida424 | 0:cca1c4e84da4 | 84 | Accel_Gain[2] = 0.50; |
komaida424 | 0:cca1c4e84da4 | 85 | Gyro_Gain_Setting = -1; |
komaida424 | 0:cca1c4e84da4 | 86 | Gyro_Divider=7; |
komaida424 | 0:cca1c4e84da4 | 87 | Gyro_LPF_Value=0; |
komaida424 | 0:cca1c4e84da4 | 88 | Gyro_SamplRate_Divider=1; |
komaida424 | 0:cca1c4e84da4 | 89 | LCD_Contrast = 60; |
komaida424 | 0:cca1c4e84da4 | 90 | PWM_Mode = 1; |
komaida424 | 0:cca1c4e84da4 | 91 | Gyro_Stick_offset_effect = 0.00; |
komaida424 | 0:cca1c4e84da4 | 92 | PWM_Interval = 3000; |
komaida424 | 0:cca1c4e84da4 | 93 | // Accel_Rang = 2; |
komaida424 | 0:cca1c4e84da4 | 94 | // Accel_Rate = 14; |
komaida424 | 0:cca1c4e84da4 | 95 | // PWM_Resolution = 0; |
komaida424 | 0:cca1c4e84da4 | 96 | StartMode = 'C'; |
komaida424 | 0:cca1c4e84da4 | 97 | Gyro_Type = _ITG3200; |
komaida424 | 0:cca1c4e84da4 | 98 | } |
komaida424 | 0:cca1c4e84da4 | 99 | }; |
komaida424 | 0:cca1c4e84da4 | 100 | #endif |
komaida424 | 0:cca1c4e84da4 | 101 | |
komaida424 | 0:cca1c4e84da4 | 102 | |
komaida424 | 0:cca1c4e84da4 | 103 | |
komaida424 | 0:cca1c4e84da4 | 104 | |
komaida424 | 0:cca1c4e84da4 | 105 | |
komaida424 | 0:cca1c4e84da4 | 106 |