A small and easy-to-use library for the Nokia 5110, 3310, and LCD-10168 / PCD8544 LCD controller. Draw support includes strings, patterns, and pixel-by-pixel methods.

Dependents:   TextLCD_NOKIA_5110 Nokia5110_KL25Z Nokia5110_test_nucleo LPC1114_5110_PIR ... more

Revision:
1:5ec993784d65
Parent:
0:9cfce382e741
--- a/NOKIA_5110.h	Mon Jan 13 23:09:26 2014 +0000
+++ b/NOKIA_5110.h	Fri Oct 15 20:36:13 2021 +0000
@@ -1,8 +1,8 @@
 // Project: Nokia5110 - Controlling a NK5110 display from an NXP LPC1768
 // File: NOKIA_5110.h
-// Author: Chris Yan
-// Created: January, 2012
-// Revised: January, 2014
+// Author: Krissi Yan
+// Created: January, 2015
+// Revised: January, 2016
 //  Desc: Commands, fonts, and class for using a
 //      Nokia 5110 LCD via the Phillips 8554 LCD driver.
 // 
@@ -75,6 +75,7 @@
 
 #include "mbed.h"
 
+// Struct to hold the serial pinout
 struct LcdPins
 {
     PinName mosi;
@@ -85,6 +86,7 @@
     PinName rst;
 };
 
+// Struct to hold the basic settings for the LCD
 struct LcdFunctionSet
 {
     char PD;
@@ -92,6 +94,7 @@
     char H;
 };
 
+// Typedefs to make the code more readable
 typedef char LcdFunctionChar;
 typedef char LcdTempControl;
 typedef char LcdDispControl;
@@ -105,6 +108,7 @@
         ~NokiaLcd();
         
     public:
+    // Setup and Modification Functions 
         void InitLcd();
         void ClearLcdMem();
         void ShutdownLcd();
@@ -113,6 +117,7 @@
         void SendDrawData(char data);
         
     public:
+    // Draw Functions
         void DrawString(char* str);
         void DrawChar(char character);
         void SetXY(char x, char y);
@@ -136,8 +141,11 @@
         
 };
 
-const char FONT_6x6[570] = //should be 564 total char
-{
+//////////////////////////////////////////////////////
+// Rotated font built for this screen's display memory
+//////////////////////////////////////////////////////
+const char FONT_6x6[570] =           //should be 564 total char
+{                                    //
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // SPACE   1   
  0x00, 0x06, 0x2F, 0x06, 0x00, 0x00, // !   2
  0x00, 0x06, 0x00, 0x06, 0x00, 0x00, // "   3