Set of routines to access 16*32character LCD display on WattBob I board.

Dependents:   Assignment_2_herpe Final_V1 ass2 ass2 ... more

Revision:
0:e5b7c70254ac
Child:
1:190b705fb9e1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WattBob_TextLCD.h	Sun Nov 28 22:47:51 2010 +0000
@@ -0,0 +1,52 @@
+/* draft mbed TextLCD 
+ * (c) 2007/8, sford
+ */
+ 
+#ifndef WATTBOB_TEXTLCD_H
+#define WATTBOB_TEXTLCD_H
+
+#include "mbed.h"
+#include "Stream.h"
+#include "MCP23017.h"
+
+#define     RS_BIT      7
+#define     RW_BIT      6
+#define     E_BIT       5
+#define     BL_BIT      4   
+
+class WattBob_TextLCD : public Stream {
+
+public:
+    WattBob_TextLCD(MCP23017 *port);                           // constructor
+           
+    virtual void locate(int row, int column);
+    virtual void cls();    
+    virtual void reset();
+        
+protected:
+
+    void clock();
+    void writeData(int data);
+    void writeCommand(int command);
+    void writeByte(int value);
+    void writeNibble(int value);
+    
+    void _rs (int data);
+    void _rw (int data);    
+    void _e (int data);
+    void _d (int data);
+
+    virtual int _putc(int c);        
+    virtual int _getc();
+    virtual void newline();                
+            
+    int _rows;
+    int _columns;
+    int _row;
+    int _column;   
+    
+private:
+    MCP23017    *par_port; 
+};
+
+#endif