![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Component Test's Software to work with "Universal Controller Box" - Software is an interpreter or "compiler" for programs to be done with a .txt file and read off of the SD Card
Dependencies: BridgeDriver FrontPanelButtons MCP23017 SDFileSystem TextLCD mbed
Initialization.hpp
- Committer:
- mehatfie
- Date:
- 2014-09-19
- Revision:
- 4:86d0d04cc055
- Parent:
- 3:078e9a1e8be3
- Child:
- 5:e36e0538a903
File content as of revision 4:86d0d04cc055:
#ifndef INITIALIZATION_HPP #define INITIALIZATION_HPP #include "mbed.h" #include "LocalPinNames.h" #include "BridgeDriver.h" #include "FrontPanelButtons.h" #include "TextLCD.h" #include "SDFileSystem.h" #include <string> #include <vector> /**********************************************************************************************************************************/ /**********************************************************************************************************************************/ /************************** <MUST MODIFY> *************************/ /**********************************************************************************************************************************/ /**********************************************************************************************************************************/ enum DeviceType{MOTOR, VOLTAGE_DRIVER, PIN_IN}; //ADD DEVICE NAME static const enum DeviceType Device_Map[] = {MOTOR, VOLTAGE_DRIVER, PIN_IN}; //AND HERE ***NOTE TO KEEP SAME ORDER /************************** <MUST MODIFY> *************************/ /**********************************************************************************************************************************/ /**********************************************************************************************************************************/ /******************************************************************************/ /*** <Global Initializations> ***/ /******************************************************************************/ //Initializations extern Timer timer; // general purpose timer extern I2C i2c; // I2C bus (SDA, SCL) extern BridgeDriver bridges; // Bridge extern TextLCD_I2C lcd; // LCD extern SDFileSystem sd; // the pinout on the mbed LPC1768 extern DigitalIn killSw; extern const int MAX_LINE_LENGTH; /******************************************************************************/ /*** <Function Initializations> ***/ /******************************************************************************/ void fullInit(); //Perform and call any needed initializations void initLCD(void); //Initialize the LCD /******************************************************************************/ /*** <Line Data Struct Initializations> ***/ /******************************************************************************/ struct Line{ //string fullLine; //full line, starting from the beginning int lineNumber; //current line number in the program txt file that is running //vector<string> word; string word[15]; //array of words from the line of text, assuming no more than 15 words will be in any given line //in this initialization there are 15 string (pointers) of size MAX_LINE_LENGTH each int numWords; //Number of words in the given line int lineAddress; }; // extern struct Line lineData; /******************************************************************************/ /*** <Parent Device Class Initializations> ***/ /******************************************************************************/ extern const string DeviceNames[]; extern int numDevices; extern int currNumDevices; class Device{ public: string name; enum DeviceType type; static Device* newDevice(int, string, Line); virtual int interpret(Line&) = 0; }; extern vector<Device*> devices; //Initialize array of devices, initially assume 15 devices will be used (will expand as needed) #endif