A C12832 LCD with generic interface

Dependents:   mbed_blinky HTTPClient_HelloWorld websocketandnode xbeerx ... more

Fork of C12832 by Chris Styles

Files at this revision

API Documentation at this revision

Comitter:
chris
Date:
Sat Nov 09 01:00:59 2013 +0000
Parent:
3:468cdccff7af
Child:
12:4affce236743
Commit message:
Added Pin names to the constructor, so we can support any board

Changed in this revision

C12832_lcd.cpp Show annotated file Show diff for this revision Revisions of this file
C12832_lcd.h Show annotated file Show diff for this revision Revisions of this file
--- a/C12832_lcd.cpp	Thu Oct 25 17:34:34 2012 +0000
+++ b/C12832_lcd.cpp	Sat Nov 09 01:00:59 2013 +0000
@@ -26,8 +26,9 @@
 
 #define BPP    1       // Bits per pixel
 
-C12832_LCD::C12832_LCD(const char* name)
-    : _spi(p5,NC,p7),_reset(p6),_A0(p8),_CS(p11),GraphicsDisplay(name)
+
+C12832_LCD::C12832_LCD(PinName mosi, PinName sck, PinName reset, PinName a0, PinName ncs, const char* name)
+    : _spi(mosi,NC,sck),_reset(reset),_A0(a0),_CS(ncs),GraphicsDisplay(name)
 {
     orientation = 1;
     draw_mode = NORMAL;
@@ -132,7 +133,7 @@
 
     _spi.format(8,3);                 // 8 bit spi mode 3
     _spi.frequency(20000000);          // 19,2 Mhz SPI clock
-    DigitalOut _reset(p6);
+//    DigitalOut _reset(p6);
     _A0 = 0;
     _CS = 1;
     _reset = 0;                        // display reset
--- a/C12832_lcd.h	Thu Oct 25 17:34:34 2012 +0000
+++ b/C12832_lcd.h	Sat Nov 09 01:00:59 2013 +0000
@@ -48,7 +48,7 @@
       *
       */
 
-    C12832_LCD(const char* name = "LCD");
+    C12832_LCD(PinName mosi, PinName sck, PinName reset, PinName a0, PinName ncs, const char* name = "LCD");
 
     /** Get the width of the screen in pixel
       *