Ian Hua / Quadcopter-mbedRTOS
Committer:
pHysiX
Date:
Sat May 10 01:39:02 2014 +0000
Revision:
27:18b6580eb0b1
Parent:
22:ef8aa9728013
Child:
30:d9b988f8d84f
Alternative1: Run Master only when YPR is updated

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 22:ef8aa9728013 5 */
pHysiX 22:ef8aa9728013 6
pHysiX 1:43f8ac7ca6d7 7 #include "mbed.h"
pHysiX 1:43f8ac7ca6d7 8 #include "MPU6050_6Axis_MotionApps20.h"
pHysiX 3:605fbcb54e75 9 #include "PID.h"
pHysiX 12:953d25061417 10 #include "MPL3115A2.h"
pHysiX 12:953d25061417 11
pHysiX 12:953d25061417 12 #ifdef ENABLE_COMPASS
pHysiX 12:953d25061417 13 #include "HMC5883L.h"
pHysiX 12:953d25061417 14 #endif
pHysiX 1:43f8ac7ca6d7 15
pHysiX 1:43f8ac7ca6d7 16 #ifndef _SETUP_H_
pHysiX 1:43f8ac7ca6d7 17 #define _SETUP_H_
pHysiX 1:43f8ac7ca6d7 18
pHysiX 22:ef8aa9728013 19 /* PID Gains: */
pHysiX 22:ef8aa9728013 20 extern float KP_PITCH_STABLE;
pHysiX 22:ef8aa9728013 21 extern float KP_ROLL_STABLE;
pHysiX 20:b193a50a2ba3 22 extern float KP_YAW_RATE;
pHysiX 20:b193a50a2ba3 23 extern float KP_PITCH_RATE;
pHysiX 20:b193a50a2ba3 24 extern float KP_ROLL_RATE;
pHysiX 21:b642c18eccd1 25 extern float PID_TI_RATE;
pHysiX 21:b642c18eccd1 26 extern float PID_TI_STABLE;
pHysiX 21:b642c18eccd1 27
pHysiX 22:ef8aa9728013 28 /* Sensors and devices: */
pHysiX 1:43f8ac7ca6d7 29 extern Serial BT;
pHysiX 1:43f8ac7ca6d7 30 extern DigitalOut BT_CMD;
pHysiX 1:43f8ac7ca6d7 31 extern MPU6050 imu;
pHysiX 1:43f8ac7ca6d7 32 extern uint16_t packetSize;
pHysiX 22:ef8aa9728013 33 extern MPL3115A2 altimeter;
pHysiX 22:ef8aa9728013 34 extern PwmOut ESC[4];
pHysiX 12:953d25061417 35
pHysiX 22:ef8aa9728013 36 /* PID Devices: */
pHysiX 21:b642c18eccd1 37 extern PID pitchPIDstable;
pHysiX 21:b642c18eccd1 38 extern PID rollPIDstable;
pHysiX 3:605fbcb54e75 39 extern PID yawPIDrate;
pHysiX 3:605fbcb54e75 40 extern PID pitchPIDrate;
pHysiX 3:605fbcb54e75 41 extern PID rollPIDrate;
pHysiX 1:43f8ac7ca6d7 42
pHysiX 22:ef8aa9728013 43 /* Setup routines: */
pHysiX 3:605fbcb54e75 44 bool setupALLdevices(void);
pHysiX 2:ab967d7b4346 45 bool setup_ESC(void);
pHysiX 1:43f8ac7ca6d7 46 bool setup_bt(void);
pHysiX 3:605fbcb54e75 47 bool setup_PID(void);
pHysiX 1:43f8ac7ca6d7 48 bool setup_mpu6050(void);
pHysiX 22:ef8aa9728013 49 bool setup_altimeter(void);
pHysiX 22:ef8aa9728013 50
pHysiX 12:953d25061417 51 #ifdef ENABLE_COMPASS
pHysiX 22:ef8aa9728013 52 extern HMC5883L compass;
pHysiX 12:953d25061417 53 bool setup_compass(void);
pHysiX 12:953d25061417 54 #endif
pHysiX 1:43f8ac7ca6d7 55
pHysiX 1:43f8ac7ca6d7 56 #endif