![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Testing 1 blue pill
Dependencies: mbed mbed-rtos TextLCD
Diff: Interface/Interface.hpp
- Revision:
- 23:07a368f2cdb1
- Parent:
- 22:fc2186b610b5
- Child:
- 25:9751619fa030
--- a/Interface/Interface.hpp Sat Feb 16 12:43:26 2019 +0000 +++ b/Interface/Interface.hpp Sat Feb 16 15:19:21 2019 +0000 @@ -3,15 +3,15 @@ #include "mbed.h" #include "STEPPER_MOTOR.hpp" //Include this to use the stepper motor -//Led Outputs //check the pin outs. -//Led Outputs //check the pin outs. +//Led Outputs //check the pin outs static DigitalOut Led_Select_Left(D2); static DigitalOut Led_Select_Right(D3); static DigitalOut Led_Power(A2); static STEPPER_MOTOR STEPPER_MOTOR_1(D15,D14,D13,D12); +static PwmOut Tendon_Power(PE_8); -class INTERFACE //This creates a class called Led +class INTERFACE//This creates a class called Led { public: //Public member variables @@ -29,11 +29,14 @@ void Interface_main();//Main Routine //Setters to assign data to the private memeber variables - void Set_No_Of_Rotations(int Rotations); + void Set_System_Running(int System_Running); void Set_Function(int Function); void Set_Twist_Go(bool Twist_Go); void Set_Anneal_Go(bool Anneal_Go); void Set_Test_Go(bool Test_Go); + void Set_Twist_Stop(bool Twist_Stop); + void Set_Anneal_Stop(bool Anneal_Stop); + void Set_Test_Stop(bool Test_Stop); void Set_Select(bool Select); void Set_Turns_Done(int Turns_Done); void Set_Turns_To_Do(int Turns_To_Do); @@ -43,11 +46,14 @@ void Set_Power_Time(float Power_Time); //Getters to receive private information - int Get_No_Of_Rotations(); + int Get_System_Running(); int Get_Function(); bool Get_Twist_Go(); bool Get_Anneal_Go(); bool Get_Test_Go(); + bool Get_Twist_Stop(); + bool Get_Anneal_Stop(); + bool Get_Test_Stop(); bool Get_Select(); int Get_Turns_Done(); int Get_Turns_To_Do(); @@ -58,12 +64,20 @@ private: //Private member variables to prevent them being accessed externally - + int _System_Running; int _No_Of_Rotations; int _Function; + + //Start bool _Twist_Go; bool _Anneal_Go; bool _Test_Go; + + //Stop + bool _Twist_Stop; + bool _Anneal_Stop; + bool _Test_Stop; + bool _Select; int _Turns_Done; int _Turns_Todo; @@ -72,5 +86,27 @@ int _Duty_Cycle; int _Power_Time; + + //Mutex Locks + Mutex _System_Running_mutex; + Mutex _No_Of_Rotations_mutex; + Mutex _Function_mutex; + Mutex _Twist_Go_mutex; + Mutex _Anneal_Go_mutex; + Mutex _Test_Go_mutex; + Mutex _Twist_Stop_mutex; + Mutex _Anneal_Stop_mutex; + Mutex _Test_Stop_mutex; + Mutex _Select_mutex; + Mutex _Turns_Done_mutex; + Mutex _Turns_Todo_mutex; + Mutex _Loop_mutex; + Mutex _Wait_Time_mutex;//IN SECONDS + Mutex _Duty_Cycle_mutex; + Mutex _Power_Time_mutex; + Mutex _Tendon_mutex; + Mutex Led_Select_Left_mutex; + Mutex Led_Select_Right_mutex; + Mutex Led_Power_mutex; }; #endif//INTERFACE_HPP \ No newline at end of file