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
- Committer:
- pHysiX
- Date:
- 2014-05-14
- Revision:
- 39:02782ad251db
- Parent:
- 32:7a9be7761c46
- Child:
- 48:9dbdc4144f00
File content as of revision 39:02782ad251db:
/* File:    setup.h
 * Author:  Trung Tin Ian HUA
 * Date:    May 2014
 * Purpose: Setup code to initialise all devices.
 */ 
//#define TIME_TASK1
//#define TIME_TASK2M
//#define TIME_TASK2S
//#define TIME_TASK3
//#define TIME_TASK4
#include "mbed.h"
#include "MPU6050_6Axis_MotionApps20.h"
#include "PID.h"
#include "MPL3115A2.h"
#include "config.h"
#ifdef ENABLE_COMPASS
#include "HMC5883L.h"
#endif
#ifndef _SETUP_H_
#define _SETUP_H_
/* PID Gains: */
extern float KP_YAW_RATE;
extern float KP_PITCH_RATE;
extern float KP_ROLL_RATE;
extern float TI_YAW_RATE;
extern float TI_PITCH_RATE;
extern float TI_ROLL_RATE;
extern float KP_PITCH_ATTITUDE;
extern float KP_ROLL_ATTITUDE;
extern float TI_PITCH_ATTITUDE;
extern float TI_ROLL_ATTITUDE;
/* Sensors and devices: */
extern Serial BT;
extern DigitalOut BT_CMD;
extern MPU6050 imu;
extern uint16_t packetSize;
extern MPL3115A2 altimeter;
extern PwmOut ESC[4];
/* PID Devices: */
extern PID pitchPIDattitude;
extern PID rollPIDattitude;
extern PID yawPIDrate;
extern PID pitchPIDrate;
extern PID rollPIDrate;
/* Setup routines: */
bool setupALLdevices(void);
bool setup_ESC(void);
bool setup_bt(void);
bool setup_PID(void);
bool setup_mpu6050(void);
bool setup_altimeter(void);
#ifdef ENABLE_COMPASS
extern HMC5883L compass;
bool setup_compass(void);
#endif
#endif