Testing 1 blue pill
Dependencies: mbed mbed-rtos TextLCD
Interface/Interface.hpp
- Committer:
- thomasmorris
- Date:
- 2019-03-13
- Revision:
- 29:f3b1387c81f1
- Parent:
- 28:3193157ebb0c
- Child:
- 30:a35f0ab97a65
File content as of revision 29:f3b1387c81f1:
#ifndef INTERFACE_HPP//Header Guards Prevents Multiple includes #define INTERFACE_HPP #include "mbed.h" #include "STEPPER_MOTOR.hpp" //Include this to use the stepper motor //Digital In for the button control to the interface static DigitalIn button_up(D8); //D8//Increment Button static DigitalIn button_down(A1); //A1//Decrement Button static DigitalIn button_start(D9); //D9//START / STOP BUTTON static DigitalIn button_function(A3); //A3//Function Button static DigitalIn button_select(A4);//A4//Select Button //Led Outputs //check the pin outs static DigitalOut Led_Select_Left(D2); static DigitalOut Led_Select_Right(D3); static DigitalOut Led_Power(A0); static STEPPER_MOTOR STEPPER_MOTOR_1(D15,D14,D13,D12); static PwmOut Tendon_Power(PE_8); class INTERFACE//This creates a class called Led { public: //Public member variables //Public Member Functions INTERFACE(); //Constructor ~INTERFACE();//Destructor void Interface_Init(int turns, int type_of_rig);//Set all values to 0 bar the passed in variable void Up();//Up Routine void Down();//Down Routine void Start_Stop();//Start / Stop Routine void Function();//Function Routine void Select();//Select Routine void Interface_main();//Main Routine //Setters to assign data to the private memeber variables 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(int Select); void Set_Turns_Done(int Turns_Done); void Set_Turns_To_Do(int Turns_To_Do); void Set_Loop(int Loop); void Set_On_Time(int On_Time); void Set_Off_Time(int Off_Time); void Set_Duty_Cycle(int Duty_Cycle); void Set_Power_Time(float Power_Time); void Set_Direction(bool Direction); //Getters to receive private information 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(); int Get_Select(); int Get_Turns_Done(); int Get_Turns_To_Do(); int Get_Loop(); int Get_On_Time(); int Get_Off_Time(); int Get_Duty_Cycle(); int Get_Power_Time(); bool Get_Direction(); 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; int _Select; int _Turns_Done; int _Turns_Todo; int _Loop; int _On_Time; int _Off_Time;//IN SECONDS int _Duty_Cycle; int _Power_Time; bool _Direction; int _Type_of_Rig; //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 _On_Time_mutex;//IN SECONDS Mutex _Off_Time_mutex; 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; Mutex _Direction_mutex; Mutex _Type_of_Rig_mutex; }; #endif//INTERFACE_HPP