Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
RTOS-Setup/inc/setup.h@30:d9b988f8d84f, 2014-05-12 (annotated)
- Committer:
- pHysiX
- Date:
- Mon May 12 04:43:38 2014 +0000
- Revision:
- 30:d9b988f8d84f
- Parent:
- 27:18b6580eb0b1
- Child:
- 32:7a9be7761c46
WIP
Who changed what in which revision?
| User | Revision | Line number | New 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 | 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 | 3:605fbcb54e75 | 14 | #include "PID.h" |
| pHysiX | 12:953d25061417 | 15 | #include "MPL3115A2.h" |
| pHysiX | 12:953d25061417 | 16 | |
| pHysiX | 12:953d25061417 | 17 | #ifdef ENABLE_COMPASS |
| pHysiX | 12:953d25061417 | 18 | #include "HMC5883L.h" |
| pHysiX | 12:953d25061417 | 19 | #endif |
| pHysiX | 1:43f8ac7ca6d7 | 20 | |
| pHysiX | 1:43f8ac7ca6d7 | 21 | #ifndef _SETUP_H_ |
| pHysiX | 1:43f8ac7ca6d7 | 22 | #define _SETUP_H_ |
| pHysiX | 1:43f8ac7ca6d7 | 23 | |
| pHysiX | 22:ef8aa9728013 | 24 | /* PID Gains: */ |
| pHysiX | 22:ef8aa9728013 | 25 | extern float KP_PITCH_STABLE; |
| pHysiX | 22:ef8aa9728013 | 26 | extern float KP_ROLL_STABLE; |
| pHysiX | 20:b193a50a2ba3 | 27 | extern float KP_YAW_RATE; |
| pHysiX | 20:b193a50a2ba3 | 28 | extern float KP_PITCH_RATE; |
| pHysiX | 20:b193a50a2ba3 | 29 | extern float KP_ROLL_RATE; |
| pHysiX | 21:b642c18eccd1 | 30 | extern float PID_TI_RATE; |
| pHysiX | 21:b642c18eccd1 | 31 | extern float PID_TI_STABLE; |
| pHysiX | 21:b642c18eccd1 | 32 | |
| pHysiX | 22:ef8aa9728013 | 33 | /* Sensors and devices: */ |
| pHysiX | 1:43f8ac7ca6d7 | 34 | extern Serial BT; |
| pHysiX | 1:43f8ac7ca6d7 | 35 | extern DigitalOut BT_CMD; |
| pHysiX | 1:43f8ac7ca6d7 | 36 | extern MPU6050 imu; |
| pHysiX | 1:43f8ac7ca6d7 | 37 | extern uint16_t packetSize; |
| pHysiX | 22:ef8aa9728013 | 38 | extern MPL3115A2 altimeter; |
| pHysiX | 22:ef8aa9728013 | 39 | extern PwmOut ESC[4]; |
| pHysiX | 12:953d25061417 | 40 | |
| pHysiX | 22:ef8aa9728013 | 41 | /* PID Devices: */ |
| pHysiX | 21:b642c18eccd1 | 42 | extern PID pitchPIDstable; |
| pHysiX | 21:b642c18eccd1 | 43 | extern PID rollPIDstable; |
| pHysiX | 3:605fbcb54e75 | 44 | extern PID yawPIDrate; |
| pHysiX | 3:605fbcb54e75 | 45 | extern PID pitchPIDrate; |
| pHysiX | 3:605fbcb54e75 | 46 | extern PID rollPIDrate; |
| pHysiX | 1:43f8ac7ca6d7 | 47 | |
| pHysiX | 22:ef8aa9728013 | 48 | /* Setup routines: */ |
| pHysiX | 3:605fbcb54e75 | 49 | bool setupALLdevices(void); |
| pHysiX | 2:ab967d7b4346 | 50 | bool setup_ESC(void); |
| pHysiX | 1:43f8ac7ca6d7 | 51 | bool setup_bt(void); |
| pHysiX | 3:605fbcb54e75 | 52 | bool setup_PID(void); |
| pHysiX | 1:43f8ac7ca6d7 | 53 | bool setup_mpu6050(void); |
| pHysiX | 22:ef8aa9728013 | 54 | bool setup_altimeter(void); |
| pHysiX | 22:ef8aa9728013 | 55 | |
| pHysiX | 12:953d25061417 | 56 | #ifdef ENABLE_COMPASS |
| pHysiX | 22:ef8aa9728013 | 57 | extern HMC5883L compass; |
| pHysiX | 12:953d25061417 | 58 | bool setup_compass(void); |
| pHysiX | 12:953d25061417 | 59 | #endif |
| pHysiX | 1:43f8ac7ca6d7 | 60 | |
| pHysiX | 1:43f8ac7ca6d7 | 61 | #endif |