Library for Nuelectronics Nokia 3310/5110 LCD Display and joystick.

Dependents:   N3310LCD_Demo FRDM_N3110LCD

Files at this revision

API Documentation at this revision

Comitter:
SomeRandomBloke
Date:
Wed Mar 27 21:09:58 2013 +0000
Parent:
4:90dce6032a37
Child:
6:46bcc4e584c4
Commit message:
Used Stream class for printf output

Changed in this revision

N3310LCD.cpp Show annotated file Show diff for this revision Revisions of this file
N3310LCD.h Show annotated file Show diff for this revision Revisions of this file
--- a/N3310LCD.cpp	Sun Mar 24 19:21:51 2013 +0000
+++ b/N3310LCD.cpp	Wed Mar 27 21:09:58 2013 +0000
@@ -235,8 +235,14 @@
             if (cursor_row >= LCDROWMAX) cursor_row=0;
         }
     }
+}
 
-
+int  N3310LCD::_putc(int c) {
+  writeChar(c, NORMAL);
+  return c;
+}
+int N3310LCD::_getc() {
+    return -1;
 }
 
 void N3310LCD::writeCharBig(BYTE xPos, BYTE yPos, BYTE ch, eDisplayMode mode)
--- a/N3310LCD.h	Sun Mar 24 19:21:51 2013 +0000
+++ b/N3310LCD.h	Wed Mar 27 21:09:58 2013 +0000
@@ -40,7 +40,7 @@
 #define FONT_ALPHA_17x17 2
 
 
-class N3310LCD
+class N3310LCD : public Stream
 {
 public:
     N3310LCD(PinName mosi, PinName miso, PinName sck,
@@ -67,6 +67,10 @@
     void drawFilledRectangle(BYTE x1, BYTE y1, BYTE x2, BYTE y2, BYTE c);
     void drawCircle(BYTE xc, BYTE yc, BYTE r, BYTE c);
 
+protected:
+    virtual int _putc(int value);
+    virtual int _getc();
+    
 private:
     // I/O
     SPI lcdPort;            // does SPI MOSI, MISO and SCK