New version of quadcopter software written to OO principles
Dependencies: mbed MODSERIAL filter mbed-rtos ConfigFile PID PPM FreeIMU_external_magnetometer TinyGPS
Diff: Status/Status.h
- Revision:
- 0:c6a85bb2a827
- Child:
- 2:969dfa4f2436
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Status/Status.h Wed Mar 04 18:50:37 2015 +0000 @@ -0,0 +1,75 @@ +#include "mbed.h" + +#ifndef Status_H +#define Status_H + +class Status // begin declaration of the class +{ + public: // begin public section + Status(); // constructor + ~Status(); // destructor + + enum State + { + PREFLIGHT, + STANDBY, + GROUND_READY, + MANUAL, + STABILISED, + AUTO, + ABORT, + EMG_LAND, + EMG_OFF, + GROUND_ERROR + }; + + enum FlightMode + { + RATE, + STAB, + NOT_SET + }; + + enum BaseStationMode + { + MOTOR_POWER, + PID_OUTPUTS, + IMU_OUTPUTS, + STATUS, + MAPPED_RC, + PID_TUNING, + GPS, + ZERO, + RATE_TUNING, + STAB_TUNING, + ALTITUDE, + VELOCITY + }; + + bool initialise(); + bool setState(State state); + State getState(); + bool setFlightMode(FlightMode flightMode); + FlightMode getFlightMode(); + bool setBaseStationMode(BaseStationMode baseStationMode); + BaseStationMode getBaseStationMode(); + bool setBatteryLevel(float batteryLevel); + float getBatteryLevel(); + bool setArmed(bool armed); + bool getArmed(); + bool setInitialised(bool initialised); + bool getInitialised(); + bool setRcConnected(bool rcConnected); + bool getRcConnected(); + + private: + State _state; + FlightMode _flightMode; + BaseStationMode _baseStationMode; + float _batteryLevel; + bool _armed; + bool _initialised; + bool _rcConnected; +}; + +#endif \ No newline at end of file