| 1 | //----------------------------------------------------------------------------- |
| 2 | // This code is licensed to you under the terms of the GNU GPL, version 2 or, |
| 3 | // at your option, any later version. See the LICENSE.txt file for the text of |
| 4 | // the license. |
| 5 | //----------------------------------------------------------------------------- |
| 6 | // LCD code |
| 7 | //----------------------------------------------------------------------------- |
| 8 | |
| 9 | #ifndef __LCD_H |
| 10 | #define __LCD_H |
| 11 | |
| 12 | // The resolution of the LCD |
| 13 | #define LCD_XRES 132 |
| 14 | #define LCD_YRES 132 |
| 15 | |
| 16 | // 8bpp Color Mode - Some basic colors defined for ease of use |
| 17 | // remember 8bpp color = 3xRed, 3xGreen & 2xBlue bits |
| 18 | // organised as RRRGGGBB |
| 19 | |
| 20 | #define BLACK 0x00 |
| 21 | #define BLUE 0x03 |
| 22 | #define GREEN 0x1C |
| 23 | #define CYAN 0x1F |
| 24 | #define RED 0xE0 |
| 25 | #define MAGENTA 0xE3 |
| 26 | #define YELLOW 0xFC |
| 27 | #define WHITE 0xFF |
| 28 | |
| 29 | // EPSON LCD command set |
| 30 | #define ECASET 0x115 |
| 31 | #define EPWRCTR 0x120 |
| 32 | #define ENOP 0x125 |
| 33 | #define ERAMWR 0x15C |
| 34 | #define ERAMRD 0x15D |
| 35 | #define EPASET 0x175 |
| 36 | #define EEPSRRD1 0x17C |
| 37 | #define EEPSRRD2 0x17D |
| 38 | #define EVOLCTR 0x181 |
| 39 | #define ETMPGRD 0x182 |
| 40 | #define ESLPOUT 0x194 |
| 41 | #define ESLPIN 0x195 |
| 42 | #define EDISNOR 0x1A6 |
| 43 | #define EDISINV 0x1A7 |
| 44 | #define EPTLIN 0x1A8 |
| 45 | #define EPTLOUT 0x1A9 |
| 46 | #define EASCSET 0x1AA |
| 47 | #define ESCSTART 0x1AB |
| 48 | #define EDISOFF 0x1AE |
| 49 | #define EDISON 0x1AF |
| 50 | #define ECOMSCN 0x1BB |
| 51 | #define EDATCTL 0x1BC |
| 52 | #define EDISCTL 0x1CA |
| 53 | #define EEPCOUT 0x1CC |
| 54 | #define EEPCTIN 0x1CD |
| 55 | #define ERGBSET8 0x1CE |
| 56 | #define EOSCON 0x1D1 |
| 57 | #define EOSCOFF 0x1D2 |
| 58 | #define EVOLUP 0x1D6 |
| 59 | #define EVOLDOWN 0x1D7 |
| 60 | #define ERMWIN 0x1E0 |
| 61 | #define ERMWOUT 0x1EE |
| 62 | #define EEPMWR 0x1FC |
| 63 | #define EEPMRD 0x1FD |
| 64 | |
| 65 | // PHILIPS LCD command set |
| 66 | #define PNOP 0x100 |
| 67 | #define PSWRESET 0x101 |
| 68 | #define PBSTROFF 0x102 |
| 69 | #define PBSTRON 0x103 |
| 70 | #define PRDDIDIF 0x104 |
| 71 | #define PRDDST 0x109 |
| 72 | #define PSLEEPIN 0x110 |
| 73 | #define PSLEEPOUT 0x111 |
| 74 | #define PPTLON 0x112 |
| 75 | #define PNORON 0x113 |
| 76 | #define PINVOFF 0x120 |
| 77 | #define PINVON 0x121 |
| 78 | #define PDALO 0x122 |
| 79 | #define PDAL 0x123 |
| 80 | #define PSETCON 0x125 |
| 81 | #define PDISPOFF 0x128 |
| 82 | #define PDISPON 0x129 |
| 83 | #define PCASET 0x12A |
| 84 | #define PPASET 0x12B |
| 85 | #define PRAMWR 0x12C |
| 86 | #define PRGBSET 0x12D |
| 87 | #define PPTLAR 0x130 |
| 88 | #define PVSCRDEF 0x133 |
| 89 | #define PTEOFF 0x134 |
| 90 | #define PTEON 0x135 |
| 91 | #define PMADCTL 0x136 |
| 92 | #define PSEP 0x137 |
| 93 | #define PIDMOFF 0x138 |
| 94 | #define PIDMON 0x139 |
| 95 | #define PCOLMOD 0x13A |
| 96 | #define PSETVOP 0x1B0 |
| 97 | #define PBRS 0x1B4 |
| 98 | #define PTRS 0x1B6 |
| 99 | #define PFINV 0x1B9 |
| 100 | #define PDOR 0x1BA |
| 101 | #define PTCDFE 0x1BD |
| 102 | #define PTCVOPE 0x1BF |
| 103 | #define PEC 0x1C0 |
| 104 | #define PSETMUL 0x1C2 |
| 105 | #define PTCVOPAB 0x1C3 |
| 106 | #define PTCVOPCD 0x1C4 |
| 107 | #define PTCDF 0x1C5 |
| 108 | #define PDF8C 0x1C6 |
| 109 | #define PSETBS 0x1C7 |
| 110 | #define PRDTEMP 0x1C8 |
| 111 | #define PNLI 0x1C9 |
| 112 | #define PRDID1 0x1DA |
| 113 | #define PRDID2 0x1DB |
| 114 | #define PRDID3 0x1DC |
| 115 | #define PSFD 0x1EF |
| 116 | #define PECM 0x1F0 |
| 117 | |
| 118 | void LCDSend(unsigned int data); |
| 119 | void LCDInit(void); |
| 120 | void LCDReset(void); |
| 121 | void LCDSetXY(unsigned char x, unsigned char y); |
| 122 | void LCDSetPixel(unsigned char x, unsigned char y, unsigned char color); |
| 123 | void LCDString (char *lcd_string, const char *font_style,unsigned char x, unsigned char y, unsigned char fcolor, unsigned char bcolor); |
| 124 | void LCDFill (unsigned char xs,unsigned char ys,unsigned char width,unsigned char height, unsigned char color); |
| 125 | |
| 126 | #endif |