ILI9341 for layerOne 2017 , original Racoon's
tft.h@0:8f8765c8b7bd, 2016-11-13 (annotated)
- Committer:
- charliex
- Date:
- Sun Nov 13 17:59:38 2016 +0000
- Revision:
- 0:8f8765c8b7bd
updated for new board
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
charliex | 0:8f8765c8b7bd | 1 | /*===================================================================*/ |
charliex | 0:8f8765c8b7bd | 2 | /* */ |
charliex | 0:8f8765c8b7bd | 3 | /* tft.h : TFT(ILI9341) function header */ |
charliex | 0:8f8765c8b7bd | 4 | /* */ |
charliex | 0:8f8765c8b7bd | 5 | /* 2016/1/20 Racoon */ |
charliex | 0:8f8765c8b7bd | 6 | /* */ |
charliex | 0:8f8765c8b7bd | 7 | /*===================================================================*/ |
charliex | 0:8f8765c8b7bd | 8 | |
charliex | 0:8f8765c8b7bd | 9 | #ifndef TFT_H |
charliex | 0:8f8765c8b7bd | 10 | #define TFT_H |
charliex | 0:8f8765c8b7bd | 11 | |
charliex | 0:8f8765c8b7bd | 12 | #include "stm32f4xx_hal.h" |
charliex | 0:8f8765c8b7bd | 13 | #include "spidma.h" |
charliex | 0:8f8765c8b7bd | 14 | |
charliex | 0:8f8765c8b7bd | 15 | #define TFT_WIDTH 320 |
charliex | 0:8f8765c8b7bd | 16 | #define TFT_HEIGHT 240 |
charliex | 0:8f8765c8b7bd | 17 | |
charliex | 0:8f8765c8b7bd | 18 | void set_back(int flag); |
charliex | 0:8f8765c8b7bd | 19 | |
charliex | 0:8f8765c8b7bd | 20 | #define TFT_WHITE 0xFFFF |
charliex | 0:8f8765c8b7bd | 21 | #define TFT_WHITESMOKE 0xBFFF |
charliex | 0:8f8765c8b7bd | 22 | #define TFT_GHOSTWHITE 0xDFFF |
charliex | 0:8f8765c8b7bd | 23 | #define TFT_ALICEBLUE 0xDFF7 |
charliex | 0:8f8765c8b7bd | 24 | #define TFT_LAVENDAR 0x5FEF |
charliex | 0:8f8765c8b7bd | 25 | #define TFT_AZURE 0xFFF7 |
charliex | 0:8f8765c8b7bd | 26 | #define TFT_LIGHTCYAN 0xFFE7 |
charliex | 0:8f8765c8b7bd | 27 | #define TFT_MINTCREAM 0xFFFF |
charliex | 0:8f8765c8b7bd | 28 | #define TFT_HONEYDEW 0xFEF7 |
charliex | 0:8f8765c8b7bd | 29 | #define TFT_IVORY 0xFEFF |
charliex | 0:8f8765c8b7bd | 30 | #define TFT_BEIGE 0xBCFF |
charliex | 0:8f8765c8b7bd | 31 | #define TFT_LIGHTYELLOW 0xFCFF |
charliex | 0:8f8765c8b7bd | 32 | #define TFT_LIGHTGOLDENRODYELLOW 0xFAFF |
charliex | 0:8f8765c8b7bd | 33 | #define TFT_LEMONCHIFFON 0xFAFF |
charliex | 0:8f8765c8b7bd | 34 | #define TFT_FLORALWHITE 0xFEFF |
charliex | 0:8f8765c8b7bd | 35 | #define TFT_OLDLACE 0xBDFF |
charliex | 0:8f8765c8b7bd | 36 | #define TFT_CORNSILK 0xDCFF |
charliex | 0:8f8765c8b7bd | 37 | #define TFT_PAPAYAWHITE 0x9BFF |
charliex | 0:8f8765c8b7bd | 38 | #define TFT_BLANCHEDALMOND 0x7AFF |
charliex | 0:8f8765c8b7bd | 39 | #define TFT_BISQUE 0x39FF |
charliex | 0:8f8765c8b7bd | 40 | #define TFT_SNOW 0xFFFF |
charliex | 0:8f8765c8b7bd | 41 | #define TFT_LINEN 0x9DFF |
charliex | 0:8f8765c8b7bd | 42 | #define TFT_ANTIQUEWHITE 0x7BFF |
charliex | 0:8f8765c8b7bd | 43 | #define TFT_SEASHELL 0xBEFF |
charliex | 0:8f8765c8b7bd | 44 | #define TFT_LAVENDERBLUSH 0x9FFF |
charliex | 0:8f8765c8b7bd | 45 | #define TFT_MISTYROSE 0x3CFF |
charliex | 0:8f8765c8b7bd | 46 | #define TFT_GAINSBORO 0xFCE6 |
charliex | 0:8f8765c8b7bd | 47 | #define TFT_LIGHTGRAY 0xBAD6 |
charliex | 0:8f8765c8b7bd | 48 | #define TFT_LIGHTSTEELBLUE 0x3CB6 |
charliex | 0:8f8765c8b7bd | 49 | #define TFT_LIGHTBLUE 0xDDB6 |
charliex | 0:8f8765c8b7bd | 50 | #define TFT_LIGHTSKYBLUE 0x9F8E |
charliex | 0:8f8765c8b7bd | 51 | #define TFT_POWDERBLUE 0x1DB7 |
charliex | 0:8f8765c8b7bd | 52 | #define TFT_PALETURQUOISE 0x9EB7 |
charliex | 0:8f8765c8b7bd | 53 | #define TFT_SKYBLUE 0x9D8E |
charliex | 0:8f8765c8b7bd | 54 | #define TFT_MEDIUMAQUAMARINE 0x756E |
charliex | 0:8f8765c8b7bd | 55 | #define TFT_AQUAMARINE 0xFB87 |
charliex | 0:8f8765c8b7bd | 56 | #define TFT_PALEGREEN 0xF39F |
charliex | 0:8f8765c8b7bd | 57 | #define TFT_LIGHTGREEN 0x9297 |
charliex | 0:8f8765c8b7bd | 58 | #define TFT_KHAKI 0x52F7 |
charliex | 0:8f8765c8b7bd | 59 | #define TFT_PALEGOLDENROD 0x55F7 |
charliex | 0:8f8765c8b7bd | 60 | #define TFT_MOCCASIN 0x37FF |
charliex | 0:8f8765c8b7bd | 61 | #define TFT_NAVAJOWHITE 0x16FF |
charliex | 0:8f8765c8b7bd | 62 | #define TFT_PEACHPUFF 0xF7FE |
charliex | 0:8f8765c8b7bd | 63 | #define TFT_WHEAT 0x16FF |
charliex | 0:8f8765c8b7bd | 64 | #define TFT_PINK 0x19FE |
charliex | 0:8f8765c8b7bd | 65 | #define TFT_LIGHTPINK 0xD8FD |
charliex | 0:8f8765c8b7bd | 66 | #define TFT_THISTLE 0x1BDE |
charliex | 0:8f8765c8b7bd | 67 | #define TFT_PLUM 0x1CE5 |
charliex | 0:8f8765c8b7bd | 68 | #define TFT_SILVER 0x18C6 |
charliex | 0:8f8765c8b7bd | 69 | #define TFT_DARKGRAY 0x55AD |
charliex | 0:8f8765c8b7bd | 70 | #define TFT_LIGHTSLATEGRAY 0x537C |
charliex | 0:8f8765c8b7bd | 71 | #define TFT_SLATEGRAY 0x1274 |
charliex | 0:8f8765c8b7bd | 72 | #define TFT_SLATEBLUE 0xFA6A |
charliex | 0:8f8765c8b7bd | 73 | #define TFT_STEELBLUE 0x374C |
charliex | 0:8f8765c8b7bd | 74 | #define TFT_MEDIUMSLATEBLUE 0x5E7B |
charliex | 0:8f8765c8b7bd | 75 | #define TFT_ROYALBLUE 0x5C43 |
charliex | 0:8f8765c8b7bd | 76 | #define TFT_BLUE 0x1F00 |
charliex | 0:8f8765c8b7bd | 77 | #define TFT_DODGERBLUE 0x9F24 |
charliex | 0:8f8765c8b7bd | 78 | #define TFT_CORNFLOWERBLUE 0xBE6C |
charliex | 0:8f8765c8b7bd | 79 | #define TFT_DEEPSKYBLUE 0x1F06 |
charliex | 0:8f8765c8b7bd | 80 | #define TFT_CYAN 0xFF07 |
charliex | 0:8f8765c8b7bd | 81 | #define TFT_AQUA 0xFF07 |
charliex | 0:8f8765c8b7bd | 82 | #define TFT_TURQUOISE 0x1A47 |
charliex | 0:8f8765c8b7bd | 83 | #define TFT_MEDIUMTURQUOISE 0x9A4E |
charliex | 0:8f8765c8b7bd | 84 | #define TFT_DARKTURQUOISE 0x9A06 |
charliex | 0:8f8765c8b7bd | 85 | #define TFT_LIGHTSEAGREEN 0xB525 |
charliex | 0:8f8765c8b7bd | 86 | #define TFT_MEDIUMSPRINGGREEN 0xF307 |
charliex | 0:8f8765c8b7bd | 87 | #define TFT_SPRINGGREEN 0xF007 |
charliex | 0:8f8765c8b7bd | 88 | #define TFT_LIME 0xE007 |
charliex | 0:8f8765c8b7bd | 89 | #define TFT_LIMEGREEN 0x6636 |
charliex | 0:8f8765c8b7bd | 90 | #define TFT_YELLOWGREEN 0x669E |
charliex | 0:8f8765c8b7bd | 91 | #define TFT_LAWNGREEN 0xE087 |
charliex | 0:8f8765c8b7bd | 92 | #define TFT_CHARTREUSE 0xE087 |
charliex | 0:8f8765c8b7bd | 93 | #define TFT_GREENYELLOW 0xE6B7 |
charliex | 0:8f8765c8b7bd | 94 | #define TFT_YELLOW 0xE0FF |
charliex | 0:8f8765c8b7bd | 95 | #define TFT_GOLD 0xC0FE |
charliex | 0:8f8765c8b7bd | 96 | #define TFT_ORANGE 0x20FD |
charliex | 0:8f8765c8b7bd | 97 | #define TFT_DARKORANGE 0x60FC |
charliex | 0:8f8765c8b7bd | 98 | #define TFT_GOLDENROD 0x24DD |
charliex | 0:8f8765c8b7bd | 99 | #define TFT_BURLYWOOD 0xD1E5 |
charliex | 0:8f8765c8b7bd | 100 | #define TFT_TAN 0xB2D5 |
charliex | 0:8f8765c8b7bd | 101 | #define TFT_SANDYBROWN 0x2CFD |
charliex | 0:8f8765c8b7bd | 102 | #define TFT_DARKSALMON 0xCFEC |
charliex | 0:8f8765c8b7bd | 103 | #define TFT_LIGHTCORAL 0x10F4 |
charliex | 0:8f8765c8b7bd | 104 | #define TFT_SALMON 0xEFC |
charliex | 0:8f8765c8b7bd | 105 | #define TFT_LIGHTSALMON 0xFFD |
charliex | 0:8f8765c8b7bd | 106 | #define TFT_CORAL 0xAFC |
charliex | 0:8f8765c8b7bd | 107 | #define TFT_TOMATO 0x29FB |
charliex | 0:8f8765c8b7bd | 108 | #define TFT_ORANGERED 0x20FA |
charliex | 0:8f8765c8b7bd | 109 | #define TFT_RED 0xF8 |
charliex | 0:8f8765c8b7bd | 110 | #define TFT_DEEPPINK 0xB2F8 |
charliex | 0:8f8765c8b7bd | 111 | #define TFT_HOTPINK 0x57FB |
charliex | 0:8f8765c8b7bd | 112 | #define TFT_PALEVIOLETRED 0x92DB |
charliex | 0:8f8765c8b7bd | 113 | #define TFT_VIOLET 0x3EF4 |
charliex | 0:8f8765c8b7bd | 114 | #define TFT_ORCHID 0x9BDB |
charliex | 0:8f8765c8b7bd | 115 | #define TFT_MAGENTA 0x1FF8 |
charliex | 0:8f8765c8b7bd | 116 | #define TFT_FUCHSIA 0x1FF8 |
charliex | 0:8f8765c8b7bd | 117 | #define TFT_MEDIUMORCHID 0xBABA |
charliex | 0:8f8765c8b7bd | 118 | #define TFT_DARKORCHID 0xBA99 |
charliex | 0:8f8765c8b7bd | 119 | #define TFT_DARKVIOLET 0x1A98 |
charliex | 0:8f8765c8b7bd | 120 | #define TFT_BLUEVIOLET 0x7C89 |
charliex | 0:8f8765c8b7bd | 121 | #define TFT_MEDIUMPURPLE 0x9B93 |
charliex | 0:8f8765c8b7bd | 122 | #define TFT_GRAY 0x1084 |
charliex | 0:8f8765c8b7bd | 123 | #define TFT_MEDIUMBLUE 0x1A00 |
charliex | 0:8f8765c8b7bd | 124 | #define TFT_DARKCYAN 0x7104 |
charliex | 0:8f8765c8b7bd | 125 | #define TFT_CADETBLUE 0x1465 |
charliex | 0:8f8765c8b7bd | 126 | #define TFT_DARKSEAGREEN 0xF295 |
charliex | 0:8f8765c8b7bd | 127 | #define TFT_MEDIUMSEAGREEN 0xAE45 |
charliex | 0:8f8765c8b7bd | 128 | #define TFT_TEAL 0x1004 |
charliex | 0:8f8765c8b7bd | 129 | #define TFT_FORESTGREEN 0x6424 |
charliex | 0:8f8765c8b7bd | 130 | #define TFT_SEAGREEN 0x6B34 |
charliex | 0:8f8765c8b7bd | 131 | #define TFT_DARKKHAKI 0xCDC5 |
charliex | 0:8f8765c8b7bd | 132 | #define TFT_PERU 0x28D4 |
charliex | 0:8f8765c8b7bd | 133 | #define TFT_CRIMSON 0xA8E0 |
charliex | 0:8f8765c8b7bd | 134 | #define TFT_INDIANRED 0xECD2 |
charliex | 0:8f8765c8b7bd | 135 | #define TFT_ROSYBROWN 0x92C4 |
charliex | 0:8f8765c8b7bd | 136 | #define TFT_MEDIUMVIOLETRED 0xB1C8 |
charliex | 0:8f8765c8b7bd | 137 | #define TFT_DIMGRAY 0x4D6B |
charliex | 0:8f8765c8b7bd | 138 | #define TFT_BLACK 0x0 |
charliex | 0:8f8765c8b7bd | 139 | #define TFT_MIDNIGHTBLUE 0xCE18 |
charliex | 0:8f8765c8b7bd | 140 | #define TFT_DARKSLATEBLUE 0xF149 |
charliex | 0:8f8765c8b7bd | 141 | #define TFT_DARKBLUE 0x1100 |
charliex | 0:8f8765c8b7bd | 142 | #define TFT_NAVY 0x1000 |
charliex | 0:8f8765c8b7bd | 143 | #define TFT_DARKSLATEGRAY 0x8A32 |
charliex | 0:8f8765c8b7bd | 144 | #define TFT_GREEN 0x4 |
charliex | 0:8f8765c8b7bd | 145 | #define TFT_DARKGREEN 0x2003 |
charliex | 0:8f8765c8b7bd | 146 | #define TFT_DARKOLIVEGREEN 0x665B |
charliex | 0:8f8765c8b7bd | 147 | #define TFT_OLIVEDRAB 0x846C |
charliex | 0:8f8765c8b7bd | 148 | #define TFT_OLIVE 0x84 |
charliex | 0:8f8765c8b7bd | 149 | #define TFT_DARKGOLDENROD 0x41BC |
charliex | 0:8f8765c8b7bd | 150 | #define TFT_CHOCOLATE 0x44D3 |
charliex | 0:8f8765c8b7bd | 151 | #define TFT_SIENNA 0xA6A2 |
charliex | 0:8f8765c8b7bd | 152 | #define TFT_SADDLEBROWN 0x228A |
charliex | 0:8f8765c8b7bd | 153 | #define TFT_FIREBRICK 0x24B1 |
charliex | 0:8f8765c8b7bd | 154 | #define TFT_BROWN 0x65A9 |
charliex | 0:8f8765c8b7bd | 155 | #define TFT_MAROON 0x80 |
charliex | 0:8f8765c8b7bd | 156 | #define TFT_DARKRED 0x88 |
charliex | 0:8f8765c8b7bd | 157 | #define TFT_DARKMAGENTA 0x1188 |
charliex | 0:8f8765c8b7bd | 158 | #define TFT_PURPLE 0x1080 |
charliex | 0:8f8765c8b7bd | 159 | #define TFT_INDIGO 0x1048 |
charliex | 0:8f8765c8b7bd | 160 | |
charliex | 0:8f8765c8b7bd | 161 | const unsigned char chrimg[][7] = |
charliex | 0:8f8765c8b7bd | 162 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 20h SP |
charliex | 0:8f8765c8b7bd | 163 | 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, // 21h ! |
charliex | 0:8f8765c8b7bd | 164 | 0x00, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, // 22h " |
charliex | 0:8f8765c8b7bd | 165 | 0x00, 0x28, 0x7c, 0x28, 0x7c, 0x28, 0x00, // 23h # |
charliex | 0:8f8765c8b7bd | 166 | 0x10, 0x3c, 0x50, 0x38, 0x14, 0x78, 0x10, // 24h $ |
charliex | 0:8f8765c8b7bd | 167 | 0x00, 0x32, 0x54, 0x68, 0x16, 0x2a, 0x4c, // 25h % |
charliex | 0:8f8765c8b7bd | 168 | 0x18, 0x24, 0x14, 0x38, 0x4e, 0x44, 0x3a, // 26h & |
charliex | 0:8f8765c8b7bd | 169 | 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, // 27h ' |
charliex | 0:8f8765c8b7bd | 170 | 0x04, 0x08, 0x10, 0x10, 0x10, 0x08, 0x04, // 28h ( |
charliex | 0:8f8765c8b7bd | 171 | 0x40, 0x20, 0x10, 0x10, 0x10, 0x20, 0x40, // 29h ) |
charliex | 0:8f8765c8b7bd | 172 | 0x10, 0x54, 0x38, 0xfe, 0x38, 0x54, 0x10, // 2Ah * |
charliex | 0:8f8765c8b7bd | 173 | 0x10, 0x10, 0x10, 0xfe, 0x10, 0x10, 0x10, // 2Bh + |
charliex | 0:8f8765c8b7bd | 174 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, // 2Ch , |
charliex | 0:8f8765c8b7bd | 175 | 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // 2Dh - |
charliex | 0:8f8765c8b7bd | 176 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, // 2Eh . |
charliex | 0:8f8765c8b7bd | 177 | 0x00, 0x08, 0x08, 0x10, 0x20, 0x20, 0x00, // 2Fh / |
charliex | 0:8f8765c8b7bd | 178 | |
charliex | 0:8f8765c8b7bd | 179 | 0x38, 0x44, 0x4c, 0x54, 0x64, 0x44, 0x38, // 30h 0 |
charliex | 0:8f8765c8b7bd | 180 | 0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x38, // 31h 1 |
charliex | 0:8f8765c8b7bd | 181 | 0x38, 0x44, 0x04, 0x18, 0x20, 0x40, 0x7c, // 32h 2 |
charliex | 0:8f8765c8b7bd | 182 | 0x38, 0x44, 0x04, 0x18, 0x04, 0x44, 0x38, // 33h 3 |
charliex | 0:8f8765c8b7bd | 183 | 0x08, 0x18, 0x28, 0x48, 0x7c, 0x08, 0x08, // 34h 4 |
charliex | 0:8f8765c8b7bd | 184 | 0x7c, 0x40, 0x78, 0x04, 0x04, 0x44, 0x38, // 35h 5 |
charliex | 0:8f8765c8b7bd | 185 | 0x38, 0x44, 0x40, 0x78, 0x44, 0x44, 0x38, // 36h 6 |
charliex | 0:8f8765c8b7bd | 186 | 0x7c, 0x44, 0x04, 0x08, 0x08, 0x10, 0x10, // 37h 7 |
charliex | 0:8f8765c8b7bd | 187 | 0x38, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38, // 38h 8 |
charliex | 0:8f8765c8b7bd | 188 | 0x38, 0x44, 0x44, 0x3c, 0x04, 0x44, 0x38, // 39h 9 |
charliex | 0:8f8765c8b7bd | 189 | 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, // 3Ah : |
charliex | 0:8f8765c8b7bd | 190 | 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x20, // 3Bh ; |
charliex | 0:8f8765c8b7bd | 191 | 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, // 3Ch < |
charliex | 0:8f8765c8b7bd | 192 | 0x00, 0x00, 0x7c, 0x00, 0x7c, 0x00, 0x00, // 3Dh = |
charliex | 0:8f8765c8b7bd | 193 | 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, // 3Eh > |
charliex | 0:8f8765c8b7bd | 194 | 0x38, 0x44, 0x44, 0x08, 0x10, 0x00, 0x10, // 3Fh > |
charliex | 0:8f8765c8b7bd | 195 | |
charliex | 0:8f8765c8b7bd | 196 | 0x7c, 0x82, 0xba, 0xa6, 0xbc, 0x80, 0x7c, // 40h @ |
charliex | 0:8f8765c8b7bd | 197 | 0x38, 0x44, 0x44, 0x44, 0x7c, 0x44, 0x44, // 41h A |
charliex | 0:8f8765c8b7bd | 198 | 0x78, 0x44, 0x44, 0x78, 0x44, 0x44, 0x78, // 42h B |
charliex | 0:8f8765c8b7bd | 199 | 0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, // 43h C |
charliex | 0:8f8765c8b7bd | 200 | 0x70, 0x48, 0x44, 0x44, 0x44, 0x48, 0x70, // 44h D |
charliex | 0:8f8765c8b7bd | 201 | 0x7c, 0x40, 0x40, 0x78, 0x40, 0x40, 0x7c, // 45h E |
charliex | 0:8f8765c8b7bd | 202 | 0x7c, 0x40, 0x40, 0x78, 0x40, 0x40, 0x40, // 46h F |
charliex | 0:8f8765c8b7bd | 203 | 0x38, 0x44, 0x40, 0x4c, 0x44, 0x44, 0x38, // 47h G |
charliex | 0:8f8765c8b7bd | 204 | 0x44, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x44, // 48h H |
charliex | 0:8f8765c8b7bd | 205 | 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, // 49h I |
charliex | 0:8f8765c8b7bd | 206 | 0x3c, 0x08, 0x08, 0x08, 0x08, 0x48, 0x30, // 4Ah J |
charliex | 0:8f8765c8b7bd | 207 | 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, // 4Bh K |
charliex | 0:8f8765c8b7bd | 208 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7c, // 4CH L |
charliex | 0:8f8765c8b7bd | 209 | 0x44, 0x6c, 0x54, 0x54, 0x44, 0x44, 0x44, // 4DH M |
charliex | 0:8f8765c8b7bd | 210 | 0x44, 0x64, 0x54, 0x54, 0x4c, 0x44, 0x44, // 4EH N |
charliex | 0:8f8765c8b7bd | 211 | 0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, // 4FH O |
charliex | 0:8f8765c8b7bd | 212 | |
charliex | 0:8f8765c8b7bd | 213 | 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, // 50h P |
charliex | 0:8f8765c8b7bd | 214 | 0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, // 51h Q |
charliex | 0:8f8765c8b7bd | 215 | 0x78, 0x44, 0x44, 0x78, 0x44, 0x44, 0x44, // 52h R |
charliex | 0:8f8765c8b7bd | 216 | 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, // 53h S |
charliex | 0:8f8765c8b7bd | 217 | 0x7c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // 54h T |
charliex | 0:8f8765c8b7bd | 218 | 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, // 55h U |
charliex | 0:8f8765c8b7bd | 219 | 0x44, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, // 56h V |
charliex | 0:8f8765c8b7bd | 220 | 0x44, 0x44, 0x54, 0x54, 0x54, 0x54, 0x28, // 57h W |
charliex | 0:8f8765c8b7bd | 221 | 0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, // 58h X |
charliex | 0:8f8765c8b7bd | 222 | 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, // 59h Y |
charliex | 0:8f8765c8b7bd | 223 | 0x7c, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7c, // 5Ah Z |
charliex | 0:8f8765c8b7bd | 224 | 0x1c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1c, // 5Bh [ |
charliex | 0:8f8765c8b7bd | 225 | 0x00, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, // 5Ch back slash |
charliex | 0:8f8765c8b7bd | 226 | 0x70, 0x10, 0x10, 0x10, 0x10, 0x10, 0x70, // 5Dh ] |
charliex | 0:8f8765c8b7bd | 227 | 0x00, 0x10, 0x28, 0x00, 0x00, 0x00, 0x00, // 5Eh ^ |
charliex | 0:8f8765c8b7bd | 228 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c // 5Fh _ |
charliex | 0:8f8765c8b7bd | 229 | }; |
charliex | 0:8f8765c8b7bd | 230 | |
charliex | 0:8f8765c8b7bd | 231 | #pragma pack(2) |
charliex | 0:8f8765c8b7bd | 232 | typedef struct tagBITMAPFILEHEADER { |
charliex | 0:8f8765c8b7bd | 233 | unsigned short bfType; |
charliex | 0:8f8765c8b7bd | 234 | unsigned long bfSize; |
charliex | 0:8f8765c8b7bd | 235 | unsigned short bfReserved1; |
charliex | 0:8f8765c8b7bd | 236 | unsigned short bfReserved2; |
charliex | 0:8f8765c8b7bd | 237 | unsigned long bfOffBits; |
charliex | 0:8f8765c8b7bd | 238 | } BITMAPFILEHEADER; |
charliex | 0:8f8765c8b7bd | 239 | |
charliex | 0:8f8765c8b7bd | 240 | typedef struct tagBITMAPINFOHEADER{ |
charliex | 0:8f8765c8b7bd | 241 | unsigned long biSize; |
charliex | 0:8f8765c8b7bd | 242 | long biWidth; |
charliex | 0:8f8765c8b7bd | 243 | long biHeight; |
charliex | 0:8f8765c8b7bd | 244 | unsigned short biPlanes; |
charliex | 0:8f8765c8b7bd | 245 | unsigned short biBitCount; |
charliex | 0:8f8765c8b7bd | 246 | unsigned long biCompression; |
charliex | 0:8f8765c8b7bd | 247 | unsigned long biSizeImage; |
charliex | 0:8f8765c8b7bd | 248 | long biXPixPerMeter; |
charliex | 0:8f8765c8b7bd | 249 | long biYPixPerMeter; |
charliex | 0:8f8765c8b7bd | 250 | unsigned long biClrUsed; |
charliex | 0:8f8765c8b7bd | 251 | unsigned long biClrImporant; |
charliex | 0:8f8765c8b7bd | 252 | } BITMAPINFOHEADER; |
charliex | 0:8f8765c8b7bd | 253 | #pragma pack() |
charliex | 0:8f8765c8b7bd | 254 | |
charliex | 0:8f8765c8b7bd | 255 | #pragma pack(1) |
charliex | 0:8f8765c8b7bd | 256 | typedef struct tagBMP24{ |
charliex | 0:8f8765c8b7bd | 257 | unsigned char B; |
charliex | 0:8f8765c8b7bd | 258 | unsigned char G; |
charliex | 0:8f8765c8b7bd | 259 | unsigned char R; |
charliex | 0:8f8765c8b7bd | 260 | } BMP24; |
charliex | 0:8f8765c8b7bd | 261 | #pragma pack() |
charliex | 0:8f8765c8b7bd | 262 | |
charliex | 0:8f8765c8b7bd | 263 | void tft_init(); |
charliex | 0:8f8765c8b7bd | 264 | void tft_set_window(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); |
charliex | 0:8f8765c8b7bd | 265 | void tft_clear(uint16_t color); |
charliex | 0:8f8765c8b7bd | 266 | void tft_put_char(int x, int y, char chr, uint16_t color, uint16_t bgcolor); |
charliex | 0:8f8765c8b7bd | 267 | void tft_text(int x, int y, char *text, uint16_t color, uint16_t bgcolor); |
charliex | 0:8f8765c8b7bd | 268 | void tft_hline(int x1, int y, int x2, uint16_t color); |
charliex | 0:8f8765c8b7bd | 269 | void tft_vline(int x, int y1, int y2, uint16_t color); |
charliex | 0:8f8765c8b7bd | 270 | void tft_box(int x1, int y1, int x2, int y2, uint16_t color); |
charliex | 0:8f8765c8b7bd | 271 | void tft_boxfill(int x1, int y1, int x2, int y2, uint16_t color); |
charliex | 0:8f8765c8b7bd | 272 | bool draw_bmp_4bpp(const unsigned char *imgdata, int x, int y); |
charliex | 0:8f8765c8b7bd | 273 | |
charliex | 0:8f8765c8b7bd | 274 | #endif |
charliex | 0:8f8765c8b7bd | 275 |