Nokia1202 LCD
Dependencies: mbed mbed-STM32F103C8T6
nLCD.h
00001 /** 00002 @file N5110.h 00003 00004 @brief Header file containing member functions and variables 00005 00006 */ 00007 00008 #ifndef N5110_H 00009 #define N5110_H 00010 00011 #include "mbed.h" 00012 00013 typedef unsigned char byte; 00014 00015 class graphicsLCD 00016 { 00017 public: 00018 //graphicsLCD(byte CSPin,byte SCKPin,byte ResetPin,byte SDAPin); 00019 graphicsLCD(PinName ResetPin,PinName CSPin,PinName SDAPin,PinName SCKPin); 00020 00021 void command(byte payload); 00022 void data(byte payload); 00023 00024 void begin(void); 00025 void init(void); 00026 void clear(); 00027 void gotoRC (int r, int c); 00028 void character(char character); 00029 void print(char *characters); 00030 void print(const char *characters); 00031 void print(long num); 00032 void println(char *characters); 00033 void println(long num); 00034 00035 void displayNormal(); 00036 void displayInverse(); 00037 00038 void displayOn(); 00039 void displayOff(); 00040 00041 void scroll(byte payload); 00042 void line(byte line); 00043 void column(byte payload); 00044 00045 void softwareReset(); 00046 void hardwareReset(); 00047 00048 void displayAllPointsOn(); 00049 void displayAllPointsOff(); 00050 00051 void contrast(byte con); 00052 00053 private: 00054 DigitalOut _SCKPin; 00055 DigitalOut _CSPin; 00056 DigitalOut _SDAPin; 00057 DigitalOut _ResetPin; 00058 }; 00059 00060 static const byte chars[][5] ={ 00061 {0x00, 0x00, 0x00, 0x00, 0x00} // 20 00062 ,{0x00, 0x00, 0x5f, 0x00, 0x00} // 21 ! 00063 ,{0x00, 0x07, 0x00, 0x07, 0x00} // 22 " 00064 ,{0x14, 0x7f, 0x14, 0x7f, 0x14} // 23 # 00065 ,{0x24, 0x2a, 0x7f, 0x2a, 0x12} // 24 $ 00066 ,{0x23, 0x13, 0x08, 0x64, 0x62} // 25 % 00067 ,{0x36, 0x49, 0x55, 0x22, 0x50} // 26 & 00068 ,{0x00, 0x05, 0x03, 0x00, 0x00} // 27 ' 00069 ,{0x00, 0x1c, 0x22, 0x41, 0x00} // 28 ( 00070 ,{0x00, 0x41, 0x22, 0x1c, 0x00} // 29 ) 00071 ,{0x14, 0x08, 0x3e, 0x08, 0x14} // 2a * 00072 ,{0x08, 0x08, 0x3e, 0x08, 0x08} // 2b + 00073 ,{0x00, 0x50, 0x30, 0x00, 0x00} // 2c , 00074 ,{0x08, 0x08, 0x08, 0x08, 0x08} // 2d - 00075 ,{0x00, 0x60, 0x60, 0x00, 0x00} // 2e . 00076 ,{0x20, 0x10, 0x08, 0x04, 0x02} // 2f / 00077 ,{0x3e, 0x51, 0x49, 0x45, 0x3e} // 30 0 00078 ,{0x00, 0x42, 0x7f, 0x40, 0x00} // 31 1 00079 ,{0x42, 0x61, 0x51, 0x49, 0x46} // 32 2 00080 ,{0x21, 0x41, 0x45, 0x4b, 0x31} // 33 3 00081 ,{0x18, 0x14, 0x12, 0x7f, 0x10} // 34 4 00082 ,{0x27, 0x45, 0x45, 0x45, 0x39} // 35 5 00083 ,{0x3c, 0x4a, 0x49, 0x49, 0x30} // 36 6 00084 ,{0x01, 0x71, 0x09, 0x05, 0x03} // 37 7 00085 ,{0x36, 0x49, 0x49, 0x49, 0x36} // 38 8 00086 ,{0x06, 0x49, 0x49, 0x29, 0x1e} // 39 9 00087 ,{0x00, 0x36, 0x36, 0x00, 0x00} // 3a : 00088 ,{0x00, 0x56, 0x36, 0x00, 0x00} // 3b ; 00089 ,{0x08, 0x14, 0x22, 0x41, 0x00} // 3c < 00090 ,{0x14, 0x14, 0x14, 0x14, 0x14} // 3d = 00091 ,{0x00, 0x41, 0x22, 0x14, 0x08} // 3e > 00092 ,{0x02, 0x01, 0x51, 0x09, 0x06} // 3f ? 00093 ,{0x32, 0x49, 0x79, 0x41, 0x3e} // 40 @ 00094 ,{0x7e, 0x11, 0x11, 0x11, 0x7e} // 41 A 00095 ,{0x7f, 0x49, 0x49, 0x49, 0x36} // 42 B 00096 ,{0x3e, 0x41, 0x41, 0x41, 0x22} // 43 C 00097 ,{0x7f, 0x41, 0x41, 0x22, 0x1c} // 44 D 00098 ,{0x7f, 0x49, 0x49, 0x49, 0x41} // 45 E 00099 ,{0x7f, 0x09, 0x09, 0x09, 0x01} // 46 F 00100 ,{0x3e, 0x41, 0x49, 0x49, 0x7a} // 47 G 00101 ,{0x7f, 0x08, 0x08, 0x08, 0x7f} // 48 H 00102 ,{0x00, 0x41, 0x7f, 0x41, 0x00} // 49 I 00103 ,{0x20, 0x40, 0x41, 0x3f, 0x01} // 4a J 00104 ,{0x7f, 0x08, 0x14, 0x22, 0x41} // 4b K 00105 ,{0x7f, 0x40, 0x40, 0x40, 0x40} // 4c L 00106 ,{0x7f, 0x02, 0x0c, 0x02, 0x7f} // 4d M 00107 ,{0x7f, 0x04, 0x08, 0x10, 0x7f} // 4e N 00108 ,{0x3e, 0x41, 0x41, 0x41, 0x3e} // 4f O 00109 ,{0x7f, 0x09, 0x09, 0x09, 0x06} // 50 P 00110 ,{0x3e, 0x41, 0x51, 0x21, 0x5e} // 51 Q 00111 ,{0x7f, 0x09, 0x19, 0x29, 0x46} // 52 R 00112 ,{0x46, 0x49, 0x49, 0x49, 0x31} // 53 S 00113 ,{0x01, 0x01, 0x7f, 0x01, 0x01} // 54 T 00114 ,{0x3f, 0x40, 0x40, 0x40, 0x3f} // 55 U 00115 ,{0x1f, 0x20, 0x40, 0x20, 0x1f} // 56 V 00116 ,{0x3f, 0x40, 0x38, 0x40, 0x3f} // 57 W 00117 ,{0x63, 0x14, 0x08, 0x14, 0x63} // 58 X 00118 ,{0x07, 0x08, 0x70, 0x08, 0x07} // 59 Y 00119 ,{0x61, 0x51, 0x49, 0x45, 0x43} // 5a Z 00120 ,{0x00, 0x7f, 0x41, 0x41, 0x00} // 5b [ 00121 ,{0x02, 0x04, 0x08, 0x10, 0x20} // 5c ¥ 00122 ,{0x00, 0x41, 0x41, 0x7f, 0x00} // 5d ] 00123 ,{0x04, 0x02, 0x01, 0x02, 0x04} // 5e ^ 00124 ,{0x40, 0x40, 0x40, 0x40, 0x40} // 5f _ 00125 ,{0x00, 0x01, 0x02, 0x04, 0x00} // 60 ` 00126 ,{0x20, 0x54, 0x54, 0x54, 0x78} // 61 a 00127 ,{0x7f, 0x48, 0x44, 0x44, 0x38} // 62 b 00128 ,{0x38, 0x44, 0x44, 0x44, 0x20} // 63 c 00129 ,{0x38, 0x44, 0x44, 0x48, 0x7f} // 64 d 00130 ,{0x38, 0x54, 0x54, 0x54, 0x18} // 65 e 00131 ,{0x08, 0x7e, 0x09, 0x01, 0x02} // 66 f 00132 ,{0x0c, 0x52, 0x52, 0x52, 0x3e} // 67 g 00133 ,{0x7f, 0x08, 0x04, 0x04, 0x78} // 68 h 00134 ,{0x00, 0x44, 0x7d, 0x40, 0x00} // 69 i 00135 ,{0x20, 0x40, 0x44, 0x3d, 0x00} // 6a j 00136 ,{0x7f, 0x10, 0x28, 0x44, 0x00} // 6b k 00137 ,{0x00, 0x41, 0x7f, 0x40, 0x00} // 6c l 00138 ,{0x7c, 0x04, 0x18, 0x04, 0x78} // 6d m 00139 ,{0x7c, 0x08, 0x04, 0x04, 0x78} // 6e n 00140 ,{0x38, 0x44, 0x44, 0x44, 0x38} // 6f o 00141 ,{0x7c, 0x14, 0x14, 0x14, 0x08} // 70 p 00142 ,{0x08, 0x14, 0x14, 0x18, 0x7c} // 71 q 00143 ,{0x7c, 0x08, 0x04, 0x04, 0x08} // 72 r 00144 ,{0x48, 0x54, 0x54, 0x54, 0x20} // 73 s 00145 ,{0x04, 0x3f, 0x44, 0x40, 0x20} // 74 t 00146 ,{0x3c, 0x40, 0x40, 0x20, 0x7c} // 75 u 00147 ,{0x1c, 0x20, 0x40, 0x20, 0x1c} // 76 v 00148 ,{0x3c, 0x40, 0x30, 0x40, 0x3c} // 77 w 00149 ,{0x44, 0x28, 0x10, 0x28, 0x44} // 78 x 00150 ,{0x0c, 0x50, 0x50, 0x50, 0x3c} // 79 y 00151 ,{0x44, 0x64, 0x54, 0x4c, 0x44} // 7a z 00152 ,{0x00, 0x08, 0x36, 0x41, 0x00} // 7b { 00153 ,{0x00, 0x00, 0x7f, 0x00, 0x00} // 7c | 00154 ,{0x00, 0x41, 0x36, 0x08, 0x00} // 7d } 00155 ,{0x10, 0x08, 0x08, 0x10, 0x08} // 7e ← 00156 ,{0x78, 0x46, 0x41, 0x46, 0x78} // 7f → 00157 }; 00158 00159 #endif
Generated on Fri Jul 15 2022 11:52:20 by
1.7.2