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@50:8a0accb23007, 2014-05-19 (annotated)
- Committer:
- pHysiX
- Date:
- Mon May 19 14:16:47 2014 +0000
- Revision:
- 50:8a0accb23007
- Parent:
- 49:c882f9135033
Semaphores implemented, currently no hanging. Need to test flight
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 | 48:9dbdc4144f00 | 5 | */ |
| pHysiX | 1:43f8ac7ca6d7 | 6 | #include "mbed.h" |
| pHysiX | 1:43f8ac7ca6d7 | 7 | #include "MPU6050_6Axis_MotionApps20.h" |
| pHysiX | 48:9dbdc4144f00 | 8 | #include "MPU6050_6Axis_MotionApps20_NB.h" |
| pHysiX | 3:605fbcb54e75 | 9 | #include "PID.h" |
| pHysiX | 12:953d25061417 | 10 | #include "MPL3115A2.h" |
| pHysiX | 12:953d25061417 | 11 | |
| pHysiX | 39:02782ad251db | 12 | #include "config.h" |
| pHysiX | 39:02782ad251db | 13 | |
| pHysiX | 12:953d25061417 | 14 | #ifdef ENABLE_COMPASS |
| pHysiX | 12:953d25061417 | 15 | #include "HMC5883L.h" |
| pHysiX | 12:953d25061417 | 16 | #endif |
| pHysiX | 1:43f8ac7ca6d7 | 17 | |
| pHysiX | 1:43f8ac7ca6d7 | 18 | #ifndef _SETUP_H_ |
| pHysiX | 1:43f8ac7ca6d7 | 19 | #define _SETUP_H_ |
| pHysiX | 1:43f8ac7ca6d7 | 20 | |
| pHysiX | 22:ef8aa9728013 | 21 | /* PID Gains: */ |
| 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 | 32:7a9be7761c46 | 25 | extern float TI_YAW_RATE; |
| pHysiX | 32:7a9be7761c46 | 26 | extern float TI_PITCH_RATE; |
| pHysiX | 32:7a9be7761c46 | 27 | extern float TI_ROLL_RATE; |
| pHysiX | 39:02782ad251db | 28 | |
| pHysiX | 39:02782ad251db | 29 | extern float KP_PITCH_ATTITUDE; |
| pHysiX | 39:02782ad251db | 30 | extern float KP_ROLL_ATTITUDE; |
| pHysiX | 39:02782ad251db | 31 | extern float TI_PITCH_ATTITUDE; |
| pHysiX | 39:02782ad251db | 32 | extern float TI_ROLL_ATTITUDE; |
| pHysiX | 21:b642c18eccd1 | 33 | |
| pHysiX | 22:ef8aa9728013 | 34 | /* Sensors and devices: */ |
| pHysiX | 1:43f8ac7ca6d7 | 35 | extern Serial BT; |
| pHysiX | 49:c882f9135033 | 36 | extern Serial PC; |
| pHysiX | 1:43f8ac7ca6d7 | 37 | extern DigitalOut BT_CMD; |
| pHysiX | 48:9dbdc4144f00 | 38 | extern AnalogIn voltageSense; |
| pHysiX | 48:9dbdc4144f00 | 39 | //extern MPU6050 imu; |
| pHysiX | 48:9dbdc4144f00 | 40 | extern MPU6050_NB imu_nb; |
| pHysiX | 1:43f8ac7ca6d7 | 41 | extern uint16_t packetSize; |
| pHysiX | 22:ef8aa9728013 | 42 | extern MPL3115A2 altimeter; |
| pHysiX | 22:ef8aa9728013 | 43 | extern PwmOut ESC[4]; |
| pHysiX | 12:953d25061417 | 44 | |
| pHysiX | 22:ef8aa9728013 | 45 | /* PID Devices: */ |
| pHysiX | 39:02782ad251db | 46 | extern PID pitchPIDattitude; |
| pHysiX | 39:02782ad251db | 47 | extern PID rollPIDattitude; |
| pHysiX | 3:605fbcb54e75 | 48 | extern PID yawPIDrate; |
| pHysiX | 3:605fbcb54e75 | 49 | extern PID pitchPIDrate; |
| pHysiX | 3:605fbcb54e75 | 50 | extern PID rollPIDrate; |
| pHysiX | 1:43f8ac7ca6d7 | 51 | |
| pHysiX | 22:ef8aa9728013 | 52 | /* Setup routines: */ |
| pHysiX | 3:605fbcb54e75 | 53 | bool setupALLdevices(void); |
| pHysiX | 2:ab967d7b4346 | 54 | bool setup_ESC(void); |
| pHysiX | 1:43f8ac7ca6d7 | 55 | bool setup_bt(void); |
| pHysiX | 3:605fbcb54e75 | 56 | bool setup_PID(void); |
| pHysiX | 1:43f8ac7ca6d7 | 57 | bool setup_mpu6050(void); |
| pHysiX | 22:ef8aa9728013 | 58 | bool setup_altimeter(void); |
| pHysiX | 22:ef8aa9728013 | 59 | |
| pHysiX | 12:953d25061417 | 60 | #ifdef ENABLE_COMPASS |
| pHysiX | 22:ef8aa9728013 | 61 | extern HMC5883L compass; |
| pHysiX | 12:953d25061417 | 62 | bool setup_compass(void); |
| pHysiX | 12:953d25061417 | 63 | #endif |
| pHysiX | 1:43f8ac7ca6d7 | 64 | |
| pHysiX | 1:43f8ac7ca6d7 | 65 | #endif |