Equator Strut Controller

Dependents:   EquatorStrutDigitalMonitor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers EquatorStrutController.h Source File

EquatorStrutController.h

00001 #ifndef EQUATOR_STRUT_CONTROLLER_H
00002 #define EQUATOR_STRUT_CONTROLLER_H
00003 
00004 #include "mbed.h"
00005 
00006 class EquatorStrut
00007 {
00008 public:
00009     EquatorStrut();
00010     void SetPower(double power);
00011     double GetPosition();
00012     double CurrentSpeed();
00013     double CurrentPower();
00014     void Home();
00015     void Enable();
00016     void Disable();
00017     bool IsEnabled();
00018     
00019 private:
00020     DigitalIn* HallSensorState;
00021     InterruptIn* RGHSinInterrupt;
00022     InterruptIn* RGHCosInterrupt;
00023     InterruptIn* RGHSinFallingInterrupt;
00024     InterruptIn* RGHCosFallingInterrupt;
00025     InterruptIn* HallSensor;
00026     DigitalOut* ResetLine;
00027     PwmOut* PhaseA;
00028     PwmOut* PhaseB;
00029     Timer* RunningTime;
00030     
00031     void RGHSinRisingHandler();
00032     void RGHCosRisingHandler();
00033     void RGHSinFallingHandler();
00034     void RGHCosFallingHandler();
00035     void ActionEvent(bool currHigh, bool currSin);
00036     
00037     void DisableInterrupts();
00038     void EnableInterrupts();
00039     
00040     void HallEffectFall();
00041     
00042     volatile int position;
00043     volatile int direction;
00044     
00045     volatile double currentPower;
00046     
00047     volatile bool Homing;
00048     volatile bool HallTriggered;
00049     volatile bool Enabled;
00050     
00051     double SpeedInterval;
00052     int LastPosition;
00053     
00054     volatile bool SinHigh;
00055     volatile bool CosHigh;
00056     volatile bool LastSin;
00057     volatile bool LastHigh;
00058 };
00059 
00060 #endif