Ian Hua / Quadcopter-mbedRTOS
Committer:
pHysiX
Date:
Mon May 19 13:33:34 2014 +0000
Revision:
49:c882f9135033
Parent:
48:9dbdc4144f00
Child:
50:8a0accb23007
Changing RtosTimer functions into Threads

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pHysiX 22:ef8aa9728013 1 /* File: setup.h
pHysiX 22:ef8aa9728013 2 * Author: Trung Tin Ian HUA
pHysiX 22:ef8aa9728013 3 * Date: May 2014
pHysiX 22:ef8aa9728013 4 * Purpose: Setup code to initialise all devices.
pHysiX 48:9dbdc4144f00 5 */
pHysiX 30:d9b988f8d84f 6 //#define TIME_TASK1
pHysiX 30:d9b988f8d84f 7 //#define TIME_TASK2M
pHysiX 30:d9b988f8d84f 8 //#define TIME_TASK2S
pHysiX 30:d9b988f8d84f 9 //#define TIME_TASK3
pHysiX 30:d9b988f8d84f 10 //#define TIME_TASK4
pHysiX 22:ef8aa9728013 11
pHysiX 1:43f8ac7ca6d7 12 #include "mbed.h"
pHysiX 1:43f8ac7ca6d7 13 #include "MPU6050_6Axis_MotionApps20.h"
pHysiX 48:9dbdc4144f00 14 #include "MPU6050_6Axis_MotionApps20_NB.h"
pHysiX 3:605fbcb54e75 15 #include "PID.h"
pHysiX 12:953d25061417 16 #include "MPL3115A2.h"
pHysiX 12:953d25061417 17
pHysiX 39:02782ad251db 18 #include "config.h"
pHysiX 39:02782ad251db 19
pHysiX 12:953d25061417 20 #ifdef ENABLE_COMPASS
pHysiX 12:953d25061417 21 #include "HMC5883L.h"
pHysiX 12:953d25061417 22 #endif
pHysiX 1:43f8ac7ca6d7 23
pHysiX 1:43f8ac7ca6d7 24 #ifndef _SETUP_H_
pHysiX 1:43f8ac7ca6d7 25 #define _SETUP_H_
pHysiX 1:43f8ac7ca6d7 26
pHysiX 22:ef8aa9728013 27 /* PID Gains: */
pHysiX 20:b193a50a2ba3 28 extern float KP_YAW_RATE;
pHysiX 20:b193a50a2ba3 29 extern float KP_PITCH_RATE;
pHysiX 20:b193a50a2ba3 30 extern float KP_ROLL_RATE;
pHysiX 32:7a9be7761c46 31 extern float TI_YAW_RATE;
pHysiX 32:7a9be7761c46 32 extern float TI_PITCH_RATE;
pHysiX 32:7a9be7761c46 33 extern float TI_ROLL_RATE;
pHysiX 39:02782ad251db 34
pHysiX 39:02782ad251db 35 extern float KP_PITCH_ATTITUDE;
pHysiX 39:02782ad251db 36 extern float KP_ROLL_ATTITUDE;
pHysiX 39:02782ad251db 37 extern float TI_PITCH_ATTITUDE;
pHysiX 39:02782ad251db 38 extern float TI_ROLL_ATTITUDE;
pHysiX 21:b642c18eccd1 39
pHysiX 22:ef8aa9728013 40 /* Sensors and devices: */
pHysiX 1:43f8ac7ca6d7 41 extern Serial BT;
pHysiX 49:c882f9135033 42 extern Serial PC;
pHysiX 1:43f8ac7ca6d7 43 extern DigitalOut BT_CMD;
pHysiX 48:9dbdc4144f00 44 extern AnalogIn voltageSense;
pHysiX 48:9dbdc4144f00 45 //extern MPU6050 imu;
pHysiX 48:9dbdc4144f00 46 extern MPU6050_NB imu_nb;
pHysiX 1:43f8ac7ca6d7 47 extern uint16_t packetSize;
pHysiX 22:ef8aa9728013 48 extern MPL3115A2 altimeter;
pHysiX 22:ef8aa9728013 49 extern PwmOut ESC[4];
pHysiX 12:953d25061417 50
pHysiX 22:ef8aa9728013 51 /* PID Devices: */
pHysiX 39:02782ad251db 52 extern PID pitchPIDattitude;
pHysiX 39:02782ad251db 53 extern PID rollPIDattitude;
pHysiX 3:605fbcb54e75 54 extern PID yawPIDrate;
pHysiX 3:605fbcb54e75 55 extern PID pitchPIDrate;
pHysiX 3:605fbcb54e75 56 extern PID rollPIDrate;
pHysiX 1:43f8ac7ca6d7 57
pHysiX 22:ef8aa9728013 58 /* Setup routines: */
pHysiX 3:605fbcb54e75 59 bool setupALLdevices(void);
pHysiX 2:ab967d7b4346 60 bool setup_ESC(void);
pHysiX 1:43f8ac7ca6d7 61 bool setup_bt(void);
pHysiX 3:605fbcb54e75 62 bool setup_PID(void);
pHysiX 1:43f8ac7ca6d7 63 bool setup_mpu6050(void);
pHysiX 22:ef8aa9728013 64 bool setup_altimeter(void);
pHysiX 22:ef8aa9728013 65
pHysiX 12:953d25061417 66 #ifdef ENABLE_COMPASS
pHysiX 22:ef8aa9728013 67 extern HMC5883L compass;
pHysiX 12:953d25061417 68 bool setup_compass(void);
pHysiX 12:953d25061417 69 #endif
pHysiX 1:43f8ac7ca6d7 70
pHysiX 1:43f8ac7ca6d7 71 #endif