Diff: PCD8544LCD.h
- Revision:
- 1:ce391193b822
- Parent:
- 0:6468a28a7b7d
--- a/PCD8544LCD.h Sun Apr 17 18:03:24 2011 +0000
+++ b/PCD8544LCD.h Thu May 19 18:06:13 2011 +0000
@@ -26,11 +26,14 @@
#ifndef PCD8544LCD_H
#define PCD8544LCD_H
+// the Nokia 3310 has a resolution of 84 x 48
+// the Nokia 3410 has a resolution of 102 x 72
+
#include "mbed.h"
/* Number of pixels on the LCD */
-#define LCD_X_RES 84
-#define LCD_Y_RES 48
+#define LCD_X_RES 102 //84
+#define LCD_Y_RES 72 //48
#define LCD_BANKS (LCD_Y_RES / 8)
#define LCD_CACHE_SIZE ((LCD_X_RES * LCD_Y_RES) / 8)
@@ -74,6 +77,12 @@
}eRasterMode;
typedef enum {
+ DRAW_OVERWRITE = 0,
+ DRAW_MERGE = 1
+}eDrawMode;
+
+
+typedef enum {
VERYSMALLFONT = 0, //3x5
TINYFONT = 1, //5x7
SMALLFONT = 2, //6x8
@@ -83,6 +92,19 @@
BIGNUMBERFONT= 6
}eFonts;
+typedef enum {
+ C_POINT = 0, //point
+ C_LINE = 1, //line
+ C_VLINE = 2, //Vertical Line
+ C_HLINE = 3, //Horizontal Line
+}eChartMode;
+
+typedef enum {
+ SPACE_NONE = 0,
+ SPACE_NORMAL = 1
+}eSpaceMode;
+
+
enum eDisplayMode {NORMAL, HIGHLIGHT};
@@ -120,7 +142,7 @@
* clears the cached copy of the screen
* and the screen itself
*/
- void cls();
+ void cls(bool fupdate=true);
/** update()
* copies the cached memory to the screen
@@ -141,14 +163,14 @@
void chooseFont(eFonts font);
- void writeString (BYTE x0, BYTE y0, char* string, eFonts font, eDisplayMode mode, BYTE update);
+ void writeString (BYTE x0, BYTE y0, char* string, eFonts font,eDisplayMode dmode,eSpaceMode smode, BYTE fupdate);
void writeChar (BYTE x0, BYTE y0, BYTE ch, eFonts font,eDisplayMode mode, BYTE update);
/** drawBitmap(x,y,bitmap,xsize,ysize)
* draw a monochrome bitmap on position x,y
* with size xsize,ysize
*/
- void drawBitmap (BYTE x0, BYTE y0, BYTE* bitmap, BYTE bmpXSize, BYTE bmpYSize, BYTE update);
+ void drawBitmap (BYTE x0, BYTE y0, const unsigned char* bitmap, BYTE bmpXSize, BYTE bmpYSize, BYTE update);
void drawpixel (BYTE x0, BYTE y0, ePixelMode pmode, BYTE update);
void drawline (BYTE x0, BYTE y0, BYTE x1,BYTE y1, ePixelMode pmode, BYTE update);
@@ -156,7 +178,7 @@
void drawrectangle (BYTE x0, BYTE y0, BYTE x1,BYTE y1, eFillMode fill, ePixelMode pmode, BYTE update);
void drawprogressbar(BYTE x0, BYTE y0, BYTE w, BYTE h, BYTE percentage, BYTE update);
void drawchart (BYTE x0, BYTE y0, BYTE w, BYTE h, BYTE unitx, BYTE unity,
- eRasterMode rmode,signed char * val, int start, int count);
+ eRasterMode rMode, eChartMode cMode, eDrawMode dMode,int16_t * val, int size, int t);
private:
@@ -168,11 +190,12 @@
void writeCmd(BYTE data);
void writeData(BYTE data);
- BYTE _LcdCache[ LCD_CACHE_SIZE ]; // local LCD buffer
+ BYTE LcdCache[LCD_CACHE_SIZE]; // __attribute__((section("AHBSRAM0")));
- int _LcdCacheIdx;
+ int LcdCacheIdx;
int _LoMark;
int _HiMark;
+ int Scale;
BYTE _font_width;
BYTE _font_height;