Proj 324 Final

Fork of ELEC351_Group_T by Plymouth ELEC351 Group T

Committer:
thomasmorris
Date:
Mon May 07 15:44:34 2018 +0000
Revision:
53:71f59e195f06
Parent:
52:99915f5240b2
Child:
54:a4c5949707ca
To test version of code;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thomasmorris 52:99915f5240b2 1 /*
thomasmorris 52:99915f5240b2 2 Setup file for the main
thomasmorris 52:99915f5240b2 3 */
thomasmorris 52:99915f5240b2 4
thomasmorris 52:99915f5240b2 5 #ifndef SETUP_HPP//Header Guards Prevents Multiple includes
thomasmorris 52:99915f5240b2 6 #define SETUP_HPP
thomasmorris 52:99915f5240b2 7
thomasmorris 52:99915f5240b2 8 //Libraries and header includes
thomasmorris 25:36699ed589ab 9 #include "rtos.h"
thomasmorris 25:36699ed589ab 10 #include "LED.hpp"
thomasmorris 25:36699ed589ab 11 #include "LCD.hpp"
thomasmorris 25:36699ed589ab 12 #include "SERIAL.hpp"
thomasmorris 30:4cde05cc7c4f 13 #include "TIME.hpp"
thomasmorris 52:99915f5240b2 14 #include "SERIAL_COMMANDS.hpp"
thomasmorris 53:71f59e195f06 15 #include "sample_hardware.hpp"
thomasmorris 52:99915f5240b2 16 #include "THREADS.hpp"
thomasmorris 52:99915f5240b2 17 #include "LED_LOGGING.hpp"
thomasmorris 53:71f59e195f06 18 #include "STEPPER_MOTOR.hpp"
thomasmorris 53:71f59e195f06 19 #include "SPI.hpp"
thomasmorris 53:71f59e195f06 20 #include "Algorithm.hpp"
thomasmorris 53:71f59e195f06 21 #include <iostream>
thomasmorris 53:71f59e195f06 22 #include <bitset>
thomasmorris 38:8d86e0d8a816 23
thomasmorris 53:71f59e195f06 24 using namespace std;
thomasmorris 41:859b5e1e3d9a 25 //Time definitions
thomasmorris 45:875f7e18a386 26 #define TimerInterval 15 //This is in seconds
thomasmorris 52:99915f5240b2 27 #define SW1_SW2_Timeout_Time 15 //This is in seconds
thomasmorris 41:859b5e1e3d9a 28
thomasmorris 52:99915f5240b2 29 //Time outs
thomasmorris 52:99915f5240b2 30 Timeout SW1TimeOut; //Used to prevent lockups
thomasmorris 52:99915f5240b2 31 Timeout SW2TimeOut; //Used to prevent lockups
thomasmorris 41:859b5e1e3d9a 32
thomasmorris 53:71f59e195f06 33 LED Red_led(PE_15);
thomasmorris 53:71f59e195f06 34 LED Green_led(PB_11);
thomasmorris 53:71f59e195f06 35
thomasmorris 41:859b5e1e3d9a 36 //Forward Declarations of functions
thomasmorris 25:36699ed589ab 37
thomasmorris 25:36699ed589ab 38 void Serial_Comms();
chills 26:78f5e454e59f 39 void Console_Output_ISR();
thomasmorris 41:859b5e1e3d9a 40 void Serial_Comms_Data_Get();
thomasmorris 41:859b5e1e3d9a 41 void Console_Output_ISR();
thomasmorris 53:71f59e195f06 42 void Rotate_Steps();
thomasmorris 52:99915f5240b2 43 void SW1TimeOutHandler();
thomasmorris 52:99915f5240b2 44 void SW1FallingEdge();
thomasmorris 52:99915f5240b2 45 void SW2TimeOutHandler();
thomasmorris 52:99915f5240b2 46 void SW2FallingEdge();
thomasmorris 53:71f59e195f06 47 //Object creations
thomasmorris 53:71f59e195f06 48 static STEPPER_MOTOR STEPPER_MOTOR_1(D0,D1);//step then direction
thomasmorris 53:71f59e195f06 49 static STEPPER_MOTOR STEPPER_MOTOR_2(D2,D3);//step then direction
thomasmorris 53:71f59e195f06 50 static STEPPER_MOTOR STEPPER_MOTOR_3(D4,D5);//step then direction
thomasmorris 53:71f59e195f06 51 static STEPPER_MOTOR STEPPER_MOTOR_4(D6,D7);//step then direction
thomasmorris 53:71f59e195f06 52 static STEPPER_MOTOR STEPPER_MOTOR_5(D8,D9);//step then direction
thomasmorris 53:71f59e195f06 53 static STEPPER_MOTOR STEPPER_MOTOR_6(D10,D11);//step then direction
thomasmorris 53:71f59e195f06 54
thomasmorris 53:71f59e195f06 55 //Sets up the sides of the cube
thomasmorris 53:71f59e195f06 56 static SIDE SIDE1();
thomasmorris 53:71f59e195f06 57 static SIDE SIDE2();
thomasmorris 53:71f59e195f06 58 static SIDE SIDE3();
thomasmorris 53:71f59e195f06 59 static SIDE SIDE4();
thomasmorris 53:71f59e195f06 60 static SIDE SIDE5();
thomasmorris 53:71f59e195f06 61 static SIDE SIDE6();
thomasmorris 41:859b5e1e3d9a 62
thomasmorris 25:36699ed589ab 63 #endif