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
Diff: Initialization.hpp
- Revision:
- 0:22618cf06f45
- Child:
- 1:5731f31f96be
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Initialization.hpp Tue Sep 16 15:28:59 2014 +0000
@@ -0,0 +1,53 @@
+#ifndef INITIALIZATION_HPP
+#define INITIALIZATION_HPP
+
+#include "mbed.h"
+#include "LocalPinNames.h"
+#include "BridgeDriver.h"
+#include "FrontPanelButtons.h"
+#include "TextLCD.h"
+#include "SDFileSystem.h"
+
+//Initializations
+Timer timer; // general purpose timer
+I2C i2c( P0_10, P0_11 ); // I2C bus (SDA, SCL)
+BridgeDriver bridges(&i2c, 1); // Bridge
+TextLCD_I2C lcd( &i2c, MCP23008_SA0, TextLCD::LCD20x4 ); // LCD
+SDFileSystem sd(P0_18, P0_17, P0_15, P0_16, "sd"); // the pinout on the mbed LPC1768
+
+DigitalIn killSw(KILL);
+
+extern const int MAX_LINE_LENGTH = 100;
+
+void initLCD(void);
+
+void fullInit() {
+
+ killSw.mode(PullUp);
+ initLCD();
+}
+
+void initLCD(void) {
+
+ i2c.frequency(1000000);
+ lcd.setBacklight(TextLCD::LightOn);
+ wait(.6);
+ lcd.cls(); //clear the display
+ lcd.setAddress(0,0);
+ lcd.printf("LCD Initialized");
+}
+
+
+struct Line{
+
+ char *fullLine; //full line, starting from the beginning
+ char *currPartLine; //current line, meaning that it only knows whatever has not been used in the line
+ int lineNumber; //current line number in the program txt file that is running
+ char word[15][MAX_LINE_LENGTH]; //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
+};
+
+extern struct Line lineData;
+
+#endif
\ No newline at end of file