diff --git a/Arduino/Libraries/MCUFRIEND_kbv/.gitattributes b/Arduino/Libraries/MCUFRIEND_kbv/.gitattributes new file mode 100644 index 0000000..bdb0cab --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/Arduino/Libraries/MCUFRIEND_kbv/.gitignore b/Arduino/Libraries/MCUFRIEND_kbv/.gitignore new file mode 100644 index 0000000..cd2946a --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/.gitignore @@ -0,0 +1,47 @@ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/Arduino/Libraries/MCUFRIEND_kbv/FreeDefaultFonts.h b/Arduino/Libraries/MCUFRIEND_kbv/FreeDefaultFonts.h new file mode 100644 index 0000000..50ff131 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/FreeDefaultFonts.h @@ -0,0 +1,725 @@ +// generate FreeFont from UTFT font +const uint8_t FreeSmallFontBitmaps[] PROGMEM = { +// 0x0 [0x20 '.'] + +// 1x8 [0x21 '!'] +0xFD, +// 4x3 [0x22 '"'] +0x5A,0xA0, +// 6x8 [0x23 '#'] +0x28,0xAF,0xCA,0x53,0xF5,0x14, +// 5x10 [0x24 '$'] +0x23,0xEB,0x46,0x18,0xB5,0xF1,0x00, +// 6x8 [0x25 '%'] +0x4A,0xAB,0x14,0x28,0xD5,0x52, +// 6x8 [0x26 '&'] +0x21,0x45,0x1E,0xAA,0xA9,0x1B, +// 2x3 [0x27 '''] +0x58, +// 3x10 [0x28 '('] +0x2A,0x49,0x24,0x44, +// 3x10 [0x29 ')'] +0x88,0x92,0x49,0x50, +// 5x6 [0x2A '*'] +0x25,0x5C,0xEA,0x90, +// 5x7 [0x2B '+'] +0x21,0x09,0xF2,0x10,0x80, +// 2x3 [0x2C ','] +0x58, +// 5x1 [0x2D '-'] +0xF8, +// 1x1 [0x2E '.'] +0x80, +// 5x10 [0x2F '/'] +0x08,0x84,0x22,0x11,0x08,0x44,0x00, +// 5x8 [0x30 '0'] +0x74,0x63,0x18,0xC6,0x2E, +// 3x8 [0x31 '1'] +0x59,0x24,0x97, +// 5x8 [0x32 '2'] +0x74,0x62,0x22,0x22,0x1F, +// 5x8 [0x33 '3'] +0x74,0x42,0x60,0x86,0x2E, +// 5x8 [0x34 '4'] +0x11,0x94,0xA9,0x3C,0x43, +// 5x8 [0x35 '5'] +0xFC,0x21,0xE0,0x86,0x2E, +// 5x8 [0x36 '6'] +0x74,0xA1,0xE8,0xC6,0x2E, +// 5x8 [0x37 '7'] +0xFC,0x84,0x42,0x10,0x84, +// 5x8 [0x38 '8'] +0x74,0x62,0xE8,0xC6,0x2E, +// 5x8 [0x39 '9'] +0x74,0x63,0x17,0x85,0x2E, +// 1x6 [0x3A ':'] +0x84, +// 1x6 [0x3B ';'] +0x8C, +// 5x9 [0x3C '<'] +0x08,0x88,0x88,0x20,0x82,0x08, +// 5x4 [0x3D '='] +0xF8,0x01,0xF0, +// 5x9 [0x3E '>'] +0x82,0x08,0x20,0x88,0x88,0x80, +// 5x8 [0x3F '?'] +0x74,0x62,0x22,0x10,0x04, +// 5x8 [0x40 '@'] +0x74,0x67,0x5A,0xDE,0x0F, +// 6x8 [0x41 'A'] +0x20,0x83,0x14,0x51,0xE4,0xB3, +// 5x8 [0x42 'B'] +0xF2,0x52,0xE4,0xA5,0x3E, +// 5x8 [0x43 'C'] +0x7C,0x61,0x08,0x42,0x2E, +// 5x8 [0x44 'D'] +0xF2,0x52,0x94,0xA5,0x3E, +// 5x8 [0x45 'E'] +0xFA,0x54,0xE5,0x21,0x3F, +// 5x8 [0x46 'F'] +0xFA,0x54,0xE5,0x21,0x1C, +// 6x8 [0x47 'G'] +0x39,0x28,0x20,0x9E,0x24,0x8C, +// 6x8 [0x48 'H'] +0xCD,0x24,0x9E,0x49,0x24,0xB3, +// 5x8 [0x49 'I'] +0xF9,0x08,0x42,0x10,0x9F, +// 6x9 [0x4A 'J'] +0x7C,0x41,0x04,0x10,0x41,0x24,0xE0, +// 6x8 [0x4B 'K'] +0xED,0x25,0x18,0x51,0x44,0xBB, +// 6x8 [0x4C 'L'] +0xE1,0x04,0x10,0x41,0x04,0x7F, +// 5x8 [0x4D 'M'] +0xDE,0xF7,0xBA,0xD6,0xB5, +// 6x8 [0x4E 'N'] +0xDD,0x26,0x9A,0x59,0x64,0xBA, +// 5x8 [0x4F 'O'] +0x74,0x63,0x18,0xC6,0x2E, +// 5x8 [0x50 'P'] +0xF2,0x52,0xE4,0x21,0x1C, +// 5x9 [0x51 'Q'] +0x74,0x63,0x18,0xF6,0x6E,0x18, +// 6x8 [0x52 'R'] +0xF1,0x24,0x9C,0x51,0x24,0xBB, +// 5x8 [0x53 'S'] +0x7C,0x60,0xC1,0x06,0x3E, +// 5x8 [0x54 'T'] +0xFD,0x48,0x42,0x10,0x8E, +// 6x8 [0x55 'U'] +0xCD,0x24,0x92,0x49,0x24,0x8C, +// 6x8 [0x56 'V'] +0xCD,0x24,0x94,0x50,0xC2,0x08, +// 5x8 [0x57 'W'] +0xAD,0x6A,0xE5,0x29,0x4A, +// 5x8 [0x58 'X'] +0xDA,0x94,0x42,0x29,0x5B, +// 5x8 [0x59 'Y'] +0xDA,0x94,0x42,0x10,0x8E, +// 5x8 [0x5A 'Z'] +0xFC,0x84,0x42,0x21,0x3F, +// 3x10 [0x5B '['] +0xF2,0x49,0x24,0x9C, +// 4x9 [0x5C '\'] +0x88,0x84,0x42,0x22,0x10, +// 3x10 [0x5D ']'] +0xE4,0x92,0x49,0x3C, +// 3x2 [0x5E '^'] +0x54, +// 6x1 [0x5F '_'] +0xFC, +// 1x1 [0x60 '`'] +0x80, +// 5x5 [0x61 'a'] +0x64,0x9D,0x27,0x80, +// 5x8 [0x62 'b'] +0xC2,0x10,0xE4,0xA5,0x2E, +// 4x5 [0x63 'c'] +0x79,0x88,0x70, +// 5x8 [0x64 'd'] +0x30,0x84,0xE9,0x4A,0x4F, +// 4x5 [0x65 'e'] +0x69,0xF8,0x70, +// 5x8 [0x66 'f'] +0x3A,0x11,0xE4,0x21,0x1E, +// 5x7 [0x67 'g'] +0x7C,0x99,0x0F,0x45,0xC0, +// 6x8 [0x68 'h'] +0xC1,0x04,0x1C,0x49,0x24,0xBB, +// 3x8 [0x69 'i'] +0x40,0x64,0x97, +// 4x10 [0x6A 'j'] +0x10,0x03,0x11,0x11,0x1E, +// 6x8 [0x6B 'k'] +0xC1,0x04,0x17,0x51,0xC4,0xBB, +// 5x8 [0x6C 'l'] +0xE1,0x08,0x42,0x10,0x9F, +// 5x5 [0x6D 'm'] +0xF5,0x6B,0x5A,0x80, +// 6x5 [0x6E 'n'] +0xF1,0x24,0x92,0xEC, +// 4x5 [0x6F 'o'] +0x69,0x99,0x60, +// 5x7 [0x70 'p'] +0xF2,0x52,0x97,0x23,0x80, +// 5x7 [0x71 'q'] +0x74,0xA5,0x27,0x08,0xE0, +// 5x5 [0x72 'r'] +0xDB,0x10,0x8E,0x00, +// 4x5 [0x73 's'] +0xF8,0x61,0xF0, +// 4x7 [0x74 't'] +0x44,0xE4,0x44,0x30, +// 6x5 [0x75 'u'] +0xD9,0x24,0x92,0x3C, +// 6x5 [0x76 'v'] +0xED,0x25,0x0C,0x20, +// 5x5 [0x77 'w'] +0xAD,0x5C,0xA5,0x00, +// 5x5 [0x78 'x'] +0xDA,0x88,0xAD,0x80, +// 6x7 [0x79 'y'] +0xED,0x25,0x0C,0x20,0x8C,0x00, +// 4x5 [0x7A 'z'] +0xF2,0x44,0xF0, +// 3x10 [0x7B '{'] +0x69,0x28,0x92,0x4C, +// 1x12 [0x7C '|'] +0xFF,0xF0, +// 3x10 [0x7D '}'] +0xC9,0x22,0x92,0x58, +// 6x3 [0x7E '~'] +0x42,0x91,0x80, +}; +const GFXglyph FreeSmallFontGlyphs[] PROGMEM = { + { 0, 0, 0, 8, 8, -12 }, // 0x20 ' ' + { 0, 1, 8, 8, 2, -10 }, // 0x21 '!' + { 1, 4, 3, 8, 1, -11 }, // 0x22 '"' + { 3, 6, 8, 8, 0, -10 }, // 0x23 '#' + { 9, 5, 10, 8, 0, -11 }, // 0x24 '$' + { 16, 6, 8, 8, 0, -10 }, // 0x25 '%' + { 22, 6, 8, 8, 0, -10 }, // 0x26 '&' + { 28, 2, 3, 8, 0, -11 }, // 0x27 ''' + { 29, 3, 10, 8, 3, -11 }, // 0x28 '(' + { 33, 3, 10, 8, 1, -11 }, // 0x29 ')' + { 37, 5, 6, 8, 0, -9 }, // 0x2A '*' + { 41, 5, 7, 8, 0, -10 }, // 0x2B '+' + { 46, 2, 3, 8, 0, -3 }, // 0x2C ',' + { 47, 5, 1, 8, 0, -7 }, // 0x2D '-' + { 48, 1, 1, 8, 1, -3 }, // 0x2E '.' + { 49, 5, 10, 8, 0, -11 }, // 0x2F '/' + { 56, 5, 8, 8, 0, -10 }, // 0x30 '0' + { 61, 3, 8, 8, 1, -10 }, // 0x31 '1' + { 64, 5, 8, 8, 0, -10 }, // 0x32 '2' + { 69, 5, 8, 8, 0, -10 }, // 0x33 '3' + { 74, 5, 8, 8, 0, -10 }, // 0x34 '4' + { 79, 5, 8, 8, 0, -10 }, // 0x35 '5' + { 84, 5, 8, 8, 0, -10 }, // 0x36 '6' + { 89, 5, 8, 8, 0, -10 }, // 0x37 '7' + { 94, 5, 8, 8, 0, -10 }, // 0x38 '8' + { 99, 5, 8, 8, 0, -10 }, // 0x39 '9' + { 104, 1, 6, 8, 2, -8 }, // 0x3A ':' + { 105, 1, 6, 8, 2, -7 }, // 0x3B ';' + { 106, 5, 9, 8, 1, -11 }, // 0x3C '<' + { 112, 5, 4, 8, 0, -8 }, // 0x3D '=' + { 115, 5, 9, 8, 1, -11 }, // 0x3E '>' + { 121, 5, 8, 8, 0, -10 }, // 0x3F '?' + { 126, 5, 8, 8, 0, -10 }, // 0x40 '@' + { 131, 6, 8, 8, 0, -10 }, // 0x41 'A' + { 137, 5, 8, 8, 0, -10 }, // 0x42 'B' + { 142, 5, 8, 8, 0, -10 }, // 0x43 'C' + { 147, 5, 8, 8, 0, -10 }, // 0x44 'D' + { 152, 5, 8, 8, 0, -10 }, // 0x45 'E' + { 157, 5, 8, 8, 0, -10 }, // 0x46 'F' + { 162, 6, 8, 8, 0, -10 }, // 0x47 'G' + { 168, 6, 8, 8, 0, -10 }, // 0x48 'H' + { 174, 5, 8, 8, 0, -10 }, // 0x49 'I' + { 179, 6, 9, 8, 0, -10 }, // 0x4A 'J' + { 186, 6, 8, 8, 0, -10 }, // 0x4B 'K' + { 192, 6, 8, 8, 0, -10 }, // 0x4C 'L' + { 198, 5, 8, 8, 0, -10 }, // 0x4D 'M' + { 203, 6, 8, 8, 0, -10 }, // 0x4E 'N' + { 209, 5, 8, 8, 0, -10 }, // 0x4F 'O' + { 214, 5, 8, 8, 0, -10 }, // 0x50 'P' + { 219, 5, 9, 8, 0, -10 }, // 0x51 'Q' + { 225, 6, 8, 8, 0, -10 }, // 0x52 'R' + { 231, 5, 8, 8, 0, -10 }, // 0x53 'S' + { 236, 5, 8, 8, 0, -10 }, // 0x54 'T' + { 241, 6, 8, 8, 0, -10 }, // 0x55 'U' + { 247, 6, 8, 8, 0, -10 }, // 0x56 'V' + { 253, 5, 8, 8, 0, -10 }, // 0x57 'W' + { 258, 5, 8, 8, 0, -10 }, // 0x58 'X' + { 263, 5, 8, 8, 0, -10 }, // 0x59 'Y' + { 268, 5, 8, 8, 0, -10 }, // 0x5A 'Z' + { 273, 3, 10, 8, 2, -11 }, // 0x5B '[' + { 277, 4, 9, 8, 1, -11 }, // 0x5C '\' + { 282, 3, 10, 8, 1, -11 }, // 0x5D ']' + { 286, 3, 2, 8, 1, -11 }, // 0x5E '^' + { 287, 6, 1, 8, 0, -1 }, // 0x5F '_' + { 288, 1, 1, 8, 2, -11 }, // 0x60 '`' + { 289, 5, 5, 8, 1, -7 }, // 0x61 'a' + { 293, 5, 8, 8, 0, -10 }, // 0x62 'b' + { 298, 4, 5, 8, 1, -7 }, // 0x63 'c' + { 301, 5, 8, 8, 1, -10 }, // 0x64 'd' + { 306, 4, 5, 8, 1, -7 }, // 0x65 'e' + { 309, 5, 8, 8, 1, -10 }, // 0x66 'f' + { 314, 5, 7, 8, 1, -7 }, // 0x67 'g' + { 319, 6, 8, 8, 0, -10 }, // 0x68 'h' + { 325, 3, 8, 8, 1, -10 }, // 0x69 'i' + { 328, 4, 10, 8, 0, -10 }, // 0x6A 'j' + { 333, 6, 8, 8, 0, -10 }, // 0x6B 'k' + { 339, 5, 8, 8, 0, -10 }, // 0x6C 'l' + { 344, 5, 5, 8, 0, -7 }, // 0x6D 'm' + { 348, 6, 5, 8, 0, -7 }, // 0x6E 'n' + { 352, 4, 5, 8, 1, -7 }, // 0x6F 'o' + { 355, 5, 7, 8, 0, -7 }, // 0x70 'p' + { 360, 5, 7, 8, 1, -7 }, // 0x71 'q' + { 365, 5, 5, 8, 0, -7 }, // 0x72 'r' + { 369, 4, 5, 8, 1, -7 }, // 0x73 's' + { 372, 4, 7, 8, 1, -9 }, // 0x74 't' + { 376, 6, 5, 8, 0, -7 }, // 0x75 'u' + { 380, 6, 5, 8, 0, -7 }, // 0x76 'v' + { 384, 5, 5, 8, 0, -7 }, // 0x77 'w' + { 388, 5, 5, 8, 0, -7 }, // 0x78 'x' + { 392, 6, 7, 8, 0, -7 }, // 0x79 'y' + { 398, 4, 5, 8, 1, -7 }, // 0x7A 'z' + { 401, 3, 10, 8, 2, -11 }, // 0x7B '{' + { 405, 1, 12, 8, 3, -12 }, // 0x7C '|' + { 407, 3, 10, 8, 1, -11 }, // 0x7D '}' + { 411, 6, 3, 8, 0, -12 }, // 0x7E '~' +}; +const GFXfont FreeSmallFont PROGMEM = { + (uint8_t *)FreeSmallFontBitmaps, + (GFXglyph *)FreeSmallFontGlyphs, + 32, 126, 12 +}; +// FreeSmallFont bitmap size = 414 [1079] [1239] +const uint8_t FreeBigFontBitmaps[] PROGMEM = { +// 0x0 [0x20 '.'] + +// 5x13 [0x21 '!'] +0x77,0xFF,0xFF,0xFD,0xCE,0x00,0x1C,0xE7,0x00, +// 9x5 [0x22 '"'] +0xE3,0xF1,0xF8,0xFC,0x76,0x30, +// 14x14 [0x23 '#'] +0x18,0x60,0x61,0x81,0x86,0x3F,0xFF,0xFF,0xFC,0x61,0x81,0x86,0x06,0x18,0x18,0x63, +0xFF,0xFF,0xFF,0xC6,0x18,0x18,0x60,0x61,0x80, +// 10x14 [0x24 '$'] +0x12,0x04,0x87,0xFF,0xFF,0xD2,0x34,0x8F,0xF9,0xFF,0x12,0xC4,0xBF,0xFF,0xFE,0x12, +0x04,0x80, +// 8x10 [0x25 '%'] +0xE1,0xE3,0xE7,0x0E,0x1C,0x38,0x70,0xE7,0xC7,0x87, +// 10x12 [0x26 '&'] +0x78,0x33,0x0C,0xC3,0x30,0x78,0x1E,0x17,0xCF,0x3F,0xC7,0xB1,0xCC,0xF9,0xF3, +// 4x4 [0x27 '''] +0x77,0x7E, +// 8x12 [0x28 '('] +0x0F,0x1C,0x38,0x70,0xE0,0xE0,0xE0,0xE0,0x70,0x38,0x1C,0x0F, +// 8x12 [0x29 ')'] +0xF0,0x38,0x1C,0x0E,0x07,0x07,0x07,0x07,0x0E,0x1C,0x38,0xF0, +// 12x12 [0x2A '*'] +0x06,0x04,0x62,0x26,0x41,0xF8,0x1F,0x8F,0xFF,0xFF,0xF1,0xF8,0x1F,0x82,0x64,0x46, +0x20,0x60, +// 8x8 [0x2B '+'] +0x18,0x18,0x18,0xFF,0xFF,0x18,0x18,0x18, +// 4x4 [0x2C ','] +0x77,0x7E, +// 10x2 [0x2D '-'] +0xFF,0xFF,0xF0, +// 3x3 [0x2E '.'] +0xFF,0x80, +// 12x12 [0x2F '/'] +0x00,0x10,0x03,0x00,0x70,0x0E,0x01,0xC0,0x38,0x07,0x00,0xE0,0x1C,0x03,0x80,0x70, +0x0E,0x00, +// 10x12 [0x30 '0'] +0x7F,0xB8,0x7E,0x3F,0x9F,0xE7,0xFB,0x7E,0xDF,0xE7,0xF9,0xFC,0x7E,0x1D,0xFE, +// 9x12 [0x31 '1'] +0x0C,0x06,0x07,0x1F,0x8F,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x07,0x1F,0xF0, +// 10x12 [0x32 '2'] +0x7F,0x38,0xEE,0x1C,0x07,0x03,0x81,0xC0,0xE0,0x70,0x38,0x1C,0x7E,0x1F,0xFF, +// 10x12 [0x33 '3'] +0x7F,0x38,0xEE,0x1C,0x07,0x03,0x87,0x81,0xE0,0x0E,0x01,0xF8,0x7E,0x39,0xFC, +// 10x12 [0x34 '4'] +0x07,0x03,0xC1,0xF0,0xDC,0x67,0x31,0xCF,0xFF,0xFF,0x07,0x01,0xC0,0x70,0x7F, +// 10x12 [0x35 '5'] +0xFF,0xF8,0x0E,0x03,0x80,0xE0,0x3F,0xCF,0xF8,0x0F,0x01,0xF8,0x7E,0x39,0xFC, +// 10x12 [0x36 '6'] +0x1F,0x0E,0x07,0x03,0x80,0xE0,0x3F,0xEF,0xFF,0x87,0xE1,0xF8,0x7E,0x1D,0xFE, +// 11x12 [0x37 '7'] +0xFF,0xFC,0x1F,0x83,0xF0,0x70,0x0E,0x03,0x80,0xE0,0x38,0x0E,0x03,0x80,0x70,0x0E, +0x00, +// 10x12 [0x38 '8'] +0x7F,0xB8,0x7E,0x1F,0x87,0xF9,0xCF,0xC3,0xF3,0x9F,0xE1,0xF8,0x7E,0x1D,0xFE, +// 10x12 [0x39 '9'] +0x7F,0xB8,0x7E,0x1F,0x87,0xE1,0xFF,0xF7,0xFC,0x07,0x01,0xC0,0xE0,0x70,0xF8, +// 3x8 [0x3A ':'] +0xFF,0x81,0xFF, +// 4x9 [0x3B ';'] +0x77,0x70,0x07,0x77,0xE0, +// 9x14 [0x3C '<'] +0x03,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0xC0,0x70,0x1C,0x07,0x01,0xC0,0x70,0x1C, +// 12x6 [0x3D '='] +0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFF,0xFF, +// 9x14 [0x3E '>'] +0xE0,0x38,0x0E,0x03,0x80,0xE0,0x38,0x0E,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x00, +// 10x14 [0x3F '?'] +0x1E,0x1F,0xEF,0x3F,0x07,0x01,0xC0,0xE0,0x70,0x38,0x0E,0x00,0x00,0x00,0x38,0x0E, +0x03,0x80, +// 11x14 [0x40 '@'] +0x7F,0xDC,0x1F,0x83,0xF0,0x7E,0x0F,0xCF,0xF9,0xFF,0x3F,0xE7,0xFC,0x03,0x80,0x70, +0x0F,0xF8,0x7F,0x80, +// 10x12 [0x41 'A'] +0x1E,0x0F,0xC7,0x3B,0x87,0xE1,0xF8,0x7E,0x1F,0xFF,0xE1,0xF8,0x7E,0x1F,0x87, +// 10x12 [0x42 'B'] +0xFF,0x9C,0x77,0x1D,0xC7,0x71,0xDF,0xE7,0xF9,0xC7,0x71,0xDC,0x77,0x1F,0xFE, +// 10x12 [0x43 'C'] +0x3F,0x9C,0x7E,0x1F,0x80,0xE0,0x38,0x0E,0x03,0x80,0xE0,0x38,0x77,0x1C,0xFE, +// 10x12 [0x44 'D'] +0xFF,0x1C,0xE7,0x1D,0xC7,0x71,0xDC,0x77,0x1D,0xC7,0x71,0xDC,0x77,0x3B,0xFC, +// 10x12 [0x45 'E'] +0xFF,0xDC,0x37,0x05,0xC0,0x71,0x9F,0xE7,0xF9,0xC6,0x70,0x1C,0x17,0x0F,0xFF, +// 10x12 [0x46 'F'] +0xFF,0xDC,0x37,0x05,0xC0,0x71,0x9F,0xE7,0xF9,0xC6,0x70,0x1C,0x07,0x03,0xE0, +// 10x12 [0x47 'G'] +0x3F,0x9C,0x7E,0x1F,0x87,0xE0,0x38,0x0E,0x03,0x9F,0xE1,0xF8,0x77,0x1C,0xFF, +// 9x12 [0x48 'H'] +0xE3,0xF1,0xF8,0xFC,0x7E,0x3F,0xFF,0xFF,0xC7,0xE3,0xF1,0xF8,0xFC,0x70, +// 7x12 [0x49 'I'] +0xFE,0x70,0xE1,0xC3,0x87,0x0E,0x1C,0x38,0x70,0xE7,0xF0, +// 12x12 [0x4A 'J'] +0x07,0xF0,0x1C,0x01,0xC0,0x1C,0x01,0xC0,0x1C,0x01,0xCE,0x1C,0xE1,0xCE,0x1C,0xE1, +0xC3,0xF8, +// 10x12 [0x4B 'K'] +0xF1,0xDC,0x77,0x39,0xDC,0x7E,0x1F,0x07,0xC1,0xF8,0x77,0x1C,0xE7,0x1F,0xC7, +// 10x12 [0x4C 'L'] +0xF8,0x1C,0x07,0x01,0xC0,0x70,0x1C,0x07,0x01,0xC0,0x70,0x5C,0x37,0x1F,0xFF, +// 11x12 [0x4D 'M'] +0xE0,0xFE,0x3F,0xEF,0xFF,0xFF,0xFF,0xDD,0xF9,0x3F,0x07,0xE0,0xFC,0x1F,0x83,0xF0, +0x70, +// 11x12 [0x4E 'N'] +0xE0,0xFC,0x1F,0xC3,0xFC,0x7F,0xCF,0xDD,0xF9,0xFF,0x1F,0xE1,0xFC,0x1F,0x83,0xF0, +0x70, +// 11x12 [0x4F 'O'] +0x1F,0x07,0xF1,0xC7,0x70,0x7E,0x0F,0xC1,0x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x3E,0x1F,0xFF, +// 7x12 [0x5B '['] +0xFF,0xC3,0x87,0x0E,0x1C,0x38,0x70,0xE1,0xC3,0x87,0xF0, +// 13x12 [0x5C '\'] +0x80,0x06,0x00,0x38,0x00,0xE0,0x03,0x80,0x0E,0x00,0x38,0x00,0xE0,0x03,0x80,0x0E, +0x00,0x38,0x00,0x70, +// 7x12 [0x5D ']'] +0xFE,0x1C,0x38,0x70,0xE1,0xC3,0x87,0x0E,0x1C,0x3F,0xF0, +// 10x5 [0x5E '^'] +0x0C,0x07,0x83,0xF1,0xCE,0xE1,0xC0, +// 15x2 [0x5F '_'] +0xFF,0xFF,0xFF,0xFC, +// 5x4 [0x60 '`'] +0xE7,0x0E,0x70, +// 10x8 [0x61 'a'] +0x7F,0x00,0xE0,0x39,0xFE,0xE3,0xB8,0xEE,0x39,0xFB, +// 10x12 [0x62 'b'] +0xF0,0x1C,0x07,0x01,0xC0,0x7F,0x9C,0x77,0x1D,0xC7,0x71,0xDC,0x77,0x1F,0x7E, +// 9x8 [0x63 'c'] +0x7F,0x71,0xF8,0xFC,0x0E,0x07,0x1F,0x8E,0xFE, +// 10x12 [0x64 'd'] +0x07,0xC0,0xE0,0x38,0x0E,0x7F,0xB8,0xEE,0x3B,0x8E,0xE3,0xB8,0xEE,0x39,0xFB, +// 9x8 [0x65 'e'] +0x7F,0x71,0xF8,0xFF,0xFE,0x07,0x1F,0x8E,0xFE, +// 9x12 [0x66 'f'] +0x1F,0x1D,0xCE,0xE7,0x03,0x87,0xFB,0xFC,0x70,0x38,0x1C,0x0E,0x1F,0xC0, +// 10x10 [0x67 'g'] +0x7E,0xF8,0xEE,0x3B,0x8E,0xE3,0x9F,0xE3,0xF8,0x0E,0xE3,0x9F,0xC0, +// 10x12 [0x68 'h'] +0xF0,0x1C,0x07,0x01,0xC0,0x77,0x9E,0x77,0x9D,0xC7,0x71,0xDC,0x77,0x1F,0xC7, +// 9x12 [0x69 'i'] +0x1C,0x0E,0x07,0x00,0x0F,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x07,0x1F,0xF0, +// 9x14 [0x6A 'j'] +0x03,0x81,0xC0,0xE0,0x01,0xF8,0x1C,0x0E,0x07,0x03,0x81,0xC0,0xFC,0x76,0x79,0xF8, +// 10x12 [0x6B 'k'] +0xF0,0x1C,0x07,0x01,0xC0,0x71,0xDC,0xE7,0x71,0xF8,0x77,0x1C,0xE7,0x1F,0xC7, +// 9x12 [0x6C 'l'] +0xFC,0x0E,0x07,0x03,0x81,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x07,0x1F,0xF0, +// 11x8 [0x6D 'm'] +0xFF,0xDC,0x9F,0x93,0xF2,0x7E,0x4F,0xC9,0xF9,0x3F,0x27, +// 9x8 [0x6E 'n'] +0xFF,0x71,0xF8,0xFC,0x7E,0x3F,0x1F,0x8F,0xC7, +// 9x8 [0x6F 'o'] +0x7F,0x71,0xF8,0xFC,0x7E,0x3F,0x1F,0x8E,0xFE, +// 10x10 [0x70 'p'] +0xDF,0x9C,0x77,0x1D,0xC7,0x71,0xDC,0x77,0xF9,0xC0,0x70,0x3E,0x00, +// 10x10 [0x71 'q'] +0x7E,0xF8,0xEE,0x3B,0x8E,0xE3,0xB8,0xE7,0xF8,0x0E,0x03,0x81,0xF0, +// 10x8 [0x72 'r'] +0xF7,0x9F,0xF7,0x9D,0xC0,0x70,0x1C,0x07,0x03,0xE0, +// 9x8 [0x73 's'] +0x7F,0x70,0xF8,0x6F,0x81,0xF6,0x1F,0x0E,0xFE, +// 9x11 [0x74 't'] +0x08,0x0C,0x0E,0x1F,0xF3,0x81,0xC0,0xE0,0x70,0x3B,0x9D,0xC7,0xC0, +// 10x8 [0x75 'u'] +0xE3,0xB8,0xEE,0x3B,0x8E,0xE3,0xB8,0xEE,0x39,0xFB, +// 9x8 [0x76 'v'] +0xE3,0xF1,0xF8,0xFC,0x7E,0x3B,0xB8,0xF8,0x38, +// 11x8 [0x77 'w'] +0xE0,0xFC,0x1F,0x83,0xF2,0x7E,0x4E,0xFF,0x8E,0xE1,0xDC, +// 8x8 [0x78 'x'] +0xE7,0xE7,0x7E,0x3C,0x3C,0x7E,0xE7,0xE7, +// 10x10 [0x79 'y'] +0x71,0xDC,0x77,0x1D,0xC7,0x71,0xCF,0xE1,0xF0,0x1C,0x0E,0x3F,0x00, +// 8x8 [0x7A 'z'] +0xFF,0xC7,0x8E,0x1C,0x38,0x71,0xE3,0xFF, +// 10x12 [0x7B '{'] +0x0F,0xC7,0x01,0xC0,0x70,0x38,0x38,0x0E,0x00,0xE0,0x1C,0x07,0x01,0xC0,0x3F, +// 3x14 [0x7C '|'] +0xFF,0xFF,0xFF,0xFF,0xFF,0xC0, +// 10x12 [0x7D '}'] +0xFC,0x03,0x80,0xE0,0x38,0x07,0x00,0x70,0x1C,0x1C,0x0E,0x03,0x80,0xE3,0xF0, +// 12x4 [0x7E '~'] +0x7C,0x7E,0xE7,0xE7,0x7E,0x3E, +}; +const GFXglyph FreeBigFontGlyphs[] PROGMEM = { + { 0, 0, 0, 16, 16, -16 }, // 0x20 ' ' + { 0, 5, 13, 16, 4, -14 }, // 0x21 '!' + { 9, 9, 5, 16, 4, -15 }, // 0x22 '"' + { 15, 14, 14, 16, 1, -15 }, // 0x23 '#' + { 40, 10, 14, 16, 3, -15 }, // 0x24 '$' + { 58, 8, 10, 16, 4, -13 }, // 0x25 '%' + { 68, 10, 12, 16, 3, -14 }, // 0x26 '&' + { 83, 4, 4, 16, 4, -14 }, // 0x27 ''' + { 85, 8, 12, 16, 4, -14 }, // 0x28 '(' + { 97, 8, 12, 16, 4, -14 }, // 0x29 ')' + { 109, 12, 12, 16, 2, -14 }, // 0x2A '*' + { 127, 8, 8, 16, 4, -12 }, // 0x2B '+' + { 135, 4, 4, 16, 4, -5 }, // 0x2C ',' + { 137, 10, 2, 16, 3, -9 }, // 0x2D '-' + { 140, 3, 3, 16, 5, -5 }, // 0x2E '.' + { 142, 12, 12, 16, 3, -14 }, // 0x2F '/' + { 160, 10, 12, 16, 3, -14 }, // 0x30 '0' + { 175, 9, 12, 16, 3, -14 }, // 0x31 '1' + { 189, 10, 12, 16, 3, -14 }, // 0x32 '2' + { 204, 10, 12, 16, 3, -14 }, // 0x33 '3' + { 219, 10, 12, 16, 3, -14 }, // 0x34 '4' + { 234, 10, 12, 16, 3, -14 }, // 0x35 '5' + { 249, 10, 12, 16, 3, -14 }, // 0x36 '6' + { 264, 11, 12, 16, 3, -14 }, // 0x37 '7' + { 281, 10, 12, 16, 3, -14 }, // 0x38 '8' + { 296, 10, 12, 16, 3, -14 }, // 0x39 '9' + { 311, 3, 8, 16, 6, -12 }, // 0x3A ':' + { 314, 4, 9, 16, 5, -12 }, // 0x3B ';' + { 319, 9, 14, 16, 3, -15 }, // 0x3C '<' + { 335, 12, 6, 16, 2, -11 }, // 0x3D '=' + { 344, 9, 14, 16, 3, -15 }, // 0x3E '>' + { 360, 10, 14, 16, 3, -15 }, // 0x3F '?' + { 378, 11, 14, 16, 3, -15 }, // 0x40 '@' + { 398, 10, 12, 16, 3, -14 }, // 0x41 'A' + { 413, 10, 12, 16, 3, -14 }, // 0x42 'B' + { 428, 10, 12, 16, 3, -14 }, // 0x43 'C' + { 443, 10, 12, 16, 3, -14 }, // 0x44 'D' + { 458, 10, 12, 16, 3, -14 }, // 0x45 'E' + { 473, 10, 12, 16, 3, -14 }, // 0x46 'F' + { 488, 10, 12, 16, 3, -14 }, // 0x47 'G' + { 503, 9, 12, 16, 3, -14 }, // 0x48 'H' + { 517, 7, 12, 16, 4, -14 }, // 0x49 'I' + { 528, 12, 12, 16, 2, -14 }, // 0x4A 'J' + { 546, 10, 12, 16, 3, -14 }, // 0x4B 'K' + { 561, 10, 12, 16, 3, -14 }, // 0x4C 'L' + { 576, 11, 12, 16, 3, -14 }, // 0x4D 'M' + { 593, 11, 12, 16, 3, -14 }, // 0x4E 'N' + { 610, 11, 12, 16, 3, -14 }, // 0x4F 'O' + { 627, 10, 12, 16, 3, -14 }, // 0x50 'P' + { 642, 11, 13, 16, 3, -14 }, // 0x51 'Q' + { 660, 10, 12, 16, 3, -14 }, // 0x52 'R' + { 675, 10, 12, 16, 3, -14 }, // 0x53 'S' + { 690, 11, 12, 16, 3, -14 }, // 0x54 'T' + { 707, 9, 12, 16, 3, -14 }, // 0x55 'U' + { 721, 9, 12, 16, 3, -14 }, // 0x56 'V' + { 735, 11, 12, 16, 3, -14 }, // 0x57 'W' + { 752, 9, 12, 16, 3, -14 }, // 0x58 'X' + { 766, 9, 12, 16, 3, -14 }, // 0x59 'Y' + { 780, 10, 12, 16, 3, -14 }, // 0x5A 'Z' + { 795, 7, 12, 16, 5, -14 }, // 0x5B '[' + { 806, 13, 12, 16, 3, -14 }, // 0x5C '\' + { 826, 7, 12, 16, 5, -14 }, // 0x5D ']' + { 837, 10, 5, 16, 3, -15 }, // 0x5E '^' + { 844, 15, 2, 16, 1, -2 }, // 0x5F '_' + { 848, 5, 4, 16, 3, -14 }, // 0x60 '`' + { 851, 10, 8, 16, 3, -10 }, // 0x61 'a' + { 861, 10, 12, 16, 3, -14 }, // 0x62 'b' + { 876, 9, 8, 16, 3, -10 }, // 0x63 'c' + { 885, 10, 12, 16, 3, -14 }, // 0x64 'd' + { 900, 9, 8, 16, 3, -10 }, // 0x65 'e' + { 909, 9, 12, 16, 3, -14 }, // 0x66 'f' + { 923, 10, 10, 16, 3, -10 }, // 0x67 'g' + { 936, 10, 12, 16, 3, -14 }, // 0x68 'h' + { 951, 9, 12, 16, 4, -14 }, // 0x69 'i' + { 965, 9, 14, 16, 3, -14 }, // 0x6A 'j' + { 981, 10, 12, 16, 3, -14 }, // 0x6B 'k' + { 996, 9, 12, 16, 4, -14 }, // 0x6C 'l' + {1010, 11, 8, 16, 3, -10 }, // 0x6D 'm' + {1021, 9, 8, 16, 3, -10 }, // 0x6E 'n' + {1030, 9, 8, 16, 3, -10 }, // 0x6F 'o' + {1039, 10, 10, 16, 3, -10 }, // 0x70 'p' + {1052, 10, 10, 16, 2, -10 }, // 0x71 'q' + {1065, 10, 8, 16, 3, -10 }, // 0x72 'r' + {1075, 9, 8, 16, 3, -10 }, // 0x73 's' + {1084, 9, 11, 16, 3, -13 }, // 0x74 't' + {1097, 10, 8, 16, 3, -10 }, // 0x75 'u' + {1107, 9, 8, 16, 3, -10 }, // 0x76 'v' + {1116, 11, 8, 16, 3, -10 }, // 0x77 'w' + {1127, 8, 8, 16, 3, -10 }, // 0x78 'x' + {1135, 10, 10, 16, 3, -10 }, // 0x79 'y' + {1148, 8, 8, 16, 3, -10 }, // 0x7A 'z' + {1156, 10, 12, 16, 3, -14 }, // 0x7B '{' + {1171, 3, 14, 16, 7, -15 }, // 0x7C '|' + {1177, 10, 12, 16, 3, -14 }, // 0x7D '}' + {1192, 12, 4, 16, 2, -14 }, // 0x7E '~' +}; +const GFXfont FreeBigFont PROGMEM = { + (uint8_t *)FreeBigFontBitmaps, + (GFXglyph *)FreeBigFontGlyphs, + 32, 126, 16 +}; +// FreeBigFont bitmap size = 1198 [1863] [3139] +const uint8_t FreeSevenSegNumFontBitmaps[] PROGMEM = { +// 27x46 [0x30 '0'] +0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0xC3,0x3F,0xFF, +0xBC,0xF0,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80, +0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F,0xFF, +0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80,0x00,0xFF,0xF0,0x00,0x1F, +0xFC,0x00,0x00,0xFE,0x00,0x00,0x07,0x00,0x00,0x00,0x40,0x00,0x00,0x04,0x00,0x00, +0x00,0xE0,0x00,0x00,0x7F,0x00,0x00,0x3F,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0, +0x00,0x7F,0xF8,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF, +0x80,0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F, +0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0x78,0x00,0x03,0xC6,0x7F,0xFF,0x30,0x1F,0xFF, +0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00, +// 6x39 [0x31 '1'] +0x31,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3C,0x30,0x40,0x00, +0x33,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xE3,0x00, +// 27x46 [0x32 '2'] +0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0xC0,0x3F,0xFF, +0xBC,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,0x00, +0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,0xC0, +0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F, +0x80,0x00,0x00,0xF0,0x7F,0xFF,0x86,0x1F,0xFF,0xFC,0x4F,0xFF,0xFF,0xE4,0xFF,0xFF, +0xF8,0xE7,0xFF,0xFC,0x1F,0x00,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,0xC0, +0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F, +0x80,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00, +0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0x78,0x00,0x00,0x06,0x7F,0xFF,0x00,0x1F,0xFF, +0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00, +// 25x46 [0x33 '3'] +0x0F,0xFF,0xE0,0x0F,0xFF,0xF8,0x0F,0xFF,0xFE,0x03,0xFF,0xFE,0xC0,0xFF,0xFE,0xF0, +0x00,0x00,0xFC,0x00,0x00,0x7E,0x00,0x00,0x3F,0x00,0x00,0x1F,0x80,0x00,0x0F,0xC0, +0x00,0x07,0xE0,0x00,0x03,0xF0,0x00,0x01,0xF8,0x00,0x00,0xFC,0x00,0x00,0x7E,0x00, +0x00,0x3F,0x00,0x00,0x1F,0x80,0x00,0x0F,0xC0,0x00,0x07,0xE0,0x00,0x00,0xF1,0xFF, +0xFE,0x19,0xFF,0xFF,0xC7,0xFF,0xFF,0xF8,0xFF,0xFF,0xF8,0x1F,0xFF,0xF1,0x80,0x00, +0x03,0xC0,0x00,0x07,0xE0,0x00,0x03,0xF0,0x00,0x01,0xF8,0x00,0x00,0xFC,0x00,0x00, +0x7E,0x00,0x00,0x3F,0x00,0x00,0x1F,0x80,0x00,0x0F,0xC0,0x00,0x07,0xE0,0x00,0x03, +0xF0,0x00,0x01,0xF8,0x00,0x00,0xFC,0x00,0x00,0x7E,0x00,0x00,0x3F,0x00,0x00,0x0F, +0x07,0xFF,0xF3,0x07,0xFF,0xFC,0x07,0xFF,0xFF,0x01,0xFF,0xFF,0x00,0x7F,0xFF,0x00, +// 27x39 [0x34 '4'] +0x00,0x00,0x01,0x86,0x00,0x00,0x79,0xE0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00, +0x7F,0xF8,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80, +0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F,0xFF, +0x00,0x01,0xFF,0xE0,0x00,0x3F,0xF8,0x00,0x01,0xFC,0xFF,0xFF,0x0E,0x3F,0xFF,0xF8, +0x9F,0xFF,0xFF,0xC1,0xFF,0xFF,0xF0,0x0F,0xFF,0xF8,0xC0,0x00,0x00,0x78,0x00,0x00, +0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00, +0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0, +0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x07, +0x80,0x00,0x00,0x60, +// 27x46 [0x35 '5'] +0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0x03,0x3F,0xFF, +0x80,0xF0,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,0x80, +0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F, +0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00, +0x7C,0x00,0x00,0x0E,0x7F,0xFF,0x81,0x1F,0xFF,0xFC,0x0F,0xFF,0xFF,0xE0,0xFF,0xFF, +0xF8,0x07,0xFF,0xFC,0x60,0x00,0x00,0x3C,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00, +0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0, +0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F, +0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x03,0xC0,0x7F,0xFF,0x30,0x1F,0xFF, +0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00, +// 27x46 [0x36 '6'] +0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0x03,0x3F,0xFF, +0x80,0xF0,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,0x80, +0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F, +0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00, +0x7C,0x00,0x00,0x0E,0x7F,0xFF,0x81,0x1F,0xFF,0xFC,0x0F,0xFF,0xFF,0xE4,0xFF,0xFF, +0xF8,0xE7,0xFF,0xFC,0x7F,0x00,0x00,0x3F,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0, +0x00,0x7F,0xF8,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF, +0x80,0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F, +0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0x78,0x00,0x03,0xC6,0x7F,0xFF,0x30,0x1F,0xFF, +0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00, +// 23x42 [0x37 '7'] +0x3F,0xFF,0x80,0xFF,0xFF,0x83,0xFF,0xFF,0x83,0xFF,0xFE,0xC3,0xFF,0xFB,0xC0,0x00, +0x0F,0xC0,0x00,0x1F,0x80,0x00,0x3F,0x00,0x00,0x7E,0x00,0x00,0xFC,0x00,0x01,0xF8, +0x00,0x03,0xF0,0x00,0x07,0xE0,0x00,0x0F,0xC0,0x00,0x1F,0x80,0x00,0x3F,0x00,0x00, +0x7E,0x00,0x00,0xFC,0x00,0x01,0xF8,0x00,0x00,0xF0,0x00,0x00,0x60,0x00,0x00,0x40, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x3C,0x00,0x01,0xF8,0x00,0x03, +0xF0,0x00,0x07,0xE0,0x00,0x0F,0xC0,0x00,0x1F,0x80,0x00,0x3F,0x00,0x00,0x7E,0x00, +0x00,0xFC,0x00,0x01,0xF8,0x00,0x03,0xF0,0x00,0x07,0xE0,0x00,0x0F,0xC0,0x00,0x1F, +0x80,0x00,0x3F,0x00,0x00,0x3C,0x00,0x00,0x30, +// 27x46 [0x38 '8'] +0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0xC3,0x3F,0xFF, +0xBC,0xF0,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80, +0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F,0xFF, +0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80,0x00,0xFF,0xF0,0x00,0x1F, +0xFC,0x00,0x00,0xFE,0x7F,0xFF,0x87,0x1F,0xFF,0xFC,0x4F,0xFF,0xFF,0xE4,0xFF,0xFF, +0xF8,0xE7,0xFF,0xFC,0x7F,0x00,0x00,0x3F,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0, +0x00,0x7F,0xF8,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF, +0x80,0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F, +0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0x78,0x00,0x03,0xC6,0x7F,0xFF,0x30,0x1F,0xFF, +0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00, +// 27x46 [0x39 '9'] +0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0xC3,0x3F,0xFF, +0xBC,0xF0,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80, +0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F,0xFF, +0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80,0x00,0xFF,0xF0,0x00,0x1F, +0xFC,0x00,0x00,0xFE,0x7F,0xFF,0x87,0x1F,0xFF,0xFC,0x4F,0xFF,0xFF,0xE0,0xFF,0xFF, +0xF8,0x07,0xFF,0xFC,0x60,0x00,0x00,0x3C,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00, +0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0, +0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F, +0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x03,0xC0,0x7F,0xFF,0x30,0x1F,0xFF, +0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00, +}; +const GFXglyph FreeSevenSegNumFontGlyphs[] PROGMEM = { + { 0, 27, 46, 32, 2, -48 }, // 0x30 '0' + { 156, 6, 39, 32, 23, -45 }, // 0x31 '1' + { 186, 27, 46, 32, 2, -48 }, // 0x32 '2' + { 342, 25, 46, 32, 4, -48 }, // 0x33 '3' + { 486, 27, 39, 32, 2, -45 }, // 0x34 '4' + { 618, 27, 46, 32, 2, -48 }, // 0x35 '5' + { 774, 27, 46, 32, 2, -48 }, // 0x36 '6' + { 930, 23, 42, 32, 6, -48 }, // 0x37 '7' + {1051, 27, 46, 32, 2, -48 }, // 0x38 '8' + {1207, 27, 46, 32, 2, -48 }, // 0x39 '9' +}; +const GFXfont FreeSevenSegNumFont PROGMEM = { + (uint8_t *)FreeSevenSegNumFontBitmaps, + (GFXglyph *)FreeSevenSegNumFontGlyphs, + 48, 57, 50 +}; +// FreeSevenSegNumFont bitmap size = 1363 [1433] [2014] + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/FreeSevenSegNumFontPlusPlus.h b/Arduino/Libraries/MCUFRIEND_kbv/FreeSevenSegNumFontPlusPlus.h new file mode 100644 index 0000000..93afe8a --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/FreeSevenSegNumFontPlusPlus.h @@ -0,0 +1,131 @@ +// generate FreeFont from UTFT font +const uint8_t FreeSevenSegNumFontPlusPlusBitmaps[] PROGMEM = { + // 7x7 [0x2E '.'] + 0x38, 0xFB, 0xFF, 0xFF, 0xEF, 0x8E, 0x00, + // 0x0 [0x2F '/'] + + // 27x46 [0x30 '0'] + 0x03, 0xFF, 0xF8, 0x00, 0xFF, 0xFF, 0x80, 0x3F, 0xFF, 0xF8, 0x03, 0xFF, 0xFE, 0xC3, 0x3F, 0xFF, + 0xBC, 0xF0, 0x00, 0x0F, 0xFF, 0x00, 0x01, 0xFF, 0xE0, 0x00, 0x3F, 0xFC, 0x00, 0x07, 0xFF, 0x80, + 0x00, 0xFF, 0xF0, 0x00, 0x1F, 0xFE, 0x00, 0x03, 0xFF, 0xC0, 0x00, 0x7F, 0xF8, 0x00, 0x0F, 0xFF, + 0x00, 0x01, 0xFF, 0xE0, 0x00, 0x3F, 0xFC, 0x00, 0x07, 0xFF, 0x80, 0x00, 0xFF, 0xF0, 0x00, 0x1F, + 0xFC, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x04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x7F, 0xFF, 0x86, 0x1F, 0xFF, 0xFC, 0x4F, 0xFF, 0xFF, 0xE4, 0xFF, 0xFF, + 0xF8, 0xE7, 0xFF, 0xFC, 0x1F, 0x00, 0x00, 0x03, 0xF0, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x0F, 0xC0, + 0x00, 0x01, 0xF8, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x1F, + 0x80, 0x00, 0x03, 0xF0, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0x01, 0xF8, 0x00, 0x00, + 0x3F, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, 0x78, 0x00, 0x00, 0x06, 0x7F, 0xFF, 0x00, 0x1F, 0xFF, + 0xF0, 0x07, 0xFF, 0xFF, 0x00, 0x7F, 0xFF, 0xC0, 0x07, 0xFF, 0xF0, 0x00, + // 25x46 [0x33 '3'] + 0x0F, 0xFF, 0xE0, 0x0F, 0xFF, 0xF8, 0x0F, 0xFF, 0xFE, 0x03, 0xFF, 0xFE, 0xC0, 0xFF, 0xFE, 0xF0, + 0x00, 0x00, 0xFC, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x0F, 0xC0, + 0x00, 0x07, 0xE0, 0x00, 0x03, 0xF0, 0x00, 0x01, 0xF8, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x7E, 0x00, + 0x00, 0x3F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x0F, 0xC0, 0x00, 0x07, 0xE0, 0x00, 0x00, 0xF1, 0xFF, + 0xFE, 0x19, 0xFF, 0xFF, 0xC7, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xF8, 0x1F, 0xFF, 0xF1, 0x80, 0x00, + 0x03, 0xC0, 0x00, 0x07, 0xE0, 0x00, 0x03, 0xF0, 0x00, 0x01, 0xF8, 0x00, 0x00, 0xFC, 0x00, 0x00, + 0x7E, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x0F, 0xC0, 0x00, 0x07, 0xE0, 0x00, 0x03, + 0xF0, 0x00, 0x01, 0xF8, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x0F, + 0x07, 0xFF, 0xF3, 0x07, 0xFF, 0xFC, 0x07, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0x00, 0x7F, 0xFF, 0x00, + // 27x39 [0x34 '4'] + 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 0x79, 0xE0, 0x00, 0x1F, 0xFE, 0x00, 0x03, 0xFF, 0xC0, 0x00, + 0x7F, 0xF8, 0x00, 0x0F, 0xFF, 0x00, 0x01, 0xFF, 0xE0, 0x00, 0x3F, 0xFC, 0x00, 0x07, 0xFF, 0x80, + 0x00, 0xFF, 0xF0, 0x00, 0x1F, 0xFE, 0x00, 0x03, 0xFF, 0xC0, 0x00, 0x7F, 0xF8, 0x00, 0x0F, 0xFF, + 0x00, 0x01, 0xFF, 0xE0, 0x00, 0x3F, 0xF8, 0x00, 0x01, 0xFC, 0xFF, 0xFF, 0x0E, 0x3F, 0xFF, 0xF8, + 0x9F, 0xFF, 0xFF, 0xC1, 0xFF, 0xFF, 0xF0, 0x0F, 0xFF, 0xF8, 0xC0, 0x00, 0x00, 0x78, 0x00, 0x00, + 0x3F, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x03, 0xF0, 0x00, + 0x00, 0x7E, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0x01, 0xF8, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x07, 0xE0, + 0x00, 0x00, 0xFC, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x03, 0xF0, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x07, + 0x80, 0x00, 0x00, 0x60, + // 27x46 [0x35 '5'] + 0x03, 0xFF, 0xF8, 0x00, 0xFF, 0xFF, 0x80, 0x3F, 0xFF, 0xF8, 0x03, 0xFF, 0xFE, 0x03, 0x3F, 0xFF, + 0x80, 0xF0, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x1F, 0x80, + 0x00, 0x03, 0xF0, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0x01, 0xF8, 0x00, 0x00, 0x3F, + 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x03, 0xF0, 0x00, 0x00, + 0x7C, 0x00, 0x00, 0x0E, 0x7F, 0xFF, 0x81, 0x1F, 0xFF, 0xFC, 0x0F, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, + 0xF8, 0x07, 0xFF, 0xFC, 0x60, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x03, 0xF0, 0x00, + 0x00, 0x7E, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0x01, 0xF8, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x07, 0xE0, + 0x00, 0x00, 0xFC, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x03, 0xF0, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x0F, + 0xC0, 0x00, 0x01, 0xF8, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x03, 0xC0, 0x7F, 0xFF, 0x30, 0x1F, 0xFF, + 0xF0, 0x07, 0xFF, 0xFF, 0x00, 0x7F, 0xFF, 0xC0, 0x07, 0xFF, 0xF0, 0x00, + // 27x46 [0x36 '6'] + 0x03, 0xFF, 0xF8, 0x00, 0xFF, 0xFF, 0x80, 0x3F, 0xFF, 0xF8, 0x03, 0xFF, 0xFE, 0x03, 0x3F, 0xFF, + 0x80, 0xF0, 0x00, 0x00, 0x3F, 0x00, 0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x00, 0x00, + 0x7E, 0x00, 0x00, 0xFC, 0x00, 0x01, 0xF8, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x60, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x3C, 0x00, 0x01, 0xF8, 0x00, 0x03, + 0xF0, 0x00, 0x07, 0xE0, 0x00, 0x0F, 0xC0, 0x00, 0x1F, 0x80, 0x00, 0x3F, 0x00, 0x00, 0x7E, 0x00, + 0x00, 0xFC, 0x00, 0x01, 0xF8, 0x00, 0x03, 0xF0, 0x00, 0x07, 0xE0, 0x00, 0x0F, 0xC0, 0x00, 0x1F, + 0x80, 0x00, 0x3F, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x30, + // 27x46 [0x38 '8'] + 0x03, 0xFF, 0xF8, 0x00, 0xFF, 0xFF, 0x80, 0x3F, 0xFF, 0xF8, 0x03, 0xFF, 0xFE, 0xC3, 0x3F, 0xFF, + 0xBC, 0xF0, 0x00, 0x0F, 0xFF, 0x00, 0x01, 0xFF, 0xE0, 0x00, 0x3F, 0xFC, 0x00, 0x07, 0xFF, 0x80, + 0x00, 0xFF, 0xF0, 0x00, 0x1F, 0xFE, 0x00, 0x03, 0xFF, 0xC0, 0x00, 0x7F, 0xF8, 0x00, 0x0F, 0xFF, + 0x00, 0x01, 0xFF, 0xE0, 0x00, 0x3F, 0xFC, 0x00, 0x07, 0xFF, 0x80, 0x00, 0xFF, 0xF0, 0x00, 0x1F, + 0xFC, 0x00, 0x00, 0xFE, 0x7F, 0xFF, 0x87, 0x1F, 0xFF, 0xFC, 0x4F, 0xFF, 0xFF, 0xE4, 0xFF, 0xFF, + 0xF8, 0xE7, 0xFF, 0xFC, 0x7F, 0x00, 0x00, 0x3F, 0xF0, 0x00, 0x1F, 0xFE, 0x00, 0x03, 0xFF, 0xC0, + 0x00, 0x7F, 0xF8, 0x00, 0x0F, 0xFF, 0x00, 0x01, 0xFF, 0xE0, 0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, 0x01, 0xF8, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x03, 0xC0, 0x7F, 0xFF, 0x30, 0x1F, 0xFF, + 0xF0, 0x07, 0xFF, 0xFF, 0x00, 0x7F, 0xFF, 0xC0, 0x07, 0xFF, 0xF0, 0x00, + // 7x28 [0x3A ':'] + 0x38, 0xFB, 0xFF, 0xFF, 0xEF, 0x8E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x1F, 0x7F, 0xFF, 0xFD, 0xF1, 0xC0, +}; +// strip blank pixels: top = 0, bot = 2, left = 2, rt = 0, adv = 32, desc = 0 +const GFXglyph FreeSevenSegNumFontPlusPlusGlyphs[] PROGMEM = { + { 0, 7, 7, 32, 14, -12 }, // 0x2E '.' + { 7, 0, 0, 32, 32, -50 }, // 0x2F '/' + { 7, 27, 46, 32, 2, -48 }, // 0x30 '0' + { 163, 6, 39, 32, 23, -45 }, // 0x31 '1' + { 193, 27, 46, 32, 2, -48 }, // 0x32 '2' + { 349, 25, 46, 32, 4, -48 }, // 0x33 '3' + { 493, 27, 39, 32, 2, -45 }, // 0x34 '4' + { 625, 27, 46, 32, 2, -48 }, // 0x35 '5' + { 781, 27, 46, 32, 2, -48 }, // 0x36 '6' + { 937, 23, 42, 32, 6, -48 }, // 0x37 '7' + {1058, 27, 46, 32, 2, -48 }, // 0x38 '8' + {1214, 27, 46, 32, 2, -48 }, // 0x39 '9' + {1370, 7, 28, 32, 14, -38 }, // 0x3A ':' +}; +const GFXfont FreeSevenSegNumFontPlusPlus PROGMEM = { + (uint8_t *)FreeSevenSegNumFontPlusPlusBitmaps, + (GFXglyph *)FreeSevenSegNumFontPlusPlusGlyphs, + 46, 59, 50 +}; +// FreeSevenSegNumFontPlusPlus bitmap size = 1395 [1525] [2617] + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/MCUFRIEND_kbv.cpp b/Arduino/Libraries/MCUFRIEND_kbv/MCUFRIEND_kbv.cpp new file mode 100644 index 0000000..66ad08e --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/MCUFRIEND_kbv.cpp @@ -0,0 +1,2937 @@ +//#define SUPPORT_0139 //S6D0139 +280 bytes +#define SUPPORT_0154 //S6D0154 +320 bytes +//#define SUPPORT_1289 //SSD1289,SSD1297 (ID=0x9797) +626 bytes, 0.03s +//#define SUPPORT_1580 //R61580 Untested +#define SUPPORT_1963 //only works with 16BIT bus anyway +//#define SUPPORT_4532 //LGDP4532 +120 bytes. thanks Leodino +#define SUPPORT_4535 //LGDP4535 +180 bytes +#define SUPPORT_68140 //RM68140 +52 bytes defaults to PIXFMT=0x55 +//#define SUPPORT_7735 +#define SUPPORT_7781 //ST7781 +172 bytes +//#define SUPPORT_8230 //UC8230 +118 bytes +//#define SUPPORT_8347D //HX8347-D, HX8347-G, HX8347-I, HX8367-A +520 bytes, 0.27s +//#define SUPPORT_8347A //HX8347-A +500 bytes, 0.27s +//#define SUPPORT_8352A //HX8352A +486 bytes, 0.27s +//#define SUPPORT_8352B //HX8352B +//#define SUPPORT_8357D_GAMMA //monster 34 byte +//#define SUPPORT_9163 // +//#define SUPPORT_9225 //ILI9225-B, ILI9225-G ID=0x9225, ID=0x9226, ID=0x6813 +380 bytes +//#define SUPPORT_9326_5420 //ILI9326, SPFD5420 +246 bytes +//#define SUPPORT_9342 //costs +114 bytes +//#define SUPPORT_9806 //UNTESTED +#define SUPPORT_9488_555 //costs +230 bytes, 0.03s / 0.19s +#define SUPPORT_B509_7793 //R61509, ST7793 +244 bytes +#define OFFSET_9327 32 //costs about 103 bytes, 0.08s + +#include "MCUFRIEND_kbv.h" +#if defined(USE_SERIAL) +#include "utility/mcufriend_serial.h" + //uint8_t running; +#elif defined(__MBED__) +#include "utility/mcufriend_mbed.h" +#elif defined(__CC_ARM) || defined(__CROSSWORKS_ARM) +#include "utility/mcufriend_keil.h" +#else +#include "utility/mcufriend_shield.h" +#endif + +#define MIPI_DCS_REV1 (1<<0) +#define AUTO_READINC (1<<1) +#define READ_BGR (1<<2) +#define READ_LOWHIGH (1<<3) +#define READ_24BITS (1<<4) +#define XSA_XEA_16BIT (1<<5) +#define READ_NODUMMY (1<<6) +#define INVERT_GS (1<<8) +#define INVERT_SS (1<<9) +#define MV_AXIS (1<<10) +#define INVERT_RGB (1<<11) +#define REV_SCREEN (1<<12) +#define FLIP_VERT (1<<13) +#define FLIP_HORIZ (1<<14) + +#if (defined(USES_16BIT_BUS)) //only comes from SPECIALs +#define USING_16BIT_BUS 1 +#else +#define USING_16BIT_BUS 0 +#endif + +MCUFRIEND_kbv::MCUFRIEND_kbv(int CS, int RS, int WR, int RD, int _RST):Adafruit_GFX(240, 320) +{ + // we can not access GPIO pins until AHB has been enabled. +} + +static uint8_t done_reset, is8347, is555, is9797; +static uint16_t color565_to_555(uint16_t color) { + return (color & 0xFFC0) | ((color & 0x1F) << 1) | ((color & 0x01)); //lose Green LSB, extend Blue LSB +} +static uint16_t color555_to_565(uint16_t color) { + return (color & 0xFFC0) | ((color & 0x0400) >> 5) | ((color & 0x3F) >> 1); //extend Green LSB +} +static uint8_t color565_to_r(uint16_t color) { + return ((color & 0xF800) >> 8); // transform to rrrrrxxx +} +static uint8_t color565_to_g(uint16_t color) { + return ((color & 0x07E0) >> 3); // transform to ggggggxx +} +static uint8_t color565_to_b(uint16_t color) { + return ((color & 0x001F) << 3); // transform to bbbbbxxx +} +static void write24(uint16_t color) { + uint8_t r = color565_to_r(color); + uint8_t g = color565_to_g(color); + uint8_t b = color565_to_b(color); + write8(r); + write8(g); + write8(b); +} + +void MCUFRIEND_kbv::reset(void) +{ + done_reset = 1; + setWriteDir(); + CTL_INIT(); + CS_IDLE; + RD_IDLE; + WR_IDLE; + RESET_IDLE; + delay(50); + RESET_ACTIVE; + delay(100); + RESET_IDLE; + delay(100); + WriteCmdData(0xB0, 0x0000); //R61520 needs this to read ID +} + +static void writecmddata(uint16_t cmd, uint16_t dat) +{ + CS_ACTIVE; + WriteCmd(cmd); + WriteData(dat); + CS_IDLE; +} + +void MCUFRIEND_kbv::WriteCmdData(uint16_t cmd, uint16_t dat) { writecmddata(cmd, dat); } + +static void WriteCmdParamN(uint16_t cmd, int8_t N, uint8_t * block) +{ + CS_ACTIVE; + WriteCmd(cmd); + while (N-- > 0) { + uint8_t u8 = *block++; + write8(u8); + if (N && is8347) { + cmd++; + WriteCmd(cmd); + } + } + CS_IDLE; +} + +static inline void WriteCmdParam4(uint8_t cmd, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4) +{ + uint8_t d[4]; + d[0] = d1, d[1] = d2, d[2] = d3, d[3] = d4; + WriteCmdParamN(cmd, 4, d); +} + +//#define WriteCmdParam4(cmd, d1, d2, d3, d4) {uint8_t d[4];d[0] = d1, d[1] = d2, d[2] = d3, d[3] = d4;WriteCmdParamN(cmd, 4, d);} +void MCUFRIEND_kbv::pushCommand(uint16_t cmd, uint8_t * block, int8_t N) { WriteCmdParamN(cmd, N, block); } + +static uint16_t read16bits(void) +{ + uint16_t ret; + uint8_t lo; +#if USING_16BIT_BUS + READ_16(ret); //single strobe to read whole bus + if (ret > 255) //ID might say 0x00D3 + return ret; +#else + delay(1); //1us should be adequate + READ_8(ret); +#endif + //all MIPI_DCS_REV1 style params are 8-bit + delay(1); //1us should be adequate + READ_8(lo); + return (ret << 8) | lo; +} + +uint16_t MCUFRIEND_kbv::readReg(uint16_t reg, int8_t index) +{ + uint16_t ret; + uint8_t lo; + if (!done_reset) + reset(); + CS_ACTIVE; + WriteCmd(reg); + setReadDir(); + delay(1); //1us should be adequate + // READ_16(ret); + do { ret = read16bits(); }while (--index >= 0); //need to test with SSD1963 + RD_IDLE; + CS_IDLE; + setWriteDir(); + return ret; +} + +uint32_t MCUFRIEND_kbv::readReg32(uint16_t reg) +{ + uint16_t h = readReg(reg, 0); + uint16_t l = readReg(reg, 1); + return ((uint32_t) h << 16) | (l); +} + +uint32_t MCUFRIEND_kbv::readReg40(uint16_t reg) +{ + uint16_t h = readReg(reg, 0); + uint16_t m = readReg(reg, 1); + uint16_t l = readReg(reg, 2); + return ((uint32_t) h << 24) | (m << 8) | (l >> 8); +} + +uint16_t MCUFRIEND_kbv::readID(void) +{ + uint16_t ret, ret2; + uint8_t msb; + ret = readReg(0); //forces a reset() if called before begin() + if (ret == 0x5408) //the SPFD5408 fails the 0xD3D3 test. + return 0x5408; + if (ret == 0x5420) //the SPFD5420 fails the 0xD3D3 test. + return 0x5420; + if (ret == 0x8989) //SSD1289 is always 8989 + return 0x1289; + ret = readReg(0x67); //HX8347-A + if (ret == 0x4747) + return 0x8347; + ret = readReg40(0xEF); //ILI9327: [xx 02 04 93 27 FF] + if (ret == 0x9327) + return 0x9327; +//#if defined(SUPPORT_1963) && USING_16BIT_BUS + ret = readReg32(0xA1); //SSD1963: [01 57 61 01] + if (ret == 0x6101) + return 0x1963; + if (ret == 0xFFFF) //R61526: [xx FF FF FF] + return 0x1526; //subsequent begin() enables Command Access + if (ret == 0xFF00) //R61520: [xx FF FF 00] + return 0x1520; //subsequent begin() enables Command Access +//#endif + ret = readReg40(0xBF); + if (ret == 0x8357) //HX8357B: [xx 01 62 83 57 FF] + return 0x8357; + if (ret == 0x9481) //ILI9481: [xx 02 04 94 81 FF] + return 0x9481; + if (ret == 0x1511) //?R61511: [xx 02 04 15 11] not tested yet + return 0x1511; + if (ret == 0x1520) //?R61520: [xx 01 22 15 20] + return 0x1520; + if (ret == 0x1526) //?R61526: [xx 01 22 15 26] + return 0x1526; + if (ret == 0x1581) //R61581: [xx 01 22 15 81] + return 0x1581; + if (ret == 0x1400) //?RM68140:[xx FF 68 14 00] not tested yet + return 0x6814; + ret = readReg32(0xD4); + if (ret == 0x5310) //NT35310: [xx 01 53 10] + return 0x5310; + ret = readReg32(0xD7); + if (ret == 0x8031) //weird unknown from BangGood [xx 20 80 31] PrinceCharles + return 0x8031; + ret = readReg32(0xFE) >> 8; //weird unknown from BangGood [04 20 53] + if (ret == 0x2053) + return 0x2053; + uint32_t ret32 = readReg32(0x04); + msb = ret32 >> 16; + ret = ret32; +// if (msb = 0x38 && ret == 0x8000) //unknown [xx 38 80 00] with D3 = 0x1602 + if (msb == 0x00 && ret == 0x8000) { //HX8357-D [xx 00 80 00] +#if 1 + uint8_t cmds[] = {0xFF, 0x83, 0x57}; + pushCommand(0xB9, cmds, 3); + msb = readReg(0xD0); + if (msb == 0x99) return 0x0099; //HX8357-D from datasheet + if (msb == 0x90) //HX8357-C undocumented +#endif + return 0x9090; //BIG CHANGE: HX8357-D was 0x8357 + } +// if (msb == 0xFF && ret == 0xFFFF) //R61526 [xx FF FF FF] +// return 0x1526; //subsequent begin() enables Command Access + if (ret == 0x1526) //R61526 [xx 06 15 26] if I have written NVM + return 0x1526; //subsequent begin() enables Command Access + if (ret == 0x89F0) //ST7735S: [xx 7C 89 F0] + return 0x7735; + if (ret == 0x8552) //ST7789V: [xx 85 85 52] + return 0x7789; + if (ret == 0xAC11) //?unknown [xx 61 AC 11] + return 0xAC11; + ret32 = readReg32(0xD3); //[xx 91 63 00] + ret = ret32 >> 8; + if (ret == 0x9163) return ret; + ret = readReg32(0xD3); //for ILI9488, 9486, 9340, 9341 + msb = ret >> 8; + if (msb == 0x93 || msb == 0x94 || msb == 0x98 || msb == 0x77 || msb == 0x16) + return ret; //0x9488, 9486, 9340, 9341, 7796 + if (ret == 0x00D3 || ret == 0xD3D3) + return ret; //16-bit write-only bus +/* + msb = 0x12; //read 3rd,4th byte. does not work in parallel + pushCommand(0xD9, &msb, 1); + ret2 = readReg(0xD3); + msb = 0x13; + pushCommand(0xD9, &msb, 1); + ret = (ret2 << 8) | readReg(0xD3); +// if (ret2 == 0x93) + return ret2; +*/ + return readReg(0); //0154, 7783, 9320, 9325, 9335, B505, B509 +} + + // independent cursor and window registers. S6D0154, ST7781 increments. ILI92320/5 do not. +int16_t MCUFRIEND_kbv::readGRAM(int16_t x, int16_t y, uint16_t * block, int16_t w, int16_t h) +{ + uint16_t ret, dummy, _MR = _MW; + int16_t n = w * h, row = 0, col = 0; + uint8_t r, g, b, tmp; + if (!is8347 && _lcd_capable & MIPI_DCS_REV1) // HX8347 uses same register + _MR = 0x2E; + if (_lcd_ID == 0x1602) _MR = 0x2E; + setAddrWindow(x, y, x + w - 1, y + h - 1); + while (n > 0) { + if (!(_lcd_capable & MIPI_DCS_REV1)) { + WriteCmdData(_MC, x + col); + WriteCmdData(_MP, y + row); + } + CS_ACTIVE; + WriteCmd(_MR); + setReadDir(); + if (_lcd_capable & READ_NODUMMY) { + ; + } else if ((_lcd_capable & MIPI_DCS_REV1) || _lcd_ID == 0x1289) { + READ_8(r); + } else { + READ_16(dummy); + } + if (_lcd_ID == 0x1511) READ_8(r); //extra dummy for R61511 + while (n) { + if (_lcd_capable & READ_24BITS) { + READ_8(r); + READ_8(g); + READ_8(b); + if (_lcd_capable & READ_BGR) + ret = color565(b, g, r); + else + ret = color565(r, g, b); + } else { + READ_16(ret); + if (_lcd_capable & READ_LOWHIGH) + ret = (ret >> 8) | (ret << 8); + if (_lcd_capable & READ_BGR) + ret = (ret & 0x07E0) | (ret >> 11) | (ret << 11); + } +#if defined(SUPPORT_9488_555) + if (is555) ret = color555_to_565(ret); +#endif + *block++ = ret; + n--; + if (!(_lcd_capable & AUTO_READINC)) + break; + } + if (++col >= w) { + col = 0; + if (++row >= h) + row = 0; + } + RD_IDLE; + CS_IDLE; + setWriteDir(); + } + if (!(_lcd_capable & MIPI_DCS_REV1)) + setAddrWindow(0, 0, width() - 1, height() - 1); + return 0; +} + +void MCUFRIEND_kbv::setRotation(uint8_t r) +{ + uint16_t GS, SS_v, ORG, REV = _lcd_rev; + uint8_t val, d[3]; + rotation = r & 3; // just perform the operation ourselves on the protected variables + _width = (rotation & 1) ? HEIGHT : WIDTH; + _height = (rotation & 1) ? WIDTH : HEIGHT; + switch (rotation) { + case 0: //PORTRAIT: + val = 0x48; //MY=0, MX=1, MV=0, ML=0, BGR=1 + break; + case 1: //LANDSCAPE: 90 degrees + val = 0x28; //MY=0, MX=0, MV=1, ML=0, BGR=1 + break; + case 2: //PORTRAIT_REV: 180 degrees + val = 0x98; //MY=1, MX=0, MV=0, ML=1, BGR=1 + break; + case 3: //LANDSCAPE_REV: 270 degrees + val = 0xF8; //MY=1, MX=1, MV=1, ML=1, BGR=1 + break; + } + if (_lcd_capable & INVERT_GS) + val ^= 0x80; + if (_lcd_capable & INVERT_SS) + val ^= 0x40; + if (_lcd_capable & INVERT_RGB) + val ^= 0x08; + if (_lcd_capable & MIPI_DCS_REV1) { + if (_lcd_ID == 0x6814) { //.kbv my weird 0x9486 might be 68140 + GS = (val & 0x80) ? (1 << 6) : 0; //MY + SS_v = (val & 0x40) ? (1 << 5) : 0; //MX + val &= 0x28; //keep MV, BGR, MY=0, MX=0, ML=0 + d[0] = 0; + d[1] = GS | SS_v | 0x02; //MY, MX + d[2] = 0x3B; + WriteCmdParamN(0xB6, 3, d); + goto common_MC; + } else if (_lcd_ID == 0x1963 || _lcd_ID == 0x9481 || _lcd_ID == 0x1511) { + if (val & 0x80) + val |= 0x01; //GS + if ((val & 0x40)) + val |= 0x02; //SS + if (_lcd_ID == 0x1963) val &= ~0xC0; + if (_lcd_ID == 0x9481) val &= ~0xD0; + if (_lcd_ID == 0x1511) { + val &= ~0x10; //remove ML + val |= 0xC0; //force penguin 180 rotation + } +// val &= (_lcd_ID == 0x1963) ? ~0xC0 : ~0xD0; //MY=0, MX=0 with ML=0 for ILI9481 + goto common_MC; + } else if (is8347) { + _MC = 0x02, _MP = 0x06, _MW = 0x22, _SC = 0x02, _EC = 0x04, _SP = 0x06, _EP = 0x08; + if (_lcd_ID == 0x0065) { //HX8352-B + val |= 0x01; //GS=1 + if ((val & 0x10)) val ^= 0xD3; //(ML) flip MY, MX, ML, SS, GS + if (r & 1) _MC = 0x82, _MP = 0x80; + else _MC = 0x80, _MP = 0x82; + } + if (_lcd_ID == 0x5252) { //HX8352-A + val |= 0x02; //VERT_SCROLLON + if ((val & 0x10)) val ^= 0xD4; //(ML) flip MY, MX, SS. GS=1 + } + goto common_BGR; + } + common_MC: + _MC = 0x2A, _MP = 0x2B, _MW = 0x2C, _SC = 0x2A, _EC = 0x2A, _SP = 0x2B, _EP = 0x2B; + common_BGR: + WriteCmdParamN(is8347 ? 0x16 : 0x36, 1, &val); + _lcd_madctl = val; +// if (_lcd_ID == 0x1963) WriteCmdParamN(0x13, 0, NULL); //NORMAL mode + } + // cope with 9320 variants + else { + switch (_lcd_ID) { +#if defined(SUPPORT_9225) + case 0x9225: + _SC = 0x37, _EC = 0x36, _SP = 0x39, _EP = 0x38; + _MC = 0x20, _MP = 0x21, _MW = 0x22; + GS = (val & 0x80) ? (1 << 9) : 0; + SS_v = (val & 0x40) ? (1 << 8) : 0; + WriteCmdData(0x01, GS | SS_v | 0x001C); // set Driver Output Control + goto common_ORG; +#endif +#if defined(SUPPORT_0139) || defined(SUPPORT_0154) +#ifdef SUPPORT_0139 + case 0x0139: + _SC = 0x46, _EC = 0x46, _SP = 0x48, _EP = 0x47; + goto common_S6D; +#endif +#ifdef SUPPORT_0154 + case 0x0154: + _SC = 0x37, _EC = 0x36, _SP = 0x39, _EP = 0x38; + goto common_S6D; +#endif + common_S6D: + _MC = 0x20, _MP = 0x21, _MW = 0x22; + GS = (val & 0x80) ? (1 << 9) : 0; + SS_v = (val & 0x40) ? (1 << 8) : 0; + // S6D0139 requires NL = 0x27, S6D0154 NL = 0x28 + WriteCmdData(0x01, GS | SS_v | ((_lcd_ID == 0x0139) ? 0x27 : 0x28)); + goto common_ORG; +#endif + case 0x5420: + case 0x7793: + case 0x9326: + case 0xB509: + _MC = 0x200, _MP = 0x201, _MW = 0x202, _SC = 0x210, _EC = 0x211, _SP = 0x212, _EP = 0x213; + GS = (val & 0x80) ? (1 << 15) : 0; + uint16_t NL; + NL = ((432 / 8) - 1) << 9; + if (_lcd_ID == 0x9326 || _lcd_ID == 0x5420) NL >>= 1; + WriteCmdData(0x400, GS | NL); + goto common_SS; + default: + _MC = 0x20, _MP = 0x21, _MW = 0x22, _SC = 0x50, _EC = 0x51, _SP = 0x52, _EP = 0x53; + GS = (val & 0x80) ? (1 << 15) : 0; + WriteCmdData(0x60, GS | 0x2700); // Gate Scan Line (0xA700) + common_SS: + SS_v = (val & 0x40) ? (1 << 8) : 0; + WriteCmdData(0x01, SS_v); // set Driver Output Control + common_ORG: + ORG = (val & 0x20) ? (1 << 3) : 0; +#ifdef SUPPORT_8230 + if (_lcd_ID == 0x8230) { // UC8230 has strange BGR and READ_BGR behaviour + if (rotation == 1 || rotation == 2) { + val ^= 0x08; // change BGR bit for LANDSCAPE and PORTRAIT_REV + } + } +#endif + if (val & 0x08) + ORG |= 0x1000; //BGR + _lcd_madctl = ORG | 0x0030; + WriteCmdData(0x03, _lcd_madctl); // set GRAM write direction and BGR=1. + break; +#ifdef SUPPORT_1289 + case 0x1289: + _MC = 0x4E, _MP = 0x4F, _MW = 0x22, _SC = 0x44, _EC = 0x44, _SP = 0x45, _EP = 0x46; + if (rotation & 1) + val ^= 0xD0; // exchange Landscape modes + GS = (val & 0x80) ? (1 << 14) : 0; //called TB (top-bottom), CAD=0 + SS_v = (val & 0x40) ? (1 << 9) : 0; //called RL (right-left) + ORG = (val & 0x20) ? (1 << 3) : 0; //called AM + _lcd_drivOut = GS | SS_v | (REV << 13) | 0x013F; //REV=0, BGR=0, MUX=319 + if (val & 0x08) + _lcd_drivOut |= 0x0800; //BGR + WriteCmdData(0x01, _lcd_drivOut); // set Driver Output Control + if (is9797) WriteCmdData(0x11, ORG | 0x4C30); else // DFM=2, DEN=1, WM=1, TY=0 + WriteCmdData(0x11, ORG | 0x6070); // DFM=3, EN=0, TY=1 + break; +#endif + } + } + if ((rotation & 1) && ((_lcd_capable & MV_AXIS) == 0)) { + uint16_t x; + x = _MC, _MC = _MP, _MP = x; + x = _SC, _SC = _SP, _SP = x; //.kbv check 0139 + x = _EC, _EC = _EP, _EP = x; //.kbv check 0139 + } + setAddrWindow(0, 0, width() - 1, height() - 1); + vertScroll(0, HEIGHT, 0); //reset scrolling after a rotation +} + +void MCUFRIEND_kbv::drawPixel(int16_t x, int16_t y, uint16_t color) +{ + // MCUFRIEND just plots at edge if you try to write outside of the box: + if (x < 0 || y < 0 || x >= width() || y >= height()) + return; +#if defined(SUPPORT_9488_555) + if (is555) color = color565_to_555(color); +#endif + setAddrWindow(x, y, x, y); +// CS_ACTIVE; WriteCmd(_MW); write16(color); CS_IDLE; //-0.01s +98B + if (is9797) { CS_ACTIVE; WriteCmd(_MW); write24(color); CS_IDLE;} else + WriteCmdData(_MW, color); +} + +void MCUFRIEND_kbv::setAddrWindow(int16_t x, int16_t y, int16_t x1, int16_t y1) +{ +#if defined(OFFSET_9327) + if (_lcd_ID == 0x9327) { + if (rotation == 2) y += OFFSET_9327, y1 += OFFSET_9327; + if (rotation == 3) x += OFFSET_9327, x1 += OFFSET_9327; + } +#endif +#if 1 + if (_lcd_ID == 0x1526 && (rotation & 1)) { + int16_t dx = x1 - x, dy = y1 - y; + if (dy == 0) { y1++; } + else if (dx == 0) { x1 += dy; y1 -= dy; } + } +#endif + if (_lcd_capable & MIPI_DCS_REV1) { + WriteCmdParam4(_SC, x >> 8, x, x1 >> 8, x1); //Start column instead of _MC + WriteCmdParam4(_SP, y >> 8, y, y1 >> 8, y1); // + if (is8347 && _lcd_ID == 0x0065) { //HX8352-B has separate _MC, _SC + uint8_t d[2]; + d[0] = x >> 8; d[1] = x; + WriteCmdParamN(_MC, 2, d); //allows !MV_AXIS to work + d[0] = y >> 8; d[1] = y; + WriteCmdParamN(_MP, 2, d); + } + } else { + WriteCmdData(_MC, x); + WriteCmdData(_MP, y); + if (!(x == x1 && y == y1)) { //only need MC,MP for drawPixel + if (_lcd_capable & XSA_XEA_16BIT) { + if (rotation & 1) + y1 = y = (y1 << 8) | y; + else + x1 = x = (x1 << 8) | x; + } + WriteCmdData(_SC, x); + WriteCmdData(_SP, y); + WriteCmdData(_EC, x1); + WriteCmdData(_EP, y1); + } + } +} + +void MCUFRIEND_kbv::fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) +{ + int16_t end; +#if defined(SUPPORT_9488_555) + if (is555) color = color565_to_555(color); +#endif + if (w < 0) { + w = -w; + x -= w; + } //+ve w + end = x + w; + if (x < 0) + x = 0; + if (end > width()) + end = width(); + w = end - x; + if (h < 0) { + h = -h; + y -= h; + } //+ve h + end = y + h; + if (y < 0) + y = 0; + if (end > height()) + end = height(); + h = end - y; + setAddrWindow(x, y, x + w - 1, y + h - 1); + CS_ACTIVE; + WriteCmd(_MW); + if (h > w) { + end = h; + h = w; + w = end; + } + uint8_t hi = color >> 8, lo = color & 0xFF; + while (h-- > 0) { + end = w; +#if USING_16BIT_BUS +#if defined(__MK66FX1M0__) //180MHz M4 +#define STROBE_16BIT {WR_ACTIVE4;WR_ACTIVE;WR_IDLE4;WR_IDLE;} //56ns +#elif defined(__SAM3X8E__) //84MHz M3 +#define STROBE_16BIT {WR_ACTIVE4;WR_ACTIVE2;WR_IDLE4;WR_IDLE2;} //286ns ?ILI9486 +//#define STROBE_16BIT {WR_ACTIVE4;WR_ACTIVE;WR_IDLE4;WR_IDLE;} //238ns SSD1289 +//#define STROBE_16BIT {WR_ACTIVE2;WR_ACTIVE;WR_IDLE2;} //119ns RM68140 +#else //16MHz AVR +#define STROBE_16BIT {WR_ACTIVE;WR_ACTIVE;WR_IDLE; } //375ns ?ILI9486 +#endif + write_16(color); //we could just do the strobe + lo = end & 7; + hi = end >> 3; + if (hi) + do { + STROBE_16BIT; + STROBE_16BIT; + STROBE_16BIT; + STROBE_16BIT; + STROBE_16BIT; + STROBE_16BIT; + STROBE_16BIT; + STROBE_16BIT; + } while (--hi > 0); + while (lo-- > 0) { + STROBE_16BIT; + } +#else +#if defined(SUPPORT_1289) + if (is9797) { + uint8_t r = color565_to_r(color); + uint8_t g = color565_to_g(color); + uint8_t b = color565_to_b(color); + do { + write8(r); + write8(g); + write8(b); + } while (--end != 0); + } else +#endif + do { + write8(hi); + write8(lo); + } while (--end != 0); +#endif + } + CS_IDLE; + if (!(_lcd_capable & MIPI_DCS_REV1) || ((_lcd_ID == 0x1526) && (rotation & 1))) + setAddrWindow(0, 0, width() - 1, height() - 1); +} + +static void pushColors_any(uint16_t cmd, uint8_t * block, int16_t n, bool first, uint8_t flags) +{ + uint16_t color; + uint8_t h, l; + bool isconst = flags & 1; + bool isbigend = (flags & 2) != 0; + CS_ACTIVE; + if (first) { + WriteCmd(cmd); + } + + if (!isconst && !isbigend) { + uint16_t *block16 = (uint16_t*)block; + while (n-- > 0) { + color = *block16++; + write16(color); + } + } else + + while (n-- > 0) { + if (isconst) { + h = pgm_read_byte(block++); + l = pgm_read_byte(block++); + } else { + h = (*block++); + l = (*block++); + } + color = (isbigend) ? (h << 8 | l) : (l << 8 | h); +#if defined(SUPPORT_9488_555) + if (is555) color = color565_to_555(color); +#endif + if (is9797) write24(color); else + write16(color); + } + CS_IDLE; +} + +void MCUFRIEND_kbv::pushColors(uint16_t * block, int16_t n, bool first) +{ + pushColors_any(_MW, (uint8_t *)block, n, first, 0); +} +void MCUFRIEND_kbv::pushColors(uint8_t * block, int16_t n, bool first) +{ + pushColors_any(_MW, (uint8_t *)block, n, first, 2); //regular bigend +} +void MCUFRIEND_kbv::pushColors(const uint8_t * block, int16_t n, bool first, bool bigend) +{ + pushColors_any(_MW, (uint8_t *)block, n, first, bigend ? 3 : 1); +} + +void MCUFRIEND_kbv::vertScroll(int16_t top, int16_t scrollines, int16_t offset) +{ +#if defined(OFFSET_9327) + if (_lcd_ID == 0x9327) { + if (rotation == 2 || rotation == 3) top += OFFSET_9327; + } +#endif + int16_t bfa = HEIGHT - top - scrollines; // bottom fixed area + int16_t vsp; + int16_t sea = top; + if (_lcd_ID == 0x9327) bfa += 32; + if (offset <= -scrollines || offset >= scrollines) offset = 0; //valid scroll + vsp = top + offset; // vertical start position + if (offset < 0) + vsp += scrollines; //keep in unsigned range + sea = top + scrollines - 1; + if (_lcd_capable & MIPI_DCS_REV1) { + uint8_t d[6]; // for multi-byte parameters +/* + if (_lcd_ID == 0x9327) { //panel is wired for 240x432 + if (rotation == 2 || rotation == 3) { //180 or 270 degrees + if (scrollines == HEIGHT) { + scrollines = 432; // we get a glitch but hey-ho + vsp -= 432 - HEIGHT; + } + if (vsp < 0) + vsp += 432; + } + bfa = 432 - top - scrollines; + } +*/ + d[0] = top >> 8; //TFA + d[1] = top; + d[2] = scrollines >> 8; //VSA + d[3] = scrollines; + d[4] = bfa >> 8; //BFA + d[5] = bfa; + WriteCmdParamN(is8347 ? 0x0E : 0x33, 6, d); +// if (offset == 0 && rotation > 1) vsp = top + scrollines; //make non-valid + d[0] = vsp >> 8; //VSP + d[1] = vsp; + WriteCmdParamN(is8347 ? 0x14 : 0x37, 2, d); + if (is8347) { + d[0] = (offset != 0) ? (_lcd_ID == 0x8347 ? 0x02 : 0x08) : 0; + WriteCmdParamN(_lcd_ID == 0x8347 ? 0x18 : 0x01, 1, d); //HX8347-D + } else if (offset == 0 && (_lcd_capable & MIPI_DCS_REV1)) { + WriteCmdParamN(0x13, 0, NULL); //NORMAL i.e. disable scroll + } + return; + } + // cope with 9320 style variants: + switch (_lcd_ID) { + case 0x7783: + WriteCmdData(0x61, _lcd_rev); //!NDL, !VLE, REV + WriteCmdData(0x6A, vsp); //VL# + break; +#ifdef SUPPORT_0139 + case 0x0139: + WriteCmdData(0x07, 0x0213 | (_lcd_rev << 2)); //VLE1=1, GON=1, REV=x, D=3 + WriteCmdData(0x41, vsp); //VL# check vsp + break; +#endif +#if defined(SUPPORT_0154) || defined(SUPPORT_9225) //thanks tongbajiel + case 0x9225: + case 0x0154: + WriteCmdData(0x31, sea); //SEA + WriteCmdData(0x32, top); //SSA + WriteCmdData(0x33, vsp - top); //SST + break; +#endif +#ifdef SUPPORT_1289 + case 0x1289: + WriteCmdData(0x41, vsp); //VL# + break; +#endif + case 0x5420: + case 0x7793: + case 0x9326: + case 0xB509: + WriteCmdData(0x401, (1 << 1) | _lcd_rev); //VLE, REV + WriteCmdData(0x404, vsp); //VL# + break; + default: + // 0x6809, 0x9320, 0x9325, 0x9335, 0xB505 can only scroll whole screen + WriteCmdData(0x61, (1 << 1) | _lcd_rev); //!NDL, VLE, REV + WriteCmdData(0x6A, vsp); //VL# + break; + } +} + +void MCUFRIEND_kbv::invertDisplay(boolean i) +{ + uint8_t val; + _lcd_rev = ((_lcd_capable & REV_SCREEN) != 0) ^ i; + if (_lcd_capable & MIPI_DCS_REV1) { + if (is8347) { + // HX8347D: 0x36 Panel Characteristic. REV_Panel + // HX8347A: 0x36 is Display Control 10 + if (_lcd_ID == 0x8347 || _lcd_ID == 0x5252) // HX8347-A, HX5352-A + val = _lcd_rev ? 6 : 2; //INVON id bit#2, NORON=bit#1 + else val = _lcd_rev ? 8 : 10; //HX8347-D, G, I: SCROLLON=bit3, INVON=bit1 + // HX8347: 0x01 Display Mode has diff bit mapping for A, D + WriteCmdParamN(0x01, 1, &val); + } else + WriteCmdParamN(_lcd_rev ? 0x21 : 0x20, 0, NULL); + return; + } + // cope with 9320 style variants: + switch (_lcd_ID) { +#ifdef SUPPORT_0139 + case 0x0139: +#endif + case 0x9225: //REV is in reg(0x07) like Samsung + case 0x0154: + WriteCmdData(0x07, 0x13 | (_lcd_rev << 2)); //.kbv kludge + break; +#ifdef SUPPORT_1289 + case 0x1289: + _lcd_drivOut &= ~(1 << 13); + if (_lcd_rev) + _lcd_drivOut |= (1 << 13); + WriteCmdData(0x01, _lcd_drivOut); + break; +#endif + case 0x5420: + case 0x7793: + case 0x9326: + case 0xB509: + WriteCmdData(0x401, (1 << 1) | _lcd_rev); //.kbv kludge VLE + break; + default: + WriteCmdData(0x61, _lcd_rev); + break; + } +} + +#define TFTLCD_DELAY 0xFFFF +#define TFTLCD_DELAY8 0x7F +static void init_table(const void *table, int16_t size) +{ +#ifdef SUPPORT_8357D_GAMMA + uint8_t *p = (uint8_t *) table, dat[36]; //HX8357_99 has GAMMA[34] +#else + uint8_t *p = (uint8_t *) table, dat[24]; //R61526 has GAMMA[22] +#endif + while (size > 0) { + uint8_t cmd = pgm_read_byte(p++); + uint8_t len = pgm_read_byte(p++); + if (cmd == TFTLCD_DELAY8) { + delay(len); + len = 0; + } else { + for (uint8_t i = 0; i < len; i++) + dat[i] = pgm_read_byte(p++); + WriteCmdParamN(cmd, len, dat); + } + size -= len + 2; + } +} + +static void init_table16(const void *table, int16_t size) +{ + uint16_t *p = (uint16_t *) table; + while (size > 0) { + uint16_t cmd = pgm_read_word(p++); + uint16_t d = pgm_read_word(p++); + if (cmd == TFTLCD_DELAY) + delay(d); + else { + writecmddata(cmd, d); //static function + } + size -= 2 * sizeof(int16_t); + } +} + +void MCUFRIEND_kbv::begin(uint16_t ID) +{ + int16_t *p16; //so we can "write" to a const protected variable. + const uint8_t *table8_ads = NULL; + int16_t table_size; + reset(); + _lcd_xor = 0; + switch (_lcd_ID = ID) { +/* + static const uint16_t _regValues[] PROGMEM = { + 0x0000, 0x0001, // start oscillation + 0x0007, 0x0000, // source output control 0 D0 + 0x0013, 0x0000, // power control 3 off + 0x0011, 0x2604, // + 0x0014, 0x0015, // + 0x0010, 0x3C00, // + // 0x0013, 0x0040, // + // 0x0013, 0x0060, // + // 0x0013, 0x0070, // + 0x0013, 0x0070, // power control 3 PON PON1 AON + + 0x0001, 0x0127, // driver output control + // 0x0002, 0x0700, // field 0 b/c waveform xor waveform + 0x0003, 0x1030, // + 0x0007, 0x0000, // + 0x0008, 0x0404, // + 0x000B, 0x0200, // + 0x000C, 0x0000, // + 0x00015,0x0000, // + + //gamma setting + 0x0030, 0x0000, + 0x0031, 0x0606, + 0x0032, 0x0006, + 0x0033, 0x0403, + 0x0034, 0x0107, + 0x0035, 0x0101, + 0x0036, 0x0707, + 0x0037, 0x0304, + 0x0038, 0x0A00, + 0x0039, 0x0706, + + 0x0040, 0x0000, + 0x0041, 0x0000, + 0x0042, 0x013F, + 0x0043, 0x0000, + 0x0044, 0x0000, + 0x0045, 0x0000, + 0x0046, 0xEF00, + 0x0047, 0x013F, + 0x0048, 0x0000, + 0x0007, 0x0011, + 0x0007, 0x0017, +}; +*/ +#ifdef SUPPORT_0139 + case 0x0139: + _lcd_capable = REV_SCREEN | XSA_XEA_16BIT; //remove AUTO_READINC + static const uint16_t S6D0139_regValues[] PROGMEM = { + 0x0000, 0x0001, //Start oscillator + 0x0011, 0x1a00, //Power Control 2 + 0x0014, 0x2020, //Power Control 4 + 0x0010, 0x0900, //Power Control 1 + 0x0013, 0x0040, //Power Control 3 + 0x0013, 0x0060, //Power Control 3 + 0x0013, 0x0070, //Power Control 3 + 0x0011, 0x1a04, //Power Control 2 + 0x0010, 0x2f00, //Power Control 1 + 0x0001, 0x0127, //Driver Control: SM=0, GS=0, SS=1, 240x320 + 0x0002, 0x0100, //LCD Control: (.kbv was 0700) FLD=0, BC= 0, EOR=1 + 0x0003, 0x1030, //Entry Mode: TR1=0, DFM=0, BGR=1, I_D=3 + 0x0007, 0x0000, //Display Control: everything off + 0x0008, 0x0303, //Blank Period: FP=3, BP=3 + 0x0009, 0x0000, //f.k. + 0x000b, 0x0000, //Frame Control: + 0x000c, 0x0000, //Interface Control: system i/f + 0x0040, 0x0000, //Scan Line + 0x0041, 0x0000, //Vertical Scroll Control + 0x0007, 0x0014, //Display Control: VLE1=0, SPT=0, GON=1, REV=1, D=0 (halt) + 0x0007, 0x0016, //Display Control: VLE1=0, SPT=0, GON=1, REV=1, D=2 (blank) + 0x0007, 0x0017, //Display Control: VLE1=0, SPT=0, GON=1, REV=1, D=3 (normal) +// 0x0007, 0x0217, //Display Control: VLE1=1, SPT=0, GON=1, REV=1, D=3 + }; + init_table16(S6D0139_regValues, sizeof(S6D0139_regValues)); + break; +#endif + +#ifdef SUPPORT_0154 + case 0x0154: + _lcd_capable = AUTO_READINC | REV_SCREEN; + static const uint16_t S6D0154_regValues[] PROGMEM = { + 0x0011, 0x001A, + 0x0012, 0x3121, //BT=3, DC1=1, DC2=2, DC3=1 + 0x0013, 0x006C, //GVD=108 + 0x0014, 0x4249, //VCM=66, VML=73 + + 0x0010, 0x0800, //SAP=8 + TFTLCD_DELAY, 10, + 0x0011, 0x011A, //APON=0, PON=1, AON=0, VCI1_EN=1, VC=10 + TFTLCD_DELAY, 10, + 0x0011, 0x031A, //APON=0, PON=3, AON=0, VCI1_EN=1, VC=10 + TFTLCD_DELAY, 10, + 0x0011, 0x071A, //APON=0, PON=7, AON=0, VCI1_EN=1, VC=10 + TFTLCD_DELAY, 10, + 0x0011, 0x0F1A, //APON=0, PON=15, AON=0, VCI1_EN=1, VC=10 + TFTLCD_DELAY, 10, + 0x0011, 0x0F3A, //APON=0, PON=15, AON=1, VCI1_EN=1, VC=10 + TFTLCD_DELAY, 30, + + 0x0001, 0x0128, + 0x0002, 0x0100, + 0x0003, 0x1030, + 0x0007, 0x1012, + 0x0008, 0x0303, + 0x000B, 0x1100, + 0x000C, 0x0000, + 0x000F, 0x1801, + 0x0015, 0x0020, + + 0x0050,0x0101, + 0x0051,0x0603, + 0x0052,0x0408, + 0x0053,0x0000, + 0x0054,0x0605, + 0x0055,0x0406, + 0x0056,0x0303, + 0x0057,0x0303, + 0x0058,0x0010, + 0x0059,0x1000, + + 0x0007, 0x0012, //GON=1, REV=0, D=2 + TFTLCD_DELAY, 40, + 0x0007, 0x0013, //GON=1, REV=0, D=3 + 0x0007, 0x0017, //GON=1, REV=1, D=3 DISPLAY ON + }; + init_table16(S6D0154_regValues, sizeof(S6D0154_regValues)); + + break; +#endif + +#ifdef SUPPORT_1289 + case 0x9797: + is9797 = 1; +// _lcd_capable = 0 | XSA_XEA_16BIT | REV_SCREEN | AUTO_READINC | READ_24BITS; +// deliberately set READ_BGR to disable Software Scroll in graphictest_kbv example + _lcd_capable = 0 | XSA_XEA_16BIT | REV_SCREEN | AUTO_READINC | READ_24BITS | READ_BGR; + _lcd_ID = 0x1289; + goto common_1289; + case 0x1289: + _lcd_capable = 0 | XSA_XEA_16BIT | REV_SCREEN | AUTO_READINC; + common_1289: + // came from MikroElektronika library http://www.hmsprojects.com/tft_lcd.html + static const uint16_t SSD1289_regValues[] PROGMEM = { + 0x0000, 0x0001, + 0x0003, 0xA8A4, + 0x000C, 0x0000, + 0x000D, 0x000A, // VRH=10 + 0x000E, 0x2B00, + 0x001E, 0x00B7, + 0x0001, 0x2B3F, // setRotation() alters + 0x0002, 0x0600, // B_C=1, EOR=1 + 0x0010, 0x0000, + 0x0011, 0x6070, // setRotation() alters + 0x0005, 0x0000, + 0x0006, 0x0000, + 0x0016, 0xEF1C, + 0x0017, 0x0003, + 0x0007, 0x0233, + 0x000B, 0x0000, + 0x000F, 0x0000, + 0x0030, 0x0707, + 0x0031, 0x0204, + 0x0032, 0x0204, + 0x0033, 0x0502, + 0x0034, 0x0507, + 0x0035, 0x0204, + 0x0036, 0x0204, + 0x0037, 0x0502, + 0x003A, 0x0302, + 0x003B, 0x0302, + 0x0023, 0x0000, + 0x0024, 0x0000, + 0x0025, 0x8000, + }; + init_table16(SSD1289_regValues, sizeof(SSD1289_regValues)); + break; +#endif + + case 0x1511: // Unknown from Levy + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1; //extra read_8(dummy) + static const uint8_t R61511_regValues[] PROGMEM = { + 0xB0, 1, 0x00, //Command Access Protect + }; + table8_ads = R61511_regValues, table_size = sizeof(R61511_regValues); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; + + case 0x1520: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; + static const uint8_t R61520_regValues[] PROGMEM = { + 0xB0, 1, 0x00, //Command Access Protect + 0xC0, 1, 0x0A, //DM=1, BGR=1 + }; + table8_ads = R61520_regValues, table_size = sizeof(R61520_regValues); + break; + + case 0x1526: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; + static const uint8_t R61526_regValues[] PROGMEM = { + 0xB0, 1, 0x03, //Command Access + 0xE2, 1, 0x3F, //Command Write Access + 0xC0, 1, 0x22, //REV=0, BGR=1, SS=0 + 0xE2, 1, 0x00, //Command Write Protect + }; + table8_ads = R61526_regValues, table_size = sizeof(R61526_regValues); + break; + +#ifdef SUPPORT_1580 + case 0x1580: + _lcd_capable = 0 | REV_SCREEN | READ_BGR | INVERT_GS | READ_NODUMMY; //thanks vanhan123 + static const uint16_t R61580_regValues[] PROGMEM = { //from MCHIP Graphics Lib drvTFT001.c + // Synchronization after reset + TFTLCD_DELAY, 2, + 0x0000, 0x0000, + 0x0000, 0x0000, + 0x0000, 0x0000, + 0x0000, 0x0000, + + // Setup display + 0x00A4, 0x0001, // CALB=1 + TFTLCD_DELAY, 2, + 0x0060, 0xA700, // Driver Output Control + 0x0008, 0x0808, // Display Control BP=8, FP=8 + 0x0030, 0x0111, // y control + 0x0031, 0x2410, // y control + 0x0032, 0x0501, // y control + 0x0033, 0x050C, // y control + 0x0034, 0x2211, // y control + 0x0035, 0x0C05, // y control + 0x0036, 0x2105, // y control + 0x0037, 0x1004, // y control + 0x0038, 0x1101, // y control + 0x0039, 0x1122, // y control + 0x0090, 0x0019, // 80Hz + 0x0010, 0x0530, // Power Control + 0x0011, 0x0237, //DC1=2, DC0=3, VC=7 +// 0x0011, 0x17B0, //DC1=7, DC0=3, VC=0 ?b12 ?b7 vanhan123 + 0x0012, 0x01BF, //VCMR=1, PSON=1, PON=1, VRH=15 +// 0x0012, 0x013A, //VCMR=1, PSON=1, PON=1, VRH=10 vanhan123 + 0x0013, 0x1300, //VDV=19 + TFTLCD_DELAY, 100, + + 0x0001, 0x0100, + 0x0002, 0x0200, + 0x0003, 0x1030, + 0x0009, 0x0001, + 0x000A, 0x0008, + 0x000C, 0x0001, + 0x000D, 0xD000, + 0x000E, 0x0030, + 0x000F, 0x0000, + 0x0020, 0x0000, + 0x0021, 0x0000, + 0x0029, 0x0077, + 0x0050, 0x0000, + 0x0051, 0xD0EF, + 0x0052, 0x0000, + 0x0053, 0x013F, + 0x0061, 0x0001, + 0x006A, 0x0000, + 0x0080, 0x0000, + 0x0081, 0x0000, + 0x0082, 0x005F, + 0x0093, 0x0701, + 0x0007, 0x0100, + }; + static const uint16_t R61580_DEM240320C[] PROGMEM = { //from DEM 240320C TMH-PW-N + 0x00, 0x0000, + 0x00, 0x0000, + TFTLCD_DELAY, 100, + 0x00, 0x0000, + 0x00, 0x0000, + 0x00, 0x0000, + 0x00, 0x0000, + 0xA4, 0x0001, + TFTLCD_DELAY, 100, + 0x60, 0xA700, + 0x08, 0x0808, + /******************************************/ + //Gamma Setting: + 0x30, 0x0203, + 0x31, 0x080F, + 0x32, 0x0401, + 0x33, 0x050B, + 0x34, 0x3330, + 0x35, 0x0B05, + 0x36, 0x0005, + 0x37, 0x0F08, + 0x38, 0x0302, + 0x39, 0x3033, + /******************************************/ + //Power Setting: + 0x90, 0x0018, //80Hz + 0x10, 0x0530, //BT,AP + 0x11, 0x0237, //DC1,DC0,VC + 0x12, 0x01BF, + 0x13, 0x1000, //VCOM + TFTLCD_DELAY, 200, + /******************************************/ + 0x01, 0x0100, + 0x02, 0x0200, + 0x03, 0x1030, + 0x09, 0x0001, + 0x0A, 0x0008, + 0x0C, 0x0000, + 0x0D, 0xD000, + + 0x0E, 0x0030, + 0x0F, 0x0000, + 0x20, 0x0000, //H Start + 0x21, 0x0000, //V Start + 0x29, 0x002E, + 0x50, 0x0000, + 0x51, 0x00EF, + 0x52, 0x0000, + 0x53, 0x013F, + 0x61, 0x0001, + 0x6A, 0x0000, + 0x80, 0x0000, + 0x81, 0x0000, + 0x82, 0x005F, + 0x93, 0x0701, + /******************************************/ + 0x07, 0x0100, + TFTLCD_DELAY, 100, + }; + init_table16(R61580_DEM240320C, sizeof(R61580_DEM240320C)); +// init_table16(R61580_regValues, sizeof(R61580_regValues)); + break; +#endif + +#if defined(SUPPORT_1963) && USING_16BIT_BUS + case 0x1963: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | READ_NODUMMY | INVERT_SS | INVERT_RGB; + // from NHD 5.0" 8-bit + static const uint8_t SSD1963_NHD_50_regValues[] PROGMEM = { + (0xE0), 1, 0x01, // PLL enable + TFTLCD_DELAY8, 10, + (0xE0), 1, 0x03, // Lock PLL + (0xB0), 7, 0x08, 0x80, 0x03, 0x1F, 0x01, 0xDF, 0x00, //LCD SPECIFICATION + (0xF0), 1, 0x03, //was 00 pixel data interface + // (0x3A), 1, 0x60, // SET R G B format = 6 6 6 + (0xE2), 3, 0x1D, 0x02, 0x54, //PLL multiplier, set PLL clock to 120M + (0xE6), 3, 0x02, 0xFF, 0xFF, //PLL setting for PCLK, depends on resolution + (0xB4), 8, 0x04, 0x20, 0x00, 0x58, 0x80, 0x00, 0x00, 0x00, //HSYNC + (0xB6), 7, 0x02, 0x0D, 0x00, 0x20, 0x01, 0x00, 0x00, //VSYNC + (0x13), 0, //Enter Normal mode + (0x38), 0, //Exit Idle mode + }; + // from NHD 7.0" 8-bit + static const uint8_t SSD1963_NHD_70_regValues[] PROGMEM = { + (0xE2), 3, 0x1D, 0x02, 0x04, //PLL multiplier, set PLL clock to 120M + (0xE0), 1, 0x01, // PLL enable + TFTLCD_DELAY8, 10, + (0xE0), 1, 0x03, // Lock PLL + 0x01, 0, //Soft Reset + TFTLCD_DELAY8, 120, + (0xB0), 7, 0x08, 0x80, 0x03, 0x1F, 0x01, 0xDF, 0x00, //LCD SPECIFICATION + (0xF0), 1, 0x03, //was 00 pixel data interface + // (0x3A), 1, 0x60, // SET R G B format = 6 6 6 + (0xE6), 3, 0x0F, 0xFF, 0xFF, //PLL setting for PCLK, depends on resolution + (0xB4), 8, 0x04, 0x20, 0x00, 0x58, 0x80, 0x00, 0x00, 0x00, //HSYNC + (0xB6), 7, 0x02, 0x0D, 0x00, 0x20, 0x01, 0x00, 0x00, //VSYNC + (0x13), 0, //Enter Normal mode + (0x38), 0, //Exit Idle mode + }; + // from UTFTv2.81 initlcd.h + static const uint8_t SSD1963_800_regValues[] PROGMEM = { + (0xE2), 3, 0x1E, 0x02, 0x54, //PLL multiplier, set PLL clock to 120M + (0xE0), 1, 0x01, // PLL enable + TFTLCD_DELAY8, 10, + (0xE0), 1, 0x03, // + TFTLCD_DELAY8, 10, + 0x01, 0, //Soft Reset + TFTLCD_DELAY8, 100, + (0xE6), 3, 0x03, 0xFF, 0xFF, //PLL setting for PCLK, depends on resolution + (0xB0), 7, 0x24, 0x00, 0x03, 0x1F, 0x01, 0xDF, 0x00, //LCD SPECIFICATION + // (0xB0), 7, 0x24, 0x00, 0x03, 0x1F, 0x01, 0xDF, 0x2D, //LCD SPECIFICATION + (0xB4), 8, 0x03, 0xA0, 0x00, 0x2E, 0x30, 0x00, 0x0F, 0x00, //HSYNC + (0xB6), 7, 0x02, 0x0D, 0x00, 0x10, 0x10, 0x00, 0x08, //VSYNC + (0xBA), 1, 0x0F, //GPIO[3:0] out 1 + (0xB8), 2, 0x07, 0x01, //GPIO3=input, GPIO[2:0]=output + (0xF0), 1, 0x03, //pixel data interface + TFTLCD_DELAY8, 1, + 0x28, 0, //Display Off + 0x11, 0, //Sleep Out + TFTLCD_DELAY8, 100, + 0x29, 0, //Display On + (0xBE), 6, 0x06, 0xF0, 0x01, 0xF0, 0x00, 0x00, //set PWM for B/L + (0xD0), 1, 0x0D, + }; + // from UTFTv2.82 initlcd.h + static const uint8_t SSD1963_800NEW_regValues[] PROGMEM = { + (0xE2), 3, 0x1E, 0x02, 0x54, //PLL multiplier, set PLL clock to 120M + (0xE0), 1, 0x01, // PLL enable + TFTLCD_DELAY8, 10, + (0xE0), 1, 0x03, // + TFTLCD_DELAY8, 10, + 0x01, 0, //Soft Reset + TFTLCD_DELAY8, 100, + (0xE6), 3, 0x03, 0xFF, 0xFF, //PLL setting for PCLK, depends on resolution + (0xB0), 7, 0x24, 0x00, 0x03, 0x1F, 0x01, 0xDF, 0x00, //LCD SPECIFICATION + (0xB4), 8, 0x03, 0xA0, 0x00, 0x2E, 0x30, 0x00, 0x0F, 0x00, //HSYNC HT=928, HPS=46, HPW=48, LPS=15 + (0xB6), 7, 0x02, 0x0D, 0x00, 0x10, 0x10, 0x00, 0x08, //VSYNC VT=525, VPS=16, VPW=16, FPS=8 + (0xBA), 1, 0x0F, //GPIO[3:0] out 1 + (0xB8), 2, 0x07, 0x01, //GPIO3=input, GPIO[2:0]=output + (0xF0), 1, 0x03, //pixel data interface + TFTLCD_DELAY8, 1, + 0x28, 0, //Display Off + 0x11, 0, //Sleep Out + TFTLCD_DELAY8, 100, + 0x29, 0, //Display On + (0xBE), 6, 0x06, 0xF0, 0x01, 0xF0, 0x00, 0x00, //set PWM for B/L + (0xD0), 1, 0x0D, + }; + // from UTFTv2.82 initlcd.h + static const uint8_t SSD1963_800ALT_regValues[] PROGMEM = { + (0xE2), 3, 0x23, 0x02, 0x04, //PLL multiplier, set PLL clock to 120M + (0xE0), 1, 0x01, // PLL enable + TFTLCD_DELAY8, 10, + (0xE0), 1, 0x03, // + TFTLCD_DELAY8, 10, + 0x01, 0, //Soft Reset + TFTLCD_DELAY8, 100, + (0xE6), 3, 0x04, 0x93, 0xE0, //PLL setting for PCLK, depends on resolution + (0xB0), 7, 0x00, 0x00, 0x03, 0x1F, 0x01, 0xDF, 0x00, //LCD SPECIFICATION + (0xB4), 8, 0x03, 0xA0, 0x00, 0x2E, 0x30, 0x00, 0x0F, 0x00, //HSYNC HT=928, HPS=46, HPW=48, LPS=15 + (0xB6), 7, 0x02, 0x0D, 0x00, 0x10, 0x10, 0x00, 0x08, //VSYNC VT=525, VPS=16, VPW=16, FPS=8 + (0xBA), 1, 0x0F, //GPIO[3:0] out 1 + (0xB8), 2, 0x07, 0x01, //GPIO3=input, GPIO[2:0]=output + (0xF0), 1, 0x03, //pixel data interface + TFTLCD_DELAY8, 1, + 0x28, 0, //Display Off + 0x11, 0, //Sleep Out + TFTLCD_DELAY8, 100, + 0x29, 0, //Display On + (0xBE), 6, 0x06, 0xF0, 0x01, 0xF0, 0x00, 0x00, //set PWM for B/L + (0xD0), 1, 0x0D, + }; + // from UTFTv2.82 initlcd.h + static const uint8_t SSD1963_480_regValues[] PROGMEM = { + (0xE2), 3, 0x23, 0x02, 0x54, //PLL multiplier, set PLL clock to 120M + (0xE0), 1, 0x01, // PLL enable + TFTLCD_DELAY8, 10, + (0xE0), 1, 0x03, // + TFTLCD_DELAY8, 10, + 0x01, 0, //Soft Reset + TFTLCD_DELAY8, 100, + (0xE6), 3, 0x01, 0x1F, 0xFF, //PLL setting for PCLK, depends on resolution + (0xB0), 7, 0x20, 0x00, 0x01, 0xDF, 0x01, 0x0F, 0x00, //LCD SPECIFICATION + (0xB4), 8, 0x02, 0x13, 0x00, 0x08, 0x2B, 0x00, 0x02, 0x00, //HSYNC + (0xB6), 7, 0x01, 0x20, 0x00, 0x04, 0x0C, 0x00, 0x02, //VSYNC + (0xBA), 1, 0x0F, //GPIO[3:0] out 1 + (0xB8), 2, 0x07, 0x01, //GPIO3=input, GPIO[2:0]=output + (0xF0), 1, 0x03, //pixel data interface + TFTLCD_DELAY8, 1, + 0x28, 0, //Display Off + 0x11, 0, //Sleep Out + TFTLCD_DELAY8, 100, + 0x29, 0, //Display On + (0xBE), 6, 0x06, 0xF0, 0x01, 0xF0, 0x00, 0x00, //set PWM for B/L + (0xD0), 1, 0x0D, + }; +// table8_ads = SSD1963_480_regValues, table_size = sizeof(SSD1963_480_regValues); + table8_ads = SSD1963_800_regValues, table_size = sizeof(SSD1963_800_regValues); +// table8_ads = SSD1963_NHD_50_regValues, table_size = sizeof(SSD1963_NHD_50_regValues); +// table8_ads = SSD1963_NHD_70_regValues, table_size = sizeof(SSD1963_NHD_70_regValues); +// table8_ads = SSD1963_800NEW_regValues, table_size = sizeof(SSD1963_800NEW_regValues); +// table8_ads = SSD1963_800ALT_regValues, table_size = sizeof(SSD1963_800ALT_regValues); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 800; + break; +#endif + +#ifdef SUPPORT_4532 +//Support for LG Electronics LGDP4532 (also 4531 i guess) by Leodino v1.0 2-Nov-2016 +//based on data by waveshare and the datasheet of LG Electronics +//My approach to get it working: the parameters by waveshare did no make it function allright +//I started with remming lines to see if this helped. Basically the stuff in range 41-93 +//gives problems. +//The other lines that are REMmed give no problems, but it seems default values are OK as well. +case 0x4532: // thanks Leodino + _lcd_capable = 0 | REV_SCREEN; // | INVERT_GS; + static const uint16_t LGDP4532_regValues[] PROGMEM = { + 0x0000,0x0001, //Device code read + 0x0010,0x0628, //Power control 1 SAP[2:0] BT[3:0] AP[2:0] DK DSTB SLP + 0x0012,0x0006, //Power control 3 PON VRH[3:0] + //0x0013,0x0A32, //Power control 4 VCOMG VDV[4:0] VCM[6:0] + 0x0011,0x0040, //Power control 2; DC1[2:0] DC0[2:0] VC[2:0] + //0x0015,0x0050, //Regulator control RSET RI[2:0] RV[2:0] RCONT[2:0] + 0x0012,0x0016, //Power control 3 PON VRH[3:0] + TFTLCD_DELAY,50, + 0x0010,0x5660, //Power control 1 SAP[2:0] BT[3:0] AP[2:0] DK DSTB SLP + TFTLCD_DELAY,50, + //0x0013,0x2A4E, //Power control 4 VCOMG VDV[4:0] VCM[6:0] + //0x0001,0x0100, //Driver output control SM SS + //0x0002,0x0300, //LCD Driving Wave Control + //0x0003,0x1030, //Entry mode TRI DFM BGR ORG I/D[1:0] AM + //0x0007,0x0202, //Display Control 1 PTDE[1:0] BASEE GON DTE COL D[1:0] + TFTLCD_DELAY,50, + //0x0008,0x0202, //Display Control 2 FP[3:0] BP[3:0] front and back porch (blank period at begin and end..) + //0x000A,0x0000, //Test Register 1 (RA0h) + //Gamma adjustment + 0x0030,0x0000, + 0x0031,0x0402, + 0x0032,0x0106, + 0x0033,0x0700, + 0x0034,0x0104, + 0x0035,0x0301, + 0x0036,0x0707, + 0x0037,0x0305, + 0x0038,0x0208, + 0x0039,0x0F0B, + TFTLCD_DELAY,50, + //some of this stuff in range 41-93 really throws things off.... + //0x0041,0x0002, + //0x0060,0x2700, //Driver Output Control (R60h) + //0x0061,0x0001, //Base Image Display Control (R61h) + //0x0090,0x0119, //Panel Interface Control 1 (R90h) DIVI[1:0] RTNI[4:0] + //0x0092,0x010A, //Panel Interface Control 2 (R92h) NOWI[2:0] EQI2[1:0] EQI1[1:0] + //0x0093,0x0004, //Panel Interface Control 3 (R93h) MCPI[2:0] + //0x00A0,0x0100, //Test Register 1 (RA0h) + TFTLCD_DELAY,50, + 0x0007,0x0133, //Display Control 1 PTDE[1:0] BASEE GON DTE COL D[1:0] + TFTLCD_DELAY,50, + //0x00A0,0x0000, //Test Register 1 (RA0h) + }; + init_table16(LGDP4532_regValues, sizeof(LGDP4532_regValues)); + break; +#endif + +#ifdef SUPPORT_4535 + case 0x4535: + _lcd_capable = 0 | REV_SCREEN; // | INVERT_GS; + static const uint16_t LGDP4535_regValues[] PROGMEM = { + 0x0015, 0x0030, // Set the internal vcore voltage + 0x009A, 0x0010, // Start internal OSC + 0x0011, 0x0020, // set SS and SM bit + 0x0010, 0x3428, // set 1 line inversion + 0x0012, 0x0002, // set GRAM write direction and BGR=1 + 0x0013, 0x1038, // Resize register + TFTLCD_DELAY, 40, + 0x0012, 0x0012, // set the back porch and front porch + TFTLCD_DELAY, 40, + 0x0010, 0x3420, // set non-display area refresh cycle ISC[3:0] + 0x0013, 0x3045, // FMARK function + TFTLCD_DELAY, 70, + 0x0030, 0x0000, // RGB interface setting + 0x0031, 0x0402, // Frame marker Position + 0x0032, 0x0307, // RGB interface polarity + 0x0033, 0x0304, // SAP, BT[3:0], AP, DSTB, SLP, STB + 0x0034, 0x0004, // DC1[2:0], DC0[2:0], VC[2:0] + 0x0035, 0x0401, // VREG1OUT voltage + 0x0036, 0x0707, // VDV[4:0] for VCOM amplitude + 0x0037, 0x0305, // SAP, BT[3:0], AP, DSTB, SLP, STB + 0x0038, 0x0610, // DC1[2:0], DC0[2:0], VC[2:0] + 0x0039, 0x0610, // VREG1OUT voltage + 0x0001, 0x0100, // VDV[4:0] for VCOM amplitude + 0x0002, 0x0300, // VCM[4:0] for VCOMH + 0x0003, 0x1030, // GRAM horizontal Address + 0x0008, 0x0808, // GRAM Vertical Address + 0x000A, 0x0008, + 0x0060, 0x2700, // Gate Scan Line + 0x0061, 0x0001, // NDL,VLE, REV + 0x0090, 0x013E, + 0x0092, 0x0100, + 0x0093, 0x0100, + 0x00A0, 0x3000, + 0x00A3, 0x0010, + 0x0007, 0x0001, + 0x0007, 0x0021, + 0x0007, 0x0023, + 0x0007, 0x0033, + 0x0007, 0x0133, + }; + init_table16(LGDP4535_regValues, sizeof(LGDP4535_regValues)); + break; +#endif + + case 0x5310: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | INVERT_SS | INVERT_RGB | READ_24BITS; + static const uint8_t NT35310_regValues[] PROGMEM = { // + TFTLCD_DELAY8, 10, //just some dummy + }; + table8_ads = NT35310_regValues, table_size = sizeof(NT35310_regValues); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; + +#ifdef SUPPORT_68140 + case 0x6814: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS; + static const uint8_t RM68140_regValues_max[] PROGMEM = { // + 0x3A, 1, 0x55, //Pixel format .kbv my Mega Shield + }; + table8_ads = RM68140_regValues_max, table_size = sizeof(RM68140_regValues_max); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; +#endif + +#ifdef SUPPORT_7735 + case 0x7735: // + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | REV_SCREEN | READ_24BITS; + static const uint8_t PROGMEM table7735S[] = { + // (COMMAND_BYTE), n, data_bytes.... + 0xB1, 3, 0x01, 0x2C, 0x2D, // [05 3C 3C] FRMCTR1 if GM==11 + 0xB2, 3, 0x01, 0x2C, 0x2D, // [05 3C 3C] + 0xB3, 6, 0x01, 0x2C, 0x2D, 0x01, 0x2C, 0x2D, // [05 3C 3C 05 3C 3C] + 0xB4, 1, 0x07, // [07] INVCTR Column inversion + //ST7735XR Power Sequence + 0xC0, 3, 0xA2, 0x02, 0x84, // [A8 08 84] PWCTR1 + 0xC1, 1, 0xC5, // [C0] + 0xC2, 2, 0x0A, 0x00, // [0A 00] + 0xC3, 2, 0x8A, 0x2A, // [8A 26] + 0xC4, 2, 0x8A, 0xEE, // [8A EE] + 0xC5, 1, 0x0E, // [05] VMCTR1 VCOM + }; + table8_ads = table7735S, table_size = sizeof(table7735S); // + p16 = (int16_t *) & HEIGHT; + *p16 = 160; + p16 = (int16_t *) & WIDTH; + *p16 = 128; + break; +#endif + +#ifdef SUPPORT_7781 + case 0x7783: + _lcd_capable = AUTO_READINC | REV_SCREEN | INVERT_GS; + static const uint16_t ST7781_regValues[] PROGMEM = { + 0x00FF, 0x0001, //can we do 0xFF + 0x00F3, 0x0008, + // LCD_Write_COM(0x00F3, + + 0x00, 0x0001, + 0x0001, 0x0100, // Driver Output Control Register (R01h) + 0x0002, 0x0700, // LCD Driving Waveform Control (R02h) + 0x0003, 0x1030, // Entry Mode (R03h) + 0x0008, 0x0302, + 0x0009, 0x0000, + 0x0010, 0x0000, // Power Control 1 (R10h) + 0x0011, 0x0007, // Power Control 2 (R11h) + 0x0012, 0x0000, // Power Control 3 (R12h) + 0x0013, 0x0000, // Power Control 4 (R13h) + TFTLCD_DELAY, 50, + 0x0010, 0x14B0, // Power Control 1 SAP=1, BT=4, APE=1, AP=3 + TFTLCD_DELAY, 10, + 0x0011, 0x0007, // Power Control 2 VC=7 + TFTLCD_DELAY, 10, + 0x0012, 0x008E, // Power Control 3 VCIRE=1, VRH=14 + 0x0013, 0x0C00, // Power Control 4 VDV=12 + 0x0029, 0x0015, // NVM read data 2 VCM=21 + TFTLCD_DELAY, 10, + 0x0030, 0x0000, // Gamma Control 1 + 0x0031, 0x0107, // Gamma Control 2 + 0x0032, 0x0000, // Gamma Control 3 + 0x0035, 0x0203, // Gamma Control 6 + 0x0036, 0x0402, // Gamma Control 7 + 0x0037, 0x0000, // Gamma Control 8 + 0x0038, 0x0207, // Gamma Control 9 + 0x0039, 0x0000, // Gamma Control 10 + 0x003C, 0x0203, // Gamma Control 13 + 0x003D, 0x0403, // Gamma Control 14 + 0x0060, 0xA700, // Driver Output Control (R60h) .kbv was 0xa700 + 0x0061, 0x0001, // Driver Output Control (R61h) + 0x0090, 0X0029, // Panel Interface Control 1 (R90h) + + // Display On + 0x0007, 0x0133, // Display Control (R07h) + TFTLCD_DELAY, 50, + }; + init_table16(ST7781_regValues, sizeof(ST7781_regValues)); + break; +#endif + + case 0x7789: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; + static const uint8_t ST7789_regValues[] PROGMEM = { + (0xB2), 5, 0x0C, 0x0C, 0x00, 0x33, 0x33, //PORCTRK: Porch setting [08 08 00 22 22] PSEN=0 anyway + (0xB7), 1, 0x35, //GCTRL: Gate Control [35] + (0xBB), 1, 0x2B, //VCOMS: VCOM setting VCOM=1.175 [20] VCOM=0.9 + (0xC0), 1, 0x04, //LCMCTRL: LCM Control [2C] + (0xC2), 2, 0x01, 0xFF, //VDVVRHEN: VDV and VRH Command Enable [01 FF] + (0xC3), 1, 0x11, //VRHS: VRH Set VAP=4.4, VAN=-4.4 [0B] + (0xC4), 1, 0x20, //VDVS: VDV Set [20] + (0xC6), 1, 0x0F, //FRCTRL2: Frame Rate control in normal mode [0F] + (0xD0), 2, 0xA4, 0xA1, //PWCTRL1: Power Control 1 [A4 A1] + (0xE0), 14, 0xD0, 0x00, 0x05, 0x0E, 0x15, 0x0D, 0x37, 0x43, 0x47, 0x09, 0x15, 0x12, 0x16, 0x19, //PVGAMCTRL: Positive Voltage Gamma control + (0xE1), 14, 0xD0, 0x00, 0x05, 0x0D, 0x0C, 0x06, 0x2D, 0x44, 0x40, 0x0E, 0x1C, 0x18, 0x16, 0x19, //NVGAMCTRL: Negative Voltage Gamma control + }; + static const uint8_t ST7789_regValues_arcain6[] PROGMEM = { + (0xB2), 5, 0x0C, 0x0C, 0x00, 0x33, 0x33, //PORCTRK: Porch setting [08 08 00 22 22] PSEN=0 anyway + (0xB7), 1, 0x35, //GCTRL: Gate Control [35] + (0xBB), 1, 0x35, //VCOMS: VCOM setting VCOM=??? [20] VCOM=0.9 + (0xC0), 1, 0x2C, //LCMCTRL: LCM Control [2C] + (0xC2), 2, 0x01, 0xFF, //VDVVRHEN: VDV and VRH Command Enable [01 FF] + (0xC3), 1, 0x13, //VRHS: VRH Set VAP=???, VAN=-??? [0B] + (0xC4), 1, 0x20, //VDVS: VDV Set [20] + (0xC6), 1, 0x0F, //FRCTRL2: Frame Rate control in normal mode [0F] + (0xCA), 1, 0x0F, //REGSEL2 [0F] + (0xC8), 1, 0x08, //REGSEL1 [08] + (0x55), 1, 0x90, //WRCACE [00] + (0xD0), 2, 0xA4, 0xA1, //PWCTRL1: Power Control 1 [A4 A1] + (0xE0), 14, 0xD0, 0x00, 0x06, 0x09, 0x0B, 0x2A, 0x3C, 0x55, 0x4B, 0x08, 0x16, 0x14, 0x19, 0x20, //PVGAMCTRL: Positive Voltage Gamma control + (0xE1), 14, 0xD0, 0x00, 0x06, 0x09, 0x0B, 0x29, 0x36, 0x54, 0x4B, 0x0D, 0x16, 0x14, 0x21, 0x20, //NVGAMCTRL: Negative Voltage Gamma control + }; + table8_ads = ST7789_regValues, table_size = sizeof(ST7789_regValues); // + break; + + case 0x8031: //Unknown BangGood thanks PrinceCharles + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | REV_SCREEN; + static const uint8_t FK8031_regValues[] PROGMEM = { + // 0xF2:8.2 = SM, 0xF2:8.0 = REV. invertDisplay(), vertScroll() do not work + 0xF2,11, 0x16, 0x16, 0x03, 0x08, 0x08, 0x08, 0x08, 0x10, 0x04, 0x16, 0x16, // f.k. 0xF2:8.2 SM=1 + 0xFD, 3, 0x11, 0x02, 0x35, //f.k 0xFD:1.1 creates contiguous scan lins + }; + table8_ads = FK8031_regValues, table_size = sizeof(FK8031_regValues); + break; + +#ifdef SUPPORT_8347D + case 0x4747: //HX8347-D + _lcd_capable = REV_SCREEN | MIPI_DCS_REV1 | MV_AXIS | INVERT_SS | AUTO_READINC | READ_24BITS; + goto common_8347DGI; + case 0x6767: //HX8367-A + case 0x7575: //HX8347-G + case 0x9595: //HX8347-I + _lcd_capable = REV_SCREEN | MIPI_DCS_REV1 | MV_AXIS; + common_8347DGI: + is8347 = 1; + static const uint8_t HX8347G_2_regValues[] PROGMEM = { + 0xEA, 2, 0x00, 0x20, //PTBA[15:0] + 0xEC, 2, 0x0C, 0xC4, //STBA[15:0] + 0xE8, 1, 0x38, //OPON[7:0] + 0xE9, 1, 0x10, //OPON1[7:0] + 0xF1, 1, 0x01, //OTPS1B + 0xF2, 1, 0x10, //GEN + //Gamma 2.2 Setting + 0x40, 13, 0x01, 0x00, 0x00, 0x10, 0x0E, 0x24, 0x04, 0x50, 0x02, 0x13, 0x19, 0x19, 0x16, + 0x50, 14, 0x1B, 0x31, 0x2F, 0x3F, 0x3F, 0x3E, 0x2F, 0x7B, 0x09, 0x06, 0x06, 0x0C, 0x1D, 0xCC, + //Power Voltage Setting + 0x1B, 1, 0x1B, //VRH=4.65V + 0x1A, 1, 0x01, //BT (VGH~15V,VGL~-10V,DDVDH~5V) + 0x24, 1, 0x2F, //VMH(VCOM High voltage ~3.2V) + 0x25, 1, 0x57, //VML(VCOM Low voltage -1.2V) + //****VCOM offset**/// + 0x23, 1, 0x88, //for Flicker adjust //can reload from OTP + //Power on Setting + 0x18, 1, 0x34, //I/P_RADJ,N/P_RADJ, Normal mode 60Hz + 0x19, 1, 0x01, //OSC_EN='1', start Osc + 0x01, 1, 0x00, //DP_STB='0', out deep sleep + 0x1F, 1, 0x88, // GAS=1, VOMG=00, PON=0, DK=1, XDK=0, DVDH_TRI=0, STB=0 + TFTLCD_DELAY8, 5, + 0x1F, 1, 0x80, // GAS=1, VOMG=00, PON=0, DK=0, XDK=0, DVDH_TRI=0, STB=0 + TFTLCD_DELAY8, 3, + 0x1F, 1, 0x90, // GAS=1, VOMG=00, PON=1, DK=0, XDK=0, DVDH_TRI=0, STB=0 + TFTLCD_DELAY8, 5, + 0x1F, 1, 0xD0, // GAS=1, VOMG=10, PON=1, DK=0, XDK=0, DDVDH_TRI=0, STB=0 + TFTLCD_DELAY8, 5, + //262k/65k color selection + 0x17, 1, 0x05, //default 0x06 262k color // 0x05 65k color + //SET PANEL + 0x36, 1, 0x00, //SS_P, GS_P,REV_P,BGR_P + //Display ON Setting + 0x28, 1, 0x38, //GON=1, DTE=1, D=1000 + TFTLCD_DELAY8, 40, + 0x28, 1, 0x3F, //GON=1, DTE=1, D=1100 + + 0x16, 1, 0x18, + }; + init_table(HX8347G_2_regValues, sizeof(HX8347G_2_regValues)); + break; +#endif + +#ifdef SUPPORT_8352A + case 0x5252: //HX8352-A + _lcd_capable = MIPI_DCS_REV1 | MV_AXIS; + is8347 = 1; + static const uint8_t HX8352A_regValues[] PROGMEM = { + 0x83, 1, 0x02, //Test Mode: TESTM=1 + 0x85, 1, 0x03, //VDD ctl : VDC_SEL=3 [05] + 0x8B, 1, 0x01, //VGS_RES 1: RES_VGS1=1 + 0x8C, 1, 0x93, //VGS_RES 2: RES_VGS2=1, anon=0x13 [93] + 0x91, 1, 0x01, //PWM control: SYNC=1 + 0x83, 1, 0x00, //Test Mode: TESTM=0 + //Gamma Setting + 0x3E, 12, 0xB0, 0x03, 0x10, 0x56, 0x13, 0x46, 0x23, 0x76, 0x00, 0x5E, 0x4F, 0x40, + //Power Voltage Setting + 0x17, 1, 0x91, //OSC 1: RADJ=9, OSC_EN=1 [F0] + 0x2B, 1, 0xF9, //Cycle 1: N_DC=F9 [BE] + TFTLCD_DELAY8, 10, + 0x1B, 1, 0x14, //Power 3: BT=1, ??=1, AP=0 [42] + 0x1A, 1, 0x11, //Power 2: VC3=1, VC1=1 [05] + 0x1C, 1, 0x06, //Power 4: VRH=6 [0D] + 0x1F, 1, 0x42, //VCOM : VCM=42 [55] + TFTLCD_DELAY8, 20, + 0x19, 1, 0x0A, //Power 1: DK=1, VL_TR1=1 [09] + 0x19, 1, 0x1A, //Power 1: PON=1, DK=1, VL_TR1=1 [09] + TFTLCD_DELAY8, 40, + 0x19, 1, 0x12, //Power 1: PON=1, DK=1, STB=1 [09] + TFTLCD_DELAY8, 40, + 0x1E, 1, 0x27, //Power 6: VCOMG=1, VDV=7 [10] + TFTLCD_DELAY8, 100, + //Display ON Setting + 0x24, 1, 0x60, //Display 2: PT=1, GON=1 [A0] + 0x3D, 1, 0x40, //Source 1: N_SAP=40 [C0] + 0x34, 1, 0x38, //Cycle 10: EQS=0x38 [38] + 0x35, 1, 0x38, //Cycle 11: EQP=0x38 [38] + 0x24, 1, 0x38, //Display 2: GON=1 D=2 [A0] + TFTLCD_DELAY8, 40, + 0x24, 1, 0x3C, //Display 2: GON=1 D=3 [A0] + 0x16, 1, 0x1C, //Memaccess: GS=1, BGR=1, SS=1 + 0x01, 1, 0x06, //Disp Mode: INVON=1, NORON=1 [02] + 0x55, 1, 0x06, //SM_PANEL=0, SS_PANEL=0, GS_PANEL=1, REV_PANEL=1, BGR_PANEL=0 + }; + init_table(HX8352A_regValues, sizeof(HX8352A_regValues)); + p16 = (int16_t *) & HEIGHT; + *p16 = 400; + break; +#endif + +#ifdef SUPPORT_8352B + case 0x0065: //HX8352-B + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | REV_SCREEN; + is8347 = 1; + static const uint8_t HX8352B_regValues[] PROGMEM = { + // Register setting for EQ setting + 0xe5, 1, 0x10, // + 0xe7, 1, 0x10, // + 0xe8, 1, 0x48, // + 0xec, 1, 0x09, // + 0xed, 1, 0x6c, // + // Power on Setting + 0x23, 1, 0x6F, //VMF + 0x24, 1, 0x57, //VMH + 0x25, 1, 0x71, //VML + 0xE2, 1, 0x18, // + 0x1B, 1, 0x15, //VRH + 0x01, 1, 0x00, // + 0x1C, 1, 0x03, //AP=3 + // Power on sequence + 0x19, 1, 0x01, //OSCEN=1 + TFTLCD_DELAY8, 5, + 0x1F, 1, 0x8C, //GASEN=1, DK=1, XDK=1 + 0x1F, 1, 0x84, //GASEN=1, XDK=1 + TFTLCD_DELAY8, 10, + 0x1F, 1, 0x94, //GASEN=1, PON=1, XDK=1 + TFTLCD_DELAY8, 10, + 0x1F, 1, 0xD4, //GASEN=1, VCOMG=1, PON=1, XDK=1 + TFTLCD_DELAY8, 5, + // Gamma Setting + 0x40, 13, 0x00, 0x2B, 0x29, 0x3E, 0x3D, 0x3F, 0x24, 0x74, 0x08, 0x06, 0x07, 0x0D, 0x17, + 0x50, 13, 0x00, 0x02, 0x01, 0x16, 0x14, 0x3F, 0x0B, 0x5B, 0x08, 0x12, 0x18, 0x19, 0x17, + 0x5D, 1, 0xFF, // + + 0x16, 1, 0x08, //MemoryAccess BGR=1 + 0x28, 1, 0x20, //GON=1 + TFTLCD_DELAY8, 40, + 0x28, 1, 0x38, //GON=1, DTE=1, D=2 + TFTLCD_DELAY8, 40, + 0x28, 1, 0x3C, //GON=1, DTE=1, D=3 + + 0x02, 2, 0x00, 0x00, //SC + 0x04, 2, 0x00, 0xEF, //EC + 0x06, 2, 0x00, 0x00, //SP + 0x08, 2, 0x01, 0x8F, //EP + + 0x80, 2, 0x00, 0x00, //CAC + 0x82, 2, 0x00, 0x00, //RAC + 0x17, 1, 0x05, //COLMOD = 565 + + }; + init_table(HX8352B_regValues, sizeof(HX8352B_regValues)); + p16 = (int16_t *) & HEIGHT; + *p16 = 400; + break; +#endif + +#ifdef SUPPORT_8347A + case 0x8347: + _lcd_capable = REV_SCREEN | MIPI_DCS_REV1 | MV_AXIS; + // AN.01 The reference setting of CMO 3.2†Panel + static const uint8_t HX8347A_CMO32_regValues[] PROGMEM = { + // VENDOR Gamma for 3.2" + (0x46), 12, 0xA4, 0x53, 0x00, 0x44, 0x04, 0x67, 0x33, 0x77, 0x12, 0x4C, 0x46, 0x44, + // Display Setting + (0x01), 1, 0x06, // IDMON=0, INVON=1, NORON=1, PTLON=0 + (0x16), 1, 0x48, // MY=0, MX=0, MV=0, ML=1, BGR=0, TEON=0 + (0x23), 3, 0x95, 0x95, 0xFF, // N_DC=1001 0101, PI_DC=1001 0101, I_DC=1111 1111 + + (0x27), 4, 0x02, 0x02, 0x02, 0x02, // N_BP=2, N_FP=2, PI_BP=2, PI_FP=2 + (0x2C), 2, 0x02, 0x02, // I_BP=2, I_FP=2 + + (0x3a), 4, 0x01, 0x01, 0xF0, 0x00, // N_RTN=0, N_NW=1, P_RTN=0, P_NW=1, I_RTN=15, I_NW=0, DIV=0 + TFTLCD_DELAY8, 5, + (0x35), 2, 0x38, 0x78, // EQS=38h, EQP=78h + (0x3E), 1, 0x38, // SON=38h + (0x40), 2, 0x0F, 0xF0, // GDON=0Fh, GDOFF + // Power Supply Setting + (0x19), 1, 0x49, // CADJ=0100, CUADJ=100, OSD_EN=1 ,60Hz + (0x93), 1, 0x0F, // RADJ=1111, 100% + TFTLCD_DELAY8, 5, + (0x20), 1, 0x40, // BT=0100 + (0x1D), 3, 0x07, 0x00, 0x04, // VC1=7, VC3=0, VRH=?? + //VCOM SETTING for 3.2" + (0x44), 2, 0x4D, 0x11, // VCM=100 1101, VDV=1 0001 + TFTLCD_DELAY8, 10, + (0x1C), 1, 0x04, // AP=100 + TFTLCD_DELAY8, 20, + (0x1B), 1, 0x18, // GASENB=0, PON=0, DK=1, XDK=0, VLCD_TRI=0, STB=0 + TFTLCD_DELAY8, 40, + (0x1B), 1, 0x10, // GASENB=0, PON=1, DK=0, XDK=0, VLCD_TRI=0, STB=0 + TFTLCD_DELAY8, 40, + (0x43), 1, 0x80, //set VCOMG=1 + TFTLCD_DELAY8, 100, + // Display ON Setting + (0x90), 1, 0x7F, // SAP=0111 1111 + (0x26), 1, 0x04, //GON=0, DTE=0, D=01 + TFTLCD_DELAY8, 40, + (0x26), 1, 0x24, //GON=1, DTE=0, D=01 + (0x26), 1, 0x2C, //GON=1, DTE=0, D=11 + TFTLCD_DELAY8, 40, + (0x26), 1, 0x3C, //GON=1, DTE=1, D=11 + // INTERNAL REGISTER SETTING + (0x57), 1, 0x02, // TEST_Mode=1: into TEST mode + (0x55), 1, 0x00, // VDC_SEL=000, VDDD=1.95V + (0xFE), 1, 0x5A, // For ESD protection + (0x57), 1, 0x00, // TEST_Mode=0: exit TEST mode + }; + // AN.01 The reference setting of CMO 2.4†Panel + static const uint8_t HX8347A_CMO24_regValues[] PROGMEM = { + // VENDOR Gamma for 2.4" + (0x46), 12, 0x94, 0x41, 0x00, 0x33, 0x23, 0x45, 0x44, 0x77, 0x12, 0xCC, 0x46, 0x82, + // Display Setting + (0x01), 1, 0x06, // IDMON=0, INVON=1, NORON=1, PTLON=0 + (0x16), 1, 0x48, // MY=0, MX=0, MV=0, ML=1, BGR=0, TEON=0 + (0x23), 3, 0x95, 0x95, 0xFF, // N_DC=1001 0101, PI_DC=1001 0101, I_DC=1111 1111 + + (0x27), 4, 0x02, 0x02, 0x02, 0x02, // N_BP=2, N_FP=2, PI_BP=2, PI_FP=2 + (0x2C), 2, 0x02, 0x02, // I_BP=2, I_FP=2 + + (0x3a), 4, 0x01, 0x01, 0xF0, 0x00, // N_RTN=0, N_NW=1, P_RTN=0, P_NW=1, I_RTN=15, I_NW=0, DIV=0 + TFTLCD_DELAY8, 5, + (0x35), 2, 0x38, 0x78, // EQS=38h, EQP=78h + (0x3E), 1, 0x38, // SON=38h + (0x40), 2, 0x0F, 0xF0, // GDON=0Fh, GDOFF + // Power Supply Setting + (0x19), 1, 0x49, // CADJ=0100, CUADJ=100, OSD_EN=1 ,60Hz + (0x93), 1, 0x0F, // RADJ=1111, 100% + TFTLCD_DELAY8, 5, + (0x20), 1, 0x40, // BT=0100 + (0x1D), 3, 0x07, 0x00, 0x04, // VC1=7, VC3=0, VRH=?? + //VCOM SETTING for 2.4" + (0x44), 2, 0x40, 0x12, // VCM=100 0000, VDV=1 0001 + TFTLCD_DELAY8, 10, + (0x1C), 1, 0x04, // AP=100 + TFTLCD_DELAY8, 20, + (0x1B), 1, 0x18, // GASENB=0, PON=0, DK=1, XDK=0, VLCD_TRI=0, STB=0 + TFTLCD_DELAY8, 40, + (0x1B), 1, 0x10, // GASENB=0, PON=1, DK=0, XDK=0, VLCD_TRI=0, STB=0 + TFTLCD_DELAY8, 40, + (0x43), 1, 0x80, //set VCOMG=1 + TFTLCD_DELAY8, 100, + // Display ON Setting + (0x90), 1, 0x7F, // SAP=0111 1111 + (0x26), 1, 0x04, //GON=0, DTE=0, D=01 + TFTLCD_DELAY8, 40, + (0x26), 1, 0x24, //GON=1, DTE=0, D=01 + (0x26), 1, 0x2C, //GON=1, DTE=0, D=11 + TFTLCD_DELAY8, 40, + (0x26), 1, 0x3C, //GON=1, DTE=1, D=11 + // INTERNAL REGISTER SETTING + (0x57), 1, 0x02, // TEST_Mode=1: into TEST mode + (0x55), 1, 0x00, // VDC_SEL=000, VDDD=1.95V + (0xFE), 1, 0x5A, // For ESD protection + (0x57), 1, 0x00, // TEST_Mode=0: exit TEST mode + }; + static const uint8_t HX8347A_ITDB02_regValues[] PROGMEM = { + // VENDOR Gamma ITDB02 same as CMO32. Delays are shorter than AN01 + (0x46), 12, 0xA4, 0x53, 0x00, 0x44, 0x04, 0x67, 0x33, 0x77, 0x12, 0x4C, 0x46, 0x44, + // Display Setting + (0x01), 1, 0x06, // IDMON=0, INVON=1, NORON=1, PTLON=0 + (0x16), 1, 0xC8, // MY=0, MX=0, MV=0, ML=1, BGR=0, TEON=0 .itead + (0x23), 3, 0x95, 0x95, 0xFF, // N_DC=1001 0101, PI_DC=1001 0101, I_DC=1111 1111 + + (0x27), 4, 0x02, 0x02, 0x02, 0x02, // N_BP=2, N_FP=2, PI_BP=2, PI_FP=2 + (0x2C), 2, 0x02, 0x02, // I_BP=2, I_FP=2 + + (0x3a), 4, 0x01, 0x00, 0xF0, 0x00, // N_RTN=0, N_NW=1, P_RTN=0, ?? P_NW=1, I_RTN=15, I_NW=0, DIV=0 .itead + TFTLCD_DELAY8, 5, + (0x35), 2, 0x38, 0x78, // EQS=38h, EQP=78h + (0x3E), 1, 0x38, // SON=38h + (0x40), 2, 0x0F, 0xF0, // GDON=0Fh, GDOFF + // Power Supply Setting + (0x19), 1, 0x49, // CADJ=0100, CUADJ=100, OSD_EN=1 ,60Hz + (0x93), 1, 0x0F, // RADJ=1111, 100% + TFTLCD_DELAY8, 5, + (0x20), 1, 0x40, // BT=0100 + (0x1D), 3, 0x07, 0x00, 0x04, // VC1=7, VC3=0, VRH=?? + //VCOM SETTING for ITDB02 + (0x44), 2, 0x4D, 0x0E, // VCM=101 0000 4D, VDV=1 0001 .itead + TFTLCD_DELAY8, 5, + (0x1C), 1, 0x04, // AP=100 + TFTLCD_DELAY8, 5, + (0x1B), 1, 0x18, // GASENB=0, PON=0, DK=1, XDK=0, VLCD_TRI=0, STB=0 + TFTLCD_DELAY8, 5, + (0x1B), 1, 0x10, // GASENB=0, PON=1, DK=0, XDK=0, VLCD_TRI=0, STB=0 + TFTLCD_DELAY8, 5, + (0x43), 1, 0x80, //set VCOMG=1 + TFTLCD_DELAY8, 5, + // Display ON Setting + (0x90), 1, 0x7F, // SAP=0111 1111 + (0x26), 1, 0x04, //GON=0, DTE=0, D=01 + TFTLCD_DELAY8, 5, + (0x26), 1, 0x24, //GON=1, DTE=0, D=01 + (0x26), 1, 0x2C, //GON=1, DTE=0, D=11 + TFTLCD_DELAY8, 5, + (0x26), 1, 0x3C, //GON=1, DTE=1, D=11 + // INTERNAL REGISTER SETTING for ITDB02 + (0x57), 1, 0x02, // TEST_Mode=1: into TEST mode + (0x95), 1, 0x01, // SET DISPLAY CLOCK AND PUMPING CLOCK TO SYNCHRONIZE .itead + (0x57), 1, 0x00, // TEST_Mode=0: exit TEST mode + }; + static const uint8_t HX8347A_NHD_regValues[] PROGMEM = { + //Gamma Setting NHD + (0x46), 12, 0x94, 0x41, 0x00, 0x33, 0x23, 0x45, 0x44, 0x77, 0x12, 0xCC, 0x46, 0x82, + (0x01), 1, 0x06, //Display Mode [06] + (0x16), 1, 0xC8, //MADCTL [00] MY=1, MX=1, BGR=1 +// (0x70), 1, 0x05, //Panel [06] 16-bit + (0x23), 3, 0x95, 0x95, 0xFF, //Cycle Control 1-3 [95 95 FF] + (0x27), 4, 0x02, 0x02, 0x02, 0x02, //Display Control 2-5 [02 02 02 02] + (0x2C), 2, 0x02, 0x02, //Display Control 6-7 [02 02] + (0x3A), 4, 0x01, 0x01, 0xF0, 0x00, //Cycle Control 1-4 [01 01 F0 00] + TFTLCD_DELAY8, 80, + (0x35), 2, 0x38, 0x78, //Display Control 9-10 [09 09] EQS=56, EQP=120 + (0x3E), 1, 0x38, //Cycle Control 5 [38] + (0x40), 1, 0x0F, //Cycle Control 6 [03] GDON=15 + (0x41), 1, 0xF0, //Cycle Control 14 [F8] GDOF=248 + + (0x19), 1, 0x2D, //OSC Control 1 [86] CADJ=2, CUADJ=6, OSCEN=1 + (0x93), 1, 0x06, //SAP Idle mode [00] ??? .nhd + TFTLCD_DELAY8, 80, + (0x20), 1, 0x40, //Power Control 6 [40] + (0x1D), 3, 0x07, 0x00, 0x04, //Power Control 3-5 [04 00 06] VC=7 + (0x44), 2, 0x3C, 0x12, //VCOM Control 2-3 [5A 11] VCM=60, VDV=18 + TFTLCD_DELAY8, 80, + (0x1C), 1, 0x04, //Power Control 2 [04] + TFTLCD_DELAY8, 80, + (0x43), 1, 0x80, //VCOM Control 1 [80] + TFTLCD_DELAY8, 80, + (0x1B), 1, 0x08, //Power Control 1 [00] DK=1 + TFTLCD_DELAY8, 80, + (0x1B), 1, 0x10, //Power Control 1 [00] PON=1 + TFTLCD_DELAY8, 80, + (0x90), 1, 0x7F, //Display Control 8 [0A] + (0x26), 1, 0x04, //Display Control 1 [A0] D=1 + TFTLCD_DELAY8, 80, + (0x26), 1, 0x24, //Display Control 1 [A0] GON=1, D=1 + (0x26), 1, 0x2C, //Display Control 1 [A0] GON=1, D=3 + TFTLCD_DELAY8, 80, + (0x26), 1, 0x3C, //Display Control 1 [A0] GON=1, DTE=1, D=3 + (0x57), 1, 0x02, //? + (0x55), 1, 0x00, //? + (0x57), 1, 0x00, //? + }; + // Atmel ASF code uses VCOM2-3: 0x38, 0x12. 50ms delays and no TEST mode changes. + init_table(HX8347A_NHD_regValues, sizeof(HX8347A_NHD_regValues)); + // init_table(HX8347A_CMO32_regValues, sizeof(HX8347A_CMO32_regValues)); + // init_table(HX8347A_CMO24_regValues, sizeof(HX8347A_CMO24_regValues)); + // init_table(HX8347A_ITDB02_regValues, sizeof(HX8347A_ITDB02_regValues)); + // init_table(HX8347G_2_regValues, sizeof(HX8347G_2_regValues)); + break; +#endif + + case 0x8357: //BIG CHANGE: HX8357-B is now 0x8357 + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | REV_SCREEN; + goto common_8357; + case 0x9090: //BIG CHANGE: HX8357-D was 0x8357 + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | REV_SCREEN | READ_24BITS; + common_8357: + static const uint8_t HX8357C_regValues[] PROGMEM = { + TFTLCD_DELAY8, 1, //dummy table + }; + table8_ads = HX8357C_regValues, table_size = sizeof(HX8357C_regValues); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; + + case 0x0099: //HX8357-D matches datasheet + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | REV_SCREEN | READ_24BITS; + static const uint8_t HX8357_99_regValues[] PROGMEM = { + (0xB9), 3, 0xFF, 0x83, 0x57, // SETEXTC + TFTLCD_DELAY8, 150, + TFTLCD_DELAY8, 150, + (0xB6), 1, 0x25, // SETCOM [4B 00] -2.5V+37*0.02V=-1.76V [-1.00V] + (0xC0), 6, 0x50, 0x50, 0x01, 0x3C, 0x1E, 0x08, // SETSTBA [73 50 00 3C C4 08] + (0xB4), 7, 0x02, 0x40, 0x00, 0x2A, 0x2A, 0x0D, 0x78, // SETCYC [02 40 00 2A 2A 0D 96] +#ifdef SUPPORT_8357D_GAMMA + // HX8357D_SETGAMMA [0B 0C 11 1D 25 37 43 4B 4E 47 41 39 35 31 2E 21 1C 1D 1D 26 31 44 4E 56 44 3F 39 33 31 2E 28 1D E0 01] + (0xE0),34, 0x02, 0x0A, 0x11, 0x1D, 0x23, 0x35, 0x41, 0x4B, 0x4B, 0x42, 0x3A, 0x27, 0x1B, 0x08, 0x09, 0x03, 0x02, 0x0A, 0x11, 0x1D, 0x23, 0x35, 0x41, 0x4B, 0x4B, 0x42, 0x3A, 0x27, 0x1B, 0x08, 0x09, 0x03, 0x00, 0x01, +#endif + }; + table8_ads = HX8357_99_regValues, table_size = sizeof(HX8357_99_regValues); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; + +#ifdef SUPPORT_8230 + case 0x8230: //thanks Auzman + _lcd_capable = 0 | REV_SCREEN | INVERT_GS | INVERT_RGB | READ_BGR; + static const uint16_t UC8230_regValues[] PROGMEM = { + //After pin Reset wait at least 100ms + TFTLCD_DELAY, 100, //at least 100ms + 0x0046, 0x0002, //MTP Disable + 0x0010, 0x1590, //SAP=1, BT=5, APE=1, AP=1 + 0x0011, 0x0227, //DC1=2, DC0=2, VC=7 + 0x0012, 0x80ff, //P5VMD=1, PON=7, VRH=15 + 0x0013, 0x9c31, //VDV=28, VCM=49 + TFTLCD_DELAY, 10, //at least 10ms + 0x0002, 0x0300, //set N-line = 1 + 0x0003, 0x1030, //set GRAM writing direction & BGR=1 + 0x0060, 0xa700, //GS; gate scan: start position & drive line Q'ty + 0x0061, 0x0001, //REV, NDL, VLE + /*--------------------Gamma control------------------------*/ + 0x0030, 0x0303, + 0x0031, 0x0303, + 0x0032, 0x0303, + 0x0033, 0x0300, + 0x0034, 0x0003, + 0x0035, 0x0303, + 0x0036, 0x1400, + 0x0037, 0x0303, + 0x0038, 0x0303, + 0x0039, 0x0303, + 0x003a, 0x0300, + 0x003b, 0x0003, + 0x003c, 0x0303, + 0x003d, 0x1400, + //-----------------------------------------------------------// + 0x0020, 0x0000, //GRAM horizontal address + 0x0021, 0x0000, //GRAM vertical address + //************** Partial Display control*********************// + 0x0080, 0x0000, + 0x0081, 0x0000, + 0x0082, 0x0000, + 0x0083, 0x0000, + 0x0084, 0x0000, + 0x0085, 0x0000, + //-----------------------------------------------------------// + 0x0092, 0x0200, + 0x0093, 0x0303, + 0x0090, 0x0010, //set clocks/Line + 0x0000, 0x0001, + TFTLCD_DELAY, 200, // Delay 200 ms + 0x0007, 0x0173, //Display on setting + }; + init_table16(UC8230_regValues, sizeof(UC8230_regValues)); + break; +#endif + +#ifdef SUPPORT_9163 + case 0x9163: // + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; + static const uint8_t PROGMEM table9163C[] = { + // (COMMAND_BYTE), n, data_bytes.... + 0x26, 1, 0x02, // [01] GAMMASET use CURVE=1, 2, 4, 8 + 0xB1, 2, 0x08, 0x02, // [0E 14] FRMCTR1 if GM==011 61.7Hz + 0xB4, 1, 0x07, // [02] INVCTR + 0xB8, 1, 0x01, // [00] GSCTRL + 0xC0, 2, 0x0A, 0x02, // [0A 05] PWCTR1 if LCM==10 + 0xC1, 1, 0x02, // [07] PWCTR2 + 0xC5, 2, 0x50, 0x63, // [43 4D] VMCTR1 + 0xC7, 1, 0, // [40] VCOMOFFS + }; + table8_ads = table9163C, table_size = sizeof(table9163C); // + p16 = (int16_t *) & HEIGHT; + *p16 = 160; + p16 = (int16_t *) & WIDTH; + *p16 = 128; + break; +#endif + +#ifdef SUPPORT_9225 +#define ILI9225_DRIVER_OUTPUT_CTRL (0x01u) // Driver Output Control +#define ILI9225_LCD_AC_DRIVING_CTRL (0x02u) // LCD AC Driving Control +#define ILI9225_ENTRY_MODE (0x03u) // Entry Mode +#define ILI9225_DISP_CTRL1 (0x07u) // Display Control 1 +#define ILI9225_BLANK_PERIOD_CTRL1 (0x08u) // Blank Period Control +#define ILI9225_FRAME_CYCLE_CTRL (0x0Bu) // Frame Cycle Control +#define ILI9225_INTERFACE_CTRL (0x0Cu) // Interface Control +#define ILI9225_OSC_CTRL (0x0Fu) // Osc Control +#define ILI9225_POWER_CTRL1 (0x10u) // Power Control 1 +#define ILI9225_POWER_CTRL2 (0x11u) // Power Control 2 +#define ILI9225_POWER_CTRL3 (0x12u) // Power Control 3 +#define ILI9225_POWER_CTRL4 (0x13u) // Power Control 4 +#define ILI9225_POWER_CTRL5 (0x14u) // Power Control 5 +#define ILI9225_VCI_RECYCLING (0x15u) // VCI Recycling +#define ILI9225_RAM_ADDR_SET1 (0x20u) // Horizontal GRAM Address Set +#define ILI9225_RAM_ADDR_SET2 (0x21u) // Vertical GRAM Address Set +#define ILI9225_GRAM_DATA_REG (0x22u) // GRAM Data Register +#define ILI9225_GATE_SCAN_CTRL (0x30u) // Gate Scan Control Register +#define ILI9225_VERTICAL_SCROLL_CTRL1 (0x31u) // Vertical Scroll Control 1 Register +#define ILI9225_VERTICAL_SCROLL_CTRL2 (0x32u) // Vertical Scroll Control 2 Register +#define ILI9225_VERTICAL_SCROLL_CTRL3 (0x33u) // Vertical Scroll Control 3 Register +#define ILI9225_PARTIAL_DRIVING_POS1 (0x34u) // Partial Driving Position 1 Register +#define ILI9225_PARTIAL_DRIVING_POS2 (0x35u) // Partial Driving Position 2 Register +#define ILI9225_HORIZONTAL_WINDOW_ADDR1 (0x36u) // Horizontal Address END Position HEA +#define ILI9225_HORIZONTAL_WINDOW_ADDR2 (0x37u) // Horizontal Address START Position HSA +#define ILI9225_VERTICAL_WINDOW_ADDR1 (0x38u) // Vertical Address END Position VEA +#define ILI9225_VERTICAL_WINDOW_ADDR2 (0x39u) // Vertical Address START Position VSA +#define ILI9225_GAMMA_CTRL1 (0x50u) // Gamma Control 1 +#define ILI9225_GAMMA_CTRL2 (0x51u) // Gamma Control 2 +#define ILI9225_GAMMA_CTRL3 (0x52u) // Gamma Control 3 +#define ILI9225_GAMMA_CTRL4 (0x53u) // Gamma Control 4 +#define ILI9225_GAMMA_CTRL5 (0x54u) // Gamma Control 5 +#define ILI9225_GAMMA_CTRL6 (0x55u) // Gamma Control 6 +#define ILI9225_GAMMA_CTRL7 (0x56u) // Gamma Control 7 +#define ILI9225_GAMMA_CTRL8 (0x57u) // Gamma Control 8 +#define ILI9225_GAMMA_CTRL9 (0x58u) // Gamma Control 9 +#define ILI9225_GAMMA_CTRL10 (0x59u) // Gamma Control 10 + +#define ILI9225C_INVOFF 0x20 +#define ILI9225C_INVON 0x21 + + case 0x6813: + case 0x9226: + _lcd_ID = 0x9225; //fall through + case 0x9225: + _lcd_capable = REV_SCREEN | READ_BGR; //thanks tongbajiel + static const uint16_t ILI9225_regValues[] PROGMEM = { + /* Start Initial Sequence */ + /* Set SS bit and direction output from S528 to S1 */ + ILI9225_POWER_CTRL1, 0x0000, // Set SAP,DSTB,STB + ILI9225_POWER_CTRL2, 0x0000, // Set APON,PON,AON,VCI1EN,VC + ILI9225_POWER_CTRL3, 0x0000, // Set BT,DC1,DC2,DC3 + ILI9225_POWER_CTRL4, 0x0000, // Set GVDD + ILI9225_POWER_CTRL5, 0x0000, // Set VCOMH/VCOML voltage + TFTLCD_DELAY, 40, + + // Power-on sequence + ILI9225_POWER_CTRL2, 0x0018, // Set APON,PON,AON,VCI1EN,VC + ILI9225_POWER_CTRL3, 0x6121, // Set BT,DC1,DC2,DC3 + ILI9225_POWER_CTRL4, 0x006F, // Set GVDD /*007F 0088 */ + ILI9225_POWER_CTRL5, 0x495F, // Set VCOMH/VCOML voltage + ILI9225_POWER_CTRL1, 0x0800, // Set SAP,DSTB,STB + TFTLCD_DELAY, 10, + ILI9225_POWER_CTRL2, 0x103B, // Set APON,PON,AON,VCI1EN,VC + TFTLCD_DELAY, 50, + + ILI9225_DRIVER_OUTPUT_CTRL, 0x011C, // set the display line number and display direction + ILI9225_LCD_AC_DRIVING_CTRL, 0x0100, // set 1 line inversion + ILI9225_ENTRY_MODE, 0x1030, // set GRAM write direction and BGR=1. + ILI9225_DISP_CTRL1, 0x0000, // Display off + ILI9225_BLANK_PERIOD_CTRL1, 0x0808, // set the back porch and front porch + ILI9225_FRAME_CYCLE_CTRL, 0x1100, // set the clocks number per line + ILI9225_INTERFACE_CTRL, 0x0000, // CPU interface + ILI9225_OSC_CTRL, 0x0D01, // Set Osc /*0e01*/ + ILI9225_VCI_RECYCLING, 0x0020, // Set VCI recycling + ILI9225_RAM_ADDR_SET1, 0x0000, // RAM Address + ILI9225_RAM_ADDR_SET2, 0x0000, // RAM Address + + /* Set GRAM area */ + ILI9225_GATE_SCAN_CTRL, 0x0000, + ILI9225_VERTICAL_SCROLL_CTRL1, 0x00DB, + ILI9225_VERTICAL_SCROLL_CTRL2, 0x0000, + ILI9225_VERTICAL_SCROLL_CTRL3, 0x0000, + ILI9225_PARTIAL_DRIVING_POS1, 0x00DB, + ILI9225_PARTIAL_DRIVING_POS2, 0x0000, + ILI9225_HORIZONTAL_WINDOW_ADDR1, 0x00AF, + ILI9225_HORIZONTAL_WINDOW_ADDR2, 0x0000, + ILI9225_VERTICAL_WINDOW_ADDR1, 0x00DB, + ILI9225_VERTICAL_WINDOW_ADDR2, 0x0000, + + /* Set GAMMA curve */ + ILI9225_GAMMA_CTRL1, 0x0000, + ILI9225_GAMMA_CTRL2, 0x0808, + ILI9225_GAMMA_CTRL3, 0x080A, + ILI9225_GAMMA_CTRL4, 0x000A, + ILI9225_GAMMA_CTRL5, 0x0A08, + ILI9225_GAMMA_CTRL6, 0x0808, + ILI9225_GAMMA_CTRL7, 0x0000, + ILI9225_GAMMA_CTRL8, 0x0A00, + ILI9225_GAMMA_CTRL9, 0x0710, + ILI9225_GAMMA_CTRL10, 0x0710, + + ILI9225_DISP_CTRL1, 0x0012, + TFTLCD_DELAY, 50, + ILI9225_DISP_CTRL1, 0x1017, + }; + init_table16(ILI9225_regValues, sizeof(ILI9225_regValues)); + p16 = (int16_t *) & HEIGHT; + *p16 = 220; + p16 = (int16_t *) & WIDTH; + *p16 = 176; + break; +#endif + + case 0x0001: + _lcd_capable = 0 | REV_SCREEN | INVERT_GS; //no RGB bug. thanks Ivo_Deshev + goto common_9320; + case 0x5408: + _lcd_capable = 0 | REV_SCREEN | READ_BGR; //Red 2.4" thanks jorgenv, Ardlab_Gent +// _lcd_capable = 0 | REV_SCREEN | READ_BGR | INVERT_GS; //Blue 2.8" might be different + goto common_9320; + case 0x1505: //R61505 thanks Ravi_kanchan2004. R61505V, R61505W different + case 0x9320: + _lcd_capable = 0 | REV_SCREEN | READ_BGR; + common_9320: + static const uint16_t ILI9320_regValues[] PROGMEM = { + 0x00e5, 0x8000, + 0x0000, 0x0001, + 0x0001, 0x100, + 0x0002, 0x0700, + 0x0003, 0x1030, + 0x0004, 0x0000, + 0x0008, 0x0202, + 0x0009, 0x0000, + 0x000A, 0x0000, + 0x000C, 0x0000, + 0x000D, 0x0000, + 0x000F, 0x0000, + //-----Power On sequence----------------------- + 0x0010, 0x0000, + 0x0011, 0x0007, + 0x0012, 0x0000, + 0x0013, 0x0000, + TFTLCD_DELAY, 50, + 0x0010, 0x17B0, //SAP=1, BT=7, APE=1, AP=3 + 0x0011, 0x0007, //DC1=0, DC0=0, VC=7 + TFTLCD_DELAY, 10, + 0x0012, 0x013A, //VCMR=1, PON=3, VRH=10 + TFTLCD_DELAY, 10, + 0x0013, 0x1A00, //VDV=26 + 0x0029, 0x000c, //VCM=12 + TFTLCD_DELAY, 10, + //-----Gamma control----------------------- + 0x0030, 0x0000, + 0x0031, 0x0505, + 0x0032, 0x0004, + 0x0035, 0x0006, + 0x0036, 0x0707, + 0x0037, 0x0105, + 0x0038, 0x0002, + 0x0039, 0x0707, + 0x003C, 0x0704, + 0x003D, 0x0807, + //-----Set RAM area----------------------- + 0x0060, 0xA700, //GS=1 + 0x0061, 0x0001, + 0x006A, 0x0000, + 0x0021, 0x0000, + 0x0020, 0x0000, + //-----Partial Display Control------------ + 0x0080, 0x0000, + 0x0081, 0x0000, + 0x0082, 0x0000, + 0x0083, 0x0000, + 0x0084, 0x0000, + 0x0085, 0x0000, + //-----Panel Control---------------------- + 0x0090, 0x0010, + 0x0092, 0x0000, + 0x0093, 0x0003, + 0x0095, 0x0110, + 0x0097, 0x0000, + 0x0098, 0x0000, + //-----Display on----------------------- + 0x0007, 0x0173, + TFTLCD_DELAY, 50, + }; + init_table16(ILI9320_regValues, sizeof(ILI9320_regValues)); + break; + case 0x6809: + _lcd_capable = 0 | REV_SCREEN | INVERT_GS | AUTO_READINC; + goto common_93x5; + case 0x9328: + case 0x9325: + _lcd_capable = 0 | REV_SCREEN | INVERT_GS; + goto common_93x5; + case 0x9331: + case 0x9335: + _lcd_capable = 0 | REV_SCREEN; + common_93x5: + static const uint16_t ILI9325_regValues[] PROGMEM = { + 0x00E5, 0x78F0, // set SRAM internal timing + 0x0001, 0x0100, // set Driver Output Control + 0x0002, 0x0200, // set 1 line inversion + 0x0003, 0x1030, // set GRAM write direction and BGR=1. + 0x0004, 0x0000, // Resize register + 0x0005, 0x0000, // .kbv 16bits Data Format Selection + 0x0008, 0x0207, // set the back porch and front porch + 0x0009, 0x0000, // set non-display area refresh cycle ISC[3:0] + 0x000A, 0x0000, // FMARK function + 0x000C, 0x0000, // RGB interface setting + 0x000D, 0x0000, // Frame marker Position + 0x000F, 0x0000, // RGB interface polarity + // ----------- Power On sequence ----------- // + 0x0010, 0x0000, // SAP, BT[3:0], AP, DSTB, SLP, STB + 0x0011, 0x0007, // DC1[2:0], DC0[2:0], VC[2:0] + 0x0012, 0x0000, // VREG1OUT voltage + 0x0013, 0x0000, // VDV[4:0] for VCOM amplitude + 0x0007, 0x0001, + TFTLCD_DELAY, 200, // Dis-charge capacitor power voltage + 0x0010, 0x1690, // SAP=1, BT=6, APE=1, AP=1, DSTB=0, SLP=0, STB=0 + 0x0011, 0x0227, // DC1=2, DC0=2, VC=7 + TFTLCD_DELAY, 50, // wait_ms 50ms + 0x0012, 0x000D, // VCIRE=1, PON=0, VRH=5 + TFTLCD_DELAY, 50, // wait_ms 50ms + 0x0013, 0x1200, // VDV=28 for VCOM amplitude + 0x0029, 0x000A, // VCM=10 for VCOMH + 0x002B, 0x000D, // Set Frame Rate + TFTLCD_DELAY, 50, // wait_ms 50ms + 0x0020, 0x0000, // GRAM horizontal Address + 0x0021, 0x0000, // GRAM Vertical Address + // ----------- Adjust the Gamma Curve ----------// + + 0x0030, 0x0000, + 0x0031, 0x0404, + 0x0032, 0x0003, + 0x0035, 0x0405, + 0x0036, 0x0808, + 0x0037, 0x0407, + 0x0038, 0x0303, + 0x0039, 0x0707, + 0x003C, 0x0504, + 0x003D, 0x0808, + + //------------------ Set GRAM area ---------------// + 0x0060, 0x2700, // Gate Scan Line GS=0 [0xA700] + 0x0061, 0x0001, // NDL,VLE, REV .kbv + 0x006A, 0x0000, // set scrolling line + //-------------- Partial Display Control ---------// + 0x0080, 0x0000, + 0x0081, 0x0000, + 0x0082, 0x0000, + 0x0083, 0x0000, + 0x0084, 0x0000, + 0x0085, 0x0000, + //-------------- Panel Control -------------------// + 0x0090, 0x0010, + 0x0092, 0x0000, + 0x0007, 0x0133, // 262K color and display ON + }; + init_table16(ILI9325_regValues, sizeof(ILI9325_regValues)); + break; + +#if defined(SUPPORT_9326_5420) + case 0x5420: + case 0x9326: + _lcd_capable = REV_SCREEN | READ_BGR; + static const uint16_t ILI9326_CPT28_regValues[] PROGMEM = { +//************* Start Initial Sequence **********// + 0x0702, 0x3008, // Set internal timing, don’t change this value + 0x0705, 0x0036, // Set internal timing, don’t change this value + 0x070B, 0x1213, // Set internal timing, don’t change this value + 0x0001, 0x0100, // set SS and SM bit + 0x0002, 0x0100, // set 1 line inversion + 0x0003, 0x1030, // set GRAM write direction and BGR=1. + 0x0008, 0x0202, // set the back porch and front porch + 0x0009, 0x0000, // set non-display area refresh cycle ISC[3:0] + 0x000C, 0x0000, // RGB interface setting + 0x000F, 0x0000, // RGB interface polarity +//*************Power On sequence ****************// + 0x0100, 0x0000, // SAP, BT[3:0], AP, DSTB, SLP, STB + 0x0102, 0x0000, // VREG1OUT voltage + 0x0103, 0x0000, // VDV[4:0] for VCOM amplitude + TFTLCD_DELAY, 200, // Dis-charge capacitor power voltage + 0x0100, 0x1190, // SAP, BT[3:0], AP, DSTB, SLP, STB + 0x0101, 0x0227, // DC1[2:0], DC0[2:0], VC[2:0] + TFTLCD_DELAY, 50, // Delay 50ms + 0x0102, 0x01BD, // VREG1OUT voltage + TFTLCD_DELAY, 50, // Delay 50ms + 0x0103, 0x2D00, // VDV[4:0] for VCOM amplitude + 0x0281, 0x000E, // VCM[5:0] for VCOMH + TFTLCD_DELAY, 50, // + 0x0200, 0x0000, // GRAM horizontal Address + 0x0201, 0x0000, // GRAM Vertical Address +// ----------- Adjust the Gamma Curve ----------// + 0x0300, 0x0000, // + 0x0301, 0x0707, // + 0x0302, 0x0606, // + 0x0305, 0x0000, // + 0x0306, 0x0D00, // + 0x0307, 0x0706, // + 0x0308, 0x0005, // + 0x0309, 0x0007, // + 0x030C, 0x0000, // + 0x030D, 0x000A, // +//------------------ Set GRAM area ---------------// + 0x0400, 0x3100, // Gate Scan Line 400 lines + 0x0401, 0x0001, // NDL,VLE, REV + 0x0404, 0x0000, // set scrolling line +//-------------- Partial Display Control ---------// + 0x0500, 0x0000, // Partial Image 1 Display Position + 0x0501, 0x0000, // Partial Image 1 RAM Start/End Address + 0x0502, 0x0000, // Partial Image 1 RAM Start/End Address + 0x0503, 0x0000, // Partial Image 2 Display Position + 0x0504, 0x0000, // Partial Image 2 RAM Start/End Address + 0x0505, 0x0000, // Partial Image 2 RAM Start/End Address +//-------------- Panel Control -------------------// + 0x0010, 0x0010, // DIVI[1:0];RTNI[4:0] + 0x0011, 0x0600, // NOWI[2:0];SDTI[2:0] + 0x0020, 0x0002, // DIVE[1:0];RTNE[5:0] + 0x0007, 0x0173, // 262K color and display ON + }; + init_table16(ILI9326_CPT28_regValues, sizeof(ILI9326_CPT28_regValues)); + p16 = (int16_t *) & HEIGHT; + *p16 = 400; + p16 = (int16_t *) & WIDTH; + *p16 = 240; + break; +#endif + + case 0x9327: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS; + static const uint8_t ILI9327_regValues[] PROGMEM = { + 0xB0, 1, 0x00, //Disable Protect for cmds B1-DF, E0-EF, F0-FF + // 0xE0, 1, 0x20, //NV Memory Write [00] + // 0xD1, 3, 0x00, 0x71, 0x19, //VCOM control [00 40 0F] + // 0xD0, 3, 0x07, 0x01, 0x08, //Power Setting [07 04 8C] + 0xC1, 4, 0x10, 0x10, 0x02, 0x02, //Display Timing [10 10 02 02] + 0xC0, 6, 0x00, 0x35, 0x00, 0x00, 0x01, 0x02, //Panel Drive [00 35 00 00 01 02 REV=0,GS=0,SS=0 + 0xC5, 1, 0x04, //Frame Rate [04] + 0xD2, 2, 0x01, 0x04, //Power Setting [01 44] + // 0xC8, 15, 0x04, 0x67, 0x35, 0x04, 0x08, 0x06, 0x24, 0x01, 0x37, 0x40, 0x03, 0x10, 0x08, 0x80, 0x00, + // 0xC8, 15, 0x00, 0x77, 0x77, 0x04, 0x04, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0xCA, 1, 0x00, //DGC LUT ??? + 0xEA, 1, 0x80, //3-Gamma Function Enable + // 0xB0, 1, 0x03, //Enable Protect + }; + table8_ads = ILI9327_regValues, table_size = sizeof(ILI9327_regValues); + p16 = (int16_t *) & HEIGHT; + *p16 = 400; + p16 = (int16_t *) & WIDTH; + *p16 = 240; + break; + case 0x1602: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS; //does not readGRAM + static const uint8_t XX1602_regValues[] PROGMEM = { + 0xB8, 1, 0x01, //GS [00] + 0xC0, 1, 0x0E, //??Power [0A] + }; + table8_ads = XX1602_regValues, table_size = sizeof(XX1602_regValues); + break; + + case 0x2053: //weird from BangGood + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | REV_SCREEN | READ_BGR; + goto common_9329; + case 0xAC11: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | REV_SCREEN; //thanks viliam + goto common_9329; + case 0x9302: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS; + goto common_9329; + case 0x9338: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; + goto common_9329; + case 0x9329: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | INVERT_SS | REV_SCREEN; + common_9329: + static const uint8_t ILI9329_regValues[] PROGMEM = { +// 0xF6, 3, 0x01, 0x01, 0x00, //Interface Control needs EXTC=1 MX_EOR=1, TM=0, RIM=0 +// 0xB6, 3, 0x0A, 0x82, 0x27, //Display Function [0A 82 27] +// 0xB7, 1, 0x06, //Entry Mode Set [06] + 0x36, 1, 0x00, //Memory Access [00] pointless but stops an empty array + }; + table8_ads = ILI9329_regValues, table_size = sizeof(ILI9329_regValues); + break; + + case 0x9340: //ILI9340 thanks Ravi_kanchan2004 and valmor_jr + //_lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | REV_SCREEN; //Ravi + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; //my new shield + goto common_9341; + case 0x9341: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; + common_9341: + static const uint8_t ILI9341_regValues_2_4[] PROGMEM = { // BOE 2.4" + 0xF6, 3, 0x01, 0x01, 0x00, //Interface Control needs EXTC=1 MV_EOR=0, TM=0, RIM=0 + 0xCF, 3, 0x00, 0x81, 0x30, //Power Control B [00 81 30] + 0xED, 4, 0x64, 0x03, 0x12, 0x81, //Power On Seq [55 01 23 01] + 0xE8, 3, 0x85, 0x10, 0x78, //Driver Timing A [04 11 7A] + 0xCB, 5, 0x39, 0x2C, 0x00, 0x34, 0x02, //Power Control A [39 2C 00 34 02] + 0xF7, 1, 0x20, //Pump Ratio [10] + 0xEA, 2, 0x00, 0x00, //Driver Timing B [66 00] + 0xB0, 1, 0x00, //RGB Signal [00] + 0xB1, 2, 0x00, 0x1B, //Frame Control [00 1B] + // 0xB6, 2, 0x0A, 0xA2, 0x27, //Display Function [0A 82 27 XX] .kbv SS=1 + 0xB4, 1, 0x00, //Inversion Control [02] .kbv NLA=1, NLB=1, NLC=1 + 0xC0, 1, 0x21, //Power Control 1 [26] + 0xC1, 1, 0x11, //Power Control 2 [00] + 0xC5, 2, 0x3F, 0x3C, //VCOM 1 [31 3C] + 0xC7, 1, 0xB5, //VCOM 2 [C0] + 0x36, 1, 0x48, //Memory Access [00] + 0xF2, 1, 0x00, //Enable 3G [02] + 0x26, 1, 0x01, //Gamma Set [01] + 0xE0, 15, 0x0f, 0x26, 0x24, 0x0b, 0x0e, 0x09, 0x54, 0xa8, 0x46, 0x0c, 0x17, 0x09, 0x0f, 0x07, 0x00, + 0xE1, 15, 0x00, 0x19, 0x1b, 0x04, 0x10, 0x07, 0x2a, 0x47, 0x39, 0x03, 0x06, 0x06, 0x30, 0x38, 0x0f, + }; + static const uint8_t ILI9341_regValues_ada[] PROGMEM = { // Adafruit_TFTLCD only works with EXTC=0 + // 0xF6, 3, 0x00, 0x01, 0x00, //Interface Control needs EXTC=1 TM=0, RIM=0 + // 0xF6, 3, 0x01, 0x01, 0x03, //Interface Control needs EXTC=1 RM=1, RIM=1 + 0xF6, 3, 0x09, 0x01, 0x03, //Interface Control needs EXTC=1 RM=0, RIM=1 + 0xB0, 1, 0x40, //RGB Signal [40] RCM=2 + 0xB4, 1, 0x00, //Inversion Control [02] .kbv NLA=1, NLB=1, NLC=1 + 0xC0, 1, 0x23, //Power Control 1 [26] + 0xC1, 1, 0x10, //Power Control 2 [00] + 0xC5, 2, 0x2B, 0x2B, //VCOM 1 [31 3C] + 0xC7, 1, 0xC0, //VCOM 2 [C0] + 0x36, 1, 0x88, //Memory Access [00] + 0xB1, 2, 0x00, 0x1B, //Frame Control [00 1B] + 0xB7, 1, 0x07, //Entry Mode [00] + }; + table8_ads = ILI9341_regValues_2_4, table_size = sizeof(ILI9341_regValues_2_4); // + break; +#if defined(SUPPORT_9342) + case 0x9342: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | INVERT_GS | REV_SCREEN; + static const uint8_t ILI9342_regValues_CPT24[] PROGMEM = { //CPT 2.4" + (0xB9), 3, 0xFF, 0x93, 0x42, //[00 00 00] + (0xC0), 2, 0x1D, 0x0A, //[26 09] + (0xC1), 1, 0x02, //[10] + (0xC5), 2, 0x2F, 0x2F, //[31 3C] + (0xC7), 1, 0xC3, //[C0] + (0xB8), 1, 0x0B, //[07] + (0xE0), 15, 0x0F, 0x33, 0x30, 0x0C, 0x0F, 0x08, 0x5D, 0x66, 0x4A, 0x07, 0x13, 0x05, 0x1B, 0x0E, 0x08, + (0xE1), 15, 0x08, 0x0E, 0x11, 0x02, 0x0E, 0x02, 0x24, 0x33, 0x37, 0x03, 0x0A, 0x09, 0x26, 0x33, 0x0F, + }; + static const uint8_t ILI9342_regValues_Tianma23[] PROGMEM = { //Tianma 2.3" + (0xB9), 3, 0xFF, 0x93, 0x42, + (0xC0), 2, 0x1D, 0x0A, + (0xC1), 1, 0x01, + (0xC5), 2, 0x2C, 0x2C, + (0xC7), 1, 0xC6, + (0xB8), 1, 0x09, + (0xE0), 15, 0x0F, 0x26, 0x21, 0x07, 0x0A, 0x03, 0x4E, 0x62, 0x3E, 0x0B, 0x11, 0x00, 0x08, 0x02, 0x00, + (0xE1), 15, 0x00, 0x19, 0x1E, 0x03, 0x0E, 0x03, 0x30, 0x23, 0x41, 0x03, 0x0B, 0x07, 0x2F, 0x36, 0x0F, + }; + static const uint8_t ILI9342_regValues_HSD23[] PROGMEM = { //HSD 2.3" + (0xB9), 3, 0xFF, 0x93, 0x42, + (0xC0), 2, 0x1D, 0x0A, + (0xC1), 1, 0x02, + (0xC5), 2, 0x2F, 0x27, + (0xC7), 1, 0xA4, + (0xB8), 1, 0x0B, + (0xE0), 15, 0x0F, 0x24, 0x21, 0x0C, 0x0F, 0x06, 0x50, 0x75, 0x3F, 0x07, 0x12, 0x05, 0x11, 0x0B, 0x08, + (0xE1), 15, 0x08, 0x1D, 0x20, 0x02, 0x0E, 0x04, 0x31, 0x24, 0x42, 0x03, 0x0B, 0x09, 0x30, 0x36, 0x0F, + }; + table8_ads = ILI9342_regValues_CPT24, table_size = sizeof(ILI9342_regValues_CPT24); // + // table8_ads = ILI9342_regValues_Tianma23, table_size = sizeof(ILI9342_regValues_Tianma23); // + // table8_ads = ILI9342_regValues_HSD23, table_size = sizeof(ILI9342_regValues_HSD23); // + p16 = (int16_t *) & HEIGHT; + *p16 = 240; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; +#endif + case 0x1581: //no BGR in MADCTL. set BGR in Panel Control + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; //thanks zdravke + goto common_9481; + case 0x9481: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_BGR; + common_9481: + static const uint8_t ILI9481_regValues[] PROGMEM = { // Atmel MaxTouch + 0xB0, 1, 0x00, // unlocks E0, F0 + 0xB3, 4, 0x02, 0x00, 0x00, 0x00, //Frame Memory, interface [02 00 00 00] + 0xB4, 1, 0x00, // Frame mode [00] + 0xD0, 3, 0x07, 0x42, 0x18, // Set Power [00 43 18] x1.00, x6, x3 + 0xD1, 3, 0x00, 0x07, 0x10, // Set VCOM [00 00 00] x0.72, x1.02 + 0xD2, 2, 0x01, 0x02, // Set Power for Normal Mode [01 22] + 0xD3, 2, 0x01, 0x02, // Set Power for Partial Mode [01 22] + 0xD4, 2, 0x01, 0x02, // Set Power for Idle Mode [01 22] + 0xC0, 5, 0x12, 0x3B, 0x00, 0x02, 0x11, //Panel Driving BGR for 1581 [10 3B 00 02 11] + 0xC1, 3, 0x10, 0x10, 0x88, // Display Timing Normal [10 10 88] + 0xC5, 1, 0x03, //Frame Rate [03] + 0xC6, 1, 0x02, //Interface Control [02] + 0xC8, 12, 0x00, 0x32, 0x36, 0x45, 0x06, 0x16, 0x37, 0x75, 0x77, 0x54, 0x0C, 0x00, + 0xCC, 1, 0x00, //Panel Control [00] + }; + static const uint8_t ILI9481_CPT29_regValues[] PROGMEM = { // 320x430 + 0xB0, 1, 0x00, + 0xD0, 3, 0x07, 0x42, 0x1C, // Set Power [00 43 18] + 0xD1, 3, 0x00, 0x02, 0x0F, // Set VCOM [00 00 00] x0.695, x1.00 + 0xD2, 2, 0x01, 0x11, // Set Power for Normal Mode [01 22] + 0xC0, 5, 0x10, 0x35, 0x00, 0x02, 0x11, //Set Panel Driving [10 3B 00 02 11] + 0xC5, 1, 0x03, //Frame Rate [03] + 0xC8, 12, 0x00, 0x30, 0x36, 0x45, 0x04, 0x16, 0x37, 0x75, 0x77, 0x54, 0x0F, 0x00, + 0xE4, 1, 0xA0, + 0xF0, 1, 0x01, + 0xF3, 2, 0x02, 0x1A, + }; + static const uint8_t ILI9481_PVI35_regValues[] PROGMEM = { // 320x480 + 0xB0, 1, 0x00, + 0xD0, 3, 0x07, 0x41, 0x1D, // Set Power [00 43 18] + 0xD1, 3, 0x00, 0x2B, 0x1F, // Set VCOM [00 00 00] x0.900, x1.32 + 0xD2, 2, 0x01, 0x11, // Set Power for Normal Mode [01 22] + 0xC0, 5, 0x10, 0x3B, 0x00, 0x02, 0x11, //Set Panel Driving [10 3B 00 02 11] + 0xC5, 1, 0x03, //Frame Rate [03] + 0xC8, 12, 0x00, 0x14, 0x33, 0x10, 0x00, 0x16, 0x44, 0x36, 0x77, 0x00, 0x0F, 0x00, + 0xE4, 1, 0xA0, + 0xF0, 1, 0x01, + 0xF3, 2, 0x40, 0x0A, + }; + static const uint8_t ILI9481_AUO317_regValues[] PROGMEM = { // 320x480 + 0xB0, 1, 0x00, + 0xD0, 3, 0x07, 0x40, 0x1D, // Set Power [00 43 18] + 0xD1, 3, 0x00, 0x18, 0x13, // Set VCOM [00 00 00] x0.805, x1.08 + 0xD2, 2, 0x01, 0x11, // Set Power for Normal Mode [01 22] + 0xC0, 5, 0x10, 0x3B, 0x00, 0x02, 0x11, //Set Panel Driving [10 3B 00 02 11] + 0xC5, 1, 0x03, //Frame Rate [03] + 0xC8, 12, 0x00, 0x44, 0x06, 0x44, 0x0A, 0x08, 0x17, 0x33, 0x77, 0x44, 0x08, 0x0C, + 0xE4, 1, 0xA0, + 0xF0, 1, 0x01, + }; + static const uint8_t ILI9481_CMO35_regValues[] PROGMEM = { // 320480 + 0xB0, 1, 0x00, + 0xD0, 3, 0x07, 0x41, 0x1D, // Set Power [00 43 18] 07,41,1D + 0xD1, 3, 0x00, 0x1C, 0x1F, // Set VCOM [00 00 00] x0.825, x1.32 1C,1F + 0xD2, 2, 0x01, 0x11, // Set Power for Normal Mode [01 22] + 0xC0, 5, 0x10, 0x3B, 0x00, 0x02, 0x11, //Set Panel Driving [10 3B 00 02 11] + 0xC5, 1, 0x03, //Frame Rate [03] + 0xC6, 1, 0x83, + 0xC8, 12, 0x00, 0x26, 0x21, 0x00, 0x00, 0x1F, 0x65, 0x23, 0x77, 0x00, 0x0F, 0x00, + 0xF0, 1, 0x01, //? + 0xE4, 1, 0xA0, //?SETCABC on Himax + 0x36, 1, 0x48, //Memory Access [00] + 0xB4, 1, 0x11, + }; + static const uint8_t ILI9481_RGB_regValues[] PROGMEM = { // 320x480 + 0xB0, 1, 0x00, + 0xD0, 3, 0x07, 0x41, 0x1D, // SETPOWER [00 43 18] + 0xD1, 3, 0x00, 0x2B, 0x1F, // SETVCOM [00 00 00] x0.900, x1.32 + 0xD2, 2, 0x01, 0x11, // SETNORPOW for Normal Mode [01 22] + 0xC0, 6, 0x10, 0x3B, 0x00, 0x02, 0x11, 0x00, //SETPANEL [10 3B 00 02 11] + 0xC5, 1, 0x03, //SETOSC Frame Rate [03] + 0xC6, 1, 0x80, //SETRGB interface control + 0xC8, 12, 0x00, 0x14, 0x33, 0x10, 0x00, 0x16, 0x44, 0x36, 0x77, 0x00, 0x0F, 0x00, + 0xF3, 2, 0x40, 0x0A, + 0xF0, 1, 0x08, + 0xF6, 1, 0x84, + 0xF7, 1, 0x80, + 0x0C, 2, 0x00, 0x55, //RDCOLMOD + 0xB4, 1, 0x00, //SETDISPLAY +// 0xB3, 4, 0x00, 0x01, 0x06, 0x01, //SETGRAM simple example + 0xB3, 4, 0x00, 0x01, 0x06, 0x30, //jpegs example + }; + table8_ads = ILI9481_regValues, table_size = sizeof(ILI9481_regValues); +// table8_ads = ILI9481_CPT29_regValues, table_size = sizeof(ILI9481_CPT29_regValues); +// table8_ads = ILI9481_PVI35_regValues, table_size = sizeof(ILI9481_PVI35_regValues); +// table8_ads = ILI9481_AUO317_regValues, table_size = sizeof(ILI9481_AUO317_regValues); +// table8_ads = ILI9481_CMO35_regValues, table_size = sizeof(ILI9481_CMO35_regValues); +// table8_ads = ILI9481_RGB_regValues, table_size = sizeof(ILI9481_RGB_regValues); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; + case 0x9486: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS; //Red 3.5", Blue 3.5" +// _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | REV_SCREEN; //old Red 3.5" + static const uint8_t ILI9486_regValues[] PROGMEM = { +/* + 0xF2, 9, 0x1C, 0xA3, 0x32, 0x02, 0xB2, 0x12, 0xFF, 0x12, 0x00, //f.k + 0xF1, 2, 0x36, 0xA4, // + 0xF8, 2, 0x21, 0x04, // + 0xF9, 2, 0x00, 0x08, // +*/ + 0xC0, 2, 0x0d, 0x0d, //Power Control 1 [0E 0E] + 0xC1, 2, 0x43, 0x00, //Power Control 2 [43 00] + 0xC2, 1, 0x00, //Power Control 3 [33] + 0xC5, 4, 0x00, 0x48, 0x00, 0x48, //VCOM Control 1 [00 40 00 40] + 0xB4, 1, 0x00, //Inversion Control [00] + 0xB6, 3, 0x02, 0x02, 0x3B, // Display Function Control [02 02 3B] +#define GAMMA9486 4 +#if GAMMA9486 == 0 + // default GAMMA terrible +#elif GAMMA9486 == 1 + // GAMMA f.k. bad + 0xE0, 15, 0x0f, 0x31, 0x2b, 0x0c, 0x0e, 0x08, 0x4e, 0xf1, 0x37, 0x07, 0x10, 0x03, 0x0e, 0x09, 0x00, + 0xE1, 15, 0x00, 0x0e, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0f, 0x0c, 0x31, 0x36, 0x0f, +#elif GAMMA9486 == 2 + // 1.2 CPT 3.5 Inch Initial Code not bad + 0xE0, 15, 0x0F, 0x1B, 0x18, 0x0B, 0x0E, 0x09, 0x47, 0x94, 0x35, 0x0A, 0x13, 0x05, 0x08, 0x03, 0x00, + 0xE1, 15, 0x0F, 0x3A, 0x37, 0x0B, 0x0C, 0x05, 0x4A, 0x24, 0x39, 0x07, 0x10, 0x04, 0x27, 0x25, 0x00, +#elif GAMMA9486 == 3 + // 2.2 HSD 3.5 Inch Initial Code not bad + 0xE0, 15, 0x0F, 0x1F, 0x1C, 0x0C, 0x0F, 0x08, 0x48, 0x98, 0x37, 0x0A, 0x13, 0x04, 0x11, 0x0D, 0x00, + 0xE1, 15, 0x0F, 0x32, 0x2E, 0x0B, 0x0D, 0x05, 0x47, 0x75, 0x37, 0x06, 0x10, 0x03, 0x24, 0x20, 0x00, +#elif GAMMA9486 == 4 + // 3.2 TM 3.2 Inch Initial Code not bad + 0xE0, 15, 0x0F, 0x21, 0x1C, 0x0B, 0x0E, 0x08, 0x49, 0x98, 0x38, 0x09, 0x11, 0x03, 0x14, 0x10, 0x00, + 0xE1, 15, 0x0F, 0x2F, 0x2B, 0x0C, 0x0E, 0x06, 0x47, 0x76, 0x37, 0x07, 0x11, 0x04, 0x23, 0x1E, 0x00, +#elif GAMMA9486 == 5 + // 4.2 WTK 3.5 Inch Initial Code too white + 0xE0, 15, 0x0F, 0x10, 0x08, 0x05, 0x09, 0x05, 0x37, 0x98, 0x26, 0x07, 0x0F, 0x02, 0x09, 0x07, 0x00, + 0xE1, 15, 0x0F, 0x38, 0x36, 0x0D, 0x10, 0x08, 0x59, 0x76, 0x48, 0x0A, 0x16, 0x0A, 0x37, 0x2F, 0x00, +#endif + }; + table8_ads = ILI9486_regValues, table_size = sizeof(ILI9486_regValues); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; + case 0x7796: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS; //thanks to safari1 + static const uint8_t PROGMEM ST7796_regValues[] = { + 0xB7, 1, 0xC6, //Entry Mode [06] + 0xE8, 8, 0x40, 0x8A, 0x00, 0x00, 0x29, 0x19, 0xA5, 0x33, //Adj3 [40 8A 00 00 25 0A 38 33] + }; + table8_ads = ST7796_regValues, table_size = sizeof(ST7796_regValues); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; + //goto common_9488; + case 0x9487: //with thanks to Charlyf + case 0x9488: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; + common_9488: + static const uint8_t ILI9488_regValues_max[] PROGMEM = { // Atmel MaxTouch + 0xC0, 2, 0x10, 0x10, //Power Control 1 [0E 0E] + 0xC1, 1, 0x41, //Power Control 2 [43] + 0xC5, 4, 0x00, 0x22, 0x80, 0x40, //VCOM Control 1 [00 40 00 40] + 0x36, 1, 0x68, //Memory Access [00] + 0xB0, 1, 0x00, //Interface [00] + 0xB1, 2, 0xB0, 0x11, //Frame Rate Control [B0 11] + 0xB4, 1, 0x02, //Inversion Control [02] + 0xB6, 3, 0x02, 0x02, 0x3B, // Display Function Control [02 02 3B] .kbv NL=480 + 0xB7, 1, 0xC6, //Entry Mode [06] + 0x3A, 1, 0x55, //Interlace Pixel Format [XX] + 0xF7, 4, 0xA9, 0x51, 0x2C, 0x82, //Adjustment Control 3 [A9 51 2C 82] + }; + table8_ads = ILI9488_regValues_max, table_size = sizeof(ILI9488_regValues_max); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; + case 0xB505: //R61505V + case 0xC505: //R61505W + _lcd_capable = 0 | REV_SCREEN | READ_LOWHIGH; + static const uint16_t R61505V_regValues[] PROGMEM = { + 0x0000, 0x0000, + 0x0000, 0x0000, + 0x0000, 0x0000, + 0x0000, 0x0001, + 0x00A4, 0x0001, //CALB=1 + TFTLCD_DELAY, 10, + 0x0060, 0x2700, //NL + 0x0008, 0x0808, //FP & BP + 0x0030, 0x0214, //Gamma settings + 0x0031, 0x3715, + 0x0032, 0x0604, + 0x0033, 0x0E16, + 0x0034, 0x2211, + 0x0035, 0x1500, + 0x0036, 0x8507, + 0x0037, 0x1407, + 0x0038, 0x1403, + 0x0039, 0x0020, + 0x0090, 0x0015, //DIVI & RTNI + 0x0010, 0x0410, //BT=4,AP=1 + 0x0011, 0x0237, //DC1=2,DC0=3, VC=7 + 0x0029, 0x0046, //VCM1=70 + 0x002A, 0x0046, //VCMSEL=0,VCM2=70 + // Sleep mode IN sequence + 0x0007, 0x0000, + //0x0012, 0x0000, //PSON=0,PON=0 + // Sleep mode EXIT sequence + 0x0012, 0x0189, //VCMR=1,PSON=0,PON=0,VRH=9 + 0x0013, 0x1100, //VDV=17 + TFTLCD_DELAY, 150, + 0x0012, 0x01B9, //VCMR=1,PSON=1,PON=1,VRH=9 [018F] + 0x0001, 0x0100, //SS=1 Other mode settings + 0x0002, 0x0200, //BC0=1--Line inversion + 0x0003, 0x1030, + 0x0009, 0x0001, //ISC=1 [0000] + 0x000A, 0x0000, // [0000] + // 0x000C, 0x0001, //RIM=1 [0000] + 0x000D, 0x0000, // [0000] + 0x000E, 0x0030, //VEM=3 VCOM equalize [0000] + 0x0061, 0x0001, + 0x006A, 0x0000, + 0x0080, 0x0000, + 0x0081, 0x0000, + 0x0082, 0x005F, + 0x0092, 0x0100, + 0x0093, 0x0701, + TFTLCD_DELAY, 80, + 0x0007, 0x0100, //BASEE=1--Display On + }; + init_table16(R61505V_regValues, sizeof(R61505V_regValues)); + break; + +#if defined(SUPPORT_B509_7793) + case 0x7793: + case 0xB509: + _lcd_capable = REV_SCREEN; + static const uint16_t R61509V_regValues[] PROGMEM = { + 0x0000, 0x0000, + 0x0000, 0x0000, + 0x0000, 0x0000, + 0x0000, 0x0000, + TFTLCD_DELAY, 15, + 0x0400, 0x6200, //NL=0x31 (49) i.e. 400 rows + 0x0008, 0x0808, + //gamma + 0x0300, 0x0C00, + 0x0301, 0x5A0B, + 0x0302, 0x0906, + 0x0303, 0x1017, + 0x0304, 0x2300, + 0x0305, 0x1700, + 0x0306, 0x6309, + 0x0307, 0x0C09, + 0x0308, 0x100C, + 0x0309, 0x2232, + + 0x0010, 0x0016, //69.5Hz 0016 + 0x0011, 0x0101, + 0x0012, 0x0000, + 0x0013, 0x0001, + + 0x0100, 0x0330, //BT,AP + 0x0101, 0x0237, //DC0,DC1,VC + 0x0103, 0x0D00, //VDV + 0x0280, 0x6100, //VCM + 0x0102, 0xC1B0, //VRH,VCMR,PSON,PON + TFTLCD_DELAY, 50, + + 0x0001, 0x0100, + 0x0002, 0x0100, + 0x0003, 0x1030, //1030 + 0x0009, 0x0001, + 0x000C, 0x0000, + 0x0090, 0x8000, + 0x000F, 0x0000, + + 0x0210, 0x0000, + 0x0211, 0x00EF, + 0x0212, 0x0000, + 0x0213, 0x018F, //432=01AF,400=018F + 0x0500, 0x0000, + 0x0501, 0x0000, + 0x0502, 0x005F, //??? + 0x0401, 0x0001, //REV=1 + 0x0404, 0x0000, + TFTLCD_DELAY, 50, + + 0x0007, 0x0100, //BASEE + TFTLCD_DELAY, 50, + + 0x0200, 0x0000, + 0x0201, 0x0000, + }; + init_table16(R61509V_regValues, sizeof(R61509V_regValues)); + p16 = (int16_t *) & HEIGHT; + *p16 = 400; + break; +#endif + +#ifdef SUPPORT_9806 + case 0x9806: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; + // from ZinggJM + static const uint8_t ILI9806_regValues[] PROGMEM = { + (0xFF), 3, /* EXTC Command Set enable register*/ 0xFF, 0x98, 0x06, + (0xBA), 1, /* SPI Interface Setting*/0xE0, + (0xBC), 21, /* GIP 1*/0x03, 0x0F, 0x63, 0x69, 0x01, 0x01, 0x1B, 0x11, 0x70, 0x73, 0xFF, 0xFF, 0x08, 0x09, 0x05, 0x00, 0xEE, 0xE2, 0x01, 0x00, 0xC1, + (0xBD), 8, /* GIP 2*/0x01, 0x23, 0x45, 0x67, 0x01, 0x23, 0x45, 0x67, + (0xBE), 9, /* GIP 3*/0x00, 0x22, 0x27, 0x6A, 0xBC, 0xD8, 0x92, 0x22, 0x22, + (0xC7), 1, /* Vcom*/0x1E, + (0xED), 3, /* EN_volt_reg*/0x7F, 0x0F, 0x00, + (0xC0), 3, /* Power Control 1*/0xE3, 0x0B, 0x00, + (0xFC), 1, 0x08, + (0xDF), 6, /* Engineering Setting*/0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + (0xF3), 1, /* DVDD Voltage Setting*/0x74, + (0xB4), 3, /* Display Inversion Control*/0x00, 0x00, 0x00, + (0xF7), 1, /* 480x854*/0x81, + (0xB1), 3, /* Frame Rate*/0x00, 0x10, 0x14, + (0xF1), 3, /* Panel Timing Control*/0x29, 0x8A, 0x07, + (0xF2), 4, /*Panel Timing Control*/0x40, 0xD2, 0x50, 0x28, + (0xC1), 4, /* Power Control 2*/0x17, 0x85, 0x85, 0x20, + (0xE0), 16, 0x00, 0x0C, 0x15, 0x0D, 0x0F, 0x0C, 0x07, 0x05, 0x07, 0x0B, 0x10, 0x10, 0x0D, 0x17, 0x0F, 0x00, + (0xE1), 16, 0x00, 0x0D, 0x15, 0x0E, 0x10, 0x0D, 0x08, 0x06, 0x07, 0x0C, 0x11, 0x11, 0x0E, 0x17, 0x0F, 0x00, + (0x35), 1, /*Tearing Effect ON*/0x00, + }; + table8_ads = ILI9806_regValues, table_size = sizeof(ILI9806_regValues); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 854; + break; +#endif + default: + p16 = (int16_t *) & WIDTH; + *p16 = 0; //error value for WIDTH + break; + } + _lcd_rev = ((_lcd_capable & REV_SCREEN) != 0); + if (table8_ads != NULL) { + static const uint8_t reset_off[] PROGMEM = { + 0x01, 0, //Soft Reset + TFTLCD_DELAY8, 150, // .kbv will power up with ONLY reset, sleep out, display on + 0x28, 0, //Display Off + 0x3A, 1, 0x55, //Pixel read=565, write=565. + }; + static const uint8_t wake_on[] PROGMEM = { + 0x11, 0, //Sleep Out + TFTLCD_DELAY8, 150, + 0x29, 0, //Display On + }; + init_table(&reset_off, sizeof(reset_off)); + init_table(table8_ads, table_size); //can change PIXFMT + init_table(&wake_on, sizeof(wake_on)); + } + setRotation(0); //PORTRAIT + invertDisplay(false); +#if defined(SUPPORT_9488_555) + if (_lcd_ID == 0x9488) { + is555 = 0; + drawPixel(0, 0, 0xFFE0); + if (readPixel(0, 0) == 0xFF1F) { + uint8_t pixfmt = 0x06; + pushCommand(0x3A, &pixfmt, 1); + _lcd_capable &= ~READ_24BITS; + is555 = 1; + } + } +#endif +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/MCUFRIEND_kbv.h b/Arduino/Libraries/MCUFRIEND_kbv/MCUFRIEND_kbv.h new file mode 100644 index 0000000..db142b8 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/MCUFRIEND_kbv.h @@ -0,0 +1,77 @@ +/* + * MCUFRIEND_kbv class inherits from Adafruit_GFX class and the Arduino Print class. + * Any use of MCUFRIEND_kbv class and examples is dependent on Adafruit and Arduino licenses + * The license texts are in the accompanying license.txt file + */ + +#ifndef MCUFRIEND_KBV_H_ +#define MCUFRIEND_KBV_H_ 299 + +//#define USE_SERIAL + +#if ARDUINO < 101 +#define USE_GFX_KBV +#include "ADA_GFX_kbv.h" +#else +#include "Adafruit_GFX.h" +#endif + +class MCUFRIEND_kbv : public Adafruit_GFX { + + public: +// MCUFRIEND_kbv(int CS=A3, int RS=A2, int WR=A1, int RD=A0, int RST=A4); //shield wiring + MCUFRIEND_kbv(int CS=0, int RS=0, int WR=0, int RD=0, int _RST=0); //dummy arguments + void reset(void); // you only need the constructor + void begin(uint16_t ID = 0x9341); // you only need the constructor + virtual void drawPixel(int16_t x, int16_t y, uint16_t color); // and these three + void WriteCmdData(uint16_t cmd, uint16_t dat); // ?public methods !!! + void pushCommand(uint16_t cmd, uint8_t * block, int8_t N); + uint16_t color565(uint8_t r, uint8_t g, uint8_t b) { return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3); } + uint16_t readID(void); + virtual void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); + virtual void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) { fillRect(x, y, 1, h, color); } + virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) { fillRect(x, y, w, 1, color); } + virtual void fillScreen(uint16_t color) { fillRect(0, 0, _width, _height, color); } + virtual void setRotation(uint8_t r); + virtual void invertDisplay(boolean i); + + uint16_t readReg(uint16_t reg, int8_t index=0); + int16_t readGRAM(int16_t x, int16_t y, uint16_t *block, int16_t w, int16_t h); + uint16_t readPixel(int16_t x, int16_t y) { uint16_t color; readGRAM(x, y, &color, 1, 1); return color; } + void setAddrWindow(int16_t x, int16_t y, int16_t x1, int16_t y1); + void pushColors(uint16_t *block, int16_t n, bool first); + void pushColors(uint8_t *block, int16_t n, bool first); + void pushColors(const uint8_t *block, int16_t n, bool first, bool bigend = false); + void vertScroll(int16_t top, int16_t scrollines, int16_t offset); + + protected: + uint32_t readReg32(uint16_t reg); + uint32_t readReg40(uint16_t reg); + uint16_t _lcd_xor, _lcd_capable; + + private: + uint16_t _lcd_ID, _lcd_rev, _lcd_madctl, _lcd_drivOut, _MC, _MP, _MW, _SC, _EC, _SP, _EP; +}; + +// New color definitions. thanks to Bodmer +#define TFT_BLACK 0x0000 /* 0, 0, 0 */ +#define TFT_NAVY 0x000F /* 0, 0, 128 */ +#define TFT_DARKGREEN 0x03E0 /* 0, 128, 0 */ +#define TFT_DARKCYAN 0x03EF /* 0, 128, 128 */ +#define TFT_MAROON 0x7800 /* 128, 0, 0 */ +#define TFT_PURPLE 0x780F /* 128, 0, 128 */ +#define TFT_OLIVE 0x7BE0 /* 128, 128, 0 */ +#define TFT_LIGHTGREY 0xC618 /* 192, 192, 192 */ +#define TFT_DARKGREY 0x7BEF /* 128, 128, 128 */ +#define TFT_BLUE 0x001F /* 0, 0, 255 */ +#define TFT_GREEN 0x07E0 /* 0, 255, 0 */ +#define TFT_CYAN 0x07FF /* 0, 255, 255 */ +#define TFT_RED 0xF800 /* 255, 0, 0 */ +#define TFT_MAGENTA 0xF81F /* 255, 0, 255 */ +#define TFT_YELLOW 0xFFE0 /* 255, 255, 0 */ +#define TFT_WHITE 0xFFFF /* 255, 255, 255 */ +#define TFT_ORANGE 0xFDA0 /* 255, 180, 0 */ +#define TFT_GREENYELLOW 0xB7E0 /* 180, 255, 0 */ +#define TFT_PINK 0xFC9F + +#endif diff --git a/Arduino/Libraries/MCUFRIEND_kbv/OPENSMART_kbv.cpp b/Arduino/Libraries/MCUFRIEND_kbv/OPENSMART_kbv.cpp new file mode 100644 index 0000000..3dc3150 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/OPENSMART_kbv.cpp @@ -0,0 +1,20 @@ +// this will avoid any library editing +// +// but the sketch must use specific OPENSMART_kbv class constructor + +#define USE_SPECIAL //SPECIAL will use the first match +//#define USE_OPENSMART_SHIELD_PINOUT //deprecated +//select the target board +#define USE_OPENSMART_SHIELD_PINOUT_UNO +#define USE_OPENSMART_SHIELD_PINOUT_MEGA +#define USE_OPENSMART_SHIELD_PINOUT_DUE //thanks Michel53 +//select the target controllers that are not enabled by default +#define SUPPORT_8352A //HX8352A +#define SUPPORT_8352B //HX8352B +#define SUPPORT_9225 //RM68130 + +#include "OPENSMART_kbv.h" //class declaration + +#define MCUFRIEND_kbv OPENSMART_kbv //rename the class scope + +#include "MCUFRIEND_kbv.cpp" //same methods, but with OPENSMART_kbv class scope diff --git a/Arduino/Libraries/MCUFRIEND_kbv/OPENSMART_kbv.h b/Arduino/Libraries/MCUFRIEND_kbv/OPENSMART_kbv.h new file mode 100644 index 0000000..543cba3 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/OPENSMART_kbv.h @@ -0,0 +1,78 @@ +/* + * OPENSMART_kbv class inherits from Adafruit_GFX class and the Arduino Print class. + * Any use of OPENSMART_kbv class and examples is dependent on Adafruit and Arduino licenses + * The license texts are in the accompanying license.txt file + */ + +#ifndef OPENSMART_KBV_H_ +#define OPENSMART_KBV_H_ 101 //version number +#define MCUFRIEND_KBV_H_ OPENSMART_KBV_H_ //guard against any MCUFRIEND_kbv.h include + +//#define USE_SERIAL + +#if ARDUINO < 101 +#define USE_GFX_KBV +#include "ADA_GFX_kbv.h" +#else +#include "Adafruit_GFX.h" +#endif + +class OPENSMART_kbv : public Adafruit_GFX { + + public: +// OPENSMART_kbv(int CS=A3, int RS=A2, int WR=A1, int RD=A0, int RST=A4); //shield wiring + OPENSMART_kbv(int CS=0, int RS=0, int WR=0, int RD=0, int _RST=0); //dummy arguments + void reset(void); // you only need the constructor + void begin(uint16_t ID = 0x9341); // you only need the constructor + virtual void drawPixel(int16_t x, int16_t y, uint16_t color); // and these three + void WriteCmdData(uint16_t cmd, uint16_t dat); // ?public methods !!! + void pushCommand(uint16_t cmd, uint8_t * block, int8_t N); + uint16_t color565(uint8_t r, uint8_t g, uint8_t b) { return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3); } + uint16_t readID(void); + virtual void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); + virtual void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) { fillRect(x, y, 1, h, color); } + virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) { fillRect(x, y, w, 1, color); } + virtual void fillScreen(uint16_t color) { fillRect(0, 0, _width, _height, color); } + virtual void setRotation(uint8_t r); + virtual void invertDisplay(boolean i); + + uint16_t readReg(uint16_t reg, int8_t index=0); + int16_t readGRAM(int16_t x, int16_t y, uint16_t *block, int16_t w, int16_t h); + uint16_t readPixel(int16_t x, int16_t y) { uint16_t color; readGRAM(x, y, &color, 1, 1); return color; } + void setAddrWindow(int16_t x, int16_t y, int16_t x1, int16_t y1); + void pushColors(uint16_t *block, int16_t n, bool first); + void pushColors(uint8_t *block, int16_t n, bool first); + void pushColors(const uint8_t *block, int16_t n, bool first, bool bigend = false); + void vertScroll(int16_t top, int16_t scrollines, int16_t offset); + + protected: + uint32_t readReg32(uint16_t reg); + uint32_t readReg40(uint16_t reg); + uint16_t _lcd_xor, _lcd_capable; + + private: + uint16_t _lcd_ID, _lcd_rev, _lcd_madctl, _lcd_drivOut, _MC, _MP, _MW, _SC, _EC, _SP, _EP; +}; + +// New color definitions. thanks to Bodmer +#define TFT_BLACK 0x0000 /* 0, 0, 0 */ +#define TFT_NAVY 0x000F /* 0, 0, 128 */ +#define TFT_DARKGREEN 0x03E0 /* 0, 128, 0 */ +#define TFT_DARKCYAN 0x03EF /* 0, 128, 128 */ +#define TFT_MAROON 0x7800 /* 128, 0, 0 */ +#define TFT_PURPLE 0x780F /* 128, 0, 128 */ +#define TFT_OLIVE 0x7BE0 /* 128, 128, 0 */ +#define TFT_LIGHTGREY 0xC618 /* 192, 192, 192 */ +#define TFT_DARKGREY 0x7BEF /* 128, 128, 128 */ +#define TFT_BLUE 0x001F /* 0, 0, 255 */ +#define TFT_GREEN 0x07E0 /* 0, 255, 0 */ +#define TFT_CYAN 0x07FF /* 0, 255, 255 */ +#define TFT_RED 0xF800 /* 255, 0, 0 */ +#define TFT_MAGENTA 0xF81F /* 255, 0, 255 */ +#define TFT_YELLOW 0xFFE0 /* 255, 255, 0 */ +#define TFT_WHITE 0xFFFF /* 255, 255, 255 */ +#define TFT_ORANGE 0xFDA0 /* 255, 180, 0 */ +#define TFT_GREENYELLOW 0xB7E0 /* 180, 255, 0 */ +#define TFT_PINK 0xFC9F + +#endif diff --git a/Arduino/Libraries/MCUFRIEND_kbv/README.md b/Arduino/Libraries/MCUFRIEND_kbv/README.md new file mode 100644 index 0000000..45ce52b --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/README.md @@ -0,0 +1,30 @@ +#MCUFRIEND_kbv +Library for Uno 2.4, 2.8, 3.5, 3.6, 3.95 inch mcufriend Shields + +1. The Arduino Library Manager should find and install MCUFRIEND_kbv library + +2. Install the Adafruit_GFX library if not already in your User libraries. + +3. Insert your Mcufriend style display shield into UNO. Only 28-pin shields are supported. + +4. Build any of the Examples from the File->Examples->Mcufriend_kbv menu. e.g. + +graphictest_kbv.ino: shows all the methods. + +LCD_ID_readreg.ino: diagnostic check to identify unsupported controllers. + +MCUFRIEND_kbv inherits all the methods from +the Adafruit_GFX class: https://learn.adafruit.com/adafruit-gfx-graphics-library/overview +and Print class: https://www.arduino.cc/en/Serial/Print + +The only "new" methods are hardware related: +vertScroll(), readGRAM(), readPixel(), setAddrWindow(), pushColors(), readID(), begin() + +readReg(), pushCommand() access the controller registers + +The File layout changed with v2.9.3. If replacing a pre-v2.9.3 library: +Please leave IDE. Delete the existing MCUFRIEND_kbv folder. Start the IDE. Install from Library Manager. + +HOW TO INSTALL AND USE: is now in "mcufriend_how_to.txt" + +CHANGE HISTORY: is now in "mcufriend_history.txt" diff --git a/Arduino/Libraries/MCUFRIEND_kbv/TFT_HX8357GLUE.h b/Arduino/Libraries/MCUFRIEND_kbv/TFT_HX8357GLUE.h new file mode 100644 index 0000000..8eacb01 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/TFT_HX8357GLUE.h @@ -0,0 +1,172 @@ +// NOT FOR PUBLIC USE + +#define HX8357_BLACK 0x0000 +#define HX8357_BLUE 0x001F +#define HX8357_RED 0xF800 +#define HX8357_GREEN 0x07E0 +#define HX8357_CYAN 0x07FF +#define HX8357_MAGENTA 0xF81F +#define HX8357_YELLOW 0xFFE0 +#define HX8357_WHITE 0xFFFF + +//#include // Core graphics library +#include // Hardware-specific library +#if !defined(AVR) +#include +#endif + +#include +#include +#include +#include +#include + +const GFXfont *Fonts[] = { + NULL, + NULL, + &FreeSans9pt7b, + NULL, + &FreeSans12pt7b, + NULL, + &FreeSans18pt7b, + &FreeSerifItalic12pt7b, + &FreeMonoBold24pt7b, +}; +#define TFT_BLACK 0x0000 +#define TFT_NAVY 0x000F +#define TFT_DARKGREEN 0x03E0 +#define TFT_DARKCYAN 0x03EF +#define TFT_MAROON 0x7800 +#define TFT_PURPLE 0x780F +#define TFT_OLIVE 0x7BE0 +#define TFT_LIGHTGREY 0xC618 +#define TFT_DARKGREY 0x7BEF +#define TFT_BLUE 0x001F +#define TFT_GREEN 0x07E0 +#define TFT_CYAN 0x07FF +#define TFT_RED 0xF800 +#define TFT_MAGENTA 0xF81F +#define TFT_YELLOW 0xFFE0 +#define TFT_WHITE 0xFFFF +#define TFT_ORANGE 0xFD20 +#define TFT_GREENYELLOW 0xAFE5 +#define TFT_PINK 0xF81F + +#define MC_DATUM 4 + +class TFT_HX8357GLUE : public MCUFRIEND_kbv +{ + public: + TFT_HX8357GLUE() {} + void begin(void) { + init(); + } + void init(void) + { + MCUFRIEND_kbv::reset(); + _ID = MCUFRIEND_kbv::readID(); + if (_ID == 0x00D3 || _ID == 0xD3D3) + _ID = 0x9486; + MCUFRIEND_kbv::begin(_ID); + MCUFRIEND_kbv::setRotation(1); + _first = true; + } + void setWindow(int16_t x0, int16_t y0, int16_t x1, int16_t y1) + { + MCUFRIEND_kbv::setAddrWindow(x0, y0, x1, y1); + _first = true; + } + + void pushColors(uint8_t *data, uint16_t len) + { + MCUFRIEND_kbv::pushColors((uint8_t*)data, len, _first); + _first = false; + } + + void pushColors(uint16_t *data, uint8_t len) + { + MCUFRIEND_kbv::pushColors((uint16_t*)data, len, _first); + _first = false; + } + + void pushColors(uint16_t *data, uint16_t len, int first) + { + MCUFRIEND_kbv::pushColors((uint16_t*)data, len, first); + } + + void pushColor(uint16_t color) + { + uint16_t c = color; + MCUFRIEND_kbv::pushColors(&c, 1, _first); + _first = false; + } + + void setCursor(int16_t x, int16_t y) + { + setCursor(x, y, _font); + } + + void setCursor(int16_t x, int16_t y, uint8_t idx) + { + + const GFXfont *f = Fonts[idx]; + MCUFRIEND_kbv::setFont(f); +// MCUFRIEND_kbv::setCursor(x, y + f->glyph->height); + + MCUFRIEND_kbv::setCursor(x, y); + } + + void setTextFont(uint8_t font) + { + _font = font; + MCUFRIEND_kbv::setFont(Fonts[_font]); + } + + int16_t drawNumber(long long_num, int16_t poX, int16_t poY, int16_t idx) + { + char buf[12]; + ltoa(long_num, buf, 10); + return drawString(buf, poX, poY, idx); + } + + int16_t drawChar(char c, int16_t poX, int16_t poY, int16_t idx) + { + char buf[2]; + buf[0] = c; + buf[1] = 0; + return drawString(buf, poX, poY, idx); + } + + int16_t drawString(char *string, int16_t poX, int16_t poY, int16_t idx) + { + int16_t x1, y1; + uint16_t w, h; + setFont(Fonts[_font = idx]); + getTextBounds(string, poX, poY, &x1, &y1, &w, &h); + fillRect(x1, y1 + h, w, h, 0x0000); + MCUFRIEND_kbv::setCursor(poX, poY + h); + print(string); + return w; + } + int16_t drawCentreString(char *string, int16_t poX, int16_t poY, int16_t idx) + { + int16_t x1, y1; + uint16_t w, h; + setFont(Fonts[_font = idx]); + getTextBounds(string, poX, poY, &x1, &y1, &w, &h); + poX -= w/2; + x1 -= w/2; + fillRect(x1, y1 + h, w, h, 0x0000); + MCUFRIEND_kbv::setCursor(poX, poY + h); + print(string); + return w; +// return drawString(string, dX, poY, idx); + } + void setTextDatum(uint8_t datum) { ; } + void setTextPadding(uint16_t x_width) { ; } + + private: + uint16_t _ID; + uint8_t _font, _first; +}; + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/TFT_PRINTGLUE.h b/Arduino/Libraries/MCUFRIEND_kbv/TFT_PRINTGLUE.h new file mode 100644 index 0000000..0a84b7f --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/TFT_PRINTGLUE.h @@ -0,0 +1,233 @@ +// NOT FOR PUBLIC USE + +//#include // Core graphics library +#include // Hardware-specific library +#if !defined(AVR) +#include +#endif + +#include +#include +#include +#include +#include + +const GFXfont *Fonts[] = { + NULL, + NULL, + &FreeSans9pt7b, //FONT2 + NULL, + &FreeSans12pt7b, //FONT4 + NULL, + &FreeSans18pt7b, //FONT6 + &FreeSevenSegNumFontPlusPlus, //FONT7 + &FreeSevenSegNumFontPlusPlus, //FONT8 + // &FreeMonoBold24pt7b, //FONT8 +}; + +//These enumerate the text plotting alignment (reference datum point) +#define TL_DATUM 0 // Top left (default) +#define TC_DATUM 1 // Top centre +#define TR_DATUM 2 // Top right +#define ML_DATUM 3 // Middle left +#define CL_DATUM 3 // Centre left, same as above +#define MC_DATUM 4 // Middle centre +#define CC_DATUM 4 // Centre centre, same as above +#define MR_DATUM 5 // Middle right +#define CR_DATUM 5 // Centre right, same as above +#define BL_DATUM 6 // Bottom left +#define BC_DATUM 7 // Bottom centre +#define BR_DATUM 8 // Bottom right +#define L_BASELINE 9 // Left character baseline (Line the 'A' character would sit on) +#define C_BASELINE 10 // Centre character baseline +#define R_BASELINE 11 // Right character baseline + +class TFT_PRINTGLUE : public MCUFRIEND_kbv +{ + public: + TFT_PRINTGLUE() {} + void begin(void) { + init(); + } + void init(void) + { + MCUFRIEND_kbv::reset(); + _ID = MCUFRIEND_kbv::readID(); + if (_ID == 0xD3D3) _ID = 0x9486; + MCUFRIEND_kbv::begin(_ID); + MCUFRIEND_kbv::setRotation(1); + _first = true; + _datum = TL_DATUM; + } + void setWindow(int16_t x0, int16_t y0, int16_t x1, int16_t y1) + { + MCUFRIEND_kbv::setAddrWindow(x0, y0, x1, y1); + _first = true; + } + + void pushColors(uint8_t *data, uint16_t len) + { + MCUFRIEND_kbv::pushColors((uint8_t*)data, len, _first); + _first = false; + } + + void pushColors(uint16_t *data, uint8_t len) + { + MCUFRIEND_kbv::pushColors((uint16_t*)data, len, _first); + _first = false; + } + + void pushColors(uint16_t *data, uint16_t len, int first) + { + MCUFRIEND_kbv::pushColors((uint16_t*)data, len, first); + } + + void pushColor(uint16_t color) + { + uint16_t c = color; + MCUFRIEND_kbv::pushColors(&c, 1, _first); + _first = false; + } + + void setCursor(int16_t x, int16_t y, uint8_t idx = 255) + { + if (idx == 255) idx = _font; //use current font + setTextFont(idx); + MCUFRIEND_kbv::setCursor(x, y + _ydatum); + } + + void setFreeFont(const GFXfont *pfont) + { + _font = 1; + _ascent = 7; + _descent = 1; + MCUFRIEND_kbv::setFont(_pfont = pfont); + if (pfont != NULL) { + int16_t x = 0, y = 0, x1, y1 = 0, x2, y2 = 0; + MCUFRIEND_kbv::setTextSize(1); + charBounds('0', &x, &y, &x1, &y1, &x2, &y2); + _ascent = y2 - y1; //yAdvance + GFXfont f; + memcpy_P(&f, _pfont, sizeof(f)); + if (f.last >= '{' && '{' >= f.first) { + charBounds('{', &x, &y, &x1, &y1, &x2, &y2); + _descent = y2 - y1 + 1 - _ascent; // + } + } + setTextDatum(_datum); + } + + int16_t drawNumber(long long_num, int16_t poX, int16_t poY, uint8_t idx) + { + char buf[12]; + ltoa(long_num, buf, 10); + return drawString(buf, poX, poY, idx); + } + + int16_t drawChar(char c, int16_t poX, int16_t poY, uint8_t idx) + { + char buf[2]; + buf[0] = c; + buf[1] = 0; + return drawString(buf, poX, poY, idx); + } + + int16_t drawString(const char *string, int16_t poX, int16_t poY, uint8_t idx) + { + int16_t x1, y1; + uint16_t w, h; + setTextFont(idx); + getTextBounds(string, 0, 50, &x1, &y1, &w, &h); //assume no newlines + w += x1; + x1 = poX; + uint16_t xpad = (_padding > w) ? _padding : w; + switch (_datum) { + case TC_DATUM: + case MC_DATUM: + case BC_DATUM: + case C_BASELINE: + poX -= w / 2; + x1 -= xpad / 2; + break; + case TR_DATUM: + case MR_DATUM: + case BR_DATUM: + case R_BASELINE: + poX -= w; + x1 -= xpad; + break; + } + if (textcolor != textbgcolor) fillRect(x1, poY + _ydatum - _ascent, xpad, _ascent + _descent, textbgcolor); + MCUFRIEND_kbv::setCursor(poX, poY + _ydatum); + print(string); + return w; + } + int16_t drawCentreString(const char *string, int16_t poX, int16_t poY, uint8_t idx) + { + uint8_t datum = _datum; + setTextDatum(TC_DATUM); + uint16_t len = drawString(string, poX, poY, idx); + setTextDatum(datum); + return len; + } + int16_t drawRightString(const char *string, int16_t poX, int16_t poY, uint8_t idx) + { + uint8_t datum = _datum; + setTextDatum(TR_DATUM); + uint16_t len = drawString(string, poX, poY, idx); + setTextDatum(datum); + return len; + } + int16_t drawFloat(float fp_num, uint8_t dec, int16_t poX, int16_t poY, int16_t idx) + { + char buf[12]; + dtostrf(fp_num, 0, dec, buf); + return drawString(buf, poX, poY, idx); + } + + void setTextDatum(uint8_t datum) { + _padding = 0; + switch (_datum = datum) { + case TL_DATUM: + case TR_DATUM: + case TC_DATUM: + _ydatum = _ascent; + break; + case ML_DATUM: + case MR_DATUM: + case MC_DATUM: + _ydatum = _ascent / 2; + break; + case BL_DATUM: + case BR_DATUM: + case BC_DATUM: + _ydatum = -_descent; + break; + case L_BASELINE: + case R_BASELINE: + case C_BASELINE: + _ydatum = 0; + break; + } + } + void setTextPadding(uint16_t x_width) { + _padding = x_width; + } + uint8_t fontHeight(uint8_t idx) { + GFXfont f; + memcpy_P(&f, _pfont, sizeof(f)); + return f.yAdvance; + } + void setTextFont(uint8_t idx) + { + if (_font == idx) return; + _font = idx; + setFreeFont(Fonts[_font]); + } + + private: + uint16_t _ID, _padding; + uint8_t _font, _first, _datum, _ascent, _descent; + int8_t _ydatum; + const GFXfont *_pfont; +}; diff --git a/Arduino/Libraries/MCUFRIEND_kbv/UTFTGLUE.h b/Arduino/Libraries/MCUFRIEND_kbv/UTFTGLUE.h new file mode 100644 index 0000000..d3dfa88 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/UTFTGLUE.h @@ -0,0 +1,198 @@ +/* + * utftglue.h @@@@@@@@@@@@@@@@@@@@@@@@ LIBRARY @@@@@@@@@@@@@@@@@@@@@@@@@ + * + * Created: 12/05/2019 14:25:06 + * Author: David Prentice + * + * 1. replace "UTFT.h" with "UTFTGLUE.h" + * 2. replace UTFT constructor with UTFTGLUE(model_ID, 0,0,0,0,0) + * 3. remove smallFont, BigFont, SeveSegNumFont declarations + * 4. UTFTGLUE uses FreeFonts or NULL (System 5x7) + * + * 5. knows FreeSmallFont, FreeBigFont and FreeSevenSegNumFont + * 6. any other Fonts just need to #include "FreeOtherXXX.h" + * 7. #define OtherXXX &FreeOtherXXX + */ + +#warning @@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ + +#ifndef UTFTGLUE_H_ +#define UTFTGLUE_H_ + +#define LEFT 0 +#define RIGHT 9999 +#define CENTER 9998 + +#define PORTRAIT 0 +#define LANDSCAPE 1 + +#include + +#include +#if defined(__arm__) && !defined(TEENSYDUINO) +#include +#endif + +#include +#define SmallFont &FreeSmallFont +#define BigFont &FreeBigFont +#define SevenSegNumFont &FreeSevenSegNumFont + +class UTFTGLUE : public MCUFRIEND_kbv +{ + public: +// UTFTGLUE() : MCUFRIEND_kbv() {} + UTFTGLUE(int model_ID, int RS, int WR,int CS, int RST, int RD = A0) + : MCUFRIEND_kbv(CS, RS, WR, RD, RST) { _model_ID = model_ID; } + void InitLCD(byte orientation=LANDSCAPE) { + MCUFRIEND_kbv::reset(); + uint16_t ID = MCUFRIEND_kbv::readID(); +// if (ID == 0) ID = 0x9341; //DealExtreme with EXTC=0 +// if (ID == 0x8989) ID = 0x1289; +// if (ID == 0xD3D3) ID = 0x9481; //write-only controller +// if (ID == 0xD3D3) ID = 0x9486; //write-only controller + if (ID == 0xD3D3) ID = 0x9090; //write-only controller HX8357-D +// if (ID == 0x9327 && orientation == LANDSCAPE) orientation = 3; + MCUFRIEND_kbv::begin(ID); + MCUFRIEND_kbv::setRotation(_orient = orientation); + _radius = 4; + } + void clrScr() { MCUFRIEND_kbv::fillScreen(0x0000);} + void drawPixel(int x, int y) { MCUFRIEND_kbv::drawPixel(x, y, _fcolor);} + void drawLine(int x1, int y1, int x2, int y2) { MCUFRIEND_kbv::drawLine(x1, y1, x2, y2, _fcolor);} + void fillScr(uint16_t color) { MCUFRIEND_kbv::fillScreen(color);} + void fillScr(byte r, byte g, byte b) { MCUFRIEND_kbv::fillScreen(setrgb(r, g, b));} + void drawRect(int x1, int y1, int x2, int y2) { + int w = x2 - x1 + 1, h = y2 - y1 + 1; + if (w < 0) { x1 = x2; w = -w; } + if (h < 0) { y1 = y2; h = -h; } + MCUFRIEND_kbv::drawRect(x1, y1, w, h, _fcolor); + } + void drawRoundRect(int x1, int y1, int x2, int y2) { + int w = x2 - x1 + 1, h = y2 - y1 + 1; + if (w < 0) { x1 = x2; w = -w; } + if (h < 0) { y1 = y2; h = -h; } + MCUFRIEND_kbv::drawRoundRect(x1, y1, w, h, _radius, _fcolor); + } + void fillRect(int x1, int y1, int x2, int y2) { + int w = x2 - x1 + 1, h = y2 - y1 + 1; + if (w < 0) { x1 = x2; w = -w; } + if (h < 0) { y1 = y2; h = -h; } + MCUFRIEND_kbv::fillRect(x1, y1, w, h, _fcolor); + } + void fillRoundRect(int x1, int y1, int x2, int y2) { + int w = x2 - x1 + 1, h = y2 - y1 + 1; + if (w < 0) { x1 = x2; w = -w; } + if (h < 0) { y1 = y2; h = -h; } + MCUFRIEND_kbv::fillRoundRect(x1, y1, w, h, _radius, _fcolor); + } + void drawCircle(int x, int y, int radius) { MCUFRIEND_kbv::drawCircle(x, y, radius, _fcolor);} + void fillCircle(int x, int y, int radius) { MCUFRIEND_kbv::fillCircle(x, y, radius, _fcolor);} + void setColor(byte r, byte g, byte b) { setColor(setrgb(r, g, b));} + void setColor(uint16_t c) { MCUFRIEND_kbv::setTextColor(_fcolor = c, _bcolor); } + void setBackColor(byte r, byte g, byte b) { setBackColor(setrgb(r, g, b)); } + void setBackColor(uint32_t c) { + if (c == 0xFFFFFFFF) _bcolor = _fcolor; + else _bcolor = c; + MCUFRIEND_kbv::setTextColor(_fcolor, _bcolor); + } + void print(const char *st, int x, int y, int deg=0) { + settextcursor((char*)st, x, y); MCUFRIEND_kbv::print(st);} + void print(char *st, int x, int y, int deg=0) { + settextcursor(st, x, y); MCUFRIEND_kbv::print(st);} + void print(String st, int x, int y, int deg=0) { + settextcursor((char*)(st.c_str()), x, y); MCUFRIEND_kbv::print(st);} + void printNumI(long num, int x, int y, int length=0, char filler=' ') { + printNumF(num, 0, x, y, '.', length, filler); + } + void printNumF(double num, byte dec, int x, int y, char divider='.', int length=0, char filler=' ') { + char buf[20]; + dtostrf(num, length, dec, buf); + for (int i = 0; buf[i] == ' '; i++) buf[i] = filler; + settextcursor(buf, x, y, length * _dig_wid * MCUFRIEND_kbv::textsize_x); + MCUFRIEND_kbv::print(buf); + } + void setTextSize(int sz) { MCUFRIEND_kbv::setTextSize(gfxFont == NULL ? sz : 1); } // ####### GFX ######## + void setFont(const GFXfont* font) { + MCUFRIEND_kbv::setFont(font); + _ascend = 8; + _descend = 1; + _dig_wid = 6; + if (font != NULL) { + int16_t x = 0, y = 0, x1, y1 = 0, x2, y2 = 0; + MCUFRIEND_kbv::setTextSize(1); + charBounds('0', &x, &y, &x1, &y1, &x2, &y2); + _ascend = y2 - y1; //yAdvance + _dig_wid = x; //xAdvance + } + } + void drawBitmap(int x, int y, int sx, int sy, const uint16_t *data, int scale=1) { + uint16_t color; + MCUFRIEND_kbv::setAddrWindow(x, y, x + sx*scale - 1, y + sy*scale - 1); + if (scale == 1) MCUFRIEND_kbv::pushColors((const uint8_t*)data, sx * sy, 1); + else { + for (int row = 0; row < sy; row++) { + for (int col = 0; col < sx; col++) { + color = pgm_read_word(data + (row*sx + col)*1); + MCUFRIEND_kbv::fillRect(x+col*scale, y+row*scale, scale, scale, color); + } + } + } + } +// void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int deg, int rox, int roy); +// void lcdOff(); +// void lcdOn(); + void setContrast(char c) {} + int getDisplayXSize() { return MCUFRIEND_kbv::width(); } + int getDisplayYSize() { return MCUFRIEND_kbv::height(); } + void setBrightness(byte br) {} +// void LCD_Write_DATA(char VH,char VL); +// void dispBitmap(File inFile); + uint8_t _ascend, _descend, _dig_wid; + uint16_t _model_ID; + + protected: + uint16_t _fcolor; + uint16_t _bcolor; +// uint8_t _ascend, _descend, _dig_wid; + uint8_t _radius; + uint8_t _orient; + void settextcursor(char *st, int x, int y, int pad = 0) { + int16_t pos, x1, y1; + uint16_t len, w, h; + bool is_gfx = (MCUFRIEND_kbv::gfxFont != NULL); + getTextBounds(st, 0, 0, &x1, &y1, &w, &h); //always + len = x1 + w + 0; // assumes the final right padding = 1. + if (pad >= len) pad = pad - len; + pos = (MCUFRIEND_kbv::width() - len - pad); + if (x == CENTER) x = pos/2; + else if (x == RIGHT) x = pos - 1; + if (is_gfx) { //only GFX fonts need to paint background + h = _ascend + _descend; //pgm_read_byte(&gfxFont->yAdvance); + if (_fcolor != _bcolor) MCUFRIEND_kbv::fillRect(x, y, len + pad + 1, h, _bcolor); + y += h; + } + MCUFRIEND_kbv::setCursor(x + pad, y); + } + uint16_t setrgb(byte r, byte g, byte b) { return ((r&0xF8) << 8) | ((g&0xFC) << 3) | (b>>3);} +}; + +#define VGA_BLACK 0x0000 +#define VGA_WHITE 0xFFFF +#define VGA_RED 0xF800 +#define VGA_GREEN 0x0400 +#define VGA_BLUE 0x001F +#define VGA_SILVER 0xC618 +#define VGA_GRAY 0x8410 +#define VGA_MAROON 0x8000 +#define VGA_YELLOW 0xFFE0 +#define VGA_OLIVE 0x8400 +#define VGA_LIME 0x07E0 +#define VGA_AQUA 0x07FF +#define VGA_TEAL 0x0410 +#define VGA_NAVY 0x0010 +#define VGA_FUCHSIA 0xF81F +#define VGA_PURPLE 0x8010 +#define VGA_TRANSPARENT 0xFFFFFFFF + +#endif /* UTFTGLUE_H_ */ \ No newline at end of file diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/Font_simple/Font_simple.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/Font_simple/Font_simple.ino new file mode 100644 index 0000000..79e7988 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/Font_simple/Font_simple.ino @@ -0,0 +1,68 @@ +#include // Core graphics library +#include // Hardware-specific library +MCUFRIEND_kbv tft; + +#include +#include +#include + +#include + +#define BLACK 0x0000 +#define RED 0xF800 +#define GREEN 0x07E0 +#define WHITE 0xFFFF +#define GREY 0x8410 + +void setup(void) +{ + Serial.begin(9600); + uint16_t ID = tft.readID(); + Serial.println("Example: Font_simple"); + Serial.print("found ID = 0x"); + Serial.println(ID, HEX); + if (ID == 0xD3D3) ID = 0x9481; //force ID if write-only display + tft.begin(ID); + tft.setRotation(0); +} + +void loop(void) +{ + tft.fillScreen(BLACK); + showmsgXY(20, 10, 1, NULL, "System x1"); + showmsgXY(20, 24, 2, NULL, "System x2"); + showmsgXY(20, 60, 1, &FreeSans9pt7b, "FreeSans9pt7b"); + showmsgXY(20, 80, 1, &FreeSans12pt7b, "FreeSans12pt7b"); + showmsgXY(20, 100, 1, &FreeSerif12pt7b, "FreeSerif12pt7b"); + showmsgXY(20, 120, 1, &FreeSmallFont, "FreeSmallFont"); + showmsgXY(5, 180, 1, &FreeSevenSegNumFont, "01234"); + showmsgXY(5, 190, 1, NULL, "System Font is drawn from topline"); + tft.setTextColor(RED, GREY); + tft.setTextSize(2); + tft.setCursor(0, 220); + tft.print("7x5 can overwrite"); + delay(1000); + tft.setCursor(0, 220); + tft.print("if background set"); + delay(1000); + showmsgXY(5, 260, 1, &FreeSans9pt7b, "Free Fonts from baseline"); + showmsgXY(5, 285, 1, &FreeSans9pt7b, "Free Fonts transparent"); + delay(1000); + showmsgXY(5, 285, 1, &FreeSans9pt7b, "Free Fonts XXX"); + delay(1000); + showmsgXY(5, 310, 1, &FreeSans9pt7b, "erase backgnd with fillRect()"); + delay(10000); +} + +void showmsgXY(int x, int y, int sz, const GFXfont *f, const char *msg) +{ + int16_t x1, y1; + uint16_t wid, ht; + tft.drawFastHLine(0, y, tft.width(), WHITE); + tft.setFont(f); + tft.setCursor(x, y); + tft.setTextColor(GREEN); + tft.setTextSize(sz); + tft.print(msg); + delay(1000); +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_220x176/GLUE_Demo_220x176.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_220x176/GLUE_Demo_220x176.ino new file mode 100644 index 0000000..b09e53c --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_220x176/GLUE_Demo_220x176.ino @@ -0,0 +1,342 @@ +// UTFT_Demo_220x176 +// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved +// web: http://www.RinkyDinkElectronics.com/ +// +// This program is a demo of how to use most of the functions +// of the library with a supported display modules. +// +// This demo was made for modules with a screen resolution +// of 220x176 pixels. +// +// This program requires the UTFT library. +// + +//################################################ +// GLUE class that implements the UTFT API +// replace UTFT include and constructor statements +// remove UTFT font declaration e.g. SmallFont +//################################################ + +#include //use GLUE class and constructor +UTFTGLUE myGLCD(0,A2,A1,A3,A4,A0); //all dummy args + +// Declare which fonts we will be using +//extern uint8_t SmallFont[]; //GLUE defines as GFXFont ref + +// Set the pins to the correct ones for your development shield +// ------------------------------------------------------------ +// Arduino Uno / 2009: +// ------------------- +// Standard Arduino Uno/2009 shield : ,A5,A4,A3,A2 +// DisplayModule Arduino Uno TFT shield : ,A5,A4,A3,A2 +// +// Arduino Mega: +// ------------------- +// Standard Arduino Mega/Due shield : ,38,39,40,41 +// CTE TFT LCD/SD Shield for Arduino Mega : ,38,39,40,41 +// +// Remember to change the model parameter to suit your display module! +//UTFT myGLCD(ITDB22,A5,A4,A3,A2); + +void setup() +{ + randomSeed(analogRead(0)); + +// Setup the LCD + myGLCD.InitLCD(); + myGLCD.setFont(SmallFont); +} + +void loop() +{ + int buf[218]; + int x, x2; + int y, y2; + int r; + +// Clear the screen and draw the frame + myGLCD.clrScr(); + + myGLCD.setColor(255, 0, 0); + myGLCD.fillRect(0, 0, 219, 13); + myGLCD.setColor(64, 64, 64); + myGLCD.fillRect(0, 162, 219, 175); + myGLCD.setColor(255, 255, 255); + myGLCD.setBackColor(255, 0, 0); + myGLCD.print("** Universal TFT Library **", CENTER, 1); + myGLCD.setBackColor(64, 64, 64); + myGLCD.setColor(255,255,0); + myGLCD.print("> Rinky-Dink Electronics <", CENTER, 163); + + myGLCD.setColor(0, 0, 255); + myGLCD.drawRect(0, 14, 219, 161); + +// Draw crosshairs + myGLCD.setColor(0, 0, 255); + myGLCD.setBackColor(0, 0, 0); + myGLCD.drawLine(109, 15, 109, 160); + myGLCD.drawLine(1, 88, 218, 88); + + for (int i=9; i<210; i+=10) + myGLCD.drawLine(i, 86, i, 90); + for (int i=19; i<155; i+=10) + myGLCD.drawLine(107, i, 111, i); + +// Draw sin-, cos- and tan-lines + myGLCD.setColor(0,255,255); + myGLCD.print("Sin", 5, 15); + for (int i=1; i<218; i++) + { + myGLCD.drawPixel(i,88+(sin(((i*1.65)*3.14)/180)*70)); + } + + myGLCD.setColor(255,0,0); + myGLCD.print("Cos", 5, 27); + for (int i=1; i<218; i++) + { + myGLCD.drawPixel(i,88+(cos(((i*1.65)*3.14)/180)*70)); + } + + myGLCD.setColor(255,255,0); + myGLCD.print("Tan", 5, 39); + for (int i=1; i<218; i++) + { + myGLCD.drawPixel(i,88+(tan(((i*1.65)*3.14)/180))); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,218,160); + myGLCD.setColor(0, 0, 255); + myGLCD.setBackColor(0, 0, 0); + myGLCD.drawLine(109, 15, 109, 160); + myGLCD.drawLine(1, 88, 218, 88); + +// Draw a moving sinewave + x=1; + for (int i=1; i<(218*20); i++) + { + x++; + if (x==219) + x=1; + if (i>219) + { + if ((x==109)||(buf[x-1]==88)) + myGLCD.setColor(0,0,255); + else + myGLCD.setColor(0,0,0); + myGLCD.drawPixel(x,buf[x-1]); + } + myGLCD.setColor(0,255,255); + y=88+(sin(((i*1.6)*3.14)/180)*(65-(i / 100))); + myGLCD.drawPixel(x,y); + buf[x-1]=y; + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,218,160); + +// Draw some filled rectangles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillRect(44+(i*15), 23+(i*15), 88+(i*15), 63+(i*15)); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,218,160); + +// Draw some filled, rounded rectangles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillRoundRect(132-(i*15), 23+(i*15), 172-(i*15), 63+(i*15)); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,218,160); + +// Draw some filled circles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillCircle(64+(i*15),43+(i*15), 20); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,218,160); + +// Draw some lines in a pattern + myGLCD.setColor (255,0,0); + for (int i=15; i<160; i+=5) + { + myGLCD.drawLine(1, i, (i*1.44)-10, 160); + } + myGLCD.setColor (255,0,0); + for (int i=160; i>15; i-=5) + { + myGLCD.drawLine(218, i, (i*1.44)-12, 15); + } + myGLCD.setColor (0,255,255); + for (int i=160; i>15; i-=5) + { + myGLCD.drawLine(1, i, 232-(i*1.44), 15); + } + myGLCD.setColor (0,255,255); + for (int i=15; i<160; i+=5) + { + myGLCD.drawLine(218, i, 231-(i*1.44), 160); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,218,160); + +// Draw some random circles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=22+random(176); + y=35+random(105); + r=random(20); + myGLCD.drawCircle(x, y, r); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,218,160); + +// Draw some random rectangles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(216); + y=16+random(143); + x2=2+random(216); + y2=16+random(143); + myGLCD.drawRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,218,160); + +// Draw some random rounded rectangles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(216); + y=16+random(143); + x2=2+random(216); + y2=16+random(143); + myGLCD.drawRoundRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,218,160); + + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(216); + y=16+random(143); + x2=2+random(216); + y2=16+random(143); + myGLCD.drawLine(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,218,160); + + for (int i=0; i<10000; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + myGLCD.drawPixel(2+random(216), 16+random(143)); + } + + delay(2000); + + myGLCD.fillScr(0, 0, 255); + myGLCD.setColor(255, 0, 0); + myGLCD.fillRoundRect(40, 57, 179, 119); + + myGLCD.setColor(255, 255, 255); + myGLCD.setBackColor(255, 0, 0); + myGLCD.print("That's it!", CENTER, 62); + myGLCD.print("Restarting in a", CENTER, 88); + myGLCD.print("few seconds...", CENTER, 101); + + myGLCD.setColor(0, 255, 0); + myGLCD.setBackColor(0, 0, 255); + myGLCD.print("Runtime: (msecs)", CENTER, 146); + myGLCD.printNumI(millis(), CENTER, 161); + + delay (10000); +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_320x240/GLUE_Demo_320x240.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_320x240/GLUE_Demo_320x240.ino new file mode 100644 index 0000000..7d06205 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_320x240/GLUE_Demo_320x240.ino @@ -0,0 +1,341 @@ +// UTFT_Demo_320x240 +// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved +// web: http://www.RinkyDinkElectronics.com/ +// +// This program is a demo of how to use most of the functions +// of the library with a supported display modules. +// +// This demo was made for modules with a screen resolution +// of 320x240 pixels. +// +// This program requires the UTFT library. +// + +//################################################ +// GLUE class that implements the UTFT API +// replace UTFT include and constructor statements +// remove UTFT font declaration e.g. SmallFont +//################################################ + +#include //use GLUE class and constructor +UTFTGLUE myGLCD(0,A2,A1,A3,A4,A0); //all dummy args + +// Declare which fonts we will be using +//extern uint8_t SmallFont[]; //GLUE defines as GFXFont ref + +// Set the pins to the correct ones for your development shield +// ------------------------------------------------------------ +// Arduino Uno / 2009: +// ------------------- +// Standard Arduino Uno/2009 shield : ,A5,A4,A3,A2 +// DisplayModule Arduino Uno TFT shield : ,A5,A4,A3,A2 +// +// Arduino Mega: +// ------------------- +// Standard Arduino Mega/Due shield : ,38,39,40,41 +// CTE TFT LCD/SD Shield for Arduino Mega : ,38,39,40,41 +// +// Remember to change the model parameter to suit your display module! +//UTFT myGLCD(ITDB32S,38,39,40,41); + +void setup() +{ + randomSeed(analogRead(0)); + +// Setup the LCD + myGLCD.InitLCD(); + myGLCD.setFont(SmallFont); +} + +void loop() +{ + int buf[318]; + int x, x2; + int y, y2; + int r; + +// Clear the screen and draw the frame + myGLCD.clrScr(); + + myGLCD.setColor(255, 0, 0); + myGLCD.fillRect(0, 0, 319, 13); + myGLCD.setColor(64, 64, 64); + myGLCD.fillRect(0, 226, 319, 239); + myGLCD.setColor(255, 255, 255); + myGLCD.setBackColor(255, 0, 0); + myGLCD.print("* Universal Color TFT Display Library *", CENTER, 1); + myGLCD.setBackColor(64, 64, 64); + myGLCD.setColor(255,255,0); + myGLCD.print("", CENTER, 227); + + myGLCD.setColor(0, 0, 255); + myGLCD.drawRect(0, 14, 319, 225); + +// Draw crosshairs + myGLCD.setColor(0, 0, 255); + myGLCD.setBackColor(0, 0, 0); + myGLCD.drawLine(159, 15, 159, 224); + myGLCD.drawLine(1, 119, 318, 119); + for (int i=9; i<310; i+=10) + myGLCD.drawLine(i, 117, i, 121); + for (int i=19; i<220; i+=10) + myGLCD.drawLine(157, i, 161, i); + +// Draw sin-, cos- and tan-lines + myGLCD.setColor(0,255,255); + myGLCD.print("Sin", 5, 15); + for (int i=1; i<318; i++) + { + myGLCD.drawPixel(i,119+(sin(((i*1.13)*3.14)/180)*95)); + } + + myGLCD.setColor(255,0,0); + myGLCD.print("Cos", 5, 27); + for (int i=1; i<318; i++) + { + myGLCD.drawPixel(i,119+(cos(((i*1.13)*3.14)/180)*95)); + } + + myGLCD.setColor(255,255,0); + myGLCD.print("Tan", 5, 39); + for (int i=1; i<318; i++) + { + myGLCD.drawPixel(i,119+(tan(((i*1.13)*3.14)/180))); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,318,224); + myGLCD.setColor(0, 0, 255); + myGLCD.setBackColor(0, 0, 0); + myGLCD.drawLine(159, 15, 159, 224); + myGLCD.drawLine(1, 119, 318, 119); + +// Draw a moving sinewave + x=1; + for (int i=1; i<(318*20); i++) + { + x++; + if (x==319) + x=1; + if (i>319) + { + if ((x==159)||(buf[x-1]==119)) + myGLCD.setColor(0,0,255); + else + myGLCD.setColor(0,0,0); + myGLCD.drawPixel(x,buf[x-1]); + } + myGLCD.setColor(0,255,255); + y=119+(sin(((i*1.1)*3.14)/180)*(90-(i / 100))); + myGLCD.drawPixel(x,y); + buf[x-1]=y; + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,318,224); + +// Draw some filled rectangles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillRect(70+(i*20), 30+(i*20), 130+(i*20), 90+(i*20)); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,318,224); + +// Draw some filled, rounded rectangles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillRoundRect(190-(i*20), 30+(i*20), 250-(i*20), 90+(i*20)); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,318,224); + +// Draw some filled circles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillCircle(100+(i*20),60+(i*20), 30); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,318,224); + +// Draw some lines in a pattern + myGLCD.setColor (255,0,0); + for (int i=15; i<224; i+=5) + { + myGLCD.drawLine(1, i, (i*1.44)-10, 224); + } + myGLCD.setColor (255,0,0); + for (int i=224; i>15; i-=5) + { + myGLCD.drawLine(318, i, (i*1.44)-11, 15); + } + myGLCD.setColor (0,255,255); + for (int i=224; i>15; i-=5) + { + myGLCD.drawLine(1, i, 331-(i*1.44), 15); + } + myGLCD.setColor (0,255,255); + for (int i=15; i<224; i+=5) + { + myGLCD.drawLine(318, i, 330-(i*1.44), 224); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,318,224); + +// Draw some random circles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=32+random(256); + y=45+random(146); + r=random(30); + myGLCD.drawCircle(x, y, r); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,318,224); + +// Draw some random rectangles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(316); + y=16+random(207); + x2=2+random(316); + y2=16+random(207); + myGLCD.drawRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,318,224); + +// Draw some random rounded rectangles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(316); + y=16+random(207); + x2=2+random(316); + y2=16+random(207); + myGLCD.drawRoundRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,318,224); + + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(316); + y=16+random(209); + x2=2+random(316); + y2=16+random(209); + myGLCD.drawLine(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,318,224); + + for (int i=0; i<10000; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + myGLCD.drawPixel(2+random(316), 16+random(209)); + } + + delay(2000); + + myGLCD.fillScr(0, 0, 255); + myGLCD.setColor(255, 0, 0); + myGLCD.fillRoundRect(80, 70, 239, 169); + + myGLCD.setColor(255, 255, 255); + myGLCD.setBackColor(255, 0, 0); + myGLCD.print("That's it!", CENTER, 93); + myGLCD.print("Restarting in a", CENTER, 119); + myGLCD.print("few seconds...", CENTER, 132); + + myGLCD.setColor(0, 255, 0); + myGLCD.setBackColor(0, 0, 255); + myGLCD.print("Runtime: (msecs)", CENTER, 210); + myGLCD.printNumI(millis(), CENTER, 225); + + delay (10000); +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_400x240/GLUE_Demo_400x240.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_400x240/GLUE_Demo_400x240.ino new file mode 100644 index 0000000..e89af66 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_400x240/GLUE_Demo_400x240.ino @@ -0,0 +1,343 @@ +// UTFT_Demo_400x240 +// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved +// web: http://www.RinkyDinkElectronics.com/ +// +// This program is a demo of how to use most of the functions +// of the library with a supported display modules. +// +// This demo was made for modules with a screen resolution +// of 400x240 pixels. +// +// This program requires the UTFT library. +// + +//################################################ +// GLUE class that implements the UTFT API +// replace UTFT include and constructor statements +// remove UTFT font declaration e.g. SmallFont +//################################################ + +#include //use GLUE class and constructor +UTFTGLUE myGLCD(0,A2,A1,A3,A4,A0); //all dummy args + +// Declare which fonts we will be using +//extern uint8_t SmallFont[]; + +// Set the pins to the correct ones for your development shield +// ------------------------------------------------------------ +// Arduino Uno / 2009: +// ------------------- +// Standard Arduino Uno/2009 shield : ,A5,A4,A3,A2 +// DisplayModule Arduino Uno TFT shield : ,A5,A4,A3,A2 +// +// Arduino Mega: +// ------------------- +// Standard Arduino Mega/Due shield : ,38,39,40,41 +// CTE TFT LCD/SD Shield for Arduino Mega : ,38,39,40,41 +// +// Remember to change the model parameter to suit your display module! +//UTFT myGLCD(ITDB32WD,38,39,40,41); + +void setup() +{ + randomSeed(analogRead(0)); + +// Setup the LCD + myGLCD.InitLCD(); + myGLCD.setFont(SmallFont); +} + +void loop() +{ + int buf[398]; + int x, x2; + int y, y2; + int r; + +// Clear the screen and draw the frame + myGLCD.clrScr(); + + myGLCD.setColor(255, 0, 0); + myGLCD.fillRect(0, 0, 399, 13); + myGLCD.setColor(64, 64, 64); + myGLCD.fillRect(0, 226, 399, 239); + myGLCD.setColor(255, 255, 255); + myGLCD.setBackColor(255, 0, 0); + myGLCD.print("*** Universal Color TFT Display Library ***", CENTER, 1); + myGLCD.setBackColor(64, 64, 64); + myGLCD.setColor(255,255,0); + myGLCD.print("< http://www.RinkyDinkElectronics.com/ >", CENTER, 227); + + myGLCD.setColor(0, 0, 255); + myGLCD.drawRect(0, 14, 399, 225); + +// Draw crosshairs + myGLCD.setColor(0, 0, 255); + myGLCD.setBackColor(0, 0, 0); + myGLCD.drawLine(199, 15, 199, 224); + myGLCD.drawLine(1, 119, 398, 119); + for (int i=9; i<390; i+=10) + myGLCD.drawLine(i, 117, i, 121); + for (int i=19; i<220; i+=10) + myGLCD.drawLine(197, i, 201, i); + +// Draw sin-, cos- and tan-lines + myGLCD.setColor(0,255,255); + myGLCD.print("Sin", 5, 15); + for (int i=1; i<398; i++) + { + myGLCD.drawPixel(i,119+(sin(((i*0.9)*3.14)/180)*95)); + } + + myGLCD.setColor(255,0,0); + myGLCD.print("Cos", 5, 27); + for (int i=1; i<398; i++) + { + myGLCD.drawPixel(i,119+(cos(((i*0.9)*3.14)/180)*95)); + } + + myGLCD.setColor(255,255,0); + myGLCD.print("Tan", 5, 39); + for (int i=1; i<398; i++) + { + y=119+(tan(((i*0.9)*3.14)/180)); + if ((y>15) && (y<224)) + myGLCD.drawPixel(i,y); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,398,224); + myGLCD.setColor(0, 0, 255); + myGLCD.setBackColor(0, 0, 0); + myGLCD.drawLine(199, 15, 199, 224); + myGLCD.drawLine(1, 119, 398, 119); + +// Draw a moving sinewave + x=1; + for (int i=1; i<(398*20); i++) + { + x++; + if (x==399) + x=1; + if (i>399) + { + if ((x==199)||(buf[x-1]==119)) + myGLCD.setColor(0,0,255); + else + myGLCD.setColor(0,0,0); + myGLCD.drawPixel(x,buf[x-1]); + } + myGLCD.setColor(0,255,255); + y=119+(sin(((i)*3.14)/180)*(90-(i / 100))); + myGLCD.drawPixel(x,y); + buf[x-1]=y; + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,398,224); + +// Draw some filled rectangles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillRect(110+(i*20), 30+(i*20), 170+(i*20), 90+(i*20)); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,398,224); + +// Draw some filled, rounded rectangles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillRoundRect(230-(i*20), 30+(i*20), 290-(i*20), 90+(i*20)); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,398,224); + +// Draw some filled circles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillCircle(110+(i*30),60+(i*20), 30); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,398,224); + +// Draw some lines in a pattern + myGLCD.setColor (255,0,0); + for (int i=15; i<224; i+=5) + { + myGLCD.drawLine(1, i, (i*1.77)-10, 224); + } + myGLCD.setColor (255,0,0); + for (int i=224; i>15; i-=5) + { + myGLCD.drawLine(398, i, (i*1.77)-11, 15); + } + myGLCD.setColor (0,255,255); + for (int i=224; i>15; i-=5) + { + myGLCD.drawLine(1, i, 411-(i*1.77), 15); + } + myGLCD.setColor (0,255,255); + for (int i=15; i<224; i+=5) + { + myGLCD.drawLine(398, i, 410-(i*1.77), 224); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,398,224); + +// Draw some random circles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=32+random(336); + y=45+random(146); + r=random(30); + myGLCD.drawCircle(x, y, r); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,398,224); + +// Draw some random rectangles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(396); + y=16+random(207); + x2=2+random(396); + y2=16+random(207); + myGLCD.drawRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,398,224); + +// Draw some random rounded rectangles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(396); + y=16+random(207); + x2=2+random(396); + y2=16+random(207); + myGLCD.drawRoundRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,398,224); + + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(396); + y=16+random(209); + x2=2+random(396); + y2=16+random(209); + myGLCD.drawLine(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,398,224); + + for (int i=0; i<10000; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + myGLCD.drawPixel(2+random(396), 16+random(209)); + } + + delay(2000); + + myGLCD.fillScr(0, 0, 255); + myGLCD.setColor(255, 0, 0); + myGLCD.fillRoundRect(120, 70, 279, 169); + + myGLCD.setColor(255, 255, 255); + myGLCD.setBackColor(255, 0, 0); + myGLCD.print("That's it!", CENTER, 93); + myGLCD.print("Restarting in a", CENTER, 119); + myGLCD.print("few seconds...", CENTER, 132); + + myGLCD.setColor(0, 255, 0); + myGLCD.setBackColor(0, 0, 255); + myGLCD.print("Runtime: (msecs)", CENTER, 210); + myGLCD.printNumI(millis(), CENTER, 225); + + delay (10000); +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_480x320/GLUE_Demo_480x320.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_480x320/GLUE_Demo_480x320.ino new file mode 100644 index 0000000..8ee943e --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_480x320/GLUE_Demo_480x320.ino @@ -0,0 +1,341 @@ +// UTFT_Demo_480x320 +// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved +// web: http://www.RinkyDinkElectronics.com/ +// +// This program is a demo of how to use most of the functions +// of the library with a supported display modules. +// +// This demo was made for modules with a screen resolution +// of 480x320 pixels. +// +// This program requires the UTFT library. +// + +//################################################ +// GLUE class that implements the UTFT API +// replace UTFT include and constructor statements +// remove UTFT font declaration e.g. SmallFont +//################################################ + +#include //use GLUE class and constructor +UTFTGLUE myGLCD(0,A2,A1,A3,A4,A0); //all dummy args + +// Declare which fonts we will be using +//extern uint8_t SmallFont[]; //GLUE defines as GFXFont ref + +// Set the pins to the correct ones for your development shield +// ------------------------------------------------------------ +// Arduino Uno / 2009: +// ------------------- +// Standard Arduino Uno/2009 shield : ,A5,A4,A3,A2 +// DisplayModule Arduino Uno TFT shield : ,A5,A4,A3,A2 +// +// Arduino Mega: +// ------------------- +// Standard Arduino Mega/Due shield : ,38,39,40,41 +// CTE TFT LCD/SD Shield for Arduino Mega : ,38,39,40,41 +// +// Remember to change the model parameter to suit your display module! +//UTFT myGLCD(CTE32HR,38,39,40,41); + +void setup() +{ + randomSeed(analogRead(0)); + +// Setup the LCD + myGLCD.InitLCD(); + myGLCD.setFont(SmallFont); +} + +void loop() +{ + int buf[478]; + int x, x2; + int y, y2; + int r; + +// Clear the screen and draw the frame + myGLCD.clrScr(); + + myGLCD.setColor(255, 0, 0); + myGLCD.fillRect(0, 0, 479, 13); + myGLCD.setColor(64, 64, 64); + myGLCD.fillRect(0, 306, 479, 319); + myGLCD.setColor(255, 255, 255); + myGLCD.setBackColor(255, 0, 0); + myGLCD.print("* Universal Color TFT Display Library *", CENTER, 1); + myGLCD.setBackColor(64, 64, 64); + myGLCD.setColor(255,255,0); + myGLCD.print("", CENTER, 307); + + myGLCD.setColor(0, 0, 255); + myGLCD.drawRect(0, 14, 479, 305); + +// Draw crosshairs + myGLCD.setColor(0, 0, 255); + myGLCD.setBackColor(0, 0, 0); + myGLCD.drawLine(239, 15, 239, 304); + myGLCD.drawLine(1, 159, 478, 159); + for (int i=9; i<470; i+=10) + myGLCD.drawLine(i, 157, i, 161); + for (int i=19; i<220; i+=10) + myGLCD.drawLine(237, i, 241, i); + +// Draw sin-, cos- and tan-lines + myGLCD.setColor(0,255,255); + myGLCD.print("Sin", 5, 15); + for (int i=1; i<478; i++) + { + myGLCD.drawPixel(i,159+(sin(((i*1.13)*3.14)/180)*95)); + } + + myGLCD.setColor(255,0,0); + myGLCD.print("Cos", 5, 27); + for (int i=1; i<478; i++) + { + myGLCD.drawPixel(i,159+(cos(((i*1.13)*3.14)/180)*95)); + } + + myGLCD.setColor(255,255,0); + myGLCD.print("Tan", 5, 39); + for (int i=1; i<478; i++) + { + myGLCD.drawPixel(i,159+(tan(((i*1.13)*3.14)/180))); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,478,304); + myGLCD.setColor(0, 0, 255); + myGLCD.setBackColor(0, 0, 0); + myGLCD.drawLine(239, 15, 239, 304); + myGLCD.drawLine(1, 159, 478, 159); + +// Draw a moving sinewave + x=1; + for (int i=1; i<(478*15); i++) + { + x++; + if (x==479) + x=1; + if (i>479) + { + if ((x==239)||(buf[x-1]==159)) + myGLCD.setColor(0,0,255); + else + myGLCD.setColor(0,0,0); + myGLCD.drawPixel(x,buf[x-1]); + } + myGLCD.setColor(0,255,255); + y=159+(sin(((i*0.7)*3.14)/180)*(90-(i / 100))); + myGLCD.drawPixel(x,y); + buf[x-1]=y; + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,478,304); + +// Draw some filled rectangles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillRect(150+(i*20), 70+(i*20), 210+(i*20), 130+(i*20)); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,478,304); + +// Draw some filled, rounded rectangles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillRoundRect(270-(i*20), 70+(i*20), 330-(i*20), 130+(i*20)); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,478,304); + +// Draw some filled circles + for (int i=1; i<6; i++) + { + switch (i) + { + case 1: + myGLCD.setColor(255,0,255); + break; + case 2: + myGLCD.setColor(255,0,0); + break; + case 3: + myGLCD.setColor(0,255,0); + break; + case 4: + myGLCD.setColor(0,0,255); + break; + case 5: + myGLCD.setColor(255,255,0); + break; + } + myGLCD.fillCircle(180+(i*20),100+(i*20), 30); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,478,304); + +// Draw some lines in a pattern + myGLCD.setColor (255,0,0); + for (int i=15; i<304; i+=5) + { + myGLCD.drawLine(1, i, (i*1.6)-10, 304); + } + myGLCD.setColor (255,0,0); + for (int i=304; i>15; i-=5) + { + myGLCD.drawLine(478, i, (i*1.6)-11, 15); + } + myGLCD.setColor (0,255,255); + for (int i=304; i>15; i-=5) + { + myGLCD.drawLine(1, i, 491-(i*1.6), 15); + } + myGLCD.setColor (0,255,255); + for (int i=15; i<304; i+=5) + { + myGLCD.drawLine(478, i, 490-(i*1.6), 304); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,478,304); + +// Draw some random circles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=32+random(416); + y=45+random(226); + r=random(30); + myGLCD.drawCircle(x, y, r); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,478,304); + +// Draw some random rectangles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(476); + y=16+random(289); + x2=2+random(476); + y2=16+random(289); + myGLCD.drawRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,478,304); + +// Draw some random rounded rectangles + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(476); + y=16+random(289); + x2=2+random(476); + y2=16+random(289); + myGLCD.drawRoundRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,478,304); + + for (int i=0; i<100; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(476); + y=16+random(289); + x2=2+random(476); + y2=16+random(289); + myGLCD.drawLine(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,478,304); + + for (int i=0; i<10000; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + myGLCD.drawPixel(2+random(476), 16+random(289)); + } + + delay(2000); + + myGLCD.fillScr(0, 0, 255); + myGLCD.setColor(255, 0, 0); + myGLCD.fillRoundRect(160, 70, 319, 169); + + myGLCD.setColor(255, 255, 255); + myGLCD.setBackColor(255, 0, 0); + myGLCD.print("That's it!", CENTER, 93); + myGLCD.print("Restarting in a", CENTER, 119); + myGLCD.print("few seconds...", CENTER, 132); + + myGLCD.setColor(0, 255, 0); + myGLCD.setBackColor(0, 0, 255); + myGLCD.print("Runtime: (msecs)", CENTER, 290); + myGLCD.printNumI(millis(), CENTER, 305); + + delay (10000); +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_800x480/GLUE_Demo_800x480.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_800x480/GLUE_Demo_800x480.ino new file mode 100644 index 0000000..1a9ff43 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/GLUE_Demo_800x480/GLUE_Demo_800x480.ino @@ -0,0 +1,296 @@ +// UTFT_Demo_800x480 +// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved +// web: http://www.RinkyDinkElectronics.com/ +// +// This program is a demo of how to use most of the functions +// of the library with a supported display modules. +// +// This demo was made for modules with a screen resolution +// of 800x480 pixels. +// +// This program requires the UTFT library. +// + +#include +#include +UTFTGLUE myGLCD(0x9163,A2,A1,A3,A4,A0); //arguments are ignored + +// Declare which fonts we will be using +extern uint8_t SmallFont[]; + +// Set the pins to the correct ones for your development shield +// ------------------------------------------------------------ +// Arduino Uno / 2009: +// ------------------- +// Standard Arduino Uno/2009 shield : ,A5,A4,A3,A2 +// DisplayModule Arduino Uno TFT shield : ,A5,A4,A3,A2 +// +// Arduino Mega: +// ------------------- +// Standard Arduino Mega/Due shield : ,38,39,40,41 +// CTE TFT LCD/SD Shield for Arduino Mega : ,38,39,40,41 +// +// Remember to change the model parameter to suit your display module! +//UTFT myGLCD(ITDB50,38,39,40,41); + +void setup() +{ + randomSeed(analogRead(0)); + +// Setup the LCD + myGLCD.InitLCD(PORTRAIT); //800x480 is already wider than tall. + myGLCD.setFont(SmallFont); +} + +void loop() +{ + int buf[798]; + int x, x2; + int y, y2; + int r; + +// Clear the screen and draw the frame + myGLCD.clrScr(); + + myGLCD.setColor(255, 0, 0); + myGLCD.fillRect(0, 0, 799, 13); + myGLCD.setColor(64, 64, 64); + myGLCD.fillRect(0, 466, 799, 479); + myGLCD.setColor(255, 255, 255); + myGLCD.setBackColor(255, 0, 0); + myGLCD.print("* Universal Color TFT Display Library *", CENTER, 1); + myGLCD.setBackColor(64, 64, 64); + myGLCD.setColor(255,255,0); + myGLCD.print("", CENTER, 467); + + myGLCD.setColor(0, 0, 255); + myGLCD.drawRect(0, 14, 799, 465); + +// Draw crosshairs + myGLCD.setColor(0, 0, 255); + myGLCD.setBackColor(0, 0, 0); + myGLCD.drawLine(399, 15, 399, 464); + myGLCD.drawLine(1, 239, 798, 239); + for (int i=9; i<790; i+=10) + myGLCD.drawLine(i, 237, i, 242); + for (int i=19; i<470; i+=10) + myGLCD.drawLine(397, i, 402, i); + +// Draw sin-, cos- and tan-lines + myGLCD.setColor(0,255,255); + myGLCD.print("Sin", 5, 15); + for (int i=1; i<798; i++) + { + myGLCD.drawPixel(i,239+(sin(((i*1.13)*3.14)/180)*200)); + } + + myGLCD.setColor(255,0,0); + myGLCD.print("Cos", 5, 27); + for (int i=1; i<798; i++) + { + myGLCD.drawPixel(i,239+(cos(((i*1.13)*3.14)/180)*200)); + } + + myGLCD.setColor(255,255,0); + myGLCD.print("Tan", 5, 39); + for (int i=1; i<798; i++) + { + myGLCD.drawPixel(i,239+(tan(((i*0.9)*3.14)/180))); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,798,464); + myGLCD.setColor(0, 0, 255); + myGLCD.setBackColor(0, 0, 0); + myGLCD.drawLine(399, 15, 399, 464); + myGLCD.drawLine(1, 239, 798, 239); + +// Draw a moving sinewave + x=1; + for (int i=1; i<(798*20); i++) + { + x++; + if (x==799) + x=1; + if (i>799) + { + if ((x==399)||(buf[x-1]==239)) + myGLCD.setColor(0,0,255); + else + myGLCD.setColor(0,0,0); + myGLCD.drawPixel(x,buf[x-1]); + } + myGLCD.setColor(0,255,255); + y=239+(sin(((i*1.65)*3.14)/180)*(200-(i / 100))); + myGLCD.drawPixel(x,y); + buf[x-1]=y; + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,798,464); + +// Draw some random filled rectangles + for (int i=0; i<50; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(746); + y=16+random(397); + x2=x+50; + y2=y+50; + myGLCD.fillRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,798,464); + +// Draw some random filled, rounded rectangles + for (int i=0; i<50; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(746); + y=16+random(397); + x2=x+50; + y2=y+50; + myGLCD.fillRoundRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,798,464); + +// Draw some random filled circles + for (int i=0; i<50; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=27+random(746); + y=41+random(397); + myGLCD.fillCircle(x, y, 25); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,798,464); + +// Draw some lines in a pattern + myGLCD.setColor (255,0,0); + for (int i=15; i<463; i+=5) + { + myGLCD.drawLine(1, i, (i*1.66)-10, 463); + } + myGLCD.setColor (255,0,0); + for (int i=463; i>15; i-=5) + { + myGLCD.drawLine(798, i, (i*1.66)+30, 15); + } + myGLCD.setColor (0,255,255); + for (int i=463; i>15; i-=5) + { + myGLCD.drawLine(1, i, 770-(i*1.66), 15); + } + myGLCD.setColor (0,255,255); + for (int i=15; i<463; i+=5) + { + myGLCD.drawLine(798, i, 810-(i*1.66), 463); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,798,464); + +// Draw some random circles + for (int i=0; i<250; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=32+random(736); + y=45+random(386); + r=random(30); + myGLCD.drawCircle(x, y, r); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,798,464); + +// Draw some random rectangles + for (int i=0; i<250; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(796); + y=16+random(447); + x2=2+random(796); + y2=16+random(447); + myGLCD.drawRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,798,464); + +// Draw some random rounded rectangles + for (int i=0; i<250; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(796); + y=16+random(447); + x2=2+random(796); + y2=16+random(447); + myGLCD.drawRoundRect(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,798,464); + + for (int i=0; i<250; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + x=2+random(796); + y=16+random(447); + x2=2+random(796); + y2=16+random(447); + myGLCD.drawLine(x, y, x2, y2); + } + + delay(2000); + + myGLCD.setColor(0,0,0); + myGLCD.fillRect(1,15,798,464); + + for (int i=0; i<10000; i++) + { + myGLCD.setColor(random(255), random(255), random(255)); + myGLCD.drawPixel(2+random(796), 16+random(447)); + } + + delay(2000); + + myGLCD.fillScr(0, 0, 255); + myGLCD.setColor(255, 0, 0); + myGLCD.fillRoundRect(320, 190, 479, 289); + + myGLCD.setColor(255, 255, 255); + myGLCD.setBackColor(255, 0, 0); + myGLCD.print("That's it!", CENTER, 213); + myGLCD.print("Restarting in a", CENTER, 239); + myGLCD.print("few seconds...", CENTER, 252); + + myGLCD.setColor(0, 255, 0); + myGLCD.setBackColor(0, 0, 255); + myGLCD.print("Runtime: (msecs)", CENTER, 450); + myGLCD.printNumI(millis(), CENTER, 465); + + delay (10000); +} + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/LCD_ID_readnew/LCD_ID_readnew.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/LCD_ID_readnew/LCD_ID_readnew.ino new file mode 100644 index 0000000..92b28ec --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/LCD_ID_readnew/LCD_ID_readnew.ino @@ -0,0 +1,734 @@ +// adapted from LCD_ID_Reader from http://misc.ws/lcd_information +// controllers either read as 16-bit or as a sequence of 8-bit values + +//-- Arduino UNO or Mega 2560 Plugged as shield +#define LCD_RST A4 //A1 +#define LCD_CS A3 +#define LCD_RS A2 +#define LCD_WR A1 +#define LCD_RD A0 + +#define LCD_D0 8 +#define LCD_D1 9 +#define LCD_D2 2 //10 +#define LCD_D3 3 //11 +#define LCD_D4 4 +#define LCD_D5 5 //13 +#define LCD_D6 6 +#define LCD_D7 7 + +uint8_t unlock_1520[] = { (0xB0), 2, 0x00, 0x00 }; +uint8_t unlock_1526[] = { (0xB0), 2, 0x3F, 0x3F }; +uint8_t unlock_8357[] = { (0xB9), 3, 0xFF, 0x83, 0x57}; +uint8_t unlock_5310[] = { (0xED), 2, 0x01, 0xFE}; +uint8_t d5310_0_in[] = { (0xEE), 2, 0xDE, 0x21}; //enter CMD3 8bit args +//uint8_t d5310_1[] = { (0x??), 2, 0xDE, 0x21}; +uint8_t d5310_1_in[] = { (0xBF), 1, 0xAA}; //enter page#1 16bit args +uint8_t d5310_1_out[] = { (0x00), 1, 0xAA}; //leave page#1 16bit args +uint8_t d1526nvm[] = { (0xE2), 1, 0x3F}; +uint8_t *unlock = NULL; +uint8_t *page_N = NULL; + +void setup() +{ + Serial.begin(9600); + while (!Serial) ; + Serial.println(F("Read Registers on MCUFRIEND UNO shield")); + Serial.println(F("controllers either read as single 16-bit")); + Serial.println(F("e.g. the ID is at readReg(0)")); + Serial.println(F("or as a sequence of 8-bit values")); + Serial.println(F("in special locations (first is dummy)")); + Serial.println(F("")); + lcdInit(); + lcdReset(); //ensures that controller is in default state + // unlock = unlock_1520; + // unlock = unlock_1526; + // unlock = unlock_8357; + // unlock = unlock_5310; + // page_N = d5310_1_in; + // for (uint16_t i = 0x00; i <= 0xFE; i++) readReg(i, 10, "f.k"); + read_regs("diagnose any controller"); + // read_xxxx("mystery"); + // read_5310_P0("NT35310 P0"); + // read_5310_P1("NT35310 P1"); + // read_61509("R61509 / ILI9326"); + // read_61526("R61520 / R61526"); + // read_8357("HX8357X"); + // read_9320("ILI9320"); + // read_9327("ILI9327"); + // read_9338("ILI9302 / ILI9329 / ILI9338 / ILI9341"); + // read_9481("ILI9481 / HX8357-B / R61581"); + // read_9486("ILI9486 / 1LI9488"); +} + +void loop() +{ + // put your main code here, to run repeatedly: + +} + +void printhex(uint8_t val) +{ + if (val < 0x10) Serial.print("0"); + Serial.print(val, HEX); +} + +void readReg(uint16_t reg, uint8_t n, const char *msg) +{ + uint8_t val8; + lcdReset(); + lcdSetWriteDir(); + if (unlock) pushCommand(unlock[0], unlock + 2, unlock[1]); + if (page_N) pushCommand(page_N[0], page_N + 2, page_N[1]); + Serial.print("reg(0x"); + printhex(reg >> 8); + printhex(reg); + Serial.print(")"); + lcdWriteCommand(reg); + lcdSetReadDir(); + while (n--) { + val8 = lcdReadData8(); + Serial.print(" "); + printhex(val8); + } + lcdSetWriteDir(); + digitalWrite(LCD_CS, HIGH); + + Serial.print("\t"); + Serial.println(msg); +} + +void lcdInit() +{ + pinMode(LCD_CS, OUTPUT); + digitalWrite(LCD_CS, HIGH); + pinMode(LCD_RS, OUTPUT); + digitalWrite(LCD_RS, HIGH); + pinMode(LCD_WR, OUTPUT); + digitalWrite(LCD_WR, HIGH); + pinMode(LCD_RD, OUTPUT); + digitalWrite(LCD_RD, HIGH); + pinMode(LCD_RST, OUTPUT); + digitalWrite(LCD_RST, HIGH); +} + +void lcdReset() +{ + digitalWrite(LCD_RST, LOW); + delay(2); + digitalWrite(LCD_RST, HIGH); + delay(10); //allow controller to re-start +} + +void lcdWrite8(uint16_t data) +{ + digitalWrite(LCD_D0, data & 1); + digitalWrite(LCD_D1, (data & 2) >> 1); + digitalWrite(LCD_D2, (data & 4) >> 2); + digitalWrite(LCD_D3, (data & 8) >> 3); + digitalWrite(LCD_D4, (data & 16) >> 4); + digitalWrite(LCD_D5, (data & 32) >> 5); + digitalWrite(LCD_D6, (data & 64) >> 6); + digitalWrite(LCD_D7, (data & 128) >> 7); +} + +uint16_t lcdRead8() +{ + uint16_t result = digitalRead(LCD_D7); + result <<= 1; + result |= digitalRead(LCD_D6); + result <<= 1; + result |= digitalRead(LCD_D5); + result <<= 1; + result |= digitalRead(LCD_D4); + result <<= 1; + result |= digitalRead(LCD_D3); + result <<= 1; + result |= digitalRead(LCD_D2); + result <<= 1; + result |= digitalRead(LCD_D1); + result <<= 1; + result |= digitalRead(LCD_D0); + + return result; +} + +void lcdSetWriteDir() +{ + uint8_t mode = OUTPUT; + pinMode(LCD_D0, mode); + pinMode(LCD_D1, mode); + pinMode(LCD_D2, mode); + pinMode(LCD_D3, mode); + pinMode(LCD_D4, mode); + pinMode(LCD_D5, mode); + pinMode(LCD_D6, mode); + pinMode(LCD_D7, mode); +} + + +void lcdSetReadDir() +{ + uint8_t mode = INPUT; + pinMode(LCD_D0, mode); + pinMode(LCD_D1, mode); + pinMode(LCD_D2, mode); + pinMode(LCD_D3, mode); + pinMode(LCD_D4, mode); + pinMode(LCD_D5, mode); + pinMode(LCD_D6, mode); + pinMode(LCD_D7, mode); +} + +void lcdWriteData(uint16_t data) +{ + lcdSetWriteDir(); + digitalWrite(LCD_CS, LOW); + digitalWrite(LCD_RS, HIGH); + digitalWrite(LCD_RD, HIGH); + digitalWrite(LCD_WR, HIGH); + + lcdWrite8(data >> 8); + + digitalWrite(LCD_WR, LOW); + delayMicroseconds(10); + digitalWrite(LCD_WR, HIGH); + + lcdWrite8(data); + + digitalWrite(LCD_WR, LOW); + delayMicroseconds(10); + digitalWrite(LCD_WR, HIGH); + + digitalWrite(LCD_CS, HIGH); +} + +void lcdWriteCommand(uint16_t command) +{ + lcdSetWriteDir(); + digitalWrite(LCD_CS, LOW); + digitalWrite(LCD_RS, LOW); + digitalWrite(LCD_RD, HIGH); + digitalWrite(LCD_WR, HIGH); + lcdWrite8(command >> 8); + digitalWrite(LCD_WR, LOW); + delayMicroseconds(10); + digitalWrite(LCD_WR, HIGH); + lcdWrite8(command); + digitalWrite(LCD_WR, LOW); + delayMicroseconds(10); + digitalWrite(LCD_WR, HIGH); + // digitalWrite(LCD_CS, HIGH); +} + +uint8_t lcdReadData8() +{ + uint8_t result; + lcdSetReadDir(); + digitalWrite(LCD_CS, LOW); + digitalWrite(LCD_RS, HIGH); + digitalWrite(LCD_RD, HIGH); + digitalWrite(LCD_WR, HIGH); + + digitalWrite(LCD_RD, LOW); + delayMicroseconds(10); + result = lcdRead8(); + digitalWrite(LCD_RD, HIGH); + + delayMicroseconds(10); + + return result; +} + + +uint16_t lcdReadData16() +{ + uint16_t result; + result = lcdReadData8() << 8; + result |= lcdReadData8(); + return result; +} + + +void lcdWriteRegister(uint16_t addr, uint16_t data) +{ + lcdWriteCommand(addr); + lcdWriteData(data); +} + +void pushCommand(uint8_t command, uint8_t *block, int8_t n) +{ + lcdSetWriteDir(); + digitalWrite(LCD_CS, LOW); + digitalWrite(LCD_RS, LOW); + digitalWrite(LCD_RD, HIGH); + digitalWrite(LCD_WR, HIGH); + lcdWrite8(command); + digitalWrite(LCD_WR, LOW); + delayMicroseconds(10); + digitalWrite(LCD_WR, HIGH); + digitalWrite(LCD_RS, HIGH); + while (n--) { + lcdWrite8(*block++); + digitalWrite(LCD_WR, LOW); + delayMicroseconds(10); + digitalWrite(LCD_WR, HIGH); + } + digitalWrite(LCD_CS, HIGH); + +} + +// make all the functions static. +// the linker will discard unused anonymous strings. + +static void read_regs(char *title) +{ + Serial.println(title); + readReg(0x00, 2, "ID: ILI9320, ILI9325, ILI9335, ..."); + readReg(0x04, 4, "Manufacturer ID"); + readReg(0x09, 5, "Status Register"); + readReg(0x0A, 2, "Get Powsr Mode"); + readReg(0x0C, 2, "Get Pixel Format"); + readReg(0x30, 5, "PTLAR"); + readReg(0x33, 7, "VSCRLDEF"); + readReg(0x61, 2, "RDID1 HX8347-G"); + readReg(0x62, 2, "RDID2 HX8347-G"); + readReg(0x63, 2, "RDID3 HX8347-G"); + readReg(0x64, 2, "RDID1 HX8347-A"); + readReg(0x65, 2, "RDID2 HX8347-A"); + readReg(0x66, 2, "RDID3 HX8347-A"); + readReg(0x67, 2, "RDID Himax HX8347-A"); + readReg(0x70, 2, "Panel Himax HX8347-A"); + readReg(0xA1, 5, "RD_DDB SSD1963"); + readReg(0xB0, 2, "RGB Interface Signal Control"); + readReg(0xB3, 5, "Frame Memory"); + readReg(0xB4, 2, "Frame Mode"); + readReg(0xB6, 5, "Display Control"); + readReg(0xB7, 2, "Entry Mode Set"); + readReg(0xBF, 6, "ILI9481, HX8357-B"); + readReg(0xC0, 9, "Panel Control"); + readReg(0xC1, 4, "Display Timing"); + readReg(0xC5, 2, "Frame Rate"); + readReg(0xC8, 13, "GAMMA"); + readReg(0xCC, 2, "Panel Control"); + readReg(0xD0, 4, "Power Control"); + readReg(0xD1, 4, "VCOM Control"); + readReg(0xD2, 3, "Power Normal"); + readReg(0xD3, 4, "ILI9341, ILI9488"); + readReg(0xD4, 4, "Novatek"); + readReg(0xDA, 2, "RDID1"); + readReg(0xDB, 2, "RDID2"); + readReg(0xDC, 2, "RDID3"); + readReg(0xE0, 16, "GAMMA-P"); + readReg(0xE1, 16, "GAMMA-N"); + readReg(0xEF, 6, "ILI9327"); + readReg(0xF2, 12, "Adjust Control 2"); + readReg(0xF6, 4, "Interface Control"); +} + +static void read_5310_P0(char *title) +{ + Serial.println(title); + readReg(0xB0, 2, "DISPLAY_CTRL"); + readReg(0xB1, 4, "PORCH_CTRL"); + readReg(0xB2, 4, "FRAME_CTRL"); + readReg(0xB3, 2, "SPI_RGB"); + readReg(0xB6, 7, "SOURCE_EQ"); + readReg(0xC0, 5, "PWR_CTRL1"); + readReg(0xC1, 3, "PWR_CTRL2"); + readReg(0xC2, 4, "PWR_CTRL3"); + readReg(0xC3, 2, "PWR_CTRL5"); + readReg(0xC4, 2, "PWR_CTRL6"); + readReg(0xC5, 5, "PWR_CTRL7"); + readReg(0xC6, 5, "PWR_CTRL8"); + readReg(0xD1, 2, "WRID"); + readReg(0xD2, 2, "WRID"); + readReg(0xD3, 2, "WRID"); + readReg(0xD4, 5, "RDID4"); + readReg(0xD5, 5, "WRDDB"); + readReg(0xDE, 4, "EPWR"); + readReg(0xFF, 2, "PAGE_STATUS"); +} + +static void read_5310_P1(char *title) +{ + Serial.println(title); + /* + readReg(0xB0, 19, "f.k"); + readReg(0xB1, 7, "f.k"); + readReg(0xB2, 7, "f.k"); + readReg(0xB3, 25, "f.k"); + readReg(0xB4, 7, "f.k"); + readReg(0xB5, 7, "f.k"); + readReg(0xB6, 3, "f.k"); + readReg(0xB7, 23, "f.k"); + readReg(0xB8, 7, "f.k"); + readReg(0xBA, 5, "f.k"); + readReg(0xC0, 19, "f.k"); + readReg(0xC1, 7, "f.k"); + readReg(0xC2, 5, "f.k"); + readReg(0xC3, 49, "f.k"); + readReg(0xC4, 27, "f.k"); + readReg(0xC5, 11, "f.k"); + readReg(0xC6, 7, "f.k"); + readReg(0xC7, 5, "f.k"); + readReg(0xC8, 5, "f.k"); + readReg(0xC9, 17, "f.k"); + */ + readReg(0xE0, 37, "GAMMA_RED_P"); + readReg(0xE1, 37, "GAMMA_RED_N"); + readReg(0xE2, 37, "GAMMA_GREEN_P"); + readReg(0xE3, 37, "GAMMA_GREEN_N"); + readReg(0xE4, 37, "GAMMA_BLUE_P"); + readReg(0xE5, 37, "GAMMA_BLUE_N"); + readReg(0xE6, 33, "CABC_RED"); + readReg(0xE7, 33, "CABC_GREEN"); + readReg(0xE8, 33, "CABC_BLUE"); + // readReg(0xE9, 5, "f.k."); + readReg(0xFF, 2, "PAGE_STATUS"); +} + +static void read_61509(char *title) +{ + Serial.println(title); + readReg(0x0000, 2, "Device Code Read"); + readReg(0x0001, 2, "Device Output Control"); + readReg(0x0002, 2, "LCD Waveform Control"); + readReg(0x0003, 2, "Entry Mode"); + readReg(0x0007, 2, "Display Control 1"); + readReg(0x0008, 2, "Display Control 2"); + readReg(0x0009, 2, "Display Control 3"); + readReg(0x0010, 2, "Panel Interface Control 1"); + readReg(0x0011, 2, "Panel Interface Control 2"); + readReg(0x0012, 2, "Panel Interface Control 3"); + readReg(0x0013, 2, "Panel Interface Control 4"); + readReg(0x0100, 2, "Power Control 1"); + readReg(0x0101, 2, "Power Control 2"); + readReg(0x0102, 2, "Power Control 3"); + readReg(0x0103, 2, "Power Control 4"); + readReg(0x0210, 2, "Horiz SA"); + readReg(0x0211, 2, "Horiz EA"); + readReg(0x0212, 2, "Vert SA"); + readReg(0x0213, 2, "Vert EA"); + readReg(0x0400, 2, "Base Image NL"); + readReg(0x0401, 2, "Base Image Control"); + readReg(0x0404, 2, "Base Image Scroll"); +} + +static void read_61526(char *title) +{ + Serial.println(title); + readReg(0x04, 4, "Manufacturer ID"); + readReg(0x0A, 2, "Get Power Mode"); + readReg(0x0B, 2, "Get Address Mode"); + readReg(0x0C, 2, "Get Pixel Format"); + readReg(0x0D, 2, "Get Display Mode"); + readReg(0x0E, 2, "Get Signal Mode"); + readReg(0x0F, 2, "Get Diagnostic Result"); + readReg(0xA1, 6, "RD_DDB Start"); + readReg(0xB0, 3, "Command Access Protect"); + readReg(0xB3, 6, "Frame Memory"); + readReg(0xB4, 2, "Frame Mode"); + readReg(0xBF, 5, "Device Code Read"); + readReg(0xC0, 9, "Panel Control"); + readReg(0xC1, 6, "Display Timing Normal"); + readReg(0xC3, 6, "Display Timing Idle"); + readReg(0xC4, 6, "Timing setting"); + readReg(0xC8, 23, "GAMMA"); + readReg(0xC9, 23, "GAMMA"); + readReg(0xCA, 23, "GAMMA"); + readReg(0xD0, 7, "Power Control"); + readReg(0xD1, 4, "VCOM Control"); + readReg(0xD2, 3, "Power Normal"); + readReg(0xD4, 3, "Power Idle"); + readReg(0xE0, 4, "NVM Access"); + readReg(0xE1, 2, "set_DDB"); + readReg(0xE2, 2, "NVM Load Control"); +} + +static void read_8357(char *title) +{ + Serial.println(title); + readReg(0x0A, 2, "Get Power Mode"); + readReg(0x0B, 2, "Get Address Mode"); + readReg(0x0C, 2, "Get Pixel Format"); + readReg(0x0D, 2, "Get Display Mode"); + readReg(0x0E, 2, "Get Signal Mode"); + readReg(0x0F, 2, "Get Diagnostic Result"); + readReg(0xA1, 6, "RD_DDB Start"); + readReg(0xB0, 3, "SETOSC"); + readReg(0xB1, 8, "SETPOWER"); + readReg(0xB2, 6, "SETDISPLAY"); + readReg(0xB3, 5, "SETRGB"); + readReg(0xB4, 8, "SETCYC"); + readReg(0xB5, 4, "SETBGP"); + readReg(0xB6, 3, "SETVCOM"); + readReg(0xB7, 6, "SETOTP"); + readReg(0xB9, 4, "SETEXTC"); + readReg(0xC0, 7, "SETSTBA"); + readReg(0xC1, 11, "SETDGC"); + readReg(0xC3, 5, "SETID"); + readReg(0xC4, 5, "SETDDB"); + readReg(0xC9, 3, "SETCABC"); + readReg(0xCC, 2, "SETPANEL"); + readReg(0xD0, 4, "GETICID"); + readReg(0xE0, 35, "SETGAMMA"); + readReg(0xE9, 2, "SETIMAGEI"); + readReg(0xEA, 2, "SETMESSI"); +} + +static void read_fk(char *title) +{ + Serial.println(title); + readReg(0x0A, 2, "Get Powsr Mode"); + readReg(0x0B, 2, "Get Address Mode"); + readReg(0x0C, 2, "Get Pixel Format"); + readReg(0x0D, 2, "Get Display Mode"); + readReg(0x0E, 2, "Get Signal Mode"); + readReg(0x0F, 2, "Get Diagnostic Result"); + readReg(0xA1, 6, "RD_DDB Start"); + readReg(0xB0, 3, "Command Access Protect"); + readReg(0xBF, 5, "Device Code Read"); + readReg(0xF0, 4, "f.k."); + readReg(0xF2, 18, "f.k."); + readReg(0xF3, 2, "f.k."); + readReg(0xF4, 14, "f.k."); + readReg(0xF5, 11, "f.k."); + readReg(0xF6, 10, "f.k."); + readReg(0xF7, 4, "f.k."); + readReg(0xF8, 2, "f.k."); + readReg(0xF9, 2, "f.k."); + readReg(0xFA, 12, "f.k."); + readReg(0xFB, 2, "f.k."); + readReg(0xFC, 2, "f.k."); + readReg(0xFD, 12, "f.k."); + readReg(0xFE, 2, "f.k."); +} + +static void read_xxxx(char *title) +{ + Serial.println(title); + readReg(0x09, 5, "Status Register"); + readReg(0x0A, 2, "Get Powsr Mode"); + readReg(0x0B, 2, "Get Address Mode"); + readReg(0x0C, 2, "Get Pixel Format"); + readReg(0x0D, 2, "Get Display Mode"); + readReg(0x0E, 2, "Get Signal Mode"); + readReg(0x0F, 2, "Get Diagnostic Result"); + readReg(0xA1, 6, "RD_DDB Start"); + readReg(0xB0, 3, "Command Access Protect"); + readReg(0xBF, 5, "Device Code Read"); + readReg(0xC6, 2, "f.k."); + readReg(0xD6, 4, "f.k."); + readReg(0xD7, 5, "f.k."); + readReg(0xD8, 5, "f.k."); + readReg(0xD9, 4, "f.k."); + readReg(0xE0, 2, "f.k."); + readReg(0xE1, 3, "f.k."); + readReg(0xF0, 2, "f.k."); + readReg(0xF1, 2, "f.k."); + readReg(0xF2, 12, "f.k."); + readReg(0xF3, 9, "f.k."); + readReg(0xF4, 6, "f.k."); + readReg(0xF5, 7, "f.k."); + readReg(0xF6, 5, "f.k."); + readReg(0xF7, 16, "f.k."); + readReg(0xFD, 4, "f.k."); + readReg(0xFE, 2, "f.k."); + readReg(0xFF, 2, "f.k."); +} + +static void read_9320(char *title) +{ + Serial.println(title); + readReg(0x0000, 2, "Device Code Read"); + readReg(0x0001, 2, "Drive Output Control"); + readReg(0x0002, 2, "LCD Waveform Control"); + readReg(0x0003, 2, "Entry Mode"); + readReg(0x0007, 2, "Display Control 1"); + readReg(0x0008, 2, "Display Control 2"); + readReg(0x0009, 2, "Display Control 3"); + readReg(0x000A, 2, "Display Control 4"); + readReg(0x0010, 2, "Power Control 1"); + readReg(0x0011, 2, "Power Control 2"); + readReg(0x0012, 2, "Power Control 3"); + readReg(0x0013, 2, "Power Control 4"); + readReg(0x0014, 2, "Power Control 5"); + readReg(0x0015, 2, "Power Control 6"); + readReg(0x0029, 2, "Power Control 7"); + readReg(0x002B, 2, "Frame Rate"); +} + +static void read_9327(char *title) +{ + Serial.println(title); + readReg(0x0A, 2, "Get Powsr Mode"); + readReg(0x0B, 2, "Get Address Mode"); + readReg(0x0C, 2, "Get Pixel Format"); + readReg(0x0D, 2, "Get Display Mode"); + readReg(0x0E, 2, "Get Signal Mode"); + readReg(0x0F, 2, "Get Diagnostic Result"); + readReg(0xA1, 6, "RD_DDB Start"); + readReg(0xB0, 2, "Command Access Protect"); + readReg(0xB1, 2, "Low Power Control"); + readReg(0xB3, 5, "Frame Memory"); + readReg(0xB4, 2, "Frame Mode"); + readReg(0xB5, 2, "Sub Panel Control"); + readReg(0xBF, 2, "Backlight Control"); + readReg(0xC0, 7, "Panel Control"); + readReg(0xC1, 4, "Display Timing Normal"); + readReg(0xC3, 4, "Display Timing Idle"); + readReg(0xC4, 2, "VCOM Timing"); + readReg(0xC5, 2, "Frame Rate"); + readReg(0xC6, 2, "Interface Control"); + readReg(0xC8, 13, "GAMMA"); + readReg(0xC9, 13, "GAMMA Red/Blue"); + readReg(0xCC, 2, "Panel Control"); + readReg(0xD0, 4, "Power Control"); + readReg(0xD1, 4, "VCOM Control"); + readReg(0xD2, 3, "Power Normal"); + readReg(0xD3, 3, "Power Partial"); + readReg(0xD4, 3, "Power Idle"); + readReg(0xEF, 6, "Device Code Read"); +} + +static void read_9338(char *title) +{ + Serial.println(title); + readReg(0x04, 4, "Manufacturer ID"); + // readReg(0x05, 2, "DSI errors"); + readReg(0x09, 5, "Status Register"); + readReg(0x0A, 2, "Get Powsr Mode"); + readReg(0x0B, 2, "Get Address Mode"); + readReg(0x0C, 2, "Get Pixel Format"); + readReg(0x0D, 2, "Get Display Mode"); + readReg(0x0E, 2, "Get Signal Mode"); + readReg(0x0F, 2, "Get Diagnostic Result"); + readReg(0xB0, 2, "Interface Mode"); + readReg(0xB1, 3, "Frame Rate Normal"); + readReg(0xB2, 3, "Frame Rate Idle"); + readReg(0xB3, 3, "Frame Rate Partial"); + readReg(0xB4, 3, "Inversion Control"); + readReg(0xB5, 5, "Blanking Porch"); + readReg(0xB6, 4, "Display Control"); + readReg(0xB7, 2, "Entry Mode Set"); + readReg(0xC0, 2, "Power Control 1"); + readReg(0xC1, 2, "Power Control 2"); + readReg(0xC2, 2, "Power Control 3"); + readReg(0xC3, 2, "Power Control 4"); + readReg(0xC4, 2, "Power Control 5"); + readReg(0xC5, 3, "VCOM Control 1"); + readReg(0xC7, 2, "VCOM Control 2"); + /* + readReg(0xD0, 3, "NVM Write"); + readReg(0xD1, 4, "NVM key"); + */ + readReg(0xD2, 3, "NVM Status"); + readReg(0xD3, 4, "RDID4"); + readReg(0xDA, 2, "RDID1"); + readReg(0xDB, 2, "RDID2"); + readReg(0xDC, 2, "RDID3"); + readReg(0xE0, 16, "GAMMA-P"); + readReg(0xE1, 16, "GAMMA-N"); + readReg(0xF2, 2, "GAMMA-3G"); + readReg(0xF6, 4, "Interface Control"); +} + +static void read_9481(char *title) +{ + Serial.println(title); + readReg(0x0A, 2, "Get Powsr Mode"); + readReg(0x0B, 2, "Get Address Mode"); + readReg(0x0C, 2, "Get Pixel Format"); + readReg(0x0D, 2, "Get Display Mode"); + readReg(0x0E, 2, "Get Signal Mode"); + readReg(0x0F, 2, "Get Diagnostic Result"); + readReg(0xA1, 6, "RD_DDB Start"); + readReg(0xB0, 2, "Command Access Protect"); + readReg(0xB3, 5, "Frame Memory"); + readReg(0xB4, 2, "Frame Mode"); + readReg(0xBF, 6, "Device Code Read"); + readReg(0xC0, 6, "Panel Control"); + readReg(0xC1, 4, "Display Timing Normal"); + readReg(0xC2, 4, "Display Timing Partial"); + readReg(0xC3, 4, "Display Timing Idle"); + readReg(0xC5, 2, "Frame Rate"); + readReg(0xC6, 2, "Interface Control"); + readReg(0xC8, 13, "GAMMA"); + readReg(0xCC, 2, "Panel Control"); + readReg(0xD0, 4, "Power Control"); + readReg(0xD1, 4, "VCOM Control"); + readReg(0xD2, 3, "Power Normal"); + readReg(0xD3, 3, "Power Partial"); + readReg(0xD4, 3, "Power Idle"); + readReg(0xE4, 4, "? SETCABC(HX) (f.k. ILI)"); + readReg(0xE9, 4, "? Set Panel Related(HX)"); + readReg(0xEE, 5, "? Set EQ Function(HX)"); + readReg(0xF0, 4, "f.k (ILI)"); + readReg(0xF1, 2, "f.k"); + readReg(0xF2, 4, "f.k"); + readReg(0xF3, 4, "f.k (ILI)"); + readReg(0xF4, 4, "f.k"); + readReg(0xF5, 2, "f.k"); + readReg(0xF6, 2, "f.k"); + readReg(0xF7, 4, "f.k"); + readReg(0xF8, 3, "f.k"); + readReg(0xF9, 2, "f.k"); +} + +static void read_9486(char *title) +{ + Serial.println(title); + readReg(0x04, 4, "Manufacturer ID"); + readReg(0x05, 2, "DSI errors"); + readReg(0x09, 5, "Status Register"); + readReg(0x0A, 2, "Get Powsr Mode"); + readReg(0x0B, 2, "Get Address Mode"); + readReg(0x0C, 2, "Get Pixel Format"); + readReg(0x0D, 2, "Get Display Mode"); + readReg(0x0E, 2, "Get Signal Mode"); + readReg(0x0F, 2, "Get Diagnostic Result"); + readReg(0xB0, 2, "Interface Mode"); + readReg(0xB1, 3, "Frame Rate Normal"); + readReg(0xB2, 3, "Frame Rate Idle"); + readReg(0xB3, 3, "Frame Rate Partial"); + readReg(0xB4, 2, "Inversion Control"); + readReg(0xB5, 5, "Blanking Porch"); + readReg(0xB6, 4, "Display Control"); + readReg(0xB7, 2, "Entry Mode Set"); + readReg(0xBF, 6, "NON-Ilitek Device Code Read"); + readReg(0xC0, 3, "Power Control 1"); + readReg(0xC1, 3, "Power Control 2"); + readReg(0xC2, 2, "Power Control 3"); + readReg(0xC3, 2, "Power Control 4"); + readReg(0xC4, 2, "Power Control 5"); + readReg(0xC5, 5, "VCOM Control 1"); + /* + readReg(0xC6, 3, "CABC Control 1"); + readReg(0xC8, 3, "CABC Control 2"); + readReg(0xC9, 2, "CABC Control 3"); + readReg(0xCA, 2, "CABC Control 4"); + readReg(0xCB, 2, "CABC Control 5"); + readReg(0xCC, 2, "CABC Control 6"); + readReg(0xCD, 2, "CABC Control 7"); + readReg(0xCE, 2, "CABC Control 8"); + readReg(0xCF, 2, "CABC Control 9"); + readReg(0xD0, 3, "NVM Write"); + readReg(0xD1, 4, "NVM key"); + readReg(0xD2, 5, "NVM Status"); + */ + readReg(0xD3, 4, "RDID4"); + readReg(0xDA, 2, "RDID1"); + readReg(0xDB, 2, "RDID2"); + readReg(0xDC, 2, "RDID3"); + readReg(0xE0, 16, "GAMMA-P"); + readReg(0xE1, 16, "GAMMA-N"); + readReg(0xF2, 10, "Adjust 2"); + readReg(0xF7, 5, "Adjust 3"); + readReg(0xF8, 3, "Adjust 4"); + readReg(0xF9, 3, "Adjust 5"); + readReg(0xFB, 2, "SPI Read"); + readReg(0xFC, 3, "Adjust 6"); +} + + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/LCD_ID_readreg/LCD_ID_readreg.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/LCD_ID_readreg/LCD_ID_readreg.ino new file mode 100644 index 0000000..eb373f8 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/LCD_ID_readreg/LCD_ID_readreg.ino @@ -0,0 +1,266 @@ +// adapted from LCD_ID_Reader from http://misc.ws/lcd_information +// controllers either read as 16-bit or as a sequence of 8-bit values + +//-- Arduino UNO or Mega 2560 Plugged as shield +#define LCD_RST A4 +#define LCD_CS A3 +#define LCD_RS A2 +#define LCD_WR A1 +#define LCD_RD A0 + +#define LCD_D0 8 +#define LCD_D1 9 +#define LCD_D2 2 +#define LCD_D3 3 +#define LCD_D4 4 +#define LCD_D5 5 +#define LCD_D6 6 +#define LCD_D7 7 + +void setup() +{ + Serial.begin(9600); + while (!Serial) ; + Serial.println("Read Registers on MCUFRIEND UNO shield"); + Serial.println("controllers either read as single 16-bit"); + Serial.println("e.g. the ID is at readReg(0)"); + Serial.println("or as a sequence of 8-bit values"); + Serial.println("in special locations (first is dummy)"); + Serial.println(""); + lcdInit(); + lcdReset(); //ensures that controller is in default state +// for (uint16_t i = 0; i < 256; i++) readReg(i, 7, "f.k"); + readReg(0x00, 2, "ID: ILI9320, ILI9325, ILI9335, ..."); + readReg(0x04, 4, "Manufacturer ID"); + readReg(0x09, 5, "Status Register"); + readReg(0x0A, 2, "Get Power Mode"); + readReg(0x0C, 2, "Get Pixel Format"); + readReg(0x61, 2, "RDID1 HX8347-G"); + readReg(0x62, 2, "RDID2 HX8347-G"); + readReg(0x63, 2, "RDID3 HX8347-G"); + readReg(0x64, 2, "RDID1 HX8347-A"); + readReg(0x65, 2, "RDID2 HX8347-A"); + readReg(0x66, 2, "RDID3 HX8347-A"); + readReg(0x67, 2, "RDID Himax HX8347-A"); + readReg(0x70, 2, "Panel Himax HX8347-A"); + readReg(0xA1, 5, "RD_DDB SSD1963"); + readReg(0xB0, 2, "RGB Interface Signal Control"); + readReg(0xB4, 2, "Inversion Control"); + readReg(0xB6, 5, "Display Control"); + readReg(0xB7, 2, "Entry Mode Set"); + readReg(0xBF, 6, "ILI9481, HX8357-B"); + readReg(0xC0, 9, "Panel Control"); + readReg(0xC8, 13, "GAMMA"); + readReg(0xCC, 2, "Panel Control"); + readReg(0xD0, 3, "Power Control"); + readReg(0xD2, 5, "NVM Read"); + readReg(0xD3, 4, "ILI9341, ILI9488"); + readReg(0xD4, 4, "Novatek ID"); + readReg(0xDA, 2, "RDID1"); + readReg(0xDB, 2, "RDID2"); + readReg(0xDC, 2, "RDID3"); + readReg(0xE0, 16, "GAMMA-P"); + readReg(0xE1, 16, "GAMMA-N"); + readReg(0xEF, 6, "ILI9327"); + readReg(0xF2, 12, "Adjust Control 2"); + readReg(0xF6, 4, "Interface Control"); +} + +void loop() +{ + // put your main code here, to run repeatedly: + +} + +void printhex(uint8_t val) +{ + if (val < 0x10) Serial.print("0"); + Serial.print(val, HEX); +} + +void readReg(uint16_t reg, uint8_t n, const char *msg) +{ + uint8_t val8; + lcdReset(); + lcdSetWriteDir(); + lcdWriteCommand(0xB0); //Command Access Protect + lcdWriteData(0x00); //looks wrong +/* + lcdWriteCommand(0xF6); + lcdWriteData(0x01); + lcdWriteData(0x01); + lcdWriteData(0x03); +*/ + lcdWriteCommand(reg); + Serial.print("reg(0x"); + printhex(reg >> 8); + printhex(reg); + Serial.print(")"); + lcdSetReadDir(); + while (n--) { + val8 = lcdReadData8(); + Serial.print(" "); + printhex(val8); + } + lcdSetWriteDir(); + Serial.print("\t"); + Serial.println(msg); +} + +void lcdInit() +{ + pinMode(LCD_CS, OUTPUT); + digitalWrite(LCD_CS, HIGH); + pinMode(LCD_RS, OUTPUT); + digitalWrite(LCD_RS, HIGH); + pinMode(LCD_WR, OUTPUT); + digitalWrite(LCD_WR, HIGH); + pinMode(LCD_RD, OUTPUT); + digitalWrite(LCD_RD, HIGH); + pinMode(LCD_RST, OUTPUT); + digitalWrite(LCD_RST, HIGH); +} + +void lcdReset() +{ + digitalWrite(LCD_RST, LOW); + delay(2); + digitalWrite(LCD_RST, HIGH); + delay(10); //allow controller to re-start +} + +void lcdWrite8(uint16_t data) +{ + digitalWrite(LCD_D0, data & 1); + digitalWrite(LCD_D1, (data & 2) >> 1); + digitalWrite(LCD_D2, (data & 4) >> 2); + digitalWrite(LCD_D3, (data & 8) >> 3); + digitalWrite(LCD_D4, (data & 16) >> 4); + digitalWrite(LCD_D5, (data & 32) >> 5); + digitalWrite(LCD_D6, (data & 64) >> 6); + digitalWrite(LCD_D7, (data & 128) >> 7); +} + +uint16_t lcdRead8() +{ + uint16_t result = digitalRead(LCD_D7); + result <<= 1; + result |= digitalRead(LCD_D6); + result <<= 1; + result |= digitalRead(LCD_D5); + result <<= 1; + result |= digitalRead(LCD_D4); + result <<= 1; + result |= digitalRead(LCD_D3); + result <<= 1; + result |= digitalRead(LCD_D2); + result <<= 1; + result |= digitalRead(LCD_D1); + result <<= 1; + result |= digitalRead(LCD_D0); + + return result; +} + +void lcdSetWriteDir() +{ + pinMode(LCD_D0, OUTPUT); + pinMode(LCD_D1, OUTPUT); + pinMode(LCD_D2, OUTPUT); + pinMode(LCD_D3, OUTPUT); + pinMode(LCD_D4, OUTPUT); + pinMode(LCD_D5, OUTPUT); + pinMode(LCD_D6, OUTPUT); + pinMode(LCD_D7, OUTPUT); +} + + +void lcdSetReadDir() +{ + pinMode(LCD_D0, INPUT); + pinMode(LCD_D1, INPUT); + pinMode(LCD_D2, INPUT); + pinMode(LCD_D3, INPUT); + pinMode(LCD_D4, INPUT); + pinMode(LCD_D5, INPUT); + pinMode(LCD_D6, INPUT); + pinMode(LCD_D7, INPUT); +} + +void lcdWriteData(uint16_t data) +{ + lcdSetWriteDir(); + digitalWrite(LCD_CS, LOW); + digitalWrite(LCD_RS, HIGH); + digitalWrite(LCD_RD, HIGH); + digitalWrite(LCD_WR, HIGH); + + lcdWrite8(data >> 8); + + digitalWrite(LCD_WR, LOW); + delayMicroseconds(10); + digitalWrite(LCD_WR, HIGH); + + lcdWrite8(data); + + digitalWrite(LCD_WR, LOW); + delayMicroseconds(10); + digitalWrite(LCD_WR, HIGH); + + digitalWrite(LCD_CS, HIGH); +} + +void lcdWriteCommand(uint16_t command) +{ + lcdSetWriteDir(); + digitalWrite(LCD_CS, LOW); + digitalWrite(LCD_RS, LOW); + digitalWrite(LCD_RD, HIGH); + digitalWrite(LCD_WR, HIGH); + lcdWrite8(command >> 8); + digitalWrite(LCD_WR, LOW); + delayMicroseconds(10); + digitalWrite(LCD_WR, HIGH); + lcdWrite8(command); + digitalWrite(LCD_WR, LOW); + delayMicroseconds(10); + digitalWrite(LCD_WR, HIGH); + digitalWrite(LCD_CS, HIGH); +} + +uint8_t lcdReadData8() +{ + uint8_t result; + lcdSetReadDir(); + digitalWrite(LCD_CS, LOW); + digitalWrite(LCD_RS, HIGH); + digitalWrite(LCD_RD, HIGH); + digitalWrite(LCD_WR, HIGH); + + digitalWrite(LCD_RD, LOW); + delayMicroseconds(10); + result = lcdRead8(); + digitalWrite(LCD_RD, HIGH); + + delayMicroseconds(10); + + return result; +} + + +uint16_t lcdReadData16() +{ + uint16_t result; + result = lcdReadData8() << 8; + result |= lcdReadData8(); + return result; +} + + +void lcdWriteRegister(uint16_t addr, uint16_t data) +{ + lcdWriteCommand(addr); + lcdWriteData(data); +} + + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/TouchScreen_Calibr_native/TouchScreen_Calibr_native.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/TouchScreen_Calibr_native/TouchScreen_Calibr_native.ino new file mode 100644 index 0000000..ec9a5f8 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/TouchScreen_Calibr_native/TouchScreen_Calibr_native.ino @@ -0,0 +1,453 @@ +// TouchScreen_Calibr_native for MCUFRIEND UNO Display Shields +// adapted by David Prentice +// for Adafruit's Resistive Touch Screen Library +// from Henning Karlsen's original UTouch_Calibration program. +// Many Thanks. + +#define PORTRAIT 0 +#define LANDSCAPE 1 +#define USE_XPT2046 0 +#define USE_LOCAL_KBV 1 + +#define TOUCH_ORIENTATION PORTRAIT + +#if defined(USB_PID) && USB_PID == 0x804E // Arduino M0 Native +#define Serial SerialUSB +#endif + +#define SWAP(x, y) { int t = x; x = y; y = t; } + +#define TITLE "TouchScreen.h GFX Calibration" +#include +#include +MCUFRIEND_kbv tft; + +// MCUFRIEND UNO shield shares pins with the TFT. +#if defined(ESP32) +int XP = 27, YP = 4, XM = 15, YM = 14; //most common configuration +#else +//int XP = 6, YP = A1, XM = A2, YM = 7; //most common configuration +int XP = 7, YP = A2, XM = A1, YM = 6; //next common configuration +//int XP=PB7,XM=PA6,YP=PA7,YM=PB6; //BLUEPILL must have Analog for YP, XM +#endif +#if USE_LOCAL_KBV +#include "TouchScreen_kbv.h" //my hacked version +#define TouchScreen TouchScreen_kbv +#define TSPoint TSPoint_kbv +#else +#include //Adafruit Library +#endif +TouchScreen ts(XP, YP, XM, YM, 300); //re-initialised after diagnose +TSPoint tp; //global point + +void readResistiveTouch(void) +{ + tp = ts.getPoint(); + pinMode(YP, OUTPUT); //restore shared pins + pinMode(XM, OUTPUT); + //digitalWrite(YP, HIGH); //because TFT control pins + //digitalWrite(XM, HIGH); + // Serial.println("tp.x=" + String(tp.x) + ", tp.y=" + String(tp.y) + ", tp.z =" + String(tp.z)); +} + +uint16_t readID(void) { + uint16_t ID = tft.readID(); + if (ID == 0xD3D3) ID = 0x9486; + return ID; +} +#define TFT_BEGIN() tft.begin(ID) + +#define WHITE 0xFFFF +#define RED 0xF800 +#define BLUE 0x001F +#define GREEN 0x07E0 +#define BLACK 0x0000 + +//#define GRAY 0x2408 //un-highlighted cross-hair +#define GRAY BLUE //idle cross-hair colour +#define GRAY_DONE RED //finished cross-hair + +bool ISPRESSED(void) +{ + // .kbv this was too sensitive !! + // now touch has to be stable for 50ms + int count = 0; + bool state, oldstate; + while (count < 10) { + readResistiveTouch(); + state = tp.z > 200; //ADJUST THIS VALUE TO SUIT YOUR SCREEN e.g. 20 ... 250 + if (state == oldstate) count++; + else count = 0; + oldstate = state; + delay(5); + } + return oldstate; +} + +uint32_t cx, cy, cz; +uint32_t rx[8], ry[8]; +int32_t clx, crx, cty, cby; +float px, py; +int dispx, dispy, text_y_center, swapxy; +uint32_t calx, caly, cals; + +char *Aval(int pin) +{ + static char buf[2][10], cnt; + cnt = !cnt; +#if defined(ESP32) + sprintf(buf[cnt], "%d", pin); +#else + sprintf(buf[cnt], "A%d", pin - A0); +#endif + return buf[cnt]; +} + +void showpins(int A, int D, int value, const char *msg) +{ + char buf[40]; + sprintf(buf, "%s (%s, D%d) = %d", msg, Aval(A), D, value); + Serial.println(buf); +} + +void bofe(char *buf) +{ + tft.println(buf); + Serial.println(buf); +} + +#if USE_XPT2046 == 0 +bool diagnose_pins() +{ + uint8_t i, j, Apins[2], Dpins[2], found = 0; + uint16_t value, Values[2]; + + Serial.println(F("Making all control and bus pins INPUT_PULLUP")); + Serial.println(F("Typical 30k Analog pullup with corresponding pin")); + Serial.println(F("would read low when digital is written LOW")); + Serial.println(F("e.g. reads ~25 for 300R X direction")); + Serial.println(F("e.g. reads ~30 for 500R Y direction")); + Serial.println(F("")); + + for (i = A0; i < A5; i++) pinMode(i, INPUT_PULLUP); + for (i = 2; i < 10; i++) pinMode(i, INPUT_PULLUP); + for (i = A0; i < A4; i++) { + pinMode(i, INPUT_PULLUP); + for (j = 5; j < 10; j++) { + pinMode(j, OUTPUT); + digitalWrite(j, LOW); + value = analogRead(i); // ignore first reading + value = analogRead(i); + if (value < 100 && value > 0) { + showpins(i, j, value, "Testing :"); + if (found < 2) { + Apins[found] = i; + Dpins[found] = j; + Values[found] = value; + } + found++; + } + pinMode(j, INPUT_PULLUP); + } + pinMode(i, INPUT_PULLUP); + } + if (found == 2) { + int idx = Values[0] < Values[1]; + /* + Serial.println(F("Diagnosing as:-")); + for (i = 0; i < 2; i++) { + showpins(Apins[i], Dpins[i], Values[i], + (Values[i] < Values[!i]) ? "XM,XP: " : "YP,YM: "); + } + */ + XM = Apins[!idx]; XP = Dpins[!idx]; YP = Apins[idx]; YM = Dpins[idx]; + ts = TouchScreen(XP, YP, XM, YM, 300); //re-initialise with pins + return true; //success + } + if (found == 0) Serial.println(F("MISSING TOUCHSCREEN")); + //else Serial.println(F("BROKEN TOUCHSCREEN")); + return false; +} +#endif + +void setup() +{ + char buf[40]; + uint16_t ID = readID(); + TFT_BEGIN(); + tft.fillScreen(TFT_NAVY); + tft.println("Waiting for Serial"); + delay(1000); + Serial.begin(9600); + while (!Serial); + tft.fillScreen(TFT_BLUE); + Serial.println(TITLE); + bool ret = true; +#if USE_XPT2046 || defined(__arm__) || defined(ESP32) + Serial.println(F("Not possible to diagnose Touch pins on ARM or ESP32")); +#else + ret = diagnose_pins(); //destroys TFT pin modes + TFT_BEGIN(); //start again +#endif + tft.setRotation(TOUCH_ORIENTATION); + dispx = tft.width(); + dispy = tft.height(); + text_y_center = (dispy / 2) - 6; + sprintf(buf, "ID = 0x%04x", ID); + Serial.println(buf); + if (ret == false) { + centerprint("BROKEN TOUCHSCREEN", text_y_center); + fail(); + } +} + +void loop() +{ + startup(); + + int x, y, cnt, idx = 0; + tft.fillScreen(BLACK); + for (x = 10, cnt = 0; x < dispx; x += (dispx - 20) / 2) { + for (y = 10; y < dispy; y += (dispy - 20) / 2) { + if (++cnt != 5) drawCrossHair(x, y, GRAY); + } + } + centerprint("***********", text_y_center - 12); + centerprint("***********", text_y_center + 12); + for (x = 10, cnt = 0; x < dispx; x += (dispx - 20) / 2) { + for (y = 10; y < dispy; y += (dispy - 20) / 2) { + if (++cnt != 5) calibrate(x, y, idx++, F(" X, Y, Pressure")); + } + } + + cals = (long(dispx - 1) << 12) + (dispy - 1); + swapxy = rx[2] - rx[0]; + //else swapxy = ry[2] - ry[0]; + swapxy = (swapxy < -400 || swapxy > 400); + if (swapxy != 0) { + clx = (ry[0] + ry[1] + ry[2]); //rotate 90 + crx = (ry[5] + ry[6] + ry[7]); + cty = (rx[0] + rx[3] + rx[5]); + cby = (rx[2] + rx[4] + rx[7]); + } else { + clx = (rx[0] + rx[1] + rx[2]); //regular + crx = (rx[5] + rx[6] + rx[7]); + cty = (ry[0] + ry[3] + ry[5]); + cby = (ry[2] + ry[4] + ry[7]); + } + clx /= 3; + crx /= 3; + cty /= 3; + cby /= 3; + px = float(crx - clx) / (dispx - 20); + py = float(cby - cty) / (dispy - 20); + // px = 0; + clx -= px * 10; + crx += px * 10; + cty -= py * 10; + cby += py * 10; + + calx = (long(clx) << 14) + long(crx); + caly = (long(cty) << 14) + long(cby); + if (swapxy) + cals |= (1L << 31); + + report(); // report results + while (true) {} // tread water +} + +void readCoordinates() +{ + int iter = 5000; + int failcount = 0; + int cnt = 0; + uint32_t tx = 0; + uint32_t ty = 0; + uint32_t tz = 0; + bool OK = false; + + while (OK == false) + { + centerprint("* PRESS *", text_y_center); + while (ISPRESSED() == false) {} + centerprint("* HOLD! *", text_y_center); + cnt = 0; + iter = 400; + do + { + readResistiveTouch(); + if (tp.z > 200) //.kbv + { + tx += tp.x; + ty += tp.y; + tz += tp.z; + cnt++; + } + else + failcount++; + } while ((cnt < iter) && (failcount < 10000)); + if (cnt >= iter) + { + OK = true; + } + else + { + tx = 0; + ty = 0; + tz = 0; + cnt = 0; + } + if (failcount >= 10000) + fail(); + } + + cx = tx / iter; + cy = ty / iter; + cz = tz / iter; +} + +void calibrate(int x, int y, int i, String msg) +{ + drawCrossHair(x, y, WHITE); + readCoordinates(); + centerprint("* RELEASE *", text_y_center); + drawCrossHair(x, y, GRAY_DONE); + rx[i] = cx; + ry[i] = cy; + char buf[40]; + sprintf(buf, "\r\ncx=%ld cy=%ld cz=%ld %s", cx, cy, cz, msg.c_str()); + Serial.print(buf); + while (ISPRESSED() == true) {} +} + +void report() +{ + uint16_t TS_LEFT, TS_RT, TS_TOP, TS_BOT, TS_WID, TS_HT, TS_SWAP; + int16_t tmp; + char buf[60]; + centertitle(TITLE); + + tft.println(F("To use the new calibration")); + tft.println(F("settings you must map the values")); + tft.println(F("from Point p = ts.getPoint() e.g. ")); + tft.println(F("x = map(p.x, LEFT, RT, 0, tft.width());")); + tft.println(F("y = map(p.y, TOP, BOT, 0, tft.height());")); + tft.println(F("swap p.x and p.y if diff ORIENTATION")); + + //.kbv show human values + TS_LEFT = (calx >> 14) & 0x3FFF; + TS_RT = (calx >> 0) & 0x3FFF; + TS_TOP = (caly >> 14) & 0x3FFF; + TS_BOT = (caly >> 0) & 0x3FFF; + TS_WID = ((cals >> 12) & 0x0FFF) + 1; + TS_HT = ((cals >> 0) & 0x0FFF) + 1; + TS_SWAP = (cals >> 31); + if (TOUCH_ORIENTATION == LANDSCAPE) { //always show PORTRAIT first + tmp = TS_LEFT, TS_LEFT = TS_BOT, TS_BOT = TS_RT, TS_RT = TS_TOP, TS_TOP = tmp; + tmp = TS_WID, TS_WID = TS_HT, TS_HT = tmp; + } + sprintf(buf, "\n\n*** COPY-PASTE from Serial Terminal:"); + bofe(buf); + bool ts_landscape = (TOUCH_ORIENTATION == LANDSCAPE) ^ swapxy; +#if (USE_XPT2046) + sprintf(buf, "const int TS_LANDSCAPE=%d; //%s", ts_landscape, TITLE); + bofe(buf); +#else + if (ts_landscape) { + SWAP(XM, YP); + SWAP(XP, YM); + SWAP(TS_LEFT, TS_RT); + SWAP(TS_TOP, TS_BOT); + } + sprintf(buf, "const int XP=%d,XM=%s,YP=%s,YM=%d; //%dx%d ID=0x%04X", + XP, Aval(XM), Aval(YP), YM, TS_WID, TS_HT, readID()); + Serial.println(buf); + sprintf(buf, "\nTouch Pin Wiring XP=%d XM=%s YP=%s YM=%d", + XP, Aval(XM), Aval(YP), YM); + tft.println(buf); +#endif + sprintf(buf, "const int TS_LEFT=%d,TS_RT=%d,TS_TOP=%d,TS_BOT=%d;", + TS_LEFT, TS_RT, TS_TOP, TS_BOT); + Serial.println(buf); + +#if !defined(ARDUINO_AVR_LEONARDO) + for (int orient = 0; orient < 2; orient++) { + sprintf(buf, "\n%s CALIBRATION %d x %d", + orient ? "LANDSCAPE" : "PORTRAIT ", TS_WID, TS_HT); + bofe(buf); + sprintf(buf, "x = map(p.%s, LEFT=%d, RT=%d, 0, %d)", + orient ? "y" : "x", TS_LEFT, TS_RT, TS_WID); + bofe(buf); + sprintf(buf, "y = map(p.%s, TOP=%d, BOT=%d, 0, %d)", + orient ? "x" : "y", TS_TOP, TS_BOT, TS_HT); + bofe(buf); + tmp = TS_LEFT, TS_LEFT = TS_TOP, TS_TOP = TS_RT, TS_RT = TS_BOT, TS_BOT = tmp; + tmp = TS_WID, TS_WID = TS_HT, TS_HT = tmp; + } + + int16_t x_range = TS_LEFT - TS_RT, y_range = TS_TOP - TS_BOT; + if (abs(x_range) > 500 && abs(y_range) > 650) //LANDSCAPE + return; + sprintf(buf, "\n*** UNUSUAL CALIBRATION RANGES %d %d", x_range, y_range); + bofe(buf); +#endif +} + +void drawCrossHair(int x, int y, uint16_t color) +{ + tft.drawRect(x - 10, y - 10, 20, 20, color); + tft.drawLine(x - 5, y, x + 5, y, color); + tft.drawLine(x, y - 5, x, y + 5, color); +} + +void centerprint(const char *s, int y) +{ + int len = strlen(s) * 6; + tft.setTextColor(WHITE, RED); + tft.setCursor((dispx - len) / 2, y); + tft.print(s); +} + +void centertitle(const char *s) +{ + tft.fillScreen(BLACK); + tft.fillRect(0, 0, dispx, 14, RED); + tft.fillRect(0, 14, dispx, 1, WHITE); + centerprint(s, 1); + tft.setCursor(0, 30); + tft.setTextColor(WHITE, BLACK); +} + +void startup() +{ + centertitle(TITLE); + + tft.println(F("#define NUMSAMPLES 3 in Library\n")); + tft.println(F("Use a stylus or something")); + tft.println(F("similar to touch as close")); + tft.println(F("to the center of the WHITE")); + tft.println(F("crosshair. Keep holding")); + tft.println(F("until crosshair turns RED.")); + tft.println(F("Repeat for all crosshairs.\n")); + tft.println(F("Report can be pasted from Serial\n")); + tft.println(F("Touch screen to continue")); + + while (ISPRESSED() == false) {} + while (ISPRESSED() == true) {} + // waitForTouch(); +} + +void fail() +{ + centertitle("Touch Calibration FAILED"); + + tft.println(F("Unable to read the position")); + tft.println(F("of the press. This is a")); + tft.println(F("hardware issue and can not")); + tft.println(F("be corrected in software.")); + tft.println(F("check XP, XM pins with a multimeter")); + tft.println(F("check YP, YM pins with a multimeter")); + tft.println(F("should be about 300 ohms")); + + while (true) {}; +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/TouchScreen_Calibr_native/TouchScreen_kbv.cpp b/Arduino/Libraries/MCUFRIEND_kbv/examples/TouchScreen_Calibr_native/TouchScreen_kbv.cpp new file mode 100644 index 0000000..938a027 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/TouchScreen_Calibr_native/TouchScreen_kbv.cpp @@ -0,0 +1,181 @@ +// Touch screen library with X Y and Z (pressure) readings as well +// as oversampling to avoid 'bouncing' +// adapted from (c) ladyada / adafruit + +#include "Arduino.h" + +#include "TouchScreen_kbv.h" + +#define NUMSAMPLES 3 //.kbv +#if defined(__STM32F1__) || defined(ESP32) //Maple core +#define ADC_ADJUST >>2 +#else +#define ADC_ADJUST +#endif + +TSPoint_kbv::TSPoint_kbv(void) { + x = y = 0; +} + +TSPoint_kbv::TSPoint_kbv(int16_t x0, int16_t y0, int16_t z0) { + x = x0; + y = y0; + z = z0; +} + +bool TSPoint_kbv::operator==(TSPoint_kbv p1) { + return ((p1.x == x) && (p1.y == y) && (p1.z == z)); +} + +bool TSPoint_kbv::operator!=(TSPoint_kbv p1) { + return ((p1.x != x) || (p1.y != y) || (p1.z != z)); +} + +static void insert_sort(int array[], uint8_t size) { + uint8_t j; + int save; + + for (int i = 1; i < size; i++) { + save = array[i]; + for (j = i; j >= 1 && save < array[j - 1]; j--) + array[j] = array[j - 1]; + array[j] = save; + } +} + +TSPoint_kbv TouchScreen_kbv::getPoint(void) { + int x, y, z; + int samples[NUMSAMPLES]; + uint8_t i, valid; + + valid = 1; + + pinMode(_yp, INPUT); + pinMode(_ym, INPUT); + + digitalWrite(_yp, LOW); + digitalWrite(_ym, LOW); + + pinMode(_xp, OUTPUT); + pinMode(_xm, OUTPUT); + digitalWrite(_xp, HIGH); + digitalWrite(_xm, LOW); + + for (i = 0; i < NUMSAMPLES; i++) { + samples[i] = analogRead(_yp) ADC_ADJUST; + } + insert_sort(samples, NUMSAMPLES); + x = (1023 - samples[NUMSAMPLES / 2]); //choose median + + pinMode(_xp, INPUT); + pinMode(_xm, INPUT); + digitalWrite(_xp, LOW); + digitalWrite(_xm, LOW); //.kbv for Due + + pinMode(_yp, OUTPUT); + digitalWrite(_yp, HIGH); + pinMode(_ym, OUTPUT); + digitalWrite(_ym, LOW); //.kbv for Due + + for (i = 0; i < NUMSAMPLES; i++) { + samples[i] = analogRead(_xm) ADC_ADJUST; + } + + insert_sort(samples, NUMSAMPLES); + + y = (1023 - samples[NUMSAMPLES / 2]); + + // Set X+ to ground + pinMode(_xp, OUTPUT); + digitalWrite(_xp, LOW); + + // Set Y- to VCC + pinMode(_ym, OUTPUT); //.kbv + digitalWrite(_ym, HIGH); + + // Hi-Z X- and Y+ + digitalWrite(_xm, LOW); //.kbv + pinMode(_xm, INPUT); //.kbv + digitalWrite(_yp, LOW); + pinMode(_yp, INPUT); + + int z1 = analogRead(_xm) ADC_ADJUST; + int z2 = analogRead(_yp) ADC_ADJUST; + + z = (1023 - (z2 - z1)); + + return TSPoint_kbv(x, y, z); //XM, YP still in ANALOG mode +} + +TouchScreen_kbv::TouchScreen_kbv(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym) { + _yp = yp; + _xm = xm; + _ym = ym; + _xp = xp; + _rxplate = 0; + pressureThreshhold = 10; +} + + +TouchScreen_kbv::TouchScreen_kbv(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, + uint16_t rxplate) { + _yp = yp; + _xm = xm; + _ym = ym; + _xp = xp; + _rxplate = rxplate; + + pressureThreshhold = 10; +} + +int TouchScreen_kbv::readTouchX(void) { + pinMode(_yp, INPUT); + pinMode(_ym, INPUT); + digitalWrite(_yp, LOW); + digitalWrite(_ym, LOW); + + pinMode(_xp, OUTPUT); + digitalWrite(_xp, HIGH); + pinMode(_xm, OUTPUT); + digitalWrite(_xm, LOW); + + return (1023 - (analogRead(_yp)) ADC_ADJUST); +} + + +int TouchScreen_kbv::readTouchY(void) { + pinMode(_xp, INPUT); + pinMode(_xm, INPUT); + digitalWrite(_xp, LOW); + digitalWrite(_xm, LOW); + + pinMode(_yp, OUTPUT); + digitalWrite(_yp, HIGH); + pinMode(_ym, OUTPUT); + digitalWrite(_ym, LOW); + + return (1023 - (analogRead(_xm)) ADC_ADJUST); +} + + +uint16_t TouchScreen_kbv::pressure(void) { + // Set X+ to ground + pinMode(_xp, OUTPUT); + digitalWrite(_xp, LOW); + + // Set Y- to VCC + pinMode(_ym, OUTPUT); + digitalWrite(_ym, HIGH); + + // Hi-Z X- and Y+ + digitalWrite(_xm, LOW); + pinMode(_xm, INPUT); + digitalWrite(_yp, LOW); + pinMode(_yp, INPUT); + + int z1 = analogRead(_xm) ADC_ADJUST; + int z2 = analogRead(_yp) ADC_ADJUST; + + return (1023 - (z2 - z1)); +} + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/TouchScreen_Calibr_native/TouchScreen_kbv.h b/Arduino/Libraries/MCUFRIEND_kbv/examples/TouchScreen_Calibr_native/TouchScreen_kbv.h new file mode 100644 index 0000000..b94fc07 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/TouchScreen_Calibr_native/TouchScreen_kbv.h @@ -0,0 +1,39 @@ +// Touch screen library with X Y and Z (pressure) readings as well +// as oversampling to avoid 'bouncing' +// (c) ladyada / adafruit +// Code under MIT License + +#ifndef _TOUCHSCREEN_KBV_H_ +#define _TOUCHSCREEN_KBV_H_ +#include + +class TSPoint_kbv { + public: + TSPoint_kbv(void); + TSPoint_kbv(int16_t x, int16_t y, int16_t z); + + bool operator==(TSPoint_kbv); + bool operator!=(TSPoint_kbv); + + int16_t x, y, z; +}; + +class TouchScreen_kbv { + public: + TouchScreen_kbv(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym); + TouchScreen_kbv(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, uint16_t rx); + +// bool isTouching(void); + uint16_t pressure(void); + int readTouchY(); + int readTouchX(); + TSPoint_kbv getPoint(); + int16_t pressureThreshhold; + + private: + uint8_t _yp, _ym, _xm, _xp; + uint16_t _rxplate; +}; + +#endif + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/Touch_shield_new/Touch_shield_new.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/Touch_shield_new/Touch_shield_new.ino new file mode 100644 index 0000000..d97546e --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/Touch_shield_new/Touch_shield_new.ino @@ -0,0 +1,202 @@ +// the regular Adafruit "TouchScreen.h" library only works on AVRs + +// different mcufriend shields have Touchscreen on different pins +// and rotation. +// Run the TouchScreen_Calibr_native sketch for calibration of your shield + +#include +MCUFRIEND_kbv tft; // hard-wired for UNO shields anyway. +#include + +char *name = "Please Calibrate."; //edit name of shield +const int XP=6,XM=A2,YP=A1,YM=7; //ID=0x9341 +const int TS_LEFT=907,TS_RT=136,TS_TOP=942,TS_BOT=139; + +TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); +TSPoint tp; + +#define MINPRESSURE 200 +#define MAXPRESSURE 1000 + +int16_t BOXSIZE; +int16_t PENRADIUS = 1; +uint16_t ID, oldcolor, currentcolor; +uint8_t Orientation = 0; //PORTRAIT + +// Assign human-readable names to some common 16-bit color values: +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF + +void show_Serial(void) +{ + Serial.println(F("Most Touch Screens use pins 6, 7, A1, A2")); + Serial.println(F("But they can be in ANY order")); + Serial.println(F("e.g. right to left or bottom to top")); + Serial.println(F("or wrong direction")); + Serial.println(F("Edit name and calibration statements\n")); + Serial.println(name); + Serial.print(F("ID=0x")); + Serial.println(ID, HEX); + Serial.println("Screen is " + String(tft.width()) + "x" + String(tft.height())); + Serial.println("Calibration is: "); + Serial.println("LEFT = " + String(TS_LEFT) + " RT = " + String(TS_RT)); + Serial.println("TOP = " + String(TS_TOP) + " BOT = " + String(TS_BOT)); + Serial.println("Wiring is always PORTRAIT"); + Serial.println("YP=" + String(YP) + " XM=" + String(XM)); + Serial.println("YM=" + String(YM) + " XP=" + String(XP)); +} + +void show_tft(void) +{ + tft.setCursor(0, 0); + tft.setTextSize(1); + tft.print(F("ID=0x")); + tft.println(ID, HEX); + tft.println("Screen is " + String(tft.width()) + "x" + String(tft.height())); + tft.println(""); + tft.setTextSize(2); + tft.println(name); + tft.setTextSize(1); + tft.println("PORTRAIT Values:"); + tft.println("LEFT = " + String(TS_LEFT) + " RT = " + String(TS_RT)); + tft.println("TOP = " + String(TS_TOP) + " BOT = " + String(TS_BOT)); + tft.println("\nWiring is: "); + tft.println("YP=" + String(YP) + " XM=" + String(XM)); + tft.println("YM=" + String(YM) + " XP=" + String(XP)); + tft.setTextSize(2); + tft.setTextColor(RED); + tft.setCursor((tft.width() - 48) / 2, (tft.height() * 2) / 4); + tft.print("EXIT"); + tft.setTextColor(YELLOW, BLACK); + tft.setCursor(0, (tft.height() * 6) / 8); + tft.print("Touch screen for loc"); + while (1) { + tp = ts.getPoint(); + pinMode(XM, OUTPUT); + pinMode(YP, OUTPUT); + if (tp.z < MINPRESSURE || tp.z > MAXPRESSURE) continue; + if (tp.x > 450 && tp.x < 570 && tp.y > 450 && tp.y < 570) break; + tft.setCursor(0, (tft.height() * 3) / 4); + tft.print("tp.x=" + String(tp.x) + " tp.y=" + String(tp.y) + " "); + } +} + + +void setup(void) +{ + uint16_t tmp; + + tft.reset(); + ID = tft.readID(); + tft.begin(ID); + Serial.begin(9600); + show_Serial(); + tft.setRotation(Orientation); + tft.fillScreen(BLACK); + show_tft(); + + BOXSIZE = tft.width() / 6; + tft.fillScreen(BLACK); + + tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); + tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); + tft.fillRect(BOXSIZE * 2, 0, BOXSIZE, BOXSIZE, GREEN); + tft.fillRect(BOXSIZE * 3, 0, BOXSIZE, BOXSIZE, CYAN); + tft.fillRect(BOXSIZE * 4, 0, BOXSIZE, BOXSIZE, BLUE); + tft.fillRect(BOXSIZE * 5, 0, BOXSIZE, BOXSIZE, MAGENTA); + + tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); + currentcolor = RED; + delay(1000); +} + +void loop() +{ + uint16_t xpos, ypos; //screen coordinates + tp = ts.getPoint(); //tp.x, tp.y are ADC values + + // if sharing pins, you'll need to fix the directions of the touchscreen pins + pinMode(XM, OUTPUT); + pinMode(YP, OUTPUT); + // we have some minimum pressure we consider 'valid' + // pressure of 0 means no pressing! + + if (tp.z > MINPRESSURE && tp.z < MAXPRESSURE) { + // most mcufriend have touch (with icons) that extends below the TFT + // screens without icons need to reserve a space for "erase" + // scale the ADC values from ts.getPoint() to screen values e.g. 0-239 + // + // Calibration is true for PORTRAIT. tp.y is always long dimension + // map to your current pixel orientation + switch (Orientation) { + case 0: + xpos = map(tp.x, TS_LEFT, TS_RT, 0, tft.width()); + ypos = map(tp.y, TS_TOP, TS_BOT, 0, tft.height()); + break; + case 1: + xpos = map(tp.y, TS_TOP, TS_BOT, 0, tft.width()); + ypos = map(tp.x, TS_RT, TS_LEFT, 0, tft.height()); + break; + case 2: + xpos = map(tp.x, TS_RT, TS_LEFT, 0, tft.width()); + ypos = map(tp.y, TS_BOT, TS_TOP, 0, tft.height()); + break; + case 3: + xpos = map(tp.y, TS_BOT, TS_TOP, 0, tft.width()); + ypos = map(tp.x, TS_LEFT, TS_RT, 0, tft.height()); + break; + } + + // are we in top color box area ? + if (ypos < BOXSIZE) { //draw white border on selected color box + oldcolor = currentcolor; + + if (xpos < BOXSIZE) { + currentcolor = RED; + tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); + } else if (xpos < BOXSIZE * 2) { + currentcolor = YELLOW; + tft.drawRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, WHITE); + } else if (xpos < BOXSIZE * 3) { + currentcolor = GREEN; + tft.drawRect(BOXSIZE * 2, 0, BOXSIZE, BOXSIZE, WHITE); + } else if (xpos < BOXSIZE * 4) { + currentcolor = CYAN; + tft.drawRect(BOXSIZE * 3, 0, BOXSIZE, BOXSIZE, WHITE); + } else if (xpos < BOXSIZE * 5) { + currentcolor = BLUE; + tft.drawRect(BOXSIZE * 4, 0, BOXSIZE, BOXSIZE, WHITE); + } else if (xpos < BOXSIZE * 6) { + currentcolor = MAGENTA; + tft.drawRect(BOXSIZE * 5, 0, BOXSIZE, BOXSIZE, WHITE); + } + + if (oldcolor != currentcolor) { //rub out the previous white border + if (oldcolor == RED) tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); + if (oldcolor == YELLOW) tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); + if (oldcolor == GREEN) tft.fillRect(BOXSIZE * 2, 0, BOXSIZE, BOXSIZE, GREEN); + if (oldcolor == CYAN) tft.fillRect(BOXSIZE * 3, 0, BOXSIZE, BOXSIZE, CYAN); + if (oldcolor == BLUE) tft.fillRect(BOXSIZE * 4, 0, BOXSIZE, BOXSIZE, BLUE); + if (oldcolor == MAGENTA) tft.fillRect(BOXSIZE * 5, 0, BOXSIZE, BOXSIZE, MAGENTA); + } + } + // are we in drawing area ? + if (((ypos - PENRADIUS) > BOXSIZE) && ((ypos + PENRADIUS) < tft.height())) { + tft.fillCircle(xpos, ypos, PENRADIUS, currentcolor); + } + // are we in erase area ? + // Plain Touch panels use bottom 10 pixels e.g. > h - 10 + // Touch panels with icon area e.g. > h - 0 + if (ypos > tft.height() - 10) { + // press the bottom of the screen to erase + tft.fillRect(0, BOXSIZE, tft.width(), tft.height() - BOXSIZE, BLACK); + } + } +} + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/aspect_kbv/aspect_kbv.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/aspect_kbv/aspect_kbv.ino new file mode 100644 index 0000000..1de1ae3 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/aspect_kbv/aspect_kbv.ino @@ -0,0 +1,40 @@ +#include // Hardware-specific library +#include +MCUFRIEND_kbv tft; + +void setup() +{ + // put your setup code here, to run once: + Serial.begin(9600); + tft.reset(); + uint16_t identifier = tft.readID(); + Serial.print("ID = 0x"); + Serial.println(identifier, HEX); + if (identifier == 0xEFEF) identifier = 0x9486; + tft.begin(identifier); + // tft.fillScreen(BLACK); +} + +char *msg[] = { "PORTRAIT", "LANDSCAPE", "PORTRAIT_REV", "LANDSCAPE_REV" }; +uint8_t aspect; + +void loop() +{ + // put your main code here, to run repeatedly: + uint16_t x = 50, y = 100; + tft.setRotation(aspect); + tft.fillScreen(0x0000); + tft.setCursor(0, 0); + tft.setTextSize(2); + tft.println(msg[aspect]); + tft.setCursor(x, y); + tft.println("[x=" + String(x) + ",y=" + String(y) + "]"); + delay(5000); + tft.println("INVERT ON"); + tft.invertDisplay(true); + delay(1000); + tft.invertDisplay(false); + tft.println("INVERT OFF"); + delay(1000); + if (++aspect >= 4) aspect = 0; +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/button_simple/button_list.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/button_simple/button_list.ino new file mode 100644 index 0000000..95d7355 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/button_simple/button_list.ino @@ -0,0 +1,116 @@ +/* an alternative approach. swap the #if 1 / 0 values to try it + * + */ +#if 0 + +#include +#include +MCUFRIEND_kbv tft; +#include +#define MINPRESSURE 200 +#define MAXPRESSURE 1000 + +// ALL Touch panels and wiring is DIFFERENT +// copy-paste results from TouchScreen_Calibr_native.ino +const int XP = 6, XM = A2, YP = A1, YM = 7; //ID=0x9341 +const int TS_LEFT = 907, TS_RT = 136, TS_TOP = 942, TS_BOT = 139; + +TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); + +Adafruit_GFX_Button on_btn, off_btn; + +int pixel_x, pixel_y; //Touch_getXY() updates global vars +bool Touch_getXY(void) +{ + TSPoint p = ts.getPoint(); + pinMode(YP, OUTPUT); //restore shared pins + pinMode(XM, OUTPUT); + digitalWrite(YP, HIGH); //because TFT control pins + digitalWrite(XM, HIGH); + bool pressed = (p.z > MINPRESSURE && p.z < MAXPRESSURE); + if (pressed) { + pixel_x = map(p.x, TS_LEFT, TS_RT, 0, tft.width()); //.kbv makes sense to me + pixel_y = map(p.y, TS_TOP, TS_BOT, 0, tft.height()); + } + return pressed; +} + +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF + +void setup(void) +{ + Serial.begin(9600); + uint16_t ID = tft.readID(); + Serial.print("TFT ID = 0x"); + Serial.println(ID, HEX); + Serial.println("Calibrate for your Touch Panel"); + if (ID == 0xD3D3) ID = 0x9486; // write-only shield + tft.begin(ID); + tft.setRotation(0); //PORTRAIT + tft.fillScreen(BLACK); + on_btn.initButton(&tft, 60, 200, 100, 40, WHITE, CYAN, BLACK, "ON", 2); + off_btn.initButton(&tft, 180, 200, 100, 40, WHITE, CYAN, BLACK, "OFF", 2); + on_btn.drawButton(false); + off_btn.drawButton(false); + tft.fillRect(40, 80, 160, 80, RED); +} + +/* + * updating multiple buttons from a list + * + * anything more than two buttons gets repetitive + * + * you can place button addresses in separate lists + * e.g. for separate menu screens + */ + +// Array of button addresses to behave like a list +Adafruit_GFX_Button *buttons[] = {&on_btn, &off_btn, NULL}; + +/* update the state of a button and redraw as reqd + * + * main program can use isPressed(), justPressed() etc + */ +bool update_button(Adafruit_GFX_Button *b, bool down) +{ + b->press(down && b->contains(pixel_x, pixel_y)); + if (b->justReleased()) + b->drawButton(false); + if (b->justPressed()) + b->drawButton(true); + return down; +} + +/* most screens have different sets of buttons + * life is easier if you process whole list in one go + */ +bool update_button_list(Adafruit_GFX_Button **pb) +{ + bool down = Touch_getXY(); + for (int i = 0 ; pb[i] != NULL; i++) { + update_button(pb[i], down); + } + return down; +} + +/* compare the simplicity of update_button_list() + */ +void loop(void) +{ + update_button_list(buttons); //use helper function + if (on_btn.justPressed()) { + tft.fillRect(40, 80, 160, 80, GREEN); + } + if (off_btn.justPressed()) { + tft.fillRect(40, 80, 160, 80, RED); + } +} +#endif + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/button_simple/button_simple.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/button_simple/button_simple.ino new file mode 100644 index 0000000..a944a85 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/button_simple/button_simple.ino @@ -0,0 +1,84 @@ +#if 1 + +#include +#include +MCUFRIEND_kbv tft; +#include +#define MINPRESSURE 200 +#define MAXPRESSURE 1000 + +// ALL Touch panels and wiring is DIFFERENT +// copy-paste results from TouchScreen_Calibr_native.ino +const int XP = 6, XM = A2, YP = A1, YM = 7; //ID=0x9341 +const int TS_LEFT = 907, TS_RT = 136, TS_TOP = 942, TS_BOT = 139; + +TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); + +Adafruit_GFX_Button on_btn, off_btn; + +int pixel_x, pixel_y; //Touch_getXY() updates global vars +bool Touch_getXY(void) +{ + TSPoint p = ts.getPoint(); + pinMode(YP, OUTPUT); //restore shared pins + pinMode(XM, OUTPUT); + digitalWrite(YP, HIGH); //because TFT control pins + digitalWrite(XM, HIGH); + bool pressed = (p.z > MINPRESSURE && p.z < MAXPRESSURE); + if (pressed) { + pixel_x = map(p.x, TS_LEFT, TS_RT, 0, tft.width()); //.kbv makes sense to me + pixel_y = map(p.y, TS_TOP, TS_BOT, 0, tft.height()); + } + return pressed; +} + +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF + +void setup(void) +{ + Serial.begin(9600); + uint16_t ID = tft.readID(); + Serial.print("TFT ID = 0x"); + Serial.println(ID, HEX); + Serial.println("Calibrate for your Touch Panel"); + if (ID == 0xD3D3) ID = 0x9486; // write-only shield + tft.begin(ID); + tft.setRotation(0); //PORTRAIT + tft.fillScreen(BLACK); + on_btn.initButton(&tft, 60, 200, 100, 40, WHITE, CYAN, BLACK, "ON", 2); + off_btn.initButton(&tft, 180, 200, 100, 40, WHITE, CYAN, BLACK, "OFF", 2); + on_btn.drawButton(false); + off_btn.drawButton(false); + tft.fillRect(40, 80, 160, 80, RED); +} + +/* two buttons are quite simple + */ +void loop(void) +{ + bool down = Touch_getXY(); + on_btn.press(down && on_btn.contains(pixel_x, pixel_y)); + off_btn.press(down && off_btn.contains(pixel_x, pixel_y)); + if (on_btn.justReleased()) + on_btn.drawButton(); + if (off_btn.justReleased()) + off_btn.drawButton(); + if (on_btn.justPressed()) { + on_btn.drawButton(true); + tft.fillRect(40, 80, 160, 80, GREEN); + } + if (off_btn.justPressed()) { + off_btn.drawButton(true); + tft.fillRect(40, 80, 160, 80, RED); + } +} +#endif + + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/diagnose_TFT_support/diagnose_TFT_support.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/diagnose_TFT_support/diagnose_TFT_support.ino new file mode 100644 index 0000000..93738bb --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/diagnose_TFT_support/diagnose_TFT_support.ino @@ -0,0 +1,126 @@ +#include +MCUFRIEND_kbv tft; + +// Assign human-readable names to some common 16-bit color values: +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF +#define GRAY 0x8410 + +uint16_t version = MCUFRIEND_KBV_H_; + +void setup() +{ + Serial.begin(9600); + if (!Serial) delay(5000); //allow some time for Leonardo + uint16_t ID = tft.readID(); // + Serial.println(F("Diagnose whether this controller is supported")); + Serial.println(F("There are FAQs in extras/mcufriend_how_to.txt")); + Serial.println(F("")); + Serial.print(F("tft.readID() finds: ID = 0x")); + Serial.println(ID, HEX); + Serial.println(F("")); + Serial.print(F("MCUFRIEND_kbv version: ")); + Serial.print(version/100); + Serial.print(F(".")); + Serial.print((version / 10) % 10); + Serial.print(F(".")); + Serial.println(version % 10); + Serial.println(F("")); + if (ID == 0x0404) { + Serial.println(F("Probably a write-only Mega2560 Shield")); + Serial.println(F("#define USE_SPECIAL in mcufriend_shield.h")); + Serial.println(F("#define appropriate SPECIAL in mcufriend_special.h")); + Serial.println(F("e.g. USE_MEGA_16BIT_SHIELD")); + Serial.println(F("e.g. USE_MEGA_8BIT_SHIELD")); + Serial.println(F("Hint. A Mega2560 Shield has a 18x2 male header")); + Serial.println(F("Often a row of resistor-packs near the 18x2")); + Serial.println(F("RP1-RP7 implies 16-bit but it might be 8-bit")); + Serial.println(F("RP1-RP4 or RP1-RP5 can only be 8-bit")); + } + if (ID == 0xD3D3) { + uint16_t guess_ID = 0x9481; // write-only shield + Serial.println(F("Probably a write-only Mega2560 Shield")); + Serial.print(F("Try to force ID = 0x")); + Serial.println(guess_ID, HEX); + tft.begin(guess_ID); + } + else tft.begin(ID); + Serial.println(F("")); + if (tft.width() == 0) { + Serial.println(F("This ID is not supported")); + Serial.println(F("look up ID in extras/mcufriend_how_to.txt")); + Serial.println(F("you may need to edit MCUFRIEND_kbv.cpp")); + Serial.println(F("to enable support for this ID")); + Serial.println(F("e.g. #define SUPPORT_8347D")); + Serial.println(F("")); + Serial.println(F("New controllers appear on Ebay often")); + Serial.println(F("If your ID is not supported")); + Serial.println(F("run LCD_ID_readreg.ino from examples/")); + Serial.println(F("Copy-Paste the output from the Serial Terminal")); + Serial.println(F("to a message in Displays topic on Arduino Forum")); + Serial.println(F("or to Issues on GitHub")); + Serial.println(F("")); + Serial.println(F("Note that OPEN-SMART boards have diff pinout")); + Serial.println(F("Edit the pin defines in LCD_ID_readreg to match")); + Serial.println(F("Edit mcufiend_shield.h for USE_SPECIAL")); + Serial.println(F("Edit mcufiend_special.h for USE_OPENSMART_SHIELD_PINOUT")); + while (1); //just die + } else { + Serial.print(F("PORTRAIT is ")); + Serial.print(tft.width()); + Serial.print(F(" x ")); + Serial.println(tft.height()); + Serial.println(F("")); + Serial.println(F("Run the examples/graphictest_kbv sketch")); + Serial.println(F("All colours, text, directions, rotations, scrolls")); + Serial.println(F("should work. If there is a problem, make notes on paper")); + Serial.println(F("Post accurate description of problem to Forum")); + Serial.println(F("Or post a link to a video (or photos)")); + Serial.println(F("")); + Serial.println(F("I rely on good information from remote users")); + } +} + +void loop() +{ + static uint8_t aspect = 0; + const char *aspectname[] = { + "PORTRAIT", "LANDSCAPE", "PORTRAIT_REV", "LANDSCAPE_REV" + }; + const char *colorname[] = { "BLUE", "GREEN", "RED", "GRAY" }; + uint16_t colormask[] = { BLUE, GREEN, RED, GRAY }; + uint16_t ID = tft.readID(); // + tft.setRotation(aspect); + int width = tft.width(); + int height = tft.height(); + tft.fillScreen(colormask[aspect]); + tft.drawRect(0, 0, width, height, WHITE); + tft.drawRect(32, 32, width - 64, height - 64, WHITE); + tft.setTextSize(2); + tft.setTextColor(BLACK); + tft.setCursor(40, 40); + tft.print("ID=0x"); + tft.print(ID, HEX); + if (ID == 0xD3D3) tft.print(" w/o"); + tft.setCursor(40, 70); + tft.print(aspectname[aspect]); + tft.setCursor(40, 100); + tft.print(width); + tft.print(" x "); + tft.print(height); + tft.setTextColor(WHITE); + tft.setCursor(40, 130); + tft.print(colorname[aspect]); + tft.setCursor(40, 160); + tft.setTextSize(1); + tft.print("MCUFRIEND_KBV_H_ = "); + tft.print(version); + if (++aspect > 3) aspect = 0; + delay(5000); +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/diagnose_Touchpins/diagnose_Touchpins.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/diagnose_Touchpins/diagnose_Touchpins.ino new file mode 100644 index 0000000..acdbc3b --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/diagnose_Touchpins/diagnose_Touchpins.ino @@ -0,0 +1,49 @@ +void showpins(int A, int D, int value, const char *msg) +{ + Serial.print(msg); + Serial.print(" (A" + String(A - A0) + ", D" + String(D) + ") = "); + Serial.println(value); +} +void setup() +{ + int i, j, value, Apins[2], Dpins[2], Values[2], found = 0; + Serial.begin(9600); + Serial.println("Making all control and bus pins INPUT_PULLUP"); + Serial.println("Typical 30k Analog pullup with corresponding pin"); + Serial.println("would read low when digital is written LOW"); + Serial.println("e.g. reads ~25 for 300R X direction"); + Serial.println("e.g. reads ~30 for 500R Y direction"); + Serial.println(""); + for (i = A0; i < A5; i++) pinMode(i, INPUT_PULLUP); + for (i = 2; i < 10; i++) pinMode(i, INPUT_PULLUP); + for (i = A0; i < A4; i++) { + for (j = 5; j < 10; j++) { + pinMode(j, OUTPUT); + digitalWrite(j, LOW); + value = analogRead(i); // ignore first reading + value = analogRead(i); + if (value < 100) { + showpins(i, j, value, "Testing :"); + if (found < 2) { + Apins[found] = i; + Dpins[found] = j; + Values[found] = value; + found++; + } + } + pinMode(j, INPUT_PULLUP); + } + } + if (found == 2) { + Serial.println("Diagnosing as:-"); + for (i = 0; i < 2; i++) { + showpins(Apins[i], Dpins[i], Values[i], (Values[i] < Values[!i]) ? "XM,XP: " : "YP,YM: "); + } + } +} + +void loop() +{ + // put your main code here, to run repeatedly: + +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/drawBitmap_kbv/bitmap_RGB.h b/Arduino/Libraries/MCUFRIEND_kbv/examples/drawBitmap_kbv/bitmap_RGB.h new file mode 100644 index 0000000..8865758 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/drawBitmap_kbv/bitmap_RGB.h @@ -0,0 +1,668 @@ +// several programs can convert BMP, JPG, PNG images to C arrays of pixels +// these used the utility bundled with UTFT. +// Online tool at http://www.rinkydinkelectronics.com/t_imageconverter565.php + +// Generated by : ImageConverter 565 v2.3 +// Generated from: marilyn_64x64.bmp +// Time generated: 14-May-18 06:55:31 +// Dimensions : 64x64 pixels +// Size : 8,192 Bytes + +#include + +//const unsigned short marilyn_64x64[0x1000] PROGMEM ={ +// uint16_t is not ambiguous +const uint16_t marilyn_64x64[0x1000] PROGMEM ={ +0x98E5, 0x98E5, 0x98E5, 0x98E5, 0x98E5, 0x98E4, 0x90E4, 0x9905, 0x9905, 0x9104, 0x90E4, 0x9905, 0x9925, 0x9925, 0x9925, 0x9945, // 0x0010 (16) +0x9945, 0x9945, 0x9946, 0xA1A6, 0xAA07, 0xB289, 0xBB4B, 0xCC4F, 0xE5F5, 0xF6B8, 0xF6D9, 0xFEF9, 0xFED8, 0xF6D8, 0xF677, 0xEDD4, // 0x0020 (32) +0xD46F, 0xBAEA, 0xAA08, 0xA186, 0x9966, 0x9966, 0xA166, 0xA166, 0x9946, 0x9946, 0x9945, 0x9926, 0x9926, 0x9946, 0x9925, 0x9925, // 0x0030 (48) +0x9926, 0x9946, 0xA146, 0xA166, 0xA167, 0xA167, 0xA146, 0xA147, 0xA146, 0xA167, 0xA167, 0xA167, 0xA987, 0xA987, 0xA967, 0xA967, // 0x0040 (64) +0x98E5, 0x98E4, 0x98E4, 0x90E4, 0x90E4, 0x90E4, 0x90E4, 0x90E4, 0x9104, 0x90E4, 0x9104, 0x9104, 0x9905, 0x9104, 0x9925, 0x9925, // 0x0050 (80) +0x9965, 0x9966, 0xA1C6, 0xBB0A, 0xC3ED, 0xD511, 0xE5B3, 0xE614, 0xEE34, 0xF6B7, 0xF6F8, 0xFF19, 0xF6D7, 0xEE76, 0xF6D8, 0xF6D8, // 0x0060 (96) +0xF697, 0xE5D5, 0xD4B0, 0xB2CA, 0x9986, 0x9966, 0x9966, 0x9966, 0x9946, 0x9945, 0x9925, 0x9925, 0x9925, 0x9946, 0x9925, 0x9925, // 0x0070 (112) +0x9925, 0x9946, 0x9946, 0xA146, 0xA146, 0xA146, 0x9946, 0xA146, 0xA146, 0xA146, 0xA146, 0xA146, 0xA967, 0xA967, 0xA967, 0xA967, // 0x0080 (128) +0x90C4, 0x90E4, 0x90E4, 0x90E4, 0x90C4, 0x90E4, 0x90E4, 0x90E4, 0x90E4, 0x9104, 0x9104, 0x9104, 0x9104, 0x9104, 0x9124, 0x9945, // 0x0090 (144) +0xAA48, 0xC38C, 0xDD73, 0xF677, 0xF71A, 0xFF3A, 0xF6D7, 0xEE75, 0xEE75, 0xF6B7, 0xF6D8, 0xEE75, 0xE5F3, 0xEE35, 0xF676, 0xF6D8, // 0x00A0 (160) +0xF6D8, 0xEE97, 0xEE77, 0xEE15, 0xCC0E, 0xAA28, 0xA1A6, 0xA186, 0x9945, 0x9945, 0x9945, 0x9925, 0x9945, 0x9945, 0x9925, 0x9925, // 0x00B0 (176) +0x9925, 0x9925, 0x9946, 0x9946, 0x9946, 0x9946, 0x9926, 0xA146, 0xA146, 0x9926, 0xA146, 0xA146, 0xA167, 0xA967, 0xA967, 0xA967, // 0x00C0 (192) +0x90C4, 0x90C4, 0x90C4, 0x90E4, 0x90E4, 0x90E4, 0x9104, 0x9904, 0x9104, 0x9104, 0x9925, 0x9925, 0x9925, 0x9924, 0x9945, 0xAA47, // 0x00D0 (208) +0xD4AF, 0xEE15, 0xF6B7, 0xF697, 0xF697, 0xEE96, 0xF6B7, 0xF6B7, 0xF6D7, 0xF6B7, 0xEE55, 0xD571, 0xCCEF, 0xD530, 0xDD92, 0xE614, // 0x00E0 (224) +0xF6F8, 0xF6D8, 0xEE76, 0xE656, 0xEE35, 0xCC2E, 0xAA28, 0xA9C7, 0xA166, 0x9945, 0x9945, 0x9945, 0x9945, 0x9945, 0x9925, 0x9925, // 0x00F0 (240) +0x9946, 0x9946, 0x9946, 0x9946, 0x9946, 0x9946, 0x9946, 0xA146, 0xA146, 0xA146, 0xA146, 0xA146, 0xA146, 0xA967, 0xA967, 0xA967, // 0x0100 (256) +0x90C4, 0x90E4, 0x90E4, 0x98E4, 0x90E4, 0x9104, 0x9904, 0x9904, 0x9925, 0x9925, 0x9945, 0x9945, 0x9945, 0xA185, 0xB268, 0xD46E, // 0x0110 (272) +0xEE14, 0xEE96, 0xEE96, 0xDDB2, 0xCCEF, 0xBC6D, 0xC4CF, 0xD5B2, 0xE655, 0xEE55, 0xDDB2, 0xD530, 0xC4AE, 0xC46D, 0xD510, 0xD530, // 0x0120 (288) +0xE614, 0xEE55, 0xE676, 0xEE97, 0xEE76, 0xE5B4, 0xC34B, 0xA9E7, 0xA186, 0xA166, 0xA166, 0xA165, 0x9945, 0x9946, 0x9946, 0x9945, // 0x0130 (304) +0x9946, 0x9946, 0x9946, 0xA166, 0xA146, 0xA146, 0x9946, 0xA146, 0xA166, 0xA166, 0xA146, 0xA146, 0xA166, 0xA166, 0xA967, 0xA967, // 0x0140 (320) +0x90E4, 0x90E4, 0x90E4, 0x90E4, 0x9904, 0x9904, 0x9904, 0x9924, 0x9925, 0x9945, 0xA165, 0xA165, 0xA186, 0xAA27, 0xCC4E, 0xDDB2, // 0x0150 (336) +0xEE96, 0xF6D8, 0xE614, 0xC4CF, 0xABCB, 0x9B49, 0x8AE8, 0x9B8A, 0xBCAE, 0xD572, 0xD530, 0xCD0F, 0xC4AE, 0xB3EB, 0xCCAE, 0xD530, // 0x0160 (352) +0xDD91, 0xE5F3, 0xEE76, 0xEE97, 0xEE56, 0xEE77, 0xD48F, 0xB269, 0xA9C7, 0xA1A6, 0xA186, 0xA166, 0xA166, 0xA166, 0xA166, 0xA166, // 0x0170 (368) +0xA146, 0xA146, 0xA166, 0xA166, 0xA166, 0xA166, 0xA166, 0xA166, 0xA167, 0xA166, 0xA166, 0xA166, 0xA166, 0xA987, 0xA987, 0xA987, // 0x0180 (384) +0x90E4, 0x98E4, 0x9904, 0x9904, 0x9904, 0x9904, 0x9925, 0x9945, 0xA165, 0xA165, 0xA186, 0xA9E7, 0xB248, 0xC3CC, 0xD530, 0xE635, // 0x0190 (400) +0xE655, 0xD592, 0xC4F0, 0xAC0C, 0x9B49, 0x8AC8, 0x82A7, 0x7A66, 0x9B8A, 0xBC8E, 0xC4AE, 0xCD10, 0xD530, 0xC46D, 0xCCF0, 0xDD51, // 0x01A0 (416) +0xE5F3, 0xE5D3, 0xEE97, 0xF6D8, 0xEE56, 0xF6D8, 0xE573, 0xCB8C, 0xBAA9, 0xB1E7, 0xA9C7, 0xA1A6, 0xA186, 0xA186, 0xA187, 0xA186, // 0x01B0 (432) +0xA166, 0xA166, 0xA166, 0xA187, 0xA187, 0xA167, 0xA167, 0xA166, 0xA187, 0xA987, 0xA987, 0xA167, 0xA167, 0xA987, 0xA987, 0xA987, // 0x01C0 (448) +0x9904, 0x9904, 0x9905, 0x9925, 0x9925, 0x9925, 0x9925, 0xA166, 0xA186, 0xA1A6, 0xB248, 0xBB2A, 0xCBED, 0xCCCF, 0xDDD3, 0xE614, // 0x01D0 (464) +0xBC4D, 0xA36A, 0x92C8, 0x92E8, 0x9329, 0x8AC8, 0x8287, 0x7A26, 0x9329, 0xB44D, 0xC4CF, 0xDDB2, 0xE614, 0xDD92, 0xE5F4, 0xE615, // 0x01E0 (480) +0xF6B7, 0xEE55, 0xEE96, 0xEE77, 0xE635, 0xFEF9, 0xEE15, 0xDC4E, 0xCB8C, 0xB208, 0xB208, 0xA9C7, 0xA9C7, 0xA9C7, 0xA9A7, 0xA986, // 0x01F0 (496) +0xA186, 0xA186, 0xA9A7, 0xA9A7, 0xA987, 0xA987, 0xA187, 0xA187, 0xA9A7, 0xA9A7, 0xA987, 0xA987, 0xA987, 0xA987, 0xA9A7, 0xA9A7, // 0x0200 (512) +0x9905, 0x9925, 0x9925, 0x9925, 0x9925, 0x9945, 0x9945, 0xA186, 0xA1A6, 0xAA68, 0xBBCC, 0xDD93, 0xE5F4, 0xD592, 0xE635, 0xD591, // 0x0210 (528) +0xC48D, 0xB42C, 0x8AC8, 0x8AA7, 0x9309, 0x9309, 0x8AC8, 0x8AC8, 0xABEC, 0xCCEF, 0xDDD3, 0xEE55, 0xF696, 0xEE34, 0xEE55, 0xEE76, // 0x0220 (544) +0xFF3A, 0xF6F8, 0xE614, 0xDDD3, 0xE635, 0xF6D8, 0xF656, 0xDC8F, 0xDC4F, 0xBAA9, 0xB249, 0xB208, 0xB228, 0xBA69, 0xA9E7, 0xA9A7, // 0x0230 (560) +0xA9A7, 0xA9A7, 0xA9C7, 0xA9A7, 0xA9A7, 0xA9A7, 0xA987, 0xA9A7, 0xA9A7, 0xA9A8, 0xA9A7, 0xA9A7, 0xA9A7, 0xA9A7, 0xA9A7, 0xA9A8, // 0x0240 (576) +0x9925, 0xA125, 0xA145, 0xA145, 0xA145, 0xA165, 0xA166, 0xAA07, 0xAA68, 0x9288, 0x9B4A, 0xCD11, 0xEE76, 0xE635, 0xE5F4, 0xE5F3, // 0x0250 (592) +0xDDB2, 0x9B6A, 0x69A5, 0x7A26, 0x8AE8, 0x9B6A, 0x8AE8, 0xA3CB, 0xC4AE, 0xE614, 0xF6B7, 0xEE76, 0xF6D7, 0xF6B7, 0xEE76, 0xE635, // 0x0260 (608) +0xFF19, 0xF6F8, 0xD571, 0xDDD3, 0xEE56, 0xF697, 0xEE35, 0xE552, 0xE4F0, 0xCBAC, 0xD3CD, 0xDCD1, 0xE573, 0xE552, 0xCBCD, 0xBA69, // 0x0270 (624) +0xB208, 0xB1E7, 0xA9C7, 0xA9C8, 0xA9C8, 0xA9A7, 0xA9A7, 0xA9A7, 0xA9C8, 0xA9C8, 0xA9A8, 0xA9A8, 0xA9A8, 0xA9A8, 0xA9A8, 0xA9A8, // 0x0280 (640) +0x9925, 0xA145, 0xA145, 0xA165, 0xA166, 0xA186, 0xA1C6, 0xAA68, 0xBB6B, 0x8AA8, 0xA38B, 0xCD31, 0xCD51, 0xD571, 0xD5B2, 0xEE76, // 0x0290 (656) +0xE635, 0x934A, 0x69C5, 0x7226, 0x9329, 0xA3CB, 0xA3AB, 0xB44E, 0xCD31, 0xEE96, 0xF6D8, 0xF6B7, 0xEE96, 0xF6B7, 0xEE56, 0xEE55, // 0x02A0 (672) +0xE634, 0xE5F4, 0xDDB3, 0xE635, 0xE655, 0xE635, 0xEE56, 0xE5D4, 0xEDF4, 0xEE35, 0xF656, 0xFED9, 0xF677, 0xEDF4, 0xED94, 0xD42E, // 0x02B0 (688) +0xBA69, 0xB208, 0xB1E8, 0xB1E8, 0xB1E8, 0xA9C8, 0xA9C8, 0xA9C8, 0xA9C8, 0xA9C8, 0xA9C8, 0xB1C8, 0xA9C8, 0xB1C8, 0xB1C8, 0xB1C8, // 0x02C0 (704) +0xA145, 0xA145, 0xA166, 0xA166, 0xA186, 0xA9C7, 0xA9E7, 0xB2A9, 0xBB8B, 0x934A, 0x8AC8, 0x92C8, 0x9B8A, 0xAC0D, 0xC510, 0xDE14, // 0x02D0 (720) +0xD5B3, 0xA3AB, 0x7A68, 0x82E9, 0xA3CC, 0xB46E, 0xC4CF, 0xC4CF, 0xCD31, 0xDDF4, 0xDDF4, 0xDDD4, 0xD592, 0xE614, 0xE614, 0xE635, // 0x02E0 (736) +0xD572, 0xC4F0, 0xCD31, 0xDDB3, 0xCD10, 0xD592, 0xEE76, 0xEE56, 0xF6B7, 0xFEF9, 0xFF19, 0xFED8, 0xF697, 0xF636, 0xEDD4, 0xED52, // 0x02F0 (752) +0xD38C, 0xBA49, 0xB208, 0xB1E8, 0xB1E8, 0xB1E8, 0xB1C8, 0xB1C8, 0xB1E8, 0xB1E8, 0xB1C8, 0xB1C8, 0xB1C8, 0xB1C8, 0xB1C8, 0xB1C8, // 0x0300 (768) +0xA145, 0xA166, 0xA186, 0xA186, 0xA9A6, 0xA9E7, 0xB248, 0xBB6B, 0xC46E, 0x8AE8, 0x8287, 0x92C8, 0xA3AB, 0xB44D, 0xB46E, 0xCD51, // 0x0310 (784) +0xD572, 0xAC0D, 0x7268, 0x934A, 0xBC8E, 0xCCF0, 0xD510, 0xD510, 0xD510, 0xD571, 0xD531, 0xCCF0, 0xC4CF, 0xDD92, 0xCD10, 0xD552, // 0x0320 (800) +0xD551, 0xCCF0, 0xC4AF, 0xA3AB, 0x8AC9, 0xB44E, 0xEE56, 0xFF1A, 0xFF1A, 0xFF1A, 0xFEF9, 0xF696, 0xF6B7, 0xF6B8, 0xF677, 0xF615, // 0x0330 (816) +0xE4F1, 0xCB4C, 0xB228, 0xB208, 0xB1E8, 0xB1E8, 0xB1E8, 0xB1E8, 0xB1E8, 0xB1E8, 0xB1E8, 0xB1E8, 0xB1E8, 0xB1E8, 0xB1E8, 0xB1E8, // 0x0340 (832) +0xA166, 0xA186, 0xA986, 0xA9A6, 0xA9A6, 0xAA07, 0xB2A9, 0xCC8E, 0xCCF0, 0x9B4A, 0x9329, 0xABEC, 0xC4CF, 0xD551, 0xCCEF, 0xC4CF, // 0x0350 (848) +0xD571, 0xBCAF, 0x932A, 0xABCC, 0xDD31, 0xE5B2, 0xEDB2, 0xEDD3, 0xEDF4, 0xEDF4, 0xEDF4, 0xE592, 0xDD52, 0xDD51, 0xDD52, 0xE5B3, // 0x0360 (864) +0xE551, 0xDD31, 0xCCAF, 0xB3ED, 0xA3AB, 0xBC6E, 0xE615, 0xF6B7, 0xFF3A, 0xFF5A, 0xFF19, 0xF697, 0xF6B7, 0xF697, 0xFEF8, 0xFE97, // 0x0370 (880) +0xF5F5, 0xE4B0, 0xC2AA, 0xB229, 0xB208, 0xB1E8, 0xB1E8, 0xB209, 0xB209, 0xB209, 0xB209, 0xB1E9, 0xB209, 0xB209, 0xB209, 0xB1E8, // 0x0380 (896) +0xA986, 0xA986, 0xA9A7, 0xA9A7, 0xA9C7, 0xB207, 0xBAC9, 0xD510, 0xCD10, 0x8B09, 0x7A88, 0xAC2D, 0xE635, 0xE634, 0xC4AE, 0xAC0C, // 0x0390 (912) +0xC4CF, 0xC4CF, 0xB40C, 0xC46D, 0xE591, 0xEDF3, 0xF614, 0xF655, 0xF676, 0xF676, 0xF655, 0xF615, 0xEDF4, 0xF614, 0xF5F4, 0xF5F4, // 0x03A0 (928) +0xEDB3, 0xE572, 0xDD30, 0xCCAF, 0xC46E, 0xCCD0, 0xDDB3, 0xEE76, 0xF719, 0xF6D8, 0xF6B7, 0xEE76, 0xF696, 0xEE55, 0xF6B7, 0xFED8, // 0x03B0 (944) +0xF676, 0xEDB4, 0xD3CD, 0xBA49, 0xB229, 0xB229, 0xB209, 0xB209, 0xB229, 0xB229, 0xB209, 0xB209, 0xB209, 0xBA29, 0xBA09, 0xBA29, // 0x03C0 (960) +0xB1C7, 0xA9C7, 0xB1C7, 0xB1E7, 0xB1E7, 0xB228, 0xBAEA, 0xDD92, 0xCD30, 0x8AE8, 0x7A26, 0x92E8, 0xB42D, 0xC4CF, 0xC4CE, 0xB42D, // 0x03D0 (976) +0x9B8B, 0xBC8E, 0xBC4D, 0xCC8E, 0xE591, 0xF614, 0xF634, 0xFE75, 0xFE97, 0xFE97, 0xFE96, 0xF655, 0xF635, 0xFE56, 0xF655, 0xF655, // 0x03E0 (992) +0xF614, 0xEDD3, 0xE551, 0xD4EF, 0xCC8E, 0xC4AF, 0xCD10, 0xDDB3, 0xE655, 0xE635, 0xEE55, 0xF697, 0xF6B7, 0xEE77, 0xEE35, 0xF655, // 0x03F0 (1008) +0xFEB7, 0xF636, 0xE4F1, 0xBA8A, 0xBA49, 0xBA49, 0xBA29, 0xB229, 0xBA29, 0xBA29, 0xBA29, 0xBA29, 0xBA29, 0xBA29, 0xBA29, 0xBA29, // 0x0400 (1024) +0xB1C7, 0xB1E7, 0xB1E7, 0xB1E7, 0xB207, 0xBA68, 0xC32A, 0xD531, 0xCD51, 0xB42D, 0x9B8B, 0x9329, 0xA38A, 0xABEC, 0xABEB, 0xABCB, // 0x0410 (1040) +0x8AE8, 0x8AA7, 0x9B09, 0xAB8A, 0xD4CE, 0xEDF3, 0xF655, 0xFED7, 0xFED8, 0xFEB7, 0xFEB7, 0xFE96, 0xFE76, 0xFE76, 0xFE76, 0xFE76, // 0x0420 (1056) +0xF634, 0xEDF3, 0xE592, 0xDD30, 0xCCAF, 0xC46E, 0xBC6E, 0xCD31, 0xD592, 0xE635, 0xE614, 0xEE97, 0xF6B8, 0xEE76, 0xEE14, 0xEE34, // 0x0430 (1072) +0xFED8, 0xF636, 0xEDB4, 0xCAEB, 0xBA69, 0xBA69, 0xBA49, 0xBA29, 0xBA29, 0xBA49, 0xBA49, 0xBA29, 0xBA29, 0xBA49, 0xBA49, 0xBA29, // 0x0440 (1088) +0xB1E7, 0xB1E7, 0xB1E7, 0xB1E7, 0xB227, 0xBAA9, 0xC32A, 0xC4AE, 0xBCAF, 0xB44E, 0xAC2D, 0x9B6A, 0xA3EC, 0x9349, 0x8AE8, 0x8AE8, // 0x0450 (1104) +0x9309, 0x8246, 0x8A87, 0x9AC8, 0xC40C, 0xEE14, 0xFED7, 0xFF19, 0xFF19, 0xFEF8, 0xFED8, 0xFEB7, 0xFEB7, 0xFEB7, 0xFEB7, 0xFE76, // 0x0460 (1120) +0xF635, 0xF5F4, 0xEDB2, 0xDD51, 0xD4EF, 0xC46E, 0xB42D, 0xBCAF, 0xD572, 0xE656, 0xDDD3, 0xD571, 0xDDD3, 0xE5F4, 0xE614, 0xF696, // 0x0470 (1136) +0xFEF8, 0xF676, 0xEDD5, 0xCB2C, 0xC28A, 0xBA69, 0xBA69, 0xBA49, 0xBA49, 0xBA49, 0xBA49, 0xBA49, 0xBA49, 0xBA49, 0xBA49, 0xBA49, // 0x0480 (1152) +0xB208, 0xB207, 0xB207, 0xB207, 0xBA48, 0xC2C9, 0xC32A, 0xB3CC, 0x9BAB, 0xAC4D, 0xA42D, 0x936A, 0xAC4D, 0xBCCF, 0xA3EC, 0xA3CC, // 0x0490 (1168) +0xBC6D, 0xBC0C, 0xB3AB, 0xC42C, 0xE5B2, 0xFEB7, 0xFEF8, 0xFF19, 0xFF39, 0xFF19, 0xFEF8, 0xFED8, 0xFED8, 0xFED8, 0xFED8, 0xFE97, // 0x04A0 (1184) +0xF634, 0xEDF3, 0xEDB2, 0xE551, 0xD4F0, 0xC46E, 0xB40D, 0xAC0D, 0xC4F0, 0xC531, 0xDDB3, 0xD551, 0xDD92, 0xE614, 0xEE76, 0xF6B7, // 0x04B0 (1200) +0xF6B7, 0xF697, 0xEDD4, 0xCB4C, 0xC2AA, 0xBA8A, 0xBA69, 0xBA49, 0xBA69, 0xBA69, 0xBA49, 0xBA49, 0xBA49, 0xBA69, 0xC269, 0xC249, // 0x04C0 (1216) +0xBA28, 0xBA28, 0xBA48, 0xBA47, 0xBA88, 0xC34A, 0xC3CC, 0xABAB, 0xA40C, 0xAC6E, 0xAC2D, 0x9BCC, 0xAC6E, 0xCD51, 0xCD31, 0xCD31, // 0x04D0 (1232) +0xD50F, 0xD50F, 0xDD30, 0xEDF3, 0xFEB6, 0xFED7, 0xFEF8, 0xFF39, 0xFF3A, 0xFF3A, 0xFF19, 0xFEF8, 0xFEF9, 0xFF19, 0xFEF9, 0xFEB7, // 0x04E0 (1248) +0xF655, 0xF5F4, 0xED92, 0xDD51, 0xD4F0, 0xC48E, 0xBC2E, 0xABCC, 0xB42D, 0xB48F, 0xD593, 0xDDF4, 0xD571, 0xDDB2, 0xDDD3, 0xEE34, // 0x04F0 (1264) +0xF635, 0xF676, 0xE532, 0xCB0B, 0xC2AA, 0xC28A, 0xBA69, 0xBA69, 0xBA69, 0xBA69, 0xC269, 0xC26A, 0xC269, 0xC26A, 0xC26A, 0xC269, // 0x0500 (1280) +0xBA48, 0xBA48, 0xBA48, 0xBA68, 0xC309, 0xC40C, 0xBC4C, 0xABEC, 0xB4AF, 0xBCCF, 0xAC4D, 0xA40C, 0xB4AF, 0xBCCF, 0xBCCF, 0xCD51, // 0x0510 (1296) +0xC4AE, 0xD4EF, 0xEDD2, 0xF675, 0xFE96, 0xFEB7, 0xFEF8, 0xFF3A, 0xFF7B, 0xFF7B, 0xFF7B, 0xFF3A, 0xFF3A, 0xFF3A, 0xFF1A, 0xFEF9, // 0x0520 (1312) +0xFE96, 0xF635, 0xEDB2, 0xDD51, 0xD510, 0xCCAF, 0xC46E, 0xABED, 0xA3CC, 0xA3ED, 0xC511, 0xD572, 0xD551, 0xDDB2, 0xDD92, 0xE5F3, // 0x0530 (1328) +0xEE14, 0xF635, 0xE4D1, 0xCB0B, 0xC2CA, 0xC28A, 0xC28A, 0xC26A, 0xC28A, 0xC28A, 0xC28A, 0xC28A, 0xC28A, 0xC28A, 0xC28A, 0xC28A, // 0x0540 (1344) +0xBA68, 0xBA68, 0xBA68, 0xC2A9, 0xC3CB, 0xC42C, 0xBC0C, 0xA3EC, 0xC531, 0xBCCF, 0xB46D, 0xB48E, 0xA42D, 0xB46E, 0x9BCB, 0xABCC, // 0x0550 (1360) +0xC46E, 0xDD30, 0xEDF3, 0xEDF4, 0xDD92, 0xE5B2, 0xEE35, 0xF677, 0xF71A, 0xFF5B, 0xFF5B, 0xFF5A, 0xFF5A, 0xFF1A, 0xFF19, 0xFEF8, // 0x0560 (1376) +0xF676, 0xEDF4, 0xDD31, 0xCCAF, 0xB40D, 0xABCC, 0xB40D, 0xB40D, 0xA3AC, 0x9B6B, 0xA3AC, 0xAC2D, 0xCD30, 0xDD92, 0xDD92, 0xE5F3, // 0x0570 (1392) +0xEE35, 0xF635, 0xE4F1, 0xD38C, 0xCAEB, 0xC2AA, 0xC28A, 0xC28A, 0xC28A, 0xC28A, 0xC28A, 0xC28A, 0xC28A, 0xC2AA, 0xC28A, 0xC28A, // 0x0580 (1408) +0xBA68, 0xBA68, 0xC288, 0xC2E9, 0xCC8E, 0xCCCF, 0xB44C, 0xAC2D, 0xC510, 0xB48E, 0xBCCF, 0xC531, 0xAC2D, 0xA3CB, 0xA3EC, 0xBC4D, // 0x0590 (1424) +0xD4CF, 0xDD30, 0xDD51, 0xABCC, 0xA38B, 0xABAB, 0xABAB, 0xABCC, 0xBC6E, 0xD551, 0xEE15, 0xFF19, 0xFF3A, 0xFEF9, 0xFEB7, 0xF697, // 0x05A0 (1440) +0xE5B3, 0xBC4D, 0x930A, 0x8288, 0x7A47, 0x8288, 0x7A89, 0x936B, 0x9B8C, 0x8B0A, 0x9B6B, 0xA3AC, 0xC4CF, 0xE5F3, 0xE5D3, 0xE5F3, // 0x05B0 (1456) +0xEE14, 0xF614, 0xED72, 0xDC2E, 0xCB0B, 0xC2AA, 0xC2AA, 0xC28A, 0xC28A, 0xC28A, 0xC28A, 0xC28A, 0xC28A, 0xC2AA, 0xC2AA, 0xC28A, // 0x05C0 (1472) +0xC288, 0xC289, 0xC2A9, 0xC30A, 0xD4CF, 0xD550, 0xB44C, 0xA42D, 0xBCEF, 0xB48E, 0xDDD3, 0xE676, 0xBCEF, 0xA3EC, 0xABEC, 0xBC2D, // 0x05D0 (1488) +0xCC8E, 0xCC8E, 0xABAB, 0xCCAF, 0xE5B2, 0xE5D3, 0xDD51, 0xCCAE, 0xC44D, 0xC46E, 0xE592, 0xF697, 0xFEF8, 0xFEB8, 0xF635, 0xE592, // 0x05E0 (1504) +0xC42D, 0xA32A, 0x9B0A, 0xB3EC, 0xCC8E, 0xCC6E, 0xB3ED, 0x8B4B, 0x936C, 0x82A9, 0x8B0A, 0x9B4A, 0xC4CF, 0xE614, 0xEE14, 0xE5F3, // 0x05F0 (1520) +0xEE14, 0xEDD3, 0xEDD3, 0xED52, 0xD36C, 0xC2CB, 0xC2AA, 0xC2AA, 0xC2AA, 0xC2AA, 0xC28A, 0xC28A, 0xC2AA, 0xCACA, 0xC2AA, 0xC2AA, // 0x0600 (1536) +0xC288, 0xC2A9, 0xC2A9, 0xC309, 0xD4AE, 0xD571, 0xB44D, 0xA40D, 0xBCCF, 0xC530, 0xD592, 0xC531, 0xA42D, 0x9BAB, 0x9B8B, 0xB3EC, // 0x0610 (1552) +0xBC2D, 0xABCC, 0xC44D, 0xDD51, 0xEDB2, 0xEDD3, 0xEDB2, 0xDD51, 0xDD10, 0xD510, 0xE592, 0xF635, 0xFED8, 0xF697, 0xEDB3, 0xD4AF, // 0x0620 (1568) +0xAB8B, 0xA34A, 0xBC2D, 0xD4AF, 0xD4AF, 0xCC4D, 0xB3CC, 0xAC0E, 0x9BCD, 0x7A48, 0x930A, 0x9B6A, 0xC4AF, 0xE5F4, 0xEE13, 0xE5D2, // 0x0630 (1584) +0xEDF3, 0xEDB3, 0xED93, 0xF5F5, 0xD38C, 0xCACB, 0xC2CA, 0xC2AA, 0xC2AA, 0xC2AA, 0xC2AA, 0xC2AA, 0xC2AA, 0xC2AA, 0xC2AA, 0xC2AA, // 0x0640 (1600) +0xC289, 0xC2A9, 0xC2A9, 0xC309, 0xC3AB, 0xBC6D, 0xB44D, 0x9C0C, 0xC530, 0xC530, 0xBCCF, 0xB48E, 0xA40C, 0x8B4A, 0x9B6A, 0xB3CC, // 0x0650 (1616) +0xB3CC, 0xABAB, 0xCC6E, 0xD4CF, 0xE551, 0xF656, 0xFEB7, 0xF676, 0xEE14, 0xE5B3, 0xDD51, 0xF614, 0xFEB8, 0xFEB8, 0xE572, 0xB3EC, // 0x0660 (1632) +0x9B2A, 0xD4F0, 0xF656, 0xF656, 0xE572, 0xBC0D, 0x9B0A, 0x9B4B, 0xAC4F, 0x7248, 0x9B4B, 0xA3AB, 0xCCCF, 0xDD92, 0xE5D2, 0xEDF3, // 0x0670 (1648) +0xEDF3, 0xF5F4, 0xF5B3, 0xF5D4, 0xD38D, 0xCAEA, 0xCACA, 0xC2AA, 0xC2AA, 0xCAAA, 0xC2AA, 0xC2AA, 0xCAAA, 0xCACB, 0xCACA, 0xCACA, // 0x0680 (1664) +0xC2A9, 0xC2C9, 0xC2C9, 0xC2E9, 0xC3AB, 0xAB8A, 0x9BAA, 0xA40D, 0xC531, 0xB46E, 0xB48E, 0xAC4D, 0x9BCB, 0x8309, 0x9B6B, 0xB3CC, // 0x0690 (1680) +0xB3CC, 0xB3AB, 0xBC2D, 0xCC8E, 0xDD51, 0xDDB3, 0xCD52, 0xC4D0, 0xD531, 0xE5B3, 0xE5B3, 0xEDD3, 0xFE97, 0xFED8, 0xDD31, 0x9B2A, // 0x06A0 (1696) +0xBC4F, 0xDD93, 0xC511, 0xAC2E, 0xABED, 0xABAC, 0x8AC9, 0x8AC9, 0xA40E, 0x7A68, 0x9B6B, 0xABEC, 0xC4AE, 0xDD71, 0xE5D3, 0xE5D2, // 0x06B0 (1712) +0xEDF3, 0xF614, 0xF635, 0xEDB3, 0xD38C, 0xCAEA, 0xCACA, 0xC2CA, 0xC2CA, 0xCACA, 0xCACA, 0xCACA, 0xCACA, 0xCACB, 0xCACA, 0xCACA, // 0x06C0 (1728) +0xC2C9, 0xC2E9, 0xCAE9, 0xC2E9, 0xC329, 0xB3AB, 0x9329, 0x8B6B, 0xAC6E, 0x8B4A, 0x9BCC, 0x9BCC, 0x936B, 0x8B09, 0x936A, 0xABCC, // 0x06D0 (1744) +0xB3EC, 0xB3CC, 0xA38B, 0x930A, 0x7247, 0x5144, 0x4103, 0x6207, 0x934A, 0xC48F, 0xEE15, 0xEDF4, 0xF635, 0xFE97, 0xDD31, 0xA36B, // 0x06E0 (1760) +0xC4B0, 0xA3ED, 0x7AEA, 0x4144, 0x38C2, 0x40E3, 0x59A6, 0x7268, 0xA3ED, 0x82C9, 0x936B, 0xABEC, 0xBC4C, 0xD530, 0xEE34, 0xEE34, // 0x06F0 (1776) +0xEDF3, 0xEDD3, 0xF676, 0xEDB3, 0xD38C, 0xCAEB, 0xCAEA, 0xC2CA, 0xC2CA, 0xCACA, 0xCACA, 0xCACA, 0xCACA, 0xCACB, 0xCACB, 0xCACB, // 0x0700 (1792) +0xC2C9, 0xCAE9, 0xCAEA, 0xCB0A, 0xCB0A, 0xBB09, 0x8A67, 0x7A88, 0x8B2A, 0x59A5, 0x7AC9, 0x9BEC, 0xA40C, 0x936A, 0x936B, 0xABEC, // 0x0710 (1808) +0xC46E, 0xCCAF, 0xBC4E, 0x7A88, 0x6A06, 0x8B2A, 0xB46E, 0xCCF0, 0xDDB3, 0xEE56, 0xF656, 0xEE14, 0xEE14, 0xF656, 0xDD52, 0xB40D, // 0x0720 (1824) +0xCCCF, 0xDD72, 0xDD72, 0xBC8F, 0xA3AC, 0x82C9, 0x6A07, 0x934B, 0xB44E, 0x938C, 0x934A, 0xAC0C, 0xBC4D, 0xC4AE, 0xDD51, 0xEE54, // 0x0730 (1840) +0xF676, 0xEDD3, 0xF614, 0xED32, 0xD38C, 0xCB0B, 0xCAEB, 0xCAEA, 0xCACA, 0xCACA, 0xCACA, 0xCACA, 0xCACA, 0xCAEB, 0xCAEB, 0xCACB, // 0x0740 (1856) +0xCAE9, 0xCAEA, 0xCB0A, 0xCB0A, 0xCB0A, 0xCB2A, 0xB32A, 0x7206, 0x7247, 0x61A5, 0x82E9, 0xAC0C, 0xAC4D, 0xA3CB, 0x9BAB, 0xBC4D, // 0x0750 (1872) +0xD4EF, 0xE592, 0xEDF3, 0xEE14, 0xE5F4, 0xEE35, 0xEDF4, 0xEE55, 0xF6B8, 0xF6B7, 0xF676, 0xEE14, 0xEDD3, 0xEDF4, 0xE572, 0xCCB0, // 0x0760 (1888) +0xC44E, 0xD510, 0xE592, 0xE592, 0xDD51, 0xDD51, 0xCCD0, 0xB40D, 0xBC6F, 0xB46F, 0x9BAB, 0xAC0C, 0xBC4D, 0xC4CF, 0xDD71, 0xE5F3, // 0x0770 (1904) +0xFED8, 0xEDB2, 0xED72, 0xE4B0, 0xD34B, 0xCB0B, 0xCAEB, 0xCAEA, 0xCAEA, 0xCAEA, 0xCACA, 0xCACA, 0xCAEB, 0xCAEB, 0xCACB, 0xCAEB, // 0x0780 (1920) +0xC2C9, 0xCAE9, 0xCB0A, 0xCB09, 0xCB09, 0xCB4A, 0xC3AB, 0x8267, 0x7247, 0x69E6, 0x6164, 0x9B4A, 0xBCAF, 0xB42C, 0xABEC, 0xBC6E, // 0x0790 (1936) +0xDD51, 0xEDF3, 0xF676, 0xFEB7, 0xFEF8, 0xFED8, 0xFED8, 0xFEF8, 0xFEF8, 0xFEB7, 0xF656, 0xEDD3, 0xE571, 0xEDF4, 0xEDB3, 0xD511, // 0x07A0 (1952) +0xBC2D, 0xCCCF, 0xE551, 0xE5B3, 0xEDD3, 0xE5B2, 0xE572, 0xD510, 0xCD11, 0xCD73, 0xA3CC, 0xA3AB, 0xB40C, 0xC4CE, 0xE5F3, 0xEE34, // 0x07B0 (1968) +0xF696, 0xE530, 0xE4AF, 0xD3CD, 0xCB0B, 0xCB0B, 0xCAEB, 0xCAEB, 0xCAEA, 0xCAEB, 0xCACA, 0xCAEB, 0xCAEB, 0xCAEB, 0xCAEB, 0xCAEB, // 0x07C0 (1984) +0xC2C9, 0xC2E9, 0xC2E9, 0xC2E9, 0xCB09, 0xCB4A, 0xBB6A, 0x8AC8, 0x82C8, 0x7226, 0x6984, 0x8247, 0xB44D, 0xBC6E, 0xB42D, 0xBC6E, // 0x07D0 (2000) +0xD530, 0xE5B3, 0xF675, 0xFEB7, 0xFEF8, 0xFEF8, 0xFEF8, 0xFEF7, 0xFEF8, 0xFEB7, 0xF634, 0xE551, 0xDD31, 0xF677, 0xF656, 0xD4F0, // 0x07E0 (2016) +0xBC6F, 0xCC8F, 0xE551, 0xE572, 0xED92, 0xE571, 0xDD31, 0xD4F0, 0xD552, 0xD593, 0xA3AB, 0xA38A, 0xB42D, 0xC4EF, 0xE614, 0xEE34, // 0x07F0 (2032) +0xE5B2, 0xDCAF, 0xD3ED, 0xCB2B, 0xCB0B, 0xCB0B, 0xCAEB, 0xCAEA, 0xCAEA, 0xCAEA, 0xCAEB, 0xCAEB, 0xCAEB, 0xCAEB, 0xCAEB, 0xCACB, // 0x0800 (2048) +0xC2E9, 0xCAE9, 0xCB09, 0xCB09, 0xCB2A, 0xB309, 0xBB8B, 0x82A8, 0x82C8, 0x82E8, 0x8267, 0xAB6A, 0xCCAE, 0xB3EC, 0xABCC, 0xB42D, // 0x0810 (2064) +0xCCAF, 0xDD51, 0xEDF3, 0xF655, 0xFEB7, 0xFEF8, 0xFF39, 0xFF19, 0xFEF8, 0xF696, 0xE5B2, 0xD4CF, 0xBBEC, 0xC42D, 0xBC2D, 0x8AA8, // 0x0820 (2080) +0x8AEA, 0xA3AC, 0xE551, 0xEDB2, 0xEDB2, 0xE572, 0xDCF0, 0xD4F0, 0xDDD4, 0xCD32, 0xA36B, 0xA3AB, 0xB42D, 0xCD30, 0xDD92, 0xE5F3, // 0x0830 (2096) +0xDD10, 0xD3CC, 0xD34B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCAEB, 0xCAEA, 0xCAEB, 0xCAEB, 0xCAEB, 0xCAEB, 0xCAEB, 0xCAEB, 0xCAEB, // 0x0840 (2112) +0xCB09, 0xCB09, 0xCB09, 0xC309, 0xBAE9, 0xB2E9, 0xB36A, 0x7A46, 0x8287, 0x8AC8, 0xABCB, 0xC44D, 0xDD2F, 0xAB6A, 0xA36A, 0xABAB, // 0x0850 (2128) +0xB40D, 0xD4CF, 0xE571, 0xEDF3, 0xF655, 0xFEF8, 0xFF7B, 0xFF3A, 0xFED7, 0xF655, 0xDD10, 0xB38B, 0x7A06, 0x92C8, 0x71E6, 0x5103, // 0x0860 (2144) +0x5103, 0x71E6, 0xD4CF, 0xEDD3, 0xEDF4, 0xE592, 0xDCD0, 0xD4F0, 0xE636, 0xB46F, 0x8AA8, 0x9329, 0xBC8E, 0xDDD3, 0xDD92, 0xE5B2, // 0x0870 (2160) +0xE531, 0xD3CC, 0xCB2B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCAEB, 0xCAEB, 0xCAEA, 0xCAEB, 0xCB0B, 0xCAEB, 0xCB0B, 0xCAEB, 0xCAEB, 0xCAEB, // 0x0880 (2176) +0xCB09, 0xCB0A, 0xCB0A, 0xCB09, 0xC2E9, 0x9A46, 0x8266, 0x71E5, 0x82A7, 0xABEB, 0xD551, 0xD550, 0xD4EE, 0xBBCB, 0xBC0C, 0xA34A, // 0x0890 (2192) +0xA34A, 0xBC0C, 0xD4CF, 0xE530, 0xEDB2, 0xF696, 0xFF19, 0xFEF8, 0xF655, 0xF634, 0xE5B3, 0xC46E, 0xDD10, 0xD4D0, 0x9B2A, 0x8247, // 0x08A0 (2208) +0x69A5, 0x7A27, 0xCC8E, 0xEDD3, 0xEDF4, 0xE571, 0xD48E, 0xCCAF, 0xD593, 0xA3AC, 0x8227, 0x8247, 0xAC0D, 0xC4CF, 0xCCEF, 0xDD30, // 0x08B0 (2224) +0xE551, 0xD3ED, 0xCB2B, 0xCB2B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCAEB, 0xCAEB, 0xCAEB, 0xCB0B, 0xCB0B, 0xCB0B, 0xCAEB, 0xCAEB, 0xCAEB, // 0x08C0 (2240) +0xCB09, 0xCB0A, 0xCB2A, 0xCB2A, 0xCB2A, 0x9A67, 0x6184, 0x7226, 0x8AC8, 0xABEB, 0xD571, 0xD571, 0xC46D, 0xD50F, 0xCC8E, 0xA34A, // 0x08D0 (2256) +0x92E9, 0xAB8B, 0xC42C, 0xD4AE, 0xE530, 0xEDD3, 0xF675, 0xF675, 0xEE14, 0xF655, 0xF635, 0xF635, 0xF635, 0xEE14, 0xEDB3, 0xDD30, // 0x08E0 (2272) +0xC46E, 0xC46E, 0xCCAF, 0xE551, 0xE592, 0xD4F0, 0xC40D, 0xB3EC, 0xBC8F, 0x9B6B, 0x7A07, 0x7A06, 0x9309, 0xB40C, 0xCCAE, 0xDD31, // 0x08F0 (2288) +0xE531, 0xD3AC, 0xCB2B, 0xCB2B, 0xCB2B, 0xCB2B, 0xCB0B, 0xCAEB, 0xCAEA, 0xCAEB, 0xCB0B, 0xCB0B, 0xCB0B, 0xCAEB, 0xCAEB, 0xCAEB, // 0x0900 (2304) +0xCB0A, 0xCB0A, 0xCB2A, 0xCB2A, 0xCB2A, 0xB2C8, 0x8206, 0x8B29, 0x934A, 0xB48E, 0xCD30, 0xC4EE, 0xBC4C, 0xD4EF, 0xDD71, 0xB3CB, // 0x0910 (2320) +0x8AE9, 0x9B09, 0xB3CB, 0xC42C, 0xD4AE, 0xE550, 0xEDD2, 0xEE13, 0xEE14, 0xF635, 0xEE14, 0xED92, 0xEE14, 0xE551, 0xDCF0, 0xD44D, // 0x0920 (2336) +0xB32A, 0xBBAB, 0xBC2D, 0xCC8E, 0xD4CF, 0xC42D, 0xB3AB, 0x9B4A, 0xA3CC, 0x9B4B, 0x71C6, 0x61A5, 0x8AC8, 0xABEC, 0xCCCF, 0xE571, // 0x0930 (2352) +0xDCAF, 0xD36C, 0xCB2B, 0xCB2B, 0xCB2B, 0xCB2B, 0xCB0B, 0xCB0B, 0xCAEA, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCAEB, // 0x0940 (2368) +0xCB0A, 0xCB0A, 0xCB2A, 0xCB2A, 0xCB4A, 0xCB4A, 0xBB09, 0x9AC8, 0x7A88, 0xA40C, 0xBCEF, 0xB44D, 0xABCA, 0xC44D, 0xDD30, 0xBC2C, // 0x0950 (2384) +0x9309, 0x9B2A, 0xB3AB, 0xC40C, 0xD48D, 0xDD2F, 0xE591, 0xEDD2, 0xEDF3, 0xDD51, 0xB2E9, 0xAA26, 0xAA87, 0xA226, 0x99C5, 0x9184, // 0x0960 (2400) +0x78C1, 0x70C1, 0x81E5, 0xABAB, 0xD4AF, 0xC44D, 0xAB8B, 0x930A, 0xA3CC, 0x8AEA, 0x4104, 0x5165, 0x92E9, 0xA38A, 0xBC0C, 0xCC6E, // 0x0970 (2416) +0xCB6C, 0xCB2B, 0xCB2B, 0xD34C, 0xD34B, 0xCB2B, 0xCB2B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCAEB, // 0x0980 (2432) +0xCB2A, 0xCB2A, 0xCB2A, 0xCB2A, 0xCB4A, 0xCB6A, 0xD38B, 0xC329, 0x79A5, 0x69E5, 0x7AC8, 0x8B08, 0x9308, 0xAB69, 0xB40C, 0xAC0C, // 0x0990 (2448) +0x9B8B, 0x9B4A, 0xB3AB, 0xBC0B, 0xCC8D, 0xDD0F, 0xE571, 0xE571, 0xDD30, 0x9A05, 0x80E1, 0x9A47, 0xC490, 0xD594, 0xCD11, 0xBC8F, // 0x09A0 (2464) +0x8A67, 0x60C2, 0x5860, 0x9288, 0xCC8E, 0xC46D, 0xABAB, 0x934B, 0xAC0D, 0x6AA9, 0x3125, 0x4986, 0x7268, 0x9B2A, 0xB3CB, 0xD46E, // 0x09B0 (2480) +0xCB4B, 0xCB2B, 0xD34B, 0xD34C, 0xD34C, 0xD32B, 0xCB2B, 0xCB2B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB2B, 0xCB0B, 0xCB0B, 0xCB0B, // 0x09C0 (2496) +0xCB2A, 0xCB2A, 0xCB2A, 0xCB4A, 0xCB4A, 0xD36B, 0xCB6B, 0xBAE9, 0x81A5, 0x50E2, 0x5984, 0x5984, 0x6184, 0x8AC8, 0x7288, 0x41E7, // 0x09D0 (2512) +0x8B09, 0x934A, 0xABAB, 0xBC0C, 0xCC8D, 0xDD0F, 0xE571, 0xDD50, 0xC42C, 0x60A1, 0x6123, 0xA38C, 0xC4F1, 0xCD52, 0xCD52, 0xB44E, // 0x09E0 (2528) +0x8AE9, 0x6185, 0x58C2, 0xB36A, 0xCCAE, 0xC46E, 0xABCC, 0xA3AC, 0xAC4E, 0x4985, 0x28C4, 0x3105, 0x7ACA, 0xA36A, 0xB3AB, 0xD40D, // 0x09F0 (2544) +0xCB4B, 0xCB2B, 0xD34C, 0xD34C, 0xD34C, 0xD34B, 0xD32B, 0xCB2B, 0xCB0B, 0xCB0B, 0xCB0B, 0xCB0B, 0xD32B, 0xCB2B, 0xCB0B, 0xCB0B, // 0x0A00 (2560) +0xCB4A, 0xCB4A, 0xCB4A, 0xCB4A, 0xCB4A, 0xD36A, 0xD36A, 0x8A06, 0x5923, 0x48E3, 0x5164, 0x5984, 0x5984, 0x49C6, 0x3965, 0x39C7, // 0x0A10 (2576) +0x59E6, 0x832A, 0xABAB, 0xBC0C, 0xCC8E, 0xDD30, 0xE591, 0xEDD2, 0xE591, 0xA267, 0x9AA8, 0xCC8F, 0xD532, 0xDDB4, 0xD594, 0xBBEC, // 0x0A20 (2592) +0x9206, 0x70E3, 0x91E5, 0xC44D, 0xCCAE, 0xC44D, 0xB3EC, 0xABEC, 0xB44E, 0x4186, 0x3146, 0x30C4, 0x8B2B, 0xB3CC, 0xCBCC, 0xD3AC, // 0x0A30 (2608) +0xD34B, 0xD34B, 0xD34C, 0xD36C, 0xD34C, 0xD34B, 0xCB2B, 0xD32B, 0xCB2B, 0xCB0B, 0xCB0B, 0xCB2B, 0xD32B, 0xD32B, 0xCB0B, 0xCB0B, // 0x0A40 (2624) +0xCB4A, 0xCB4A, 0xD36A, 0xCB4A, 0xCB4A, 0xCB6A, 0xCB6A, 0x79C5, 0x69C5, 0x7267, 0x61C5, 0x61A5, 0x5143, 0x2061, 0x3145, 0x20C3, // 0x0A50 (2640) +0x2125, 0x6ACA, 0xA38B, 0xBC0C, 0xCC6D, 0xDD0F, 0xE591, 0xEDF3, 0xEE13, 0xDCF0, 0xAA46, 0xAA26, 0xC36B, 0xC36B, 0xBB09, 0xA1C5, // 0x0A60 (2656) +0x88E2, 0x8984, 0xAB6A, 0xC44D, 0xC44D, 0xBC2D, 0xABED, 0xAC0D, 0x9BCD, 0x2041, 0x3925, 0x6228, 0xA36B, 0xCBAC, 0xD38C, 0xCB4B, // 0x0A70 (2672) +0xCB4B, 0xD34B, 0xD34C, 0xD36C, 0xD34C, 0xD34C, 0xD34C, 0xD34B, 0xD32B, 0xCB2B, 0xCB2B, 0xD32B, 0xD34B, 0xD32B, 0xD32B, 0xD32B, // 0x0A80 (2688) +0xCB4A, 0xCB4A, 0xD36A, 0xCB4A, 0xCB4A, 0xCB6A, 0xCB4A, 0x7184, 0x61A4, 0x7AA7, 0x6A26, 0x4902, 0x3061, 0x2925, 0x4208, 0x4A8A, // 0x0A90 (2704) +0x20E4, 0x4165, 0x8309, 0xABCB, 0xC44D, 0xD4CE, 0xDD50, 0xE5D2, 0xEE13, 0xEE14, 0xDCCF, 0xB2C8, 0xA1E5, 0xA226, 0xA1E5, 0x8984, // 0x0AA0 (2720) +0x9226, 0xAB4A, 0xBC0D, 0xBC0C, 0xBC0C, 0xB3EC, 0xABCC, 0xAC2D, 0x82EA, 0x4924, 0x5186, 0xAB6B, 0xCB8C, 0xCB6B, 0xD36B, 0xCB4B, // 0x0AB0 (2736) +0xCB4B, 0xD34C, 0xD36C, 0xD36C, 0xD36C, 0xD36C, 0xD34C, 0xD34B, 0xCB2B, 0xD32B, 0xD34B, 0xD36C, 0xD36C, 0xD36C, 0xD34B, 0xD34C, // 0x0AC0 (2752) +0xCB2A, 0xCB2A, 0xCB4A, 0xCB4A, 0xCB4A, 0xCB6A, 0xCB4A, 0x7143, 0x6184, 0x8B49, 0x938B, 0x8309, 0x40E2, 0x3082, 0x28E3, 0x41E8, // 0x0AD0 (2768) +0x28E4, 0x30C2, 0x6A67, 0x936A, 0xB40C, 0xC46D, 0xD50F, 0xE591, 0xEDF3, 0xF634, 0xEE14, 0xEDD3, 0xE551, 0xDCF0, 0xD4AF, 0xD4AF, // 0x0AE0 (2784) +0xCC8E, 0xCC6E, 0xC46E, 0xBC2D, 0xB3EC, 0xA3AB, 0xA38B, 0xA3EC, 0xA3CC, 0x7A68, 0xA36B, 0xCBCC, 0xCB6C, 0xD36B, 0xD36B, 0xD34B, // 0x0AF0 (2800) +0xD34B, 0xD34C, 0xD36C, 0xD36C, 0xD38C, 0xDBEE, 0xE4B1, 0xE4D1, 0xDC6F, 0xDC6F, 0xE4B0, 0xE511, 0xED31, 0xE4F0, 0xE48F, 0xDC2E, // 0x0B00 (2816) +0xCB2A, 0xCB2A, 0xCB4A, 0xCB4A, 0xCB4A, 0xCB6A, 0xCB6A, 0xAA87, 0x7184, 0x7226, 0x8B49, 0x936A, 0x7287, 0x48E2, 0x4144, 0x4164, // 0x0B10 (2832) +0x2861, 0x30C3, 0x7267, 0x7AC9, 0x934A, 0xBC4D, 0xCCCE, 0xDD30, 0xE5B2, 0xEE14, 0xF655, 0xF655, 0xF676, 0xF676, 0xF614, 0xEDB3, // 0x0B20 (2848) +0xDD10, 0xD4F0, 0xCC8E, 0xBC2D, 0xA3AB, 0x9B6B, 0x9B6B, 0x8B0A, 0xA3CC, 0x8B6B, 0x9B8C, 0xB3AD, 0xCBAC, 0xCB6B, 0xD36B, 0xD34B, // 0x0B30 (2864) +0xD36C, 0xD3AC, 0xDC0E, 0xE4D1, 0xEE16, 0xF6FA, 0xF6B8, 0xF6B7, 0xFEB7, 0xFEB7, 0xFED8, 0xFED8, 0xFED8, 0xFE96, 0xF614, 0xED92, // 0x0B40 (2880) +0xCB2A, 0xCB2A, 0xCB2A, 0xCB4A, 0xCB4A, 0xCB6A, 0xCB6A, 0xB2C8, 0x71A5, 0x71E6, 0x8287, 0x82E8, 0x7AA7, 0x7267, 0x8309, 0x51A4, // 0x0B50 (2896) +0x38A1, 0x3881, 0x7AA8, 0x8B29, 0x6A47, 0x9B6A, 0xBC4C, 0xCCCE, 0xDD51, 0xEDD3, 0xF635, 0xF696, 0xFED8, 0xFEF9, 0xF655, 0xEDB3, // 0x0B60 (2912) +0xDCF0, 0xD4EF, 0xC46E, 0xABEC, 0x9B6B, 0x8B2A, 0x7A68, 0x6A27, 0x936B, 0x8B6C, 0x834C, 0x7B2B, 0x9BED, 0xB3CD, 0xB34B, 0xB36C, // 0x0B70 (2928) +0xC46F, 0xE5B5, 0xF71B, 0xFFDE, 0xFFDF, 0xF71A, 0xFF39, 0xFF3A, 0xFF3A, 0xFF39, 0xFF3A, 0xFF5A, 0xFF3A, 0xFF19, 0xFE97, 0xF634, // 0x0B80 (2944) +0xCB2A, 0xCB2A, 0xCB4A, 0xCB4A, 0xCB6A, 0xD38B, 0xD38B, 0xC329, 0x81E5, 0x7226, 0x8B09, 0x8B08, 0x8AE8, 0x936A, 0x7AE9, 0x6A67, // 0x0B90 (2960) +0x6206, 0x4103, 0x7AC9, 0xAC0C, 0x82C8, 0x59E6, 0x82E9, 0xABEC, 0xC48E, 0xDD50, 0xEDD3, 0xF655, 0xF696, 0xEE55, 0xE5D3, 0xEDD3, // 0x0BA0 (2976) +0xDD30, 0xCC8E, 0xABCC, 0x934A, 0x82C9, 0x6A07, 0x5965, 0x5985, 0x6A07, 0x7B4B, 0x838D, 0x7B4C, 0x8BCD, 0x9C4F, 0xACB0, 0xAC90, // 0x0BB0 (2992) +0xD636, 0xF75C, 0xFFDF, 0xFFFF, 0xF73B, 0xFF5A, 0xFF7B, 0xFF5A, 0xFF5A, 0xFF5A, 0xFF7B, 0xFF7B, 0xFF7B, 0xFF5A, 0xFF18, 0xFE96, // 0x0BC0 (3008) +0xCB4A, 0xCB4A, 0xCB4A, 0xD36A, 0xD36B, 0xD38B, 0xD3AB, 0xCB8B, 0x89E5, 0x5943, 0x7267, 0x8B09, 0x8B29, 0x8B6A, 0x8309, 0x9BEC, // 0x0BD0 (3024) +0x834A, 0x51C5, 0x6A88, 0xAC2D, 0xAC0C, 0x6A27, 0x4923, 0x6227, 0x934A, 0xB40D, 0xCCCF, 0xD551, 0xD551, 0xD510, 0xCCAF, 0xCCF0, // 0x0BE0 (3040) +0xB40D, 0x932A, 0x82C9, 0x7A88, 0x61E6, 0x5964, 0x5944, 0x5144, 0x5144, 0x49C6, 0x6289, 0x6ACA, 0x83AD, 0xBD74, 0xE6B9, 0xDE99, // 0x0BF0 (3056) +0xEF1B, 0xFFDE, 0xFFFF, 0xFFDF, 0xF71A, 0xFF7B, 0xFF7B, 0xFF5A, 0xFF5A, 0xFF7B, 0xFF7B, 0xFF9B, 0xFF9B, 0xFF7B, 0xFF3A, 0xFED7, // 0x0C00 (3072) +0xCB4A, 0xCB4A, 0xD36A, 0xD36B, 0xD36A, 0xD38B, 0xD3AB, 0xD3AB, 0xAA67, 0x50E2, 0x5964, 0x69E5, 0x7AC8, 0x834A, 0xA44D, 0xB4F0, // 0x0C10 (3088) +0xC5B3, 0xA4B0, 0x8BAC, 0xAC2D, 0xC48E, 0xB42D, 0x7AA8, 0x4103, 0x4123, 0x6227, 0x7AA9, 0x8B2A, 0x8B09, 0x82A8, 0x7247, 0x7227, // 0x0C20 (3104) +0x69E6, 0x6A06, 0x61C6, 0x5985, 0x5144, 0x5144, 0x5124, 0x5103, 0x48E3, 0x2041, 0x1800, 0x1800, 0x1820, 0x3124, 0x83CF, 0xBDF7, // 0x0C30 (3120) +0xF77D, 0xFFDF, 0xFFFF, 0xF79D, 0xEED8, 0xFF9C, 0xFF9C, 0xFF7B, 0xFF7B, 0xFF7B, 0xFF7B, 0xFF9C, 0xFF9C, 0xFF9B, 0xFF3A, 0xFEF8, // 0x0C40 (3136) +0xCB4A, 0xD34B, 0xD36B, 0xD38B, 0xD36B, 0xD38B, 0xD3AB, 0xD38B, 0xB2C9, 0x7985, 0x71A5, 0x8267, 0x8B09, 0x8B4A, 0xBD10, 0xDE97, // 0x0C50 (3152) +0xEF3B, 0xEF3B, 0xDE98, 0xBCF0, 0xC4AE, 0xC4CF, 0xB44D, 0x82A8, 0x5184, 0x4103, 0x4124, 0x4964, 0x5165, 0x5164, 0x5164, 0x5964, // 0x0C60 (3168) +0x5964, 0x5944, 0x5144, 0x5124, 0x5124, 0x5144, 0x5124, 0x5103, 0x40C3, 0x2041, 0x1800, 0x1800, 0x1821, 0x1842, 0x2083, 0x3146, // 0x0C70 (3184) +0x738E, 0xCE59, 0xF7BF, 0xE6B9, 0xEEB8, 0xFF9C, 0xFF9C, 0xFF7B, 0xFF7B, 0xFF7A, 0xFF7B, 0xFF9C, 0xFF9C, 0xFF7B, 0xFF39, 0xFED8, // 0x0C80 (3200) +0xCB4A, 0xD34A, 0xD36B, 0xD36B, 0xCB6B, 0xD38B, 0xD3AB, 0xD38B, 0xC34A, 0x91E6, 0x8A26, 0x9AE9, 0x9B4A, 0x9BCB, 0xDE77, 0xEF1A, // 0x0C90 (3216) +0xF79D, 0xFFDE, 0xFFBE, 0xD615, 0xBCCE, 0xCCEF, 0xCD10, 0xC4AE, 0x9B8B, 0x6206, 0x4964, 0x4124, 0x4924, 0x4923, 0x5144, 0x5144, // 0x0CA0 (3232) +0x5124, 0x5944, 0x5944, 0x5124, 0x5124, 0x5144, 0x5944, 0x5124, 0x48E3, 0x2841, 0x1800, 0x1800, 0x1821, 0x1863, 0x1883, 0x1884, // 0x0CB0 (3248) +0x20A4, 0x2925, 0x736E, 0xA42E, 0xF6F9, 0xFF7C, 0xFF9C, 0xFF9C, 0xFF7B, 0xFF7B, 0xFF7B, 0xFF9B, 0xFF9B, 0xFF7B, 0xFF19, 0xFED7, // 0x0CC0 (3264) +0xCB4A, 0xCB4B, 0xD36B, 0xD36B, 0xD36B, 0xD38B, 0xD3AB, 0xD3AC, 0xD3AB, 0xC34A, 0xB2E9, 0xBB4A, 0xC3EC, 0xDE36, 0xFFBE, 0xFFBE, // 0x0CD0 (3280) +0xFFBE, 0xFFFF, 0xFFDE, 0xEF1A, 0xC510, 0xCD0F, 0xCD30, 0xD550, 0xC4CF, 0x9BAB, 0x7267, 0x5185, 0x4944, 0x4944, 0x5144, 0x5144, // 0x0CE0 (3296) +0x5944, 0x5964, 0x5964, 0x5124, 0x5124, 0x5964, 0x5964, 0x5144, 0x4903, 0x3082, 0x1820, 0x1821, 0x1862, 0x1883, 0x1884, 0x1884, // 0x0CF0 (3312) +0x1883, 0x2084, 0x20C4, 0x6269, 0xEE97, 0xFF5B, 0xFF7B, 0xFF9C, 0xFF9C, 0xFF7B, 0xFF7B, 0xFF7B, 0xFF7B, 0xFF5A, 0xFF19, 0xF6B6, // 0x0D00 (3328) +0xD36B, 0xD36B, 0xD36B, 0xD38B, 0xD38B, 0xD3AB, 0xD3AB, 0xD3AB, 0xD3AC, 0xD3CC, 0xD3CC, 0xD40D, 0xE5D5, 0xFFBE, 0xFFFF, 0xFFFF, // 0x0D10 (3344) +0xFFFF, 0xFFFF, 0xFFDE, 0xF79D, 0xD5D4, 0xC510, 0xCD30, 0xD571, 0xD571, 0xCCEF, 0xA3EC, 0x7AA8, 0x59A5, 0x5164, 0x5164, 0x5164, // 0x0D20 (3360) +0x5965, 0x5964, 0x5964, 0x5944, 0x5944, 0x5965, 0x5985, 0x5164, 0x5144, 0x4904, 0x4924, 0x30C3, 0x20A4, 0x20A4, 0x2084, 0x2084, // 0x0D30 (3376) +0x1884, 0x1884, 0x1883, 0x28E4, 0x732C, 0xDE57, 0xFF5A, 0xFF7B, 0xFF9B, 0xFF7B, 0xFF7B, 0xFF7B, 0xFF5B, 0xFF3A, 0xFEF8, 0xF675, // 0x0D40 (3392) +0xD36B, 0xD36B, 0xD38B, 0xD38B, 0xD38B, 0xD3AB, 0xD3AB, 0xD3AC, 0xD3CC, 0xD3CC, 0xD3ED, 0xDCB0, 0xF75C, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0D50 (3408) +0xFFFF, 0xFFFF, 0xFFFF, 0xF79D, 0xDE77, 0xC510, 0xCD30, 0xD551, 0xD551, 0xD550, 0xC4CF, 0xABEC, 0x82C8, 0x61E6, 0x5985, 0x5985, // 0x0D60 (3424) +0x5985, 0x5985, 0x5965, 0x5964, 0x5985, 0x5985, 0x5985, 0x5985, 0x5965, 0x69E6, 0x934A, 0x936B, 0x3946, 0x28C5, 0x20A4, 0x2084, // 0x0D70 (3440) +0x1884, 0x1884, 0x1883, 0x1884, 0x20C4, 0x49E8, 0xACF2, 0xEEF9, 0xFF5B, 0xFF5A, 0xFF5A, 0xFF7B, 0xFF3A, 0xFF18, 0xF6B6, 0xEE34, // 0x0D80 (3456) +0xD36B, 0xD38B, 0xD38B, 0xD38B, 0xD38B, 0xD38B, 0xD3AC, 0xD3CC, 0xD3CC, 0xD3CC, 0xDC0D, 0xE4F1, 0xFF9D, 0xFFDF, 0xFFFF, 0xFFFF, // 0x0D90 (3472) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFDE, 0xEF1A, 0xC530, 0xC50F, 0xD550, 0xD550, 0xD550, 0xCD30, 0xC4AE, 0xABEC, 0x8AE9, 0x7227, 0x69E6, // 0x0DA0 (3488) +0x61A5, 0x61A5, 0x61A5, 0x5985, 0x5985, 0x61A5, 0x61A5, 0x61C6, 0x61E6, 0x9309, 0xBC4D, 0xD510, 0x8B8C, 0x3105, 0x20C5, 0x20A4, // 0x0DB0 (3504) +0x2084, 0x1883, 0x1884, 0x1884, 0x1863, 0x20A4, 0x2905, 0x7B8D, 0xDE77, 0xFF39, 0xFF3A, 0xFF3A, 0xFF19, 0xFED7, 0xF696, 0xEE34, // 0x0DC0 (3520) +0xD36B, 0xD38B, 0xD3AB, 0xD38B, 0xD38B, 0xD3AB, 0xD3AC, 0xD3CC, 0xD3CC, 0xD3EC, 0xDC0D, 0xDC6E, 0xF6D9, 0xF79D, 0xFFDF, 0xFFFF, // 0x0DD0 (3536) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF79D, 0xBCEF, 0xBCCE, 0xCD30, 0xD571, 0xD571, 0xCD50, 0xCD10, 0xC4AE, 0xB42C, 0x9B4A, 0x82C8, // 0x0DE0 (3552) +0x7247, 0x6A06, 0x69E6, 0x61C6, 0x61A5, 0x61C5, 0x69E6, 0x7227, 0x82C8, 0xB40C, 0xCCEF, 0xDD92, 0xDD92, 0x832B, 0x28E5, 0x20A4, // 0x0DF0 (3568) +0x20A4, 0x1884, 0x1884, 0x1884, 0x1884, 0x1863, 0x18A4, 0x20C4, 0x41A7, 0xB512, 0xEEB7, 0xF6F8, 0xFEF8, 0xF6B7, 0xF675, 0xEE34, // 0x0E00 (3584) +0xCB6B, 0xD38B, 0xD3AB, 0xD3AB, 0xD38B, 0xD3AB, 0xD3CB, 0xD3CC, 0xD3CC, 0xD3EC, 0xD40D, 0xDC4D, 0xE572, 0xEF1A, 0xF79D, 0xFFDF, // 0x0E10 (3600) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, 0xC551, 0xB46D, 0xC50F, 0xCD70, 0xD571, 0xD550, 0xCD10, 0xCCEF, 0xC4CE, 0xB44D, 0xA3AB, // 0x0E20 (3616) +0x8B09, 0x82A8, 0x7A67, 0x7227, 0x6A06, 0x6A27, 0x7A88, 0x8AE9, 0xA3AB, 0xC4AE, 0xD551, 0xE5D3, 0xE614, 0xCD72, 0x41A7, 0x28E5, // 0x0E30 (3632) +0x20C5, 0x18A4, 0x1884, 0x18A4, 0x1884, 0x1863, 0x1883, 0x1884, 0x18A4, 0x3146, 0x940F, 0xEEB7, 0xF6D7, 0xF6B6, 0xEE75, 0xEE34, // 0x0E40 (3648) +0xCB6A, 0xD38B, 0xD38B, 0xD38B, 0xD38B, 0xD3AB, 0xD3CB, 0xD3CC, 0xD3EC, 0xD40C, 0xDC2D, 0xDC4E, 0xDC8E, 0xE615, 0xEF5B, 0xF7BE, // 0x0E50 (3664) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xEF1A, 0xB48E, 0xBCAE, 0xCD30, 0xD571, 0xD571, 0xCD50, 0xCD2F, 0xCD0F, 0xC4CE, 0xBC6D, // 0x0E60 (3680) +0xA3EB, 0x9B6A, 0x9329, 0x8B09, 0x8B09, 0x936A, 0xA3CC, 0xB44D, 0xC4CE, 0xD550, 0xDDB2, 0xE613, 0xEE34, 0xEE55, 0xAC8F, 0x4187, // 0x0E70 (3696) +0x2905, 0x20C4, 0x18A4, 0x18A4, 0x18A4, 0x18A4, 0x1884, 0x1083, 0x1883, 0x18A4, 0x20E5, 0x6B0B, 0xD5D4, 0xEE75, 0xEE54, 0xE614, // 0x0E80 (3712) +0xCB6A, 0xD36B, 0xD38B, 0xD38B, 0xD38B, 0xD3AB, 0xD3CB, 0xD3CC, 0xD3EC, 0xDC2D, 0xDC4D, 0xDC6E, 0xDC8E, 0xEDF4, 0xEF7C, 0xF7BD, // 0x0E90 (3728) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, 0xCDF5, 0xAC6D, 0xC50F, 0xCD70, 0xD571, 0xD571, 0xD550, 0xD550, 0xCD0F, 0xC4EE, // 0x0EA0 (3744) +0xBC6D, 0xB42C, 0xAC0C, 0xAC0C, 0xB42C, 0xBC8E, 0xC4CF, 0xCD0F, 0xD571, 0xDDD2, 0xE613, 0xEE54, 0xEE55, 0xEE75, 0xE635, 0x9C0E, // 0x0EB0 (3760) +0x3126, 0x20E5, 0x18C4, 0x18C5, 0x18C5, 0x18A4, 0x18A4, 0x18A4, 0x1084, 0x1883, 0x18A4, 0x20C4, 0x5229, 0xACD0, 0xDDF3, 0xE5F3, // 0x0EC0 (3776) +0xCB6B, 0xD36B, 0xD38B, 0xD38B, 0xD38B, 0xD3AB, 0xD3CB, 0xD3EC, 0xD40C, 0xDC2D, 0xDC4D, 0xDC6E, 0xDC8E, 0xEE15, 0xF7BD, 0xF7DE, // 0x0ED0 (3792) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF7BE, 0xB4F0, 0xC52F, 0xD570, 0xD591, 0xD591, 0xD570, 0xD570, 0xD570, 0xD550, // 0x0EE0 (3808) +0xCCEF, 0xC4CE, 0xC4AE, 0xC4CF, 0xCD10, 0xD571, 0xDDB2, 0xDDB2, 0xE5F2, 0xEE33, 0xEE54, 0xEE54, 0xEE75, 0xF695, 0xEE96, 0xE655, // 0x0EF0 (3824) +0x5208, 0x2905, 0x20C4, 0x18C4, 0x18C5, 0x18A5, 0x1083, 0x18A4, 0x18A4, 0x10A4, 0x1083, 0x18A4, 0x18C4, 0x2905, 0x8B8C, 0xD591, // 0x0F00 (3840) +0xCB4B, 0xCB6B, 0xD38B, 0xD38A, 0xD38B, 0xD3AB, 0xD3CB, 0xD3CC, 0xD3EC, 0xDC0C, 0xDC2D, 0xDC4D, 0xDC8E, 0xE635, 0xF7BE, 0xF7DE, // 0x0F10 (3856) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE6B9, 0xD592, 0xE5F2, 0xE613, 0xE613, 0xDDD2, 0xDDB1, 0xDDB1, 0xDD91, // 0x0F20 (3872) +0xD570, 0xD570, 0xDD71, 0xDDB2, 0xE5F3, 0xE613, 0xEE34, 0xEE33, 0xEE34, 0xEE54, 0xEE54, 0xEE54, 0xF675, 0xF696, 0xF696, 0xEE96, // 0x0F30 (3888) +0xA46F, 0x3166, 0x20E5, 0x18C4, 0x18C5, 0x18A5, 0x1083, 0x18A4, 0x18A4, 0x1084, 0x1084, 0x1083, 0x1083, 0x18A4, 0x20E5, 0x5228, // 0x0F40 (3904) +0xCB4A, 0xCB4A, 0xCB6A, 0xD36A, 0xD38A, 0xD3AB, 0xD3AB, 0xD3CB, 0xD3EC, 0xD40C, 0xDC2D, 0xD46E, 0xD4EF, 0xE677, 0xF7BE, 0xFFFF, // 0x0F50 (3920) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF7BE, 0xE655, 0xEE74, 0xF675, 0xEE75, 0xEE54, 0xEE53, 0xE613, 0xE612, // 0x0F60 (3936) +0xE5F2, 0xE5F3, 0xE613, 0xEE34, 0xF675, 0xF695, 0xF675, 0xEE75, 0xF675, 0xEE75, 0xEE75, 0xEE75, 0xF695, 0xF696, 0xF696, 0xF6B6, // 0x0F70 (3952) +0xE635, 0x62CA, 0x2105, 0x18C4, 0x18A4, 0x18A5, 0x10A4, 0x1083, 0x18A4, 0x10A4, 0x1084, 0x1084, 0x1083, 0x1083, 0x1083, 0x1883, // 0x0F80 (3968) +0xCB2A, 0xCB4A, 0xCB6A, 0xCB6A, 0xCB6A, 0xD38B, 0xD3AB, 0xD3CB, 0xD3EC, 0xD42D, 0xD4CE, 0xD571, 0xDE34, 0xF77C, 0xFFDF, 0xFFFF, // 0x0F90 (3984) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xB594, 0xE654, 0xF6B6, 0xF6D6, 0xF6B6, 0xF695, 0xF695, 0xF695, // 0x0FA0 (4000) +0xEE54, 0xEE54, 0xEE54, 0xF675, 0xF695, 0xF6B5, 0xF695, 0xF695, 0xF695, 0xEE75, 0xEE75, 0xEE75, 0xF695, 0xF696, 0xF6B6, 0xF6B7, // 0x0FB0 (4016) +0xEE96, 0xB4F1, 0x2926, 0x20C5, 0x18A4, 0x18C5, 0x18A5, 0x1083, 0x10A4, 0x10A4, 0x1084, 0x1084, 0x1084, 0x1083, 0x1063, 0x1063, // 0x0FC0 (4032) +0xCB2A, 0xCB4A, 0xCB4A, 0xCB6A, 0xCB6A, 0xD38B, 0xD3AB, 0xD3CB, 0xD44D, 0xD52F, 0xDDD2, 0xE654, 0xF75B, 0xFFDF, 0xFFFF, 0xFFFF, // 0x0FD0 (4048) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xEF9E, 0x73AE, 0xACAF, 0xF6B6, 0xF6F7, 0xF6B6, 0xF6B6, 0xF6D6, 0xF6B6, // 0x0FE0 (4064) +0xF695, 0xF695, 0xF695, 0xF6B6, 0xF6B6, 0xF6D6, 0xF6D6, 0xF6B6, 0xF695, 0xF675, 0xF675, 0xEE75, 0xEE75, 0xF696, 0xF6B6, 0xF6B6, // 0x0FF0 (4080) +0xEE96, 0xDDF4, 0x4A08, 0x20E5, 0x18A4, 0x18C5, 0x18A5, 0x1083, 0x1084, 0x10A4, 0x10A4, 0x10A4, 0x1084, 0x1063, 0x1063, 0x1043, // 0x1000 (4096) +}; + +// Generated by : ImageConverter 565 v2.3 +// Generated from: tractor10.jpg +// Time generated: 11-May-18 09:27:27 +// Dimensions : 96x64 pixels +// Size : 12,288 Bytes + +#include + +const uint16_t tractor10_96x64[0x1800] PROGMEM ={ +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0010 (16) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0020 (32) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0030 (48) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0040 (64) +0xFFFF, 0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 0xFFFF, 0xFFFF, // 0x0310 (784) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF7DE, 0xFFFF, // 0x0320 (800) +0xFFFF, 0xFFFF, 0xFFFF, 0xF7DF, 0xF75D, 0xF6FB, 0xEE38, 0xE553, 0xE4B0, 0xE44E, 0xCA25, 0xB921, 0xD265, 0xDA23, 0xD1E2, 0xD1A1, // 0x0330 (816) +0xD160, 0xD920, 0xD920, 0xD920, 0xE180, 0xE180, 0xE1A0, 0xC161, 0x9901, 0xC982, 0xD940, 0xC900, 0xB2E9, 0xB574, 0x8451, 0xFFFF, // 0x0340 (832) +0xFFFF, 0xFF9E, 0xFF5D, 0xFF5C, 0xFFBE, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0350 (848) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0360 (864) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0370 (880) +0xFFFF, 0xFFDF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF7DF, 0xF77D, 0xF71B, 0xF699, 0xEDF6, 0xE532, // 0x0380 (896) +0xE48F, 0xE3ED, 0xE329, 0xDA85, 0xD9E3, 0xD9C2, 0xD980, 0xD920, 0xD920, 0xD920, 0xE160, 0xE180, 0xE160, 0xE180, 0xE9A0, 0xF1C1, // 0x0390 (912) +0xF243, 0xF264, 0xEA44, 0xF2A6, 0xEA86, 0xD204, 0xCA45, 0xAA04, 0x7142, 0x7963, 0x9163, 0xA961, 0xB141, 0x81E5, 0x9C30, 0xED93, // 0x03A0 (928) +0xE40D, 0xD286, 0xD1E3, 0xD9E3, 0xD245, 0xCBAC, 0xEEBA, 0xFFFF, 0xFFDF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF9D, 0xFF7D, 0xFFFF, // 0x03B0 (944) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x03C0 (960) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x03D0 (976) +0xFFFF, 0xFFFF, 0xFFFF, 0xF77C, 0xF71B, 0xEE78, 0xEDD5, 0xECF1, 0xE44F, 0xE3AB, 0xDAE7, 0xDA44, 0xE204, 0xE1C2, 0xE160, 0xE120, // 0x03E0 (992) +0xE140, 0xE160, 0xE160, 0xE160, 0xE160, 0xE980, 0xE981, 0xE1A1, 0xE9C2, 0xEA03, 0xEA65, 0xF2A6, 0xEAA5, 0xEAE8, 0xE2C7, 0xD265, // 0x03F0 (1008) +0xCA86, 0xBA45, 0xA1C3, 0x91A4, 0x8983, 0x6922, 0x6902, 0x7122, 0x7942, 0x7963, 0x7164, 0x5944, 0x5943, 0x8122, 0xD1A1, 0xE1A1, // 0x0400 (1024) +0xE9E2, 0xE1A1, 0xD980, 0xE1A0, 0xD161, 0x80C0, 0xAA06, 0xFF9D, 0xFFFF, 0xFFFF, 0xF73C, 0xBCF3, 0x8ACA, 0x69C5, 0x69A4, 0x7A68, // 0x0410 (1040) +0xA44F, 0xEF5D, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0420 (1056) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0430 (1072) +0xFED9, 0xD40E, 0xCAE8, 0xD224, 0xD9E2, 0xD9A1, 0xD960, 0xD940, 0xD940, 0xE140, 0xE180, 0xE180, 0xE181, 0xE980, 0xE980, 0xE9A0, // 0x0440 (1088) +0xE9A1, 0xE9C2, 0xE9E2, 0xF264, 0xEAC6, 0xF2C6, 0xF307, 0xF38A, 0xEB08, 0xD2C7, 0xCAE8, 0xC287, 0x99C4, 0x9183, 0x9182, 0x6901, // 0x0450 (1104) +0x6101, 0x68E1, 0x6102, 0x60E1, 0x7122, 0x8142, 0x8942, 0x9142, 0x9942, 0xB982, 0xB9A2, 0xA962, 0xD1A1, 0xE9C1, 0xE1A2, 0xD9A1, // 0x0460 (1120) +0xE1A1, 0xD162, 0xD182, 0xD182, 0xB982, 0x8100, 0xBB29, 0xFFFF, 0xFFDE, 0xAC70, 0x5944, 0x4080, 0x68C1, 0x8901, 0x9941, 0x9920, // 0x0470 (1136) +0x98E0, 0x8A27, 0xDEDB, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0480 (1152) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE6DA, // 0x0490 (1168) +0xB182, 0xC900, 0xD981, 0xE180, 0xE181, 0xE981, 0xE9A1, 0xE1C1, 0xE1C1, 0xE9C1, 0xE9C1, 0xE9E2, 0xEA64, 0xF2C7, 0xF2C6, 0xFAE7, // 0x04A0 (1184) +0xFB69, 0xF3AB, 0xE2E8, 0xD308, 0xD2C8, 0xBA45, 0x99A4, 0x8983, 0x9142, 0x7102, 0x58E1, 0x68E1, 0x68E2, 0x48E2, 0x60E1, 0x8942, // 0x04B0 (1200) +0x8162, 0x8962, 0xA162, 0xB182, 0xB982, 0xC9C2, 0xD1C2, 0xD9A1, 0xC9C2, 0xB181, 0xC981, 0xE1C1, 0xD9A0, 0xD9A1, 0xD1A1, 0xD1A1, // 0x04C0 (1216) +0xD1A1, 0xC981, 0xC981, 0xB181, 0x9121, 0x91A5, 0xFF9E, 0xEEDB, 0x7227, 0x4840, 0x8901, 0xC182, 0xD9C2, 0xD1C2, 0xE9A1, 0xE981, // 0x04D0 (1232) +0xE181, 0xC0E0, 0xA267, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x04E0 (1248) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xD38C, // 0x04F0 (1264) +0x98E0, 0xE1C1, 0xE1A1, 0xE9C1, 0xF1C1, 0xE9E2, 0xEA02, 0xE9C1, 0xE9A1, 0xF1E2, 0xF3AA, 0xEBAA, 0xF34A, 0xEB4A, 0xCAC7, 0xCA44, // 0x0500 (1280) +0xB1C4, 0xA183, 0x8121, 0x70E1, 0xB121, 0x70E1, 0x7902, 0x70E2, 0x6902, 0x6901, 0x7922, 0x7901, 0x9AC9, 0xA4F2, 0x49C6, 0x99C3, // 0x0510 (1296) +0xD1A2, 0xD1A2, 0xD9C2, 0xD9C2, 0xD9C1, 0xD9A2, 0xD9C2, 0xE1A1, 0xC9A1, 0xA981, 0xB981, 0xD1A1, 0xE1C1, 0xE9C2, 0xE9C1, 0xE1A2, // 0x0520 (1312) +0xE9A1, 0xE9A1, 0xD182, 0xA141, 0x6102, 0xD617, 0xE6DA, 0x8184, 0x80C0, 0xC982, 0xD982, 0xD9A1, 0xD160, 0xE181, 0xD9C2, 0xA286, // 0x0530 (1328) +0xA225, 0x89C4, 0x6922, 0xA4B1, 0xF79E, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0540 (1344) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF7FF, 0xDBED, // 0x0550 (1360) +0xB920, 0xE9E1, 0xE9C1, 0xE9C1, 0xE9A1, 0xEAC7, 0xEBAA, 0xE9C1, 0xE9E2, 0xE9E2, 0xEA03, 0xE9C2, 0xE1A0, 0xD981, 0x88E1, 0x8922, // 0x0560 (1376) +0x6902, 0x7102, 0x7122, 0x7122, 0x8902, 0x58C1, 0x48E1, 0x58E1, 0x58A1, 0x48A1, 0x8122, 0x9900, 0xB44E, 0xE6FA, 0x52CB, 0x48E1, // 0x0570 (1392) +0xD9A2, 0xD9A1, 0xE1C2, 0xD9A2, 0xD9A1, 0xD9C2, 0xD1C3, 0xD1E3, 0xB981, 0xB981, 0x7122, 0x7142, 0x7941, 0x9941, 0xB961, 0xB981, // 0x0580 (1408) +0xB982, 0xA142, 0x6921, 0x40E2, 0x6142, 0xBBAD, 0x81E5, 0xB100, 0xE1A2, 0xD9A1, 0xD981, 0xC182, 0xBAA8, 0xA941, 0x59E5, 0x52AA, // 0x0590 (1424) +0x52AA, 0x4248, 0x52EB, 0x41E7, 0x5269, 0xAD33, 0xF79D, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x05A0 (1440) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, 0xC36B, // 0x05B0 (1456) +0xB120, 0xE1C1, 0xE1C1, 0xD9A1, 0xE9C1, 0xF1C1, 0xE9C2, 0xD9C1, 0xC1A2, 0xC9A2, 0xD182, 0xD1A1, 0xD9A1, 0xC9A2, 0x8922, 0x7102, // 0x05C0 (1472) +0x58E1, 0x50C1, 0x48C2, 0x3082, 0x2061, 0x1861, 0x2041, 0xA9A4, 0xE284, 0xB962, 0x8921, 0xA921, 0x9BAC, 0xF75C, 0x52CB, 0x60E1, // 0x05D0 (1488) +0xEA22, 0xCA24, 0xC9E3, 0xD203, 0xCA03, 0xC9C3, 0xC1E2, 0xC9E2, 0xC182, 0xB961, 0x38E2, 0x5902, 0x6102, 0x40E2, 0x7102, 0x7143, // 0x05E0 (1504) +0x38C2, 0x40A1, 0x6922, 0x8122, 0xC181, 0x88C0, 0xC141, 0xD9A1, 0xD181, 0xE181, 0xE981, 0xA143, 0x6B2C, 0x6289, 0x4A89, 0x5269, // 0x05F0 (1520) +0x5248, 0x5289, 0x5269, 0x3185, 0x3185, 0x4227, 0x41E7, 0xAD55, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0600 (1536) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, 0x9A88, // 0x0610 (1552) +0x90E0, 0xC981, 0xC182, 0xC182, 0xC182, 0xD245, 0xD265, 0xC182, 0xB161, 0xA962, 0xA982, 0xB162, 0xC982, 0x8921, 0x2861, 0x2061, // 0x0620 (1568) +0x1861, 0x1881, 0x1061, 0x3061, 0x6102, 0x48A1, 0x3860, 0x6102, 0x8984, 0x5922, 0x7122, 0xE9A1, 0xB1C3, 0x7B8D, 0x3985, 0x40E2, // 0x0630 (1584) +0x91A3, 0xD203, 0xD1C2, 0xD9C2, 0xD9A2, 0xE1A1, 0xE9C1, 0x9141, 0x9141, 0xD182, 0x40C2, 0x38A2, 0x5902, 0x7923, 0x6921, 0xA942, // 0x0640 (1600) +0xA1C3, 0xA309, 0x9182, 0xD1A1, 0xA942, 0xB982, 0xE9A1, 0xD9A1, 0xCA03, 0x71C5, 0x91C4, 0x832A, 0x4A89, 0x5269, 0x5268, 0x5269, // 0x0650 (1616) +0x5249, 0x4208, 0x5269, 0x3165, 0x20E4, 0x4207, 0x2103, 0x2924, 0xB595, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0660 (1632) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xAB4B, // 0x0670 (1648) +0x8102, 0x5902, 0x40A1, 0x48C1, 0x48A1, 0x5903, 0x5103, 0x50A1, 0xA962, 0xC1A2, 0xC9A2, 0xC9A2, 0xE1C2, 0x9941, 0x1841, 0x3881, // 0x0680 (1664) +0x7122, 0x9122, 0x8942, 0x8941, 0xB9C3, 0xDCF2, 0x9BAD, 0x48E2, 0xA143, 0x6122, 0xA962, 0xE1C2, 0xC9A2, 0x48C1, 0x38C3, 0x30C2, // 0x0690 (1680) +0x9162, 0xE1C1, 0xE1A1, 0xE1C1, 0xE1A1, 0xE9C1, 0xC9A2, 0x40C2, 0x8141, 0xD9C2, 0x9162, 0x38E2, 0x6102, 0x7922, 0x6902, 0x7902, // 0x06A0 (1696) +0xE182, 0x9AC8, 0xA9A4, 0xC181, 0x8942, 0xC962, 0xD981, 0xE160, 0xD2A7, 0x7BCF, 0x2986, 0x4A48, 0x5228, 0x734C, 0x8C0F, 0x5248, // 0x06B0 (1712) +0x20E3, 0x2924, 0x2924, 0x2924, 0x2103, 0x2124, 0x2104, 0x2904, 0x39A6, 0xEF5D, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x06C0 (1728) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xB3EE, // 0x06D0 (1744) +0x8122, 0x5903, 0x2840, 0x3881, 0x4081, 0x40E2, 0x38C2, 0x4081, 0xB162, 0xC982, 0xC9A2, 0xD1A2, 0xE1C1, 0x9941, 0x2060, 0xA9A2, // 0x06E0 (1760) +0xD204, 0xB162, 0xB182, 0xA142, 0xA941, 0xCC90, 0xDE9A, 0x7207, 0xB1A2, 0xA142, 0xD1A2, 0xD1A2, 0xE9C2, 0xA962, 0x3902, 0x7142, // 0x06F0 (1776) +0xD981, 0xE1C2, 0xD9E2, 0xDA43, 0xD204, 0xD9A1, 0x9962, 0x38E2, 0x7122, 0xC9A1, 0xC161, 0x8142, 0x9982, 0xC161, 0x6122, 0x38E2, // 0x0700 (1792) +0xA141, 0xB982, 0x8142, 0xA941, 0x6122, 0xA161, 0xF1A1, 0xF181, 0xA1C4, 0x83EE, 0x39A6, 0x5AA9, 0x8C0F, 0xAD13, 0x9C91, 0x5AA9, // 0x0710 (1808) +0x3185, 0x20E3, 0x2104, 0x2104, 0x18E3, 0x18E3, 0x18C3, 0x2924, 0x18A2, 0x9491, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0720 (1824) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xB470, // 0x0730 (1840) +0x7902, 0x6923, 0x3881, 0x4881, 0x48A0, 0x50E2, 0x48C2, 0x60C1, 0xC982, 0xC9A2, 0xD1A2, 0xD1A2, 0xE1C1, 0xA161, 0x30A1, 0xB983, // 0x0740 (1856) +0x9942, 0x8942, 0x8121, 0xB182, 0xC981, 0xA962, 0xCD34, 0x9C70, 0xBA04, 0xA121, 0xD1A2, 0xD1C2, 0xE1C2, 0xE1C2, 0xC9A3, 0xCA04, // 0x0750 (1872) +0xD203, 0xD244, 0xD204, 0xD204, 0xE1E2, 0xA142, 0x4102, 0x40E3, 0x5922, 0xB9C2, 0xB9A2, 0xA162, 0x9162, 0xB162, 0x5922, 0x38C2, // 0x0760 (1888) +0x5901, 0xC9A2, 0xA962, 0x8941, 0x38E3, 0x7102, 0x9942, 0x8162, 0x4164, 0x62EB, 0x736C, 0x6B2C, 0x7BAD, 0x5A69, 0x39A6, 0x2944, // 0x0770 (1904) +0x2104, 0x20E3, 0x20C3, 0x20C3, 0x18E3, 0x18C3, 0x18A2, 0x20E3, 0x18A2, 0x2945, 0xD6BA, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0780 (1920) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC4F3, // 0x0790 (1936) +0x70E1, 0x6123, 0x4061, 0x48A1, 0x48A1, 0x48E2, 0x48C2, 0x68C1, 0xC9C1, 0xD1C2, 0xD1C1, 0xD9C2, 0xE1C1, 0xA922, 0x48E2, 0x4144, // 0x07A0 (1952) +0x28C2, 0x8942, 0xA182, 0x8121, 0x8963, 0x7901, 0x6A07, 0xC618, 0xA2C9, 0xB961, 0xC9C2, 0xD9E2, 0xDA85, 0xC9C3, 0xD9E2, 0xD9E2, // 0x07B0 (1968) +0xD9C2, 0xD9A1, 0xE1C2, 0xE9A1, 0xD182, 0x4902, 0x38E3, 0x38E3, 0x6123, 0xB9C3, 0xB9A2, 0x9942, 0x6143, 0x5122, 0x8922, 0x5902, // 0x07C0 (1984) +0x5902, 0x9983, 0x8942, 0x6921, 0x40C2, 0x5164, 0x4A68, 0x4248, 0x83AF, 0x5A69, 0x62EA, 0x6B0B, 0x5269, 0x3165, 0x2924, 0x20E3, // 0x07D0 (2000) +0x18C3, 0x18C2, 0x31A5, 0x4A28, 0x41E7, 0x20E3, 0x18A2, 0x20C3, 0x20C3, 0x18C2, 0x736D, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x07E0 (2016) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xD595, // 0x07F0 (2032) +0x8101, 0x7164, 0x4881, 0x50A1, 0x4080, 0x40C2, 0x40A2, 0x70E2, 0xD1A2, 0xD9C2, 0xD9C2, 0xE1C2, 0xE9E2, 0xB161, 0x3922, 0x2965, // 0x0800 (2048) +0x2104, 0x2103, 0x30A2, 0x3081, 0xBA05, 0x68C1, 0x80E0, 0xDD53, 0xA4D2, 0xA1A2, 0x9942, 0xE1C2, 0xE1E2, 0xE9A1, 0xE9C1, 0xE9C1, // 0x0810 (2064) +0xE9C1, 0xE9E1, 0xE9C2, 0xE1C2, 0x7142, 0x30E3, 0x6143, 0x5922, 0x9962, 0xD9C3, 0xC9A2, 0xA182, 0x9162, 0x8122, 0x9142, 0x9162, // 0x0820 (2080) +0x9143, 0x4902, 0x6122, 0x7922, 0x48E2, 0x5185, 0x734C, 0x3986, 0x41E7, 0x6B0C, 0xBDB5, 0xD678, 0x8C30, 0x39A6, 0x2924, 0x18C3, // 0x0830 (2096) +0x2924, 0x632C, 0x736D, 0x7BAD, 0x83CF, 0x7B8E, 0x39A6, 0x1082, 0x18C3, 0x18A2, 0x9492, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0840 (2112) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xDE37, // 0x0850 (2128) +0x98E1, 0x6122, 0x4081, 0x4861, 0x3860, 0x38C2, 0x30A1, 0x8101, 0xD9A1, 0xD9C2, 0xD9C2, 0xE1C2, 0xF1E1, 0xA982, 0x2165, 0x5248, // 0x0860 (2144) +0x4A48, 0x4208, 0x5185, 0xA142, 0xCA44, 0x8102, 0xD960, 0xD265, 0xC5F8, 0x830B, 0x78E1, 0xE1A1, 0xF1C1, 0xE9C1, 0xE1C2, 0xD1A2, // 0x0870 (2160) +0xC162, 0x9943, 0x8142, 0x6122, 0x30E3, 0x5903, 0xB1A3, 0xB182, 0xB9A2, 0xB1A3, 0xA182, 0x9963, 0x9183, 0xB9A3, 0xA982, 0x9942, // 0x0880 (2176) +0x8942, 0x9962, 0xA982, 0xC1C3, 0x6902, 0x38C2, 0x838D, 0x4A48, 0x5AAA, 0x9C90, 0xBD94, 0x9470, 0x4A08, 0x20E3, 0x18A2, 0x2904, // 0x0890 (2192) +0xB5F7, 0xB470, 0x80C0, 0x7207, 0x630B, 0x7B8D, 0x83CE, 0x2924, 0x18C3, 0x1081, 0x630B, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x08A0 (2208) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xEEFB, // 0x08B0 (2224) +0xA163, 0x6922, 0x40A1, 0x3881, 0x3060, 0x30A1, 0x3082, 0x9121, 0xE1C2, 0xE1C1, 0xE1C2, 0xE9E1, 0xF9E2, 0xB182, 0x18C3, 0x18E3, // 0x08C0 (2240) +0x18E3, 0x18E3, 0x18C2, 0x6101, 0xD203, 0x9122, 0xD181, 0xD940, 0xCC2D, 0x8C51, 0x5923, 0x9121, 0x8962, 0x7122, 0x50E2, 0x6164, // 0x08D0 (2256) +0x7964, 0x40E2, 0x6923, 0x7122, 0x7142, 0x8183, 0xA162, 0xB163, 0x9962, 0xA1C3, 0xD285, 0xDA44, 0xE265, 0xF223, 0xC9A2, 0xB183, // 0x08E0 (2272) +0xC9A2, 0xD182, 0xA162, 0xB962, 0x7122, 0x3924, 0x5A89, 0x5A89, 0x83AD, 0xAD13, 0x9450, 0x2945, 0x2104, 0x20E3, 0x18A2, 0xAD75, // 0x08F0 (2288) +0xFF5C, 0xD266, 0x8080, 0xC513, 0xB5D7, 0x62EB, 0x9450, 0x6B0B, 0x18A2, 0x18E3, 0x18C3, 0xB5B6, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0900 (2304) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF77E, // 0x0910 (2320) +0xA1C5, 0x7922, 0x3881, 0x3081, 0x3081, 0x38C2, 0x3082, 0x9921, 0xE1A1, 0xE1C1, 0xE9C1, 0xE9C1, 0xF9E1, 0xB161, 0x18E3, 0x2924, // 0x0920 (2336) +0x2104, 0x2104, 0x28C2, 0x8123, 0xA9E3, 0x8941, 0xB9A2, 0xE9A1, 0xD1A1, 0xC595, 0xA32C, 0x68E0, 0x38E2, 0x58E3, 0x7942, 0x9205, // 0x0930 (2352) +0x6943, 0xD1A2, 0xC9C2, 0xC9A1, 0xC9C2, 0x8983, 0x9962, 0xE9C2, 0xC9A1, 0xC182, 0xE9A2, 0xF1C2, 0xE9A1, 0xE1C1, 0xA963, 0x9182, // 0x0940 (2368) +0xC9C2, 0xC9A2, 0xA962, 0x9182, 0x41C6, 0x3186, 0x41E7, 0x9450, 0x83CD, 0x5AAA, 0x41C6, 0x3986, 0x2924, 0x1061, 0x7BAE, 0xFFFF, // 0x0950 (2384) +0xE3CE, 0xC8C0, 0xA0C0, 0xCCD1, 0xFFFF, 0x8C30, 0x9471, 0x9C71, 0x2945, 0x20E3, 0x0861, 0x8C51, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0960 (2400) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF79E, // 0x0970 (2416) +0x91C6, 0x8101, 0x40A1, 0x3060, 0x3861, 0x38C2, 0x38A2, 0xA162, 0xE1C1, 0xE9C1, 0xF1C1, 0xF1C1, 0xF9E1, 0xB161, 0x20A2, 0x40E2, // 0x0980 (2432) +0x48E1, 0x48E2, 0x60C1, 0xB1A2, 0xDA03, 0xB1C3, 0xB1C3, 0xC203, 0xF308, 0xC34A, 0xC5B4, 0xB9A3, 0x9100, 0xF1E2, 0xE203, 0x81C5, // 0x0990 (2448) +0x9982, 0xE1E2, 0xC161, 0xC9A2, 0xB1A3, 0x9942, 0xB1A2, 0xF1C2, 0xD1A2, 0x9962, 0xB982, 0xC9C2, 0xE9C2, 0xD982, 0xB181, 0xC1A3, // 0x09A0 (2464) +0xB9C3, 0xC9A3, 0xD182, 0xB204, 0x4A49, 0x5AAA, 0x8C0E, 0x5AA9, 0x736C, 0xC5D5, 0x83EF, 0x3165, 0x20E3, 0x2945, 0xD699, 0xD69A, // 0x09B0 (2480) +0x9183, 0xB1A3, 0xD940, 0xAA47, 0xFFFF, 0xCE38, 0xA4B1, 0xB554, 0x4207, 0x1061, 0x4208, 0xF79D, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x09C0 (2496) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, // 0x09D0 (2512) +0x9227, 0x88E1, 0x4081, 0x3861, 0x3881, 0x38E2, 0x38A2, 0xA941, 0xE1C1, 0xE9C1, 0xF1E1, 0xF1C1, 0xF9E1, 0xA161, 0x3081, 0xC9A2, // 0x09E0 (2528) +0xD9C1, 0xE1C2, 0xE1C2, 0xC204, 0xAA05, 0x6142, 0x60E1, 0xB2C8, 0xDC0D, 0x98E0, 0xB4D2, 0xCDB4, 0x9A46, 0xE160, 0xB1E4, 0x7163, // 0x09F0 (2544) +0xD9C3, 0xB1C2, 0xB9C3, 0xB1A3, 0xB9A3, 0xD1E2, 0xD9A2, 0xE9C1, 0xD1A1, 0xA142, 0x5922, 0x9962, 0xF1C1, 0xE9A1, 0xE1A1, 0xEA24, // 0x0A00 (2560) +0xE1E3, 0xC9A2, 0xB982, 0x7963, 0x6AEA, 0x41E8, 0x5248, 0x6B2B, 0xC5B5, 0xCE16, 0x62CB, 0x20C3, 0x10C3, 0x6A48, 0xB266, 0x8142, // 0x0A10 (2576) +0x9921, 0xD9C3, 0xE9A1, 0xA100, 0xD639, 0xF79D, 0xAD13, 0xCDF6, 0x6B0B, 0x0821, 0x5269, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0A20 (2592) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0A30 (2608) +0xAAC9, 0x80C1, 0x48A1, 0x2880, 0x3861, 0x40E2, 0x48C2, 0xB961, 0xE9C1, 0xE9C1, 0xF1E1, 0xF1C1, 0xF9E1, 0xB161, 0x7101, 0xE1C2, // 0x0A40 (2624) +0xE9E2, 0xE1C1, 0xE1E2, 0xC1A2, 0x8121, 0xA141, 0x8100, 0xCB6B, 0xEC4E, 0x90E0, 0x8142, 0x8B6D, 0xC5F6, 0xD3ED, 0x7122, 0xB960, // 0x0A50 (2640) +0xF9E2, 0xB9A2, 0xD1C2, 0xCA03, 0xA982, 0xB9A2, 0xA162, 0xA982, 0xA982, 0xA962, 0x9962, 0xC182, 0xF1C1, 0xD9A2, 0xE1A1, 0xE1E3, // 0x0A60 (2656) +0xD1A2, 0xE9A2, 0xA982, 0x38A1, 0x730A, 0x5269, 0x41C7, 0x62CA, 0x83CE, 0x6B0B, 0x3165, 0x20C4, 0x2966, 0xAA46, 0xF140, 0xE160, // 0x0A70 (2672) +0xF1A1, 0xC182, 0xC1A2, 0xD0E0, 0xB3EE, 0xF7FF, 0xB574, 0xD678, 0x83CE, 0x1082, 0x18C3, 0xBDF7, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0A80 (2688) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0A90 (2704) +0xBBAD, 0x88C1, 0x48C2, 0x2861, 0x3840, 0x40C2, 0x48E2, 0xC182, 0xE1E2, 0xE9C1, 0xF1C1, 0xF1C1, 0xF9C1, 0xC1C3, 0xAA66, 0xA942, // 0x0AA0 (2720) +0xF1C1, 0xC1C3, 0xA162, 0xF1C2, 0xF1C2, 0xF9E1, 0xC141, 0xB2A7, 0xAB4A, 0x78E1, 0xA961, 0x9900, 0x7A06, 0xAD74, 0xBCB1, 0xE224, // 0x0AB0 (2736) +0xC961, 0x9101, 0xB962, 0xC9E2, 0x8121, 0x50A2, 0x7142, 0x8142, 0xA982, 0xA183, 0xC982, 0x8941, 0xB162, 0xD9E2, 0xC981, 0xC182, // 0x0AC0 (2752) +0xA962, 0xE1C1, 0x9162, 0x4123, 0x5228, 0x732C, 0x3985, 0x5269, 0x734C, 0x39A6, 0x2924, 0x20C4, 0x31A6, 0x9983, 0xE9A1, 0xE9A1, // 0x0AD0 (2768) +0xE9A1, 0xD161, 0xC182, 0xB921, 0x9205, 0xD638, 0xCDF7, 0xE6D9, 0x8C2F, 0x18C3, 0x1061, 0x840F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0AE0 (2784) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0AF0 (2800) +0xBC51, 0x90C0, 0x50C1, 0x2881, 0x2840, 0x30E2, 0x40E2, 0xC982, 0xD9E2, 0xE9E1, 0xF1C1, 0xF1C1, 0xF1E1, 0xBA24, 0x89E5, 0xA163, // 0x0B00 (2816) +0xF9E2, 0xC1E3, 0xC1A2, 0xE9C1, 0xE9C1, 0xE9C1, 0xF1E1, 0xE181, 0xA100, 0xA162, 0xC182, 0xC182, 0xB141, 0x7903, 0x93CE, 0xC574, // 0x0B10 (2832) +0x9B0B, 0x92EA, 0xB205, 0xB920, 0x8247, 0x8AEA, 0x90E0, 0x9921, 0xB182, 0xB982, 0xB9A2, 0x7122, 0xA162, 0xC9A1, 0xC181, 0xC9A2, // 0x0B20 (2848) +0xB181, 0xC9A2, 0x8962, 0x31C6, 0x31A6, 0x3165, 0x5AAA, 0x6B0B, 0x62CA, 0x4A28, 0x3165, 0x18C3, 0x62A9, 0x6963, 0xB961, 0xE9A1, // 0x0B30 (2864) +0xE9A1, 0xE9E3, 0xA162, 0x8122, 0x9101, 0x8121, 0xCD74, 0xF75B, 0x8C0F, 0x18A3, 0x10A2, 0xBDF7, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0B40 (2880) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0B50 (2896) +0xBCD2, 0x98A0, 0xB981, 0xA161, 0xA142, 0x99C4, 0xA1A3, 0xD9A2, 0xD9A2, 0xE9C1, 0xF1C1, 0xF1C1, 0xF9E1, 0xA9E3, 0x71C5, 0xA1A2, // 0x0B60 (2912) +0xE9C2, 0xE1A1, 0xE9C1, 0xF1E1, 0xF1E1, 0xF1C1, 0xF1C1, 0xD9A1, 0xD1A2, 0xB182, 0xB9A1, 0xA983, 0x9941, 0x6080, 0x938E, 0xBD54, // 0x0B70 (2928) +0xB513, 0xE6DB, 0xE658, 0xCC50, 0xF75D, 0xF71B, 0xC533, 0xAC70, 0xB1E4, 0x9920, 0xA183, 0xD1C2, 0xE1A1, 0xE1C1, 0xE1C1, 0xE181, // 0x0B80 (2944) +0xD1A2, 0xB142, 0x6963, 0x4207, 0x4A28, 0x5269, 0x5249, 0x5A89, 0xA4D2, 0x5269, 0x2103, 0x18C2, 0xB554, 0x8A48, 0x88E1, 0xE9A1, // 0x0B90 (2960) +0xE9A1, 0xDA24, 0xA941, 0xB961, 0xB942, 0x932B, 0xEED9, 0xEF3B, 0x734C, 0x0841, 0x8C51, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0BA0 (2976) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0BB0 (2992) +0xDD74, 0xA0E0, 0xD1A2, 0xF1C1, 0xF9C1, 0xF9E2, 0xF1E2, 0xD9A1, 0xD9A2, 0xE9C1, 0xF1E2, 0xF1E2, 0xF9E1, 0xA962, 0x8944, 0xA182, // 0x0BC0 (3008) +0xD9C2, 0xD9C1, 0xC9A1, 0xD1A2, 0xD9C2, 0xB9A2, 0x9942, 0x7102, 0x5101, 0x5901, 0xA163, 0x58C1, 0x38E3, 0x5164, 0xE6B9, 0xFFFF, // 0x0BD0 (3024) +0xCDD7, 0xA491, 0xCDB6, 0xF7BE, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xD40E, 0x90C0, 0x9142, 0x9101, 0x9962, 0xB162, 0x8942, 0x7A26, // 0x0BE0 (3040) +0x89C4, 0x7268, 0x49C7, 0x5A48, 0x4A29, 0x5269, 0x39A6, 0x62CB, 0x6B2C, 0x39A6, 0x2924, 0x20E3, 0xBDB6, 0xAA46, 0x9901, 0xD9A1, // 0x0BF0 (3056) +0xD181, 0xA920, 0xB141, 0xA982, 0xA122, 0xD4B0, 0xF79C, 0xE6FA, 0x5269, 0x0820, 0x9CB2, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0C00 (3072) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0C10 (3088) +0xEE37, 0xB941, 0xC982, 0xE1C1, 0xE9C1, 0xE9C1, 0xE9C1, 0xD9A1, 0xD1A1, 0xE9C1, 0xF1C1, 0xF1E1, 0xD9A2, 0xB961, 0xB1A2, 0xA9A3, // 0x0C20 (3104) +0xB182, 0xD9E3, 0xB982, 0x7942, 0x5122, 0x4103, 0x40A1, 0x38A1, 0x50C1, 0x7942, 0x6123, 0x4902, 0xD679, 0xF79D, 0xFFFF, 0xFFFF, // 0x0C30 (3120) +0xFFFF, 0xEF1C, 0xB513, 0xB533, 0xDE78, 0xFFDF, 0xFFFF, 0xFFFF, 0xF7BF, 0xCE17, 0xBC2F, 0xC42F, 0xA450, 0x8A47, 0xB575, 0xD6FB, // 0x0C40 (3136) +0xBAE9, 0xB3CD, 0xD679, 0x9CD3, 0x2924, 0x3165, 0x3986, 0x41C7, 0x41C7, 0x41E7, 0x2924, 0x2145, 0xB34B, 0xE181, 0xC961, 0xB962, // 0x0C50 (3152) +0xB181, 0x8901, 0x78E2, 0x78C0, 0x8247, 0xE657, 0xF77C, 0xD678, 0x3986, 0x1061, 0x4A28, 0xFFDE, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0C60 (3168) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE73C, 0xA4D3, // 0x0C70 (3184) +0x7ACA, 0xC9A2, 0xC981, 0xE1C2, 0xE9E1, 0xE9C1, 0xE9C1, 0xD1A1, 0xD1C1, 0xE9C1, 0xF1C1, 0xF1C1, 0xB982, 0xCA03, 0xC1E2, 0x8961, // 0x0C80 (3200) +0x6903, 0x8142, 0x7121, 0x48C2, 0x60A1, 0xA100, 0xCB4A, 0xD5D5, 0xA1A3, 0x8921, 0x6060, 0x8B6D, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, // 0x0C90 (3216) +0xFFFF, 0xFFFF, 0xFFFF, 0xD659, 0xB4F3, 0xCD96, 0xEEFB, 0xEF3C, 0xDE79, 0xC595, 0xACD2, 0xB5B6, 0xD554, 0xC32A, 0xC5F7, 0xA4D1, // 0x0CA0 (3232) +0x91A3, 0xA309, 0xCE18, 0x5AEB, 0x39A6, 0x2924, 0x3144, 0x41E7, 0x41E7, 0x2104, 0x20E3, 0x2186, 0xA9A3, 0xC9A2, 0xE1A2, 0xD961, // 0x0CB0 (3248) +0xD181, 0xB161, 0x70A0, 0x81C6, 0xEF5C, 0xF75C, 0xF77B, 0xB553, 0x2924, 0x1082, 0x630C, 0xFFDF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0CC0 (3264) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xBDD6, 0x6B4C, 0x71E6, // 0x0CD0 (3280) +0x7183, 0xB9C2, 0xD1C2, 0xE9E1, 0xF1C1, 0xF223, 0xEA03, 0xD9C1, 0xD9C1, 0xF1C1, 0xE9E2, 0xC9A2, 0xD1A1, 0xDA03, 0xB1A2, 0x8123, // 0x0CE0 (3296) +0x8963, 0xB1E3, 0x7983, 0x79E4, 0xC287, 0xB2C8, 0xC533, 0xDD54, 0xA962, 0xA100, 0xA205, 0xE69A, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0CF0 (3312) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xEF3C, 0xB554, 0x9C71, 0xACF3, 0xC596, 0xCDF7, 0xAC91, 0xB4D2, 0x8AA9, 0x9A26, 0xB40F, 0xC450, // 0x0D00 (3328) +0xD574, 0xFF1C, 0xB535, 0x18C3, 0x3165, 0x2924, 0x3986, 0x4A08, 0x3986, 0x2945, 0x2924, 0x2966, 0x89C4, 0xD980, 0xE140, 0xD181, // 0x0D10 (3344) +0xB161, 0xB161, 0xA121, 0xDE17, 0xF7BD, 0xEF1A, 0xEF5A, 0x738C, 0x1081, 0x8410, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0D20 (3360) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xAD34, 0x5A89, 0x41E7, 0x69E6, // 0x0D30 (3376) +0x9162, 0x8942, 0x9962, 0xC1A2, 0xB961, 0xC285, 0xC224, 0xB961, 0xB982, 0xB182, 0x8142, 0x9962, 0xD9C2, 0x8942, 0x3060, 0x78C1, // 0x0D40 (3392) +0x79E4, 0x930A, 0x8A68, 0x8ACA, 0x93CD, 0x93CF, 0xABEE, 0xD4B0, 0xCD74, 0x91E5, 0xBC2F, 0xFFFF, 0xFFDF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0D50 (3408) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE73C, 0xEF5C, 0xFFDF, 0xFFFF, 0xFF9D, 0xDDD6, 0xDDB6, 0xF6FA, 0xFFBE, 0xFFFF, // 0x0D60 (3424) +0xFFFF, 0xFFFF, 0xD6DB, 0x39C7, 0x2924, 0x3165, 0x39A6, 0x2945, 0x41C7, 0x3165, 0x2945, 0x2165, 0x71A4, 0xB901, 0xBA87, 0x91A4, // 0x0D70 (3440) +0x9141, 0xC900, 0xC3AC, 0xF7DF, 0xE6D9, 0xEF3B, 0xCE17, 0x39A6, 0x18C2, 0xD69A, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0D80 (3456) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xAD54, 0x4A48, 0x4A07, 0x5269, 0x2965, // 0x0D90 (3472) +0x3904, 0x7A06, 0x7983, 0xA162, 0x9942, 0x91C4, 0x9183, 0x9142, 0x8141, 0x8142, 0x8162, 0xA9A2, 0x8942, 0x6184, 0x9BAE, 0x92C8, // 0x0DA0 (3488) +0x99C4, 0xC4F2, 0xE6FA, 0xFFBE, 0xFFDF, 0xFFFF, 0xFFFF, 0xFFFF, 0xDD75, 0xC3CC, 0xF6FC, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0DB0 (3504) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0DC0 (3520) +0xFFFF, 0xFFFF, 0xFFFF, 0x7BAE, 0x3165, 0x2945, 0x2104, 0x3165, 0x39A6, 0x4208, 0x3986, 0x20E4, 0x6ACA, 0xE6BA, 0xF7FF, 0xB4D2, // 0x0DD0 (3536) +0x98E0, 0xA182, 0xD638, 0xEF3B, 0xE6D9, 0xEF1A, 0x83CF, 0x2904, 0x0840, 0xAD55, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0DE0 (3552) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xDEDA, 0x5248, 0x3986, 0x5289, 0x39A6, 0x3A08, // 0x0DF0 (3568) +0x934C, 0x9B4B, 0x9A47, 0x8921, 0xA961, 0x9962, 0xB181, 0xD9C2, 0xB981, 0xA162, 0xB181, 0xC182, 0x99C3, 0xE6BA, 0xFFFF, 0xFFFF, // 0x0E00 (3584) +0xE5F6, 0xC3ED, 0xCC0E, 0xE658, 0xFFFF, 0xFFFF, 0xEF5C, 0xB3CD, 0xB36B, 0xF77D, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0E10 (3600) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0E20 (3616) +0xFFFF, 0xFFFF, 0xFFFF, 0xA514, 0x2124, 0x2103, 0x2924, 0x2924, 0x39A6, 0x41C7, 0x2924, 0x2924, 0x5ACA, 0xFFDF, 0xFFFF, 0xF7BE, // 0x0E30 (3632) +0xB1E5, 0x8901, 0xC554, 0xE6FA, 0xE6FA, 0xB574, 0x41E7, 0x20C3, 0x18C2, 0xAD55, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0E40 (3648) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8C30, 0x3985, 0x41E7, 0x41E7, 0x39E8, 0xAC2F, // 0x0E50 (3664) +0xDA03, 0xB141, 0xA961, 0xAA46, 0xB3AD, 0xC981, 0x9121, 0x8121, 0x7142, 0x60C0, 0xA100, 0xD9A1, 0xD1E1, 0xEB69, 0xEDD5, 0xFFFF, // 0x0E60 (3680) +0xFFFF, 0xFFFF, 0xDE58, 0x9A27, 0xA30A, 0xCCF2, 0xA246, 0x99C4, 0xF7BE, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0E70 (3696) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0E80 (3712) +0xFFFF, 0xFFFF, 0xFFFF, 0x9CB2, 0x18C3, 0x3186, 0x2924, 0x2924, 0x3186, 0x2104, 0x2904, 0x3165, 0x39C6, 0x9CB2, 0xE71C, 0xDEFB, // 0x0E90 (3728) +0xBD13, 0xA36B, 0xD616, 0xE6FA, 0xC5D6, 0x5ACA, 0x20E3, 0x5269, 0xDEDA, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0EA0 (3744) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE73C, 0x4A49, 0x3165, 0x39A6, 0x2924, 0x8C0F, 0xE265, // 0x0EB0 (3760) +0xE1A1, 0x9162, 0xC181, 0x9942, 0x8C30, 0xC1E3, 0x81A4, 0x4944, 0x50C1, 0xA3AC, 0xCBED, 0xB161, 0xD140, 0xE980, 0xEA65, 0xE349, // 0x0EC0 (3776) +0xD46F, 0xF79C, 0xEF7C, 0xC267, 0x7880, 0x8983, 0x81A3, 0x8944, 0xEF3C, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0ED0 (3792) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0EE0 (3808) +0xFFFF, 0xFFFF, 0xFFFF, 0xE73C, 0x3186, 0x2103, 0x3145, 0x3165, 0x2945, 0x2904, 0x2904, 0x3145, 0x39C6, 0x5A8A, 0xB554, 0xCE17, // 0x0EF0 (3824) +0xCE57, 0xD658, 0xDE79, 0xBD75, 0x734C, 0x3986, 0x20C3, 0xD699, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0F00 (3840) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xAD75, 0x2904, 0x2944, 0x20E3, 0x4A28, 0xB40F, 0xB941, // 0x0F10 (3856) +0xB981, 0xA9C3, 0xB1A2, 0x80E1, 0x6269, 0xBCF2, 0xC553, 0x4207, 0x0841, 0xB5B6, 0xFFFF, 0xE679, 0xAB4B, 0xA942, 0xD1C3, 0xEB07, // 0x0F20 (3872) +0xCA04, 0xBA67, 0xA1C4, 0xB961, 0x9206, 0xDEBA, 0xEF3B, 0xDDB5, 0xF7BE, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0F30 (3888) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0F40 (3904) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xA514, 0x1882, 0x3165, 0x2924, 0x20E3, 0x2924, 0x3186, 0x2924, 0x3165, 0x4A28, 0x6B2B, 0xA4F2, // 0x0F50 (3920) +0xBDB5, 0xB553, 0x9471, 0x732C, 0x41C7, 0x18A2, 0x1082, 0xD69A, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0F60 (3936) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x7BCE, 0x1062, 0x20C3, 0x1081, 0x738E, 0xD329, 0xB940, // 0x0F70 (3952) +0xA982, 0xB9C2, 0xB9A3, 0x70E1, 0x6227, 0xE6FA, 0xE6F9, 0x41A6, 0x1061, 0xB5B6, 0xFFFF, 0xFFFF, 0xFFFF, 0xDE78, 0xAB6A, 0xB141, // 0x0F80 (3968) +0x9982, 0xA9E4, 0xB224, 0xC9A1, 0xB30A, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0F90 (3984) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0FA0 (4000) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x62EB, 0x18A2, 0x20E3, 0x20E3, 0x3165, 0x3186, 0x20E3, 0x2924, 0x39A6, 0x5269, 0x6B2B, // 0x0FB0 (4016) +0x7BAD, 0x736C, 0x62CA, 0x39A6, 0x1882, 0x5269, 0x8430, 0xDEFB, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0FC0 (4032) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x738E, 0x0821, 0x18A2, 0x1082, 0x8430, 0xDB49, 0xD960, // 0x0FD0 (4048) +0x9962, 0x8142, 0xC182, 0x68E1, 0x7902, 0xEDF5, 0xD678, 0x3144, 0x20E3, 0xD699, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE679, // 0x0FE0 (4064) +0xA288, 0x8901, 0xBA04, 0xCAA6, 0x8AA8, 0xA4B1, 0x8C10, 0x9451, 0xAD34, 0xEF3C, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x0FF0 (4080) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x1000 (4096) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xD69A, 0x20C3, 0x20C3, 0x2904, 0x2924, 0x20E3, 0x20E3, 0x2945, 0x2924, 0x3145, 0x41E7, // 0x1010 (4112) +0x4A28, 0x41A6, 0x2924, 0x18A2, 0x41C7, 0xEF7D, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x1020 (4128) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x83EF, 0x0820, 0x18C3, 0x1082, 0x7C0F, 0xDB8B, 0xB100, // 0x1030 (4144) +0x9983, 0x8942, 0x80A0, 0x71C5, 0xC574, 0xF73A, 0xACF2, 0x18A2, 0x41C7, 0xFFDF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x1040 (4160) +0xED94, 0x9942, 0x8AC9, 0x9C2F, 0x8BEF, 0x62A9, 0x41C6, 0x41C6, 0x3145, 0x4A07, 0xA4F3, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x1050 (4176) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x1060 (4192) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x9CB3, 0x1882, 0x20E3, 0x28E3, 0x20C3, 0x2924, 0x3165, 0x20E3, 0x2924, 0x2944, // 0x1070 (4208) +0x2904, 0x20E3, 0x1882, 0x18A2, 0x5249, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x1080 (4224) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xB575, 0x1021, 0x18C3, 0x1081, 0x4A28, 0x9A88, 0x8183, // 0x1090 (4240) +0xA941, 0xC1C3, 0xB32A, 0xD5D6, 0xE75B, 0xE6FA, 0x5AAA, 0x0820, 0x8C30, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x10A0 (4256) +0xC5F7, 0x93CD, 0x9C90, 0x7BAE, 0x39E6, 0x3164, 0x3145, 0x2924, 0x2924, 0x2104, 0x18A2, 0x7BCF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x10B0 (4272) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x10C0 (4288) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xBDB6, 0x3145, 0x1041, 0x18A2, 0x2924, 0x2104, 0x18C3, 0x3165, 0x18C3, // 0x10D0 (4304) +0x1882, 0x18C2, 0x8C71, 0xCE58, 0xBDB6, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x10E0 (4320) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xEF5D, 0x2924, 0x1082, 0x18C3, 0x2904, 0x736D, 0xC5B6, // 0x10F0 (4336) +0xD594, 0xD658, 0xE73C, 0xE73B, 0xEEFA, 0x8C2F, 0x2104, 0x2945, 0xEF5D, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC5F7, // 0x1100 (4352) +0x7BAD, 0x83CE, 0x630B, 0x3986, 0x2924, 0x2124, 0x18A3, 0x18C2, 0x18A2, 0x18C3, 0x2924, 0x1882, 0xA514, 0xFFFF, 0xFFFF, 0xFFFF, // 0x1110 (4368) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x1120 (4384) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE73C, 0x7BCF, 0x3165, 0x18A2, 0x20E3, 0x2904, 0x1061, 0x6B2C, // 0x1130 (4400) +0x94B2, 0x39E7, 0xDEFB, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x1140 (4416) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8C30, 0x0000, 0x18C3, 0x18C3, 0x39C6, 0x9491, // 0x1150 (4432) +0xCE78, 0xD678, 0xD657, 0xCE16, 0x8C0F, 0x39A6, 0x1061, 0xB596, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xD6BA, 0x62CA, // 0x1160 (4448) +0x6B0B, 0x5A89, 0x3185, 0x2944, 0x20E3, 0x39A6, 0x736D, 0x8C2F, 0x83CE, 0x39A7, 0x18C3, 0x20E3, 0x39C7, 0xEF7D, 0xFFFF, 0xFFFF, // 0x1170 (4464) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x1180 (4480) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE71C, 0xB575, 0xB596, 0xB596, 0x630C, 0xE75D, // 0x1190 (4496) +0xFFFF, 0xEF7D, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF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0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x17C0 (6080) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x17D0 (6096) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x17E0 (6112) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF7DE, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x17F0 (6128) +0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, // 0x1800 (6144) +}; + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/drawBitmap_kbv/bitmap_mono.h b/Arduino/Libraries/MCUFRIEND_kbv/examples/drawBitmap_kbv/bitmap_mono.h new file mode 100644 index 0000000..938aef0 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/drawBitmap_kbv/bitmap_mono.h @@ -0,0 +1,343 @@ +// http://skaarhoj.com/FreeStuff/GraphicDisplayImageConverter.php + +// width x height = 64,64 +static const uint8_t magnify_inv_64x64[] PROGMEM = { + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xfc,0x03,0xff,0xff,0xff,0xff, + 0xff,0xff,0xe0,0x00,0x7f,0xff,0xff,0xff, + 0xff,0xff,0x80,0x00,0x1f,0xff,0xff,0xff, + 0xff,0xff,0x00,0x00,0x0f,0xff,0xff,0xff, + 0xff,0xfc,0x00,0x00,0x03,0xff,0xff,0xff, + 0xff,0xf8,0x00,0x00,0x01,0xff,0xff,0xff, + 0xff,0xf0,0x00,0x40,0x01,0xff,0xff,0xff, + 0xff,0xf0,0x07,0xfe,0x00,0xff,0xff,0xff, + 0xff,0xe0,0x0f,0xff,0x00,0x7f,0xff,0xff, + 0xff,0xc0,0x3f,0xff,0xc0,0x7f,0xff,0xff, + 0xff,0xc0,0x7f,0xff,0xc0,0x3f,0xff,0xff, + 0xff,0xc0,0x7f,0xff,0xe0,0x3f,0xff,0xff, + 0xff,0x80,0xff,0xff,0xf0,0x1f,0xff,0xff, + 0xff,0x80,0xff,0xff,0xf0,0x1f,0xff,0xff, + 0xff,0x81,0xff,0xff,0xf8,0x1f,0xff,0xff, + 0xff,0x81,0xff,0xff,0xf8,0x1f,0xff,0xff, + 0xff,0x01,0xff,0xff,0xf8,0x1f,0xff,0xff, + 0xff,0x01,0xff,0xff,0xf8,0x1f,0xff,0xff, + 0xff,0x01,0xff,0xff,0xf8,0x1f,0xff,0xff, + 0xff,0x81,0xff,0xff,0xf8,0x1f,0xff,0xff, + 0xff,0x81,0xff,0xff,0xf8,0x1f,0xff,0xff, + 0xff,0x80,0xff,0xff,0xf0,0x1f,0xff,0xff, + 0xff,0x80,0xff,0xff,0xf0,0x1f,0xff,0xff, + 0xff,0x80,0x7f,0xff,0xe0,0x3f,0xff,0xff, + 0xff,0xc0,0x7f,0xff,0xe0,0x3f,0xff,0xff, + 0xff,0xc0,0x3f,0xff,0xc0,0x7f,0xff,0xff, + 0xff,0xe0,0x1f,0xff,0x00,0x7f,0xff,0xff, + 0xff,0xf0,0x07,0xfe,0x00,0x7f,0xff,0xff, + 0xff,0xf0,0x00,0xf0,0x00,0x7f,0xff,0xff, + 0xff,0xf8,0x00,0x00,0x00,0x3f,0xff,0xff, + 0xff,0xfc,0x00,0x00,0x00,0x1f,0xff,0xff, + 0xff,0xfe,0x00,0x00,0x00,0x0f,0xff,0xff, + 0xff,0xff,0x80,0x00,0x10,0x07,0xff,0xff, + 0xff,0xff,0xe0,0x00,0x78,0x03,0xff,0xff, + 0xff,0xff,0xfc,0x03,0xfc,0x01,0xff,0xff, + 0xff,0xff,0xff,0xff,0xfe,0x00,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0x00,0x7f,0xff, + 0xff,0xff,0xff,0xff,0xff,0x80,0x3f,0xff, + 0xff,0xff,0xff,0xff,0xff,0xc0,0x1f,0xff, + 0xff,0xff,0xff,0xff,0xff,0xe0,0x0f,0xff, + 0xff,0xff,0xff,0xff,0xff,0xf0,0x07,0xff, + 0xff,0xff,0xff,0xff,0xff,0xf8,0x03,0xff, + 0xff,0xff,0xff,0xff,0xff,0xfc,0x01,0xff, + 0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x7f, + 0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x3f, + 0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x7f, + 0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xf1,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xfb,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, +}; + +// width x height = 64,64 +static const uint8_t magnify_64x64[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x03,0xfc,0x00,0x00,0x00,0x00, + 0x00,0x00,0x1f,0xff,0x80,0x00,0x00,0x00, + 0x00,0x00,0x7f,0xff,0xe0,0x00,0x00,0x00, + 0x00,0x00,0xff,0xff,0xf0,0x00,0x00,0x00, + 0x00,0x03,0xff,0xff,0xfc,0x00,0x00,0x00, + 0x00,0x07,0xff,0xff,0xfe,0x00,0x00,0x00, + 0x00,0x0f,0xff,0xbf,0xfe,0x00,0x00,0x00, + 0x00,0x0f,0xf8,0x01,0xff,0x00,0x00,0x00, + 0x00,0x1f,0xf0,0x00,0xff,0x80,0x00,0x00, + 0x00,0x3f,0xc0,0x00,0x3f,0x80,0x00,0x00, + 0x00,0x3f,0x80,0x00,0x3f,0xc0,0x00,0x00, + 0x00,0x3f,0x80,0x00,0x1f,0xc0,0x00,0x00, + 0x00,0x7f,0x00,0x00,0x0f,0xe0,0x00,0x00, + 0x00,0x7f,0x00,0x00,0x0f,0xe0,0x00,0x00, + 0x00,0x7e,0x00,0x00,0x07,0xe0,0x00,0x00, + 0x00,0x7e,0x00,0x00,0x07,0xe0,0x00,0x00, + 0x00,0xfe,0x00,0x00,0x07,0xe0,0x00,0x00, + 0x00,0xfe,0x00,0x00,0x07,0xe0,0x00,0x00, + 0x00,0xfe,0x00,0x00,0x07,0xe0,0x00,0x00, + 0x00,0x7e,0x00,0x00,0x07,0xe0,0x00,0x00, + 0x00,0x7e,0x00,0x00,0x07,0xe0,0x00,0x00, + 0x00,0x7f,0x00,0x00,0x0f,0xe0,0x00,0x00, + 0x00,0x7f,0x00,0x00,0x0f,0xe0,0x00,0x00, + 0x00,0x7f,0x80,0x00,0x1f,0xc0,0x00,0x00, + 0x00,0x3f,0x80,0x00,0x1f,0xc0,0x00,0x00, + 0x00,0x3f,0xc0,0x00,0x3f,0x80,0x00,0x00, + 0x00,0x1f,0xe0,0x00,0xff,0x80,0x00,0x00, + 0x00,0x0f,0xf8,0x01,0xff,0x80,0x00,0x00, + 0x00,0x0f,0xff,0x0f,0xff,0x80,0x00,0x00, + 0x00,0x07,0xff,0xff,0xff,0xc0,0x00,0x00, + 0x00,0x03,0xff,0xff,0xff,0xe0,0x00,0x00, + 0x00,0x01,0xff,0xff,0xff,0xf0,0x00,0x00, + 0x00,0x00,0x7f,0xff,0xef,0xf8,0x00,0x00, + 0x00,0x00,0x1f,0xff,0x87,0xfc,0x00,0x00, + 0x00,0x00,0x03,0xfc,0x03,0xfe,0x00,0x00, + 0x00,0x00,0x00,0x00,0x01,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xff,0x80,0x00, + 0x00,0x00,0x00,0x00,0x00,0x7f,0xc0,0x00, + 0x00,0x00,0x00,0x00,0x00,0x3f,0xe0,0x00, + 0x00,0x00,0x00,0x00,0x00,0x1f,0xf0,0x00, + 0x00,0x00,0x00,0x00,0x00,0x0f,0xf8,0x00, + 0x00,0x00,0x00,0x00,0x00,0x07,0xfc,0x00, + 0x00,0x00,0x00,0x00,0x00,0x03,0xfe,0x00, + 0x00,0x00,0x00,0x00,0x00,0x01,0xff,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x80, + 0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xc0, + 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x80, + 0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +}; + +// width x height = 96,64 (768 bytes) +static const uint8_t camera_96x64[] PROGMEM = { + 0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x0f,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x07,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x03,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x01,0xff,0x00,0x0f,0xff, + 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0x00,0x0f,0xff, + 0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x7f,0x00,0x0f,0xff, + 0x00,0x00,0x00,0x00,0x01,0xff,0xff,0x80,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xe0,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xf0,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xf8,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xfc,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xfe,0x00,0x00,0x00,0x00, + 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xf0,0x3f,0xff,0xff,0xfc,0x3f,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xf0,0x3f,0xff,0xff,0xc0,0x03,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xf0,0x3f,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xf0,0x3f,0xff,0xfc,0x00,0x00,0x3f,0xff,0xff,0xff,0xc0, + 0x03,0xf0,0x3f,0xff,0xf8,0x00,0x00,0x1f,0xff,0xff,0xff,0xc0, + 0x03,0xf0,0x3f,0xff,0xf0,0x00,0x00,0x0f,0xff,0xff,0xff,0xc0, + 0x03,0xf0,0x7f,0xff,0xe0,0x00,0x00,0x07,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xc0,0x1f,0xf8,0x03,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0x80,0x3f,0xfc,0x01,0xff,0xff,0xff,0xc0, + 0x01,0xff,0xff,0xff,0x00,0xff,0xff,0x00,0xff,0xff,0xff,0x80, + 0x00,0x00,0x00,0x00,0x01,0xff,0xff,0x80,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xc0,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xc0,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xe0,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xe0,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xf0,0x00,0x00,0x00,0x00, + 0x03,0xff,0xff,0xfc,0x0f,0xff,0xff,0xf0,0x3f,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xfc,0x0f,0xff,0xff,0xf0,0x3f,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xfc,0x0f,0xff,0xff,0xf0,0x3f,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xfc,0x0f,0xff,0xff,0xf0,0x3f,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xfc,0x0f,0xff,0xff,0xf0,0x3f,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xfc,0x0f,0xff,0xff,0xf0,0x3f,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xfc,0x07,0xff,0xff,0xe0,0x3f,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xfe,0x07,0xff,0xff,0xe0,0x7f,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xfe,0x03,0xff,0xff,0xc0,0x7f,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xfe,0x03,0xff,0xff,0xc0,0x7f,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0x01,0xff,0xff,0x80,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0x00,0xff,0xff,0x00,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0x80,0x7f,0xfe,0x01,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0x80,0x1f,0xf8,0x01,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xc0,0x03,0xc0,0x03,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xe0,0x00,0x00,0x07,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xf0,0x00,0x00,0x0f,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xf8,0x00,0x00,0x1f,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xfe,0x00,0x00,0x7f,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xff,0x80,0x01,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xff,0xf0,0x0f,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0, + 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +}; + +// width x height = 96,64 +static const uint8_t camera_inv_96x64[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xf0,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xf8,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xfc,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xfe,0x00,0xff,0xf0,0x00, + 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xf0,0x00, + 0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0x80,0xff,0xf0,0x00, + 0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x7f,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x1f,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x0f,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x07,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x03,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x01,0xff,0xff,0xff,0xff, + 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x0f,0xc0,0x00,0x00,0x03,0xc0,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x0f,0xc0,0x00,0x00,0x3f,0xfc,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x0f,0xc0,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x0f,0xc0,0x00,0x03,0xff,0xff,0xc0,0x00,0x00,0x00,0x3f, + 0xfc,0x0f,0xc0,0x00,0x07,0xff,0xff,0xe0,0x00,0x00,0x00,0x3f, + 0xfc,0x0f,0xc0,0x00,0x0f,0xff,0xff,0xf0,0x00,0x00,0x00,0x3f, + 0xfc,0x0f,0x80,0x00,0x1f,0xff,0xff,0xf8,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x3f,0xe0,0x07,0xfc,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x7f,0xc0,0x03,0xfe,0x00,0x00,0x00,0x3f, + 0xfe,0x00,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x7f, + 0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x7f,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x3f,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x3f,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x1f,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x1f,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x0f,0xff,0xff,0xff,0xff, + 0xfc,0x00,0x00,0x03,0xf0,0x00,0x00,0x0f,0xc0,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x03,0xf0,0x00,0x00,0x0f,0xc0,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x03,0xf0,0x00,0x00,0x0f,0xc0,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x03,0xf0,0x00,0x00,0x0f,0xc0,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x03,0xf0,0x00,0x00,0x0f,0xc0,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x03,0xf0,0x00,0x00,0x0f,0xc0,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x03,0xf8,0x00,0x00,0x1f,0xc0,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x01,0xf8,0x00,0x00,0x1f,0x80,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x01,0xfc,0x00,0x00,0x3f,0x80,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x01,0xfc,0x00,0x00,0x3f,0x80,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0xfe,0x00,0x00,0x7f,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x7f,0x80,0x01,0xfe,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x7f,0xe0,0x07,0xfe,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x3f,0xfc,0x3f,0xfc,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x1f,0xff,0xff,0xf8,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x0f,0xff,0xff,0xf0,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x07,0xff,0xff,0xe0,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x01,0xff,0xff,0x80,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x00,0x7f,0xfe,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x00,0x0f,0xf0,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f, + 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, +}; + +// width x height = 128,64 (1024 bytes) +static const uint8_t tractor_128x64[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x31,0xc0,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x28,0x70,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x24,0x10,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x23,0x38,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x23,0xec,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x1f,0x84,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x03,0xf8,0x7c,0x00,0x00,0x00,0x1b,0x84,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x0f,0xff,0xff,0xfc,0x00,0x00,0x0e,0x44,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x1c,0x80,0x00,0x1f,0xff,0xfc,0x06,0x2e,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x39,0x00,0x00,0x00,0x30,0x1e,0x6f,0x9f,0xc0,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x39,0x00,0x00,0x00,0x00,0x01,0xfc,0xff,0xe0,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x79,0x00,0x09,0x00,0x08,0x00,0xf8,0xff,0x80,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xf9,0x80,0xf0,0x12,0x4a,0x22,0xf1,0xfe,0x07,0x00,0x00,0x00,0x00,0x00, + 0x00,0x01,0x7c,0x04,0x28,0x00,0x08,0x00,0xf3,0xf3,0xfd,0xc0,0x00,0x00,0x00,0x00, + 0x00,0x01,0x7f,0xf2,0x09,0xff,0xc8,0x00,0xf3,0xf0,0x0c,0xf0,0x00,0x00,0x00,0x00, + 0x00,0x01,0x7c,0x01,0x2f,0xff,0xef,0xff,0x67,0xeb,0xe4,0x78,0x00,0x00,0x00,0x00, + 0x00,0x01,0xff,0xfd,0xbf,0xff,0xc0,0x00,0x7f,0x0f,0xe0,0x38,0x00,0x00,0x00,0x00, + 0x00,0x00,0x7f,0xfd,0x7f,0xff,0xcf,0xff,0xff,0x90,0x20,0x1c,0x00,0x00,0x00,0x00, + 0x00,0x00,0x3c,0x01,0x3f,0xff,0xef,0xff,0xff,0x81,0x00,0x0e,0x00,0x00,0x00,0x00, + 0x00,0x00,0x3f,0xfd,0x3c,0x03,0xef,0xff,0xff,0x67,0x0f,0xce,0x00,0x00,0x00,0x00, + 0x00,0x00,0x7f,0xfc,0x3f,0xff,0xef,0xf0,0xfc,0x5f,0x9f,0xe6,0x00,0x00,0x00,0x00, + 0x00,0x00,0x1c,0x00,0x3f,0xff,0xef,0xc1,0x3c,0x70,0x3f,0xe7,0x00,0x00,0x00,0x00, + 0x00,0x00,0x3f,0xfc,0x3f,0xff,0xff,0x87,0xbe,0xc0,0x70,0x73,0x80,0x00,0x00,0x00, + 0x00,0x00,0x3f,0xfc,0xbf,0xff,0xff,0x87,0xde,0x00,0x67,0xb3,0x00,0x00,0x00,0x00, + 0x00,0x00,0x1c,0x00,0x9b,0x80,0xe0,0x07,0xdc,0x0e,0xef,0xdf,0x00,0x00,0x00,0x00, + 0x00,0x00,0x1c,0x00,0x83,0x80,0xe0,0x07,0x59,0xbc,0xdf,0xef,0x00,0x00,0x00,0x00, + 0x00,0x00,0x3f,0xfc,0x93,0xc0,0xe0,0x77,0x50,0x70,0xe1,0xef,0x00,0x00,0x00,0x00, + 0x00,0x00,0x1c,0x00,0x9f,0xff,0xe0,0x77,0xd8,0xe0,0x80,0xdf,0x80,0x00,0x00,0x00, + 0x00,0x00,0x5f,0xe0,0x9f,0xff,0xe0,0x7a,0xd9,0x80,0x80,0xd7,0xc0,0x00,0x00,0x00, + 0x00,0x01,0xbf,0xfc,0x9f,0xff,0xe0,0xfa,0xbd,0x08,0x80,0xd7,0x80,0x00,0x00,0x00, + 0x00,0x02,0xfc,0x00,0x1f,0xe0,0xf3,0xfc,0x7c,0x1c,0x80,0x77,0x80,0x00,0x00,0x00, + 0x00,0x05,0x3f,0xff,0xdf,0xb0,0x37,0xff,0xf2,0xb8,0x00,0x7f,0x80,0x00,0x00,0x00, + 0x00,0x0a,0x7c,0x00,0x03,0x40,0x1f,0xff,0xf1,0xf0,0x04,0x6f,0x80,0x00,0x00,0x00, + 0x00,0x14,0xfe,0x00,0x06,0x90,0x0f,0xff,0xf1,0x60,0x06,0x6f,0x80,0x00,0x00,0x00, + 0x00,0x15,0xff,0x00,0x0d,0x07,0x8f,0xfe,0xf0,0xc0,0x04,0x63,0xc0,0x00,0x00,0x00, + 0x00,0x2b,0xff,0xff,0xfc,0x4f,0xc7,0xf9,0xf9,0x80,0x04,0x77,0xc0,0x00,0x00,0x00, + 0x00,0x2b,0x9f,0xff,0xfa,0x98,0x67,0xc7,0xfd,0x0c,0x40,0x77,0x80,0x00,0x00,0x00, + 0x00,0x27,0x1f,0xff,0xfa,0xb7,0x34,0x3f,0xfe,0x1c,0x00,0xf7,0x80,0x00,0x00,0x00, + 0x00,0x37,0x01,0xff,0xf8,0x2f,0xb3,0xff,0xfa,0x3c,0x00,0xd7,0x80,0x00,0x00,0x00, + 0x00,0x37,0x00,0xff,0x9c,0x39,0xdb,0xff,0xf9,0x3c,0x00,0xc7,0x80,0x00,0x00,0x00, + 0x00,0x36,0x1c,0xff,0x9c,0x20,0xdb,0xff,0xfc,0x78,0x21,0xaf,0x80,0x00,0x00,0x00, + 0x00,0x36,0x1e,0x3f,0x9c,0x40,0xdb,0xff,0xfe,0xf0,0x13,0x0f,0x80,0x00,0x00,0x00, + 0x00,0x36,0x1f,0xff,0x9c,0x42,0x5b,0xff,0xe6,0xf2,0x1e,0x5f,0x00,0x00,0x00,0x00, + 0x00,0x36,0x1f,0xff,0xfc,0x41,0x5b,0xff,0xc3,0x67,0x00,0x1e,0x00,0x00,0x00,0x00, + 0x00,0x26,0x1f,0xff,0xfc,0x0f,0x5b,0xff,0xc7,0xee,0x00,0x37,0x00,0x00,0x00,0x00, + 0x00,0x27,0x02,0xff,0xfd,0x0e,0x5b,0xff,0xc3,0xfe,0x07,0xe7,0x00,0x00,0x00,0x00, + 0x00,0x37,0x44,0xe0,0x1d,0x00,0xd7,0xff,0x81,0xfc,0xc3,0xc6,0x00,0x00,0x00,0x00, + 0x00,0x1b,0x38,0xe0,0x19,0x00,0x97,0xff,0x80,0xfc,0xc0,0x0c,0x00,0x00,0x00,0x00, + 0x00,0x13,0x81,0xe0,0x1b,0x20,0xb7,0xff,0x00,0xfd,0x80,0x18,0x00,0x00,0x00,0x00, + 0x00,0x1b,0xc3,0xc0,0x0a,0x33,0x27,0xff,0xfc,0xff,0x90,0x3f,0xe0,0x00,0x00,0x00, + 0x00,0x0f,0xff,0xc0,0x0e,0x1e,0x6f,0xff,0xff,0xff,0xb8,0xff,0xe0,0x00,0x00,0x00, + 0x00,0x3f,0xff,0x80,0x0d,0x98,0xcf,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00, + 0x03,0xff,0xff,0xff,0xfd,0x8f,0x9f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x7f,0xff,0xff,0xff,0xff,0xc0,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x0f,0xff,0xff,0x83,0xff,0xc0,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x07,0xe0,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +}; + + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/drawBitmap_kbv/drawBitmap_kbv.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/drawBitmap_kbv/drawBitmap_kbv.ino new file mode 100644 index 0000000..a40ae6c --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/drawBitmap_kbv/drawBitmap_kbv.ino @@ -0,0 +1,160 @@ +#include "MCUFRIEND_kbv.h" +MCUFRIEND_kbv tft; + +#define LOWFLASH (defined(__AVR_ATmega328P__) && defined(MCUFRIEND_KBV_H_)) + +#include "bitmap_mono.h" +#include "bitmap_RGB.h" + +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF +#define GREY 0x8410 +#define ORANGE 0xE880 + +void setup() +{ + Serial.begin(9600); + uint16_t ID = tft.readID(); + + Serial.print(F("ID = 0x")); + Serial.println(ID, HEX); + + Serial.println(F("GFX drawBitmap() plots one mono pixel at a time")); + Serial.println(F("it defaults to transparent plotting")); + Serial.println(F("unless you specify foreground and background colours")); + Serial.println(F("it can plot a monochrome bitmap from Flash or SRAM")); + + Serial.println(F("")); + Serial.println(F("GFX drawGrayscaleBitmap() is not relevant for OLED, TFT")); + Serial.println(F("GFX drawRGBBitmap() plots one colour pixel at a time")); + Serial.println(F("from Flash or SRAM and with a monochrome transparent bitmask")); + Serial.println(F("")); + Serial.println(F("Using the hardware pushColors() methods is faster")); + Serial.println(F("pushColors() expects uint16 array in SRAM")); + Serial.println(F("for any runtime generated images")); + Serial.println(F("but it expects uint8_t array of serialised bytes in Flash")); + Serial.println(F("")); + + Serial.println(F("Colour TFTs are natively big-endian")); + Serial.println(F("Many microcontrollers and Tools are little-endian")); + Serial.println(F("you can use the optional argument to select big-end")); + tft.begin(ID); + // invertmap(betty_1_bmp + 62, 8960); + // while (1); +} + +// GFX drawBitmap() expects each row to be on 8-bit boundary. i.e. pad = 7 +// Mono BMP rows are on 32-bit boundary. i.e. pad = 31, rows are in RVS order. +// FreeFont bitmaps have no padding. i.e. pad = 0. e.g. 5x4 bitmap is in 3 bytes +void showbgd(int x, int y, const uint8_t *bmp, int w, int h, uint16_t color, uint16_t bg, uint8_t pad = 7) +{ + int yy, xx; + uint8_t first = 1, RVS = pad & 0x80; + uint16_t pixel; + pad &= 31; + uint16_t wid = (w + pad) & ~pad; //bits per row + tft.setAddrWindow(x, y, x + w - 1, y + h - 1); // + for (yy = 0; yy < h; yy++) { + uint32_t ofs = (RVS ? (h - yy - 1) : yy) * wid; //bit offset + const uint8_t *p = bmp + (ofs >> 3); //flash address + uint8_t mask = 0x80 >> (ofs & 7); //bit mask + uint8_t c = pgm_read_byte(p++); + for (xx = 0; xx < w; xx++) { + if (mask == 0) { + c = pgm_read_byte(p++); + mask = 0x80; + } + pixel = (c & mask) ? color : bg; + tft.pushColors(&pixel, 1, first); + first = 0; + mask >>= 1; + } + } + tft.setAddrWindow(0, 0, tft.width() - 1, tft.height() - 1); +} + +void msg_time(int x, int y, String msg, uint32_t t) +{ + t = millis() - t; + tft.setCursor(x, y); + tft.print(msg); + tft.print(t); + tft.print(F("ms")); +} + +void loop(void) +{ + int x = 5, y, w = 128, h = 64; + uint32_t t; + const int SZ = w * h / 8; + uint8_t sram[SZ]; + memcpy_P(sram, tractor_128x64, SZ); + + tft.fillScreen(BLACK); + y = 0; t = millis(); + tft.drawBitmap(x, y, tractor_128x64, 128, 64, BLUE); + msg_time(0, y + 66, F("drawBitmap() transparent flash "), t); + y = 80; t = millis(); + tft.drawBitmap(x, y, tractor_128x64, 128, 64, RED, YELLOW); + msg_time(0, y + 66, F("drawBitmap() background flash "), t); + y = 160; t = millis(); + tft.fillRect(x, y, w, h, GREY); + tft.drawBitmap(x, y, sram, 128, 64, GREEN); + msg_time(0, y + 66, F("drawBitmap() fill bgd SRAM "), t); + y = 240; t = millis(); + showbgd(x, y, tractor_128x64, 128, 64, MAGENTA, YELLOW); + msg_time(0, y + 66, F("pushColors() background flash "), t); + delay(5000); + + tft.fillScreen(BLACK); + y = 0; t = millis(); + tft.drawRGBBitmap(x, y, marilyn_64x64, 64, 64); + msg_time(0, y + 66, "drawRGBBitmap() flash ", t); + y = 80; t = millis(); + tft.setAddrWindow(x, y, x + 64 - 1, y + 64 - 1); + tft.pushColors((const uint8_t*)marilyn_64x64, 64 * 64, 1, false); + tft.setAddrWindow(0, 0, tft.width() - 1, tft.height() - 1); + msg_time(0, y + 66, F("pushColors() flash "), t); + y = 160; t = millis(); + w = 64; + tft.fillRect(x, y, w, h, GREY); + tft.drawRGBBitmap(x, y, marilyn_64x64, magnify_64x64, 64, 64); + msg_time(0, y + 66, F("drawRGBBitmap() with mask "), t); + y = 240; t = millis(); + w = 64; + tft.fillRect(x, y, w, h, GREY); + tft.drawRGBBitmap(x, y, marilyn_64x64, magnify_inv_64x64, 64, 64); + msg_time(0, y + 66, F("drawRGBBitmap() with mask "), t); + delay(5000); + +#if !LOWFLASH + tft.fillScreen(BLACK); + y = 0; t = millis(); + tft.drawRGBBitmap(x, y, tractor10_96x64, 96, 64); + msg_time(0, y + 66, "drawRGBBitmap() flash ", t); + y = 80; t = millis(); + tft.setAddrWindow(x, y, x + 96 - 1, y + 64 - 1); + tft.pushColors((const uint8_t*)tractor10_96x64, 96 * 64, 1, false); + tft.setAddrWindow(0, 0, tft.width() - 1, tft.height() - 1); + msg_time(0, y + 66, F("pushColors() flash "), t); + y = 160; t = millis(); + w = 96; + tft.fillRect(x, y, w, h, GREY); + tft.drawRGBBitmap(x, y, tractor10_96x64, camera_96x64, 96, 64); + msg_time(0, y + 66, F("drawRGBBitmap() with mask "), t); + y = 240; t = millis(); + w = 96; + tft.fillRect(x, y, w, h, GREY); + tft.drawRGBBitmap(x, y, tractor10_96x64, camera_inv_96x64, 96, 64); + msg_time(0, y + 66, F("drawRGBBitmap() with mask "), t); + delay(5000); +#endif +} + + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_kbv/graphictest_kbv.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_kbv/graphictest_kbv.ino new file mode 100644 index 0000000..916b5a2 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_kbv/graphictest_kbv.ino @@ -0,0 +1,586 @@ +// All the mcufriend.com UNO shields have the same pinout. +// i.e. control pins A0-A4. Data D2-D9. microSD D10-D13. +// Touchscreens are normally A1, A2, D7, D6 but the order varies +// +// This demo should work with most Adafruit TFT libraries +// If you are not using a shield, use a full Adafruit constructor() +// e.g. Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); + +#define LCD_CS A3 // Chip Select goes to Analog 3 +#define LCD_CD A2 // Command/Data goes to Analog 2 +#define LCD_WR A1 // LCD Write goes to Analog 1 +#define LCD_RD A0 // LCD Read goes to Analog 0 +#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin + +#include // f.k. for Arduino-1.5.2 +#include "Adafruit_GFX.h"// Hardware-specific library +#include +MCUFRIEND_kbv tft; +//#include +//Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); + +// Assign human-readable names to some common 16-bit color values: +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF + +#ifndef min +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#endif + +void setup(void); +void loop(void); +unsigned long testFillScreen(); +unsigned long testText(); +unsigned long testLines(uint16_t color); +unsigned long testFastLines(uint16_t color1, uint16_t color2); +unsigned long testRects(uint16_t color); +unsigned long testFilledRects(uint16_t color1, uint16_t color2); +unsigned long testFilledCircles(uint8_t radius, uint16_t color); +unsigned long testCircles(uint8_t radius, uint16_t color); +unsigned long testTriangles(); +unsigned long testFilledTriangles(); +unsigned long testRoundRects(); +unsigned long testFilledRoundRects(); +void progmemPrint(const char *str); +void progmemPrintln(const char *str); + +void runtests(void); + +uint16_t g_identifier; + +extern const uint8_t hanzi[]; +void showhanzi(unsigned int x, unsigned int y, unsigned char index) +{ + uint8_t i, j, c, first = 1; + uint8_t *temp = (uint8_t*)hanzi; + uint16_t color; + tft.setAddrWindow(x, y, x + 31, y + 31); //设置区域 + temp += index * 128; + for (j = 0; j < 128; j++) + { + c = pgm_read_byte(temp); + for (i = 0; i < 8; i++) + { + if ((c & (1 << i)) != 0) + { + color = RED; + } + else + { + color = BLACK; + } + tft.pushColors(&color, 1, first); + first = 0; + } + temp++; + } +} + +void setup(void) { + Serial.begin(9600); + uint32_t when = millis(); + // while (!Serial) ; //hangs a Leonardo until you connect a Serial + if (!Serial) delay(5000); //allow some time for Leonardo + Serial.println("Serial took " + String((millis() - when)) + "ms to start"); + // tft.reset(); //hardware reset + uint16_t ID = tft.readID(); // + Serial.print("ID = 0x"); + Serial.println(ID, HEX); + if (ID == 0xD3D3) ID = 0x9481; // write-only shield +// ID = 0x9329; // force ID + tft.begin(ID); +} + +#if defined(MCUFRIEND_KBV_H_) +uint16_t scrollbuf[320]; // my biggest screen is 320x480 +#define READGRAM(x, y, buf, w, h) tft.readGRAM(x, y, buf, w, h) +#else +uint16_t scrollbuf[320]; // Adafruit only does 240x320 +// Adafruit can read a block by one pixel at a time +int16_t READGRAM(int16_t x, int16_t y, uint16_t *block, int16_t w, int16_t h) +{ + uint16_t *p; + for (int row = 0; row < h; row++) { + p = block + row * w; + for (int col = 0; col < w; col++) { + *p++ = tft.readPixel(x + col, y + row); + } + } +} +#endif + +void windowScroll(int16_t x, int16_t y, int16_t wid, int16_t ht, int16_t dx, int16_t dy, uint16_t *buf) +{ + if (dx) for (int16_t row = 0; row < ht; row++) { + READGRAM(x, y + row, buf, wid, 1); + tft.setAddrWindow(x, y + row, x + wid - 1, y + row); + tft.pushColors(buf + dx, wid - dx, 1); + tft.pushColors(buf + 0, dx, 0); + } + if (dy) for (int16_t col = 0; col < wid; col++) { + READGRAM(x + col, y, buf, 1, ht); + tft.setAddrWindow(x + col, y, x + col, y + ht - 1); + tft.pushColors(buf + dy, ht - dy, 1); + tft.pushColors(buf + 0, dy, 0); + } +} + +void printmsg(int row, const char *msg) +{ + tft.setTextColor(YELLOW, BLACK); + tft.setCursor(0, row); + tft.println(msg); +} + +void loop(void) { + uint8_t aspect; + uint16_t pixel; + const char *aspectname[] = { + "PORTRAIT", "LANDSCAPE", "PORTRAIT_REV", "LANDSCAPE_REV" + }; + const char *colorname[] = { "BLUE", "GREEN", "RED", "GRAY" }; + uint16_t colormask[] = { 0x001F, 0x07E0, 0xF800, 0xFFFF }; + uint16_t dx, rgb, n, wid, ht, msglin; + tft.setRotation(0); + runtests(); + delay(2000); + if (tft.height() > 64) { + for (uint8_t cnt = 0; cnt < 4; cnt++) { + aspect = (cnt + 0) & 3; + tft.setRotation(aspect); + wid = tft.width(); + ht = tft.height(); + msglin = (ht > 160) ? 200 : 112; + testText(); + dx = wid / 32; + for (n = 0; n < 32; n++) { + rgb = n * 8; + rgb = tft.color565(rgb, rgb, rgb); + tft.fillRect(n * dx, 48, dx, 63, rgb & colormask[aspect]); + } + tft.drawRect(0, 48 + 63, wid, 1, WHITE); + tft.setTextSize(2); + tft.setTextColor(colormask[aspect], BLACK); + tft.setCursor(0, 72); + tft.print(colorname[aspect]); + tft.setTextColor(WHITE); + tft.println(" COLOR GRADES"); + tft.setTextColor(WHITE, BLACK); + printmsg(184, aspectname[aspect]); + delay(1000); + tft.drawPixel(0, 0, YELLOW); + pixel = tft.readPixel(0, 0); + tft.setTextSize((ht > 160) ? 2 : 1); //for messages +#if defined(MCUFRIEND_KBV_H_) +#if 1 + extern const uint8_t penguin[]; + tft.setAddrWindow(wid - 40 - 40, 20 + 0, wid - 1 - 40, 20 + 39); + tft.pushColors(penguin, 1600, 1); +#elif 1 + extern const uint8_t wifi_full[]; + tft.setAddrWindow(wid - 40 - 40, 20 + 0, wid - 40 - 40 + 31, 20 + 31); + tft.pushColors(wifi_full, 1024, 1, true); +#elif 1 + extern const uint8_t icon_40x40[]; + tft.setAddrWindow(wid - 40 - 40, 20 + 0, wid - 1 - 40, 20 + 39); + tft.pushColors(icon_40x40, 1600, 1); +#endif + tft.setAddrWindow(0, 0, wid - 1, ht - 1); + if (aspect & 1) tft.drawRect(wid - 1, 0, 1, ht, WHITE); + else tft.drawRect(0, ht - 1, wid, 1, WHITE); + printmsg(msglin, "VERTICAL SCROLL UP"); + uint16_t maxscroll; + if (tft.getRotation() & 1) maxscroll = wid; + else maxscroll = ht; + for (uint16_t i = 1; i <= maxscroll; i++) { + tft.vertScroll(0, maxscroll, i); + delay(10); + } + delay(1000); + printmsg(msglin, "VERTICAL SCROLL DN"); + for (uint16_t i = 1; i <= maxscroll; i++) { + tft.vertScroll(0, maxscroll, 0 - (int16_t)i); + delay(10); + } + tft.vertScroll(0, maxscroll, 0); + printmsg(msglin, "SCROLL DISABLED "); + + delay(1000); + if ((aspect & 1) == 0) { //Portrait + tft.setTextColor(BLUE, BLACK); + printmsg(msglin, "ONLY THE COLOR BAND"); + for (uint16_t i = 1; i <= 64; i++) { + tft.vertScroll(48, 64, i); + delay(20); + } + delay(1000); + } +#endif + tft.setTextColor(YELLOW, BLACK); + if (pixel == YELLOW) { + printmsg(msglin, "SOFTWARE SCROLL "); +#if 0 + // diagonal scroll of block + for (int16_t i = 45, dx = 2, dy = 1; i > 0; i -= dx) { + windowScroll(24, 8, 90, 40, dx, dy, scrollbuf); + } +#else + // plain horizontal scroll of block + n = (wid > 320) ? 320 : wid; + for (int16_t i = n, dx = 4, dy = 0; i > 0; i -= dx) { + windowScroll(0, 200, n, 16, dx, dy, scrollbuf); + } +#endif + } + else if (pixel == CYAN) + tft.println("readPixel() reads as BGR"); + else if ((pixel & 0xF8F8) == 0xF8F8) + tft.println("readPixel() should be 24-bit"); + else { + tft.print("readPixel() reads 0x"); + tft.println(pixel, HEX); + } + delay(5000); + } + } + printmsg(msglin, "INVERT DISPLAY "); + tft.invertDisplay(true); + delay(2000); + tft.invertDisplay(false); +} + +typedef struct { + PGM_P msg; + uint32_t ms; +} TEST; +TEST result[12]; + +#define RUNTEST(n, str, test) { result[n].msg = PSTR(str); result[n].ms = test; delay(500); } + +void runtests(void) +{ + uint8_t i, len = 24, cnt; + uint32_t total; + RUNTEST(0, "FillScreen ", testFillScreen()); + RUNTEST(1, "Text ", testText()); + RUNTEST(2, "Lines ", testLines(CYAN)); + RUNTEST(3, "Horiz/Vert Lines ", testFastLines(RED, BLUE)); + RUNTEST(4, "Rectangles (outline) ", testRects(GREEN)); + RUNTEST(5, "Rectangles (filled) ", testFilledRects(YELLOW, MAGENTA)); + RUNTEST(6, "Circles (filled) ", testFilledCircles(10, MAGENTA)); + RUNTEST(7, "Circles (outline) ", testCircles(10, WHITE)); + RUNTEST(8, "Triangles (outline) ", testTriangles()); + RUNTEST(9, "Triangles (filled) ", testFilledTriangles()); + RUNTEST(10, "Rounded rects (outline) ", testRoundRects()); + RUNTEST(11, "Rounded rects (filled) ", testFilledRoundRects()); + + tft.fillScreen(BLACK); + tft.setTextColor(GREEN); + tft.setCursor(0, 0); + uint16_t wid = tft.width(); + if (wid > 176) { + tft.setTextSize(2); +#if defined(MCUFRIEND_KBV_H_) + tft.print("MCUFRIEND "); +#if MCUFRIEND_KBV_H_ != 0 + tft.print(0.01 * MCUFRIEND_KBV_H_, 2); +#else + tft.print("for"); +#endif + tft.println(" UNO"); +#else + tft.println("Adafruit-Style Tests"); +#endif + } else len = wid / 6 - 8; + tft.setTextSize(1); + total = 0; + for (i = 0; i < 12; i++) { + PGM_P str = result[i].msg; + char c; + if (len > 24) { + if (i < 10) tft.print(" "); + tft.print(i); + tft.print(": "); + } + uint8_t cnt = len; + while ((c = pgm_read_byte(str++)) && cnt--) tft.print(c); + tft.print(" "); + tft.println(result[i].ms); + total += result[i].ms; + } + tft.setTextSize(2); + tft.print("Total:"); + tft.print(0.000001 * total); + tft.println("sec"); + g_identifier = tft.readID(); + tft.print("ID: 0x"); + tft.println(tft.readID(), HEX); +// tft.print("Reg(00):0x"); +// tft.println(tft.readReg(0x00), HEX); + tft.print("F_CPU:"); + tft.print(0.000001 * F_CPU); +#if defined(__OPTIMIZE_SIZE__) + tft.println("MHz -Os"); +#else + tft.println("MHz"); +#endif + + delay(10000); +} + +// Standard Adafruit tests. will adjust to screen size + +unsigned long testFillScreen() { + unsigned long start = micros(); + tft.fillScreen(BLACK); + tft.fillScreen(RED); + tft.fillScreen(GREEN); + tft.fillScreen(BLUE); + tft.fillScreen(BLACK); + return micros() - start; +} + +unsigned long testText() { + unsigned long start; + tft.fillScreen(BLACK); + start = micros(); + tft.setCursor(0, 0); + tft.setTextColor(WHITE); tft.setTextSize(1); + tft.println("Hello World!"); + tft.setTextColor(YELLOW); tft.setTextSize(2); + tft.println(123.45); + tft.setTextColor(RED); tft.setTextSize(3); + tft.println(0xDEADBEEF, HEX); + tft.println(); + tft.setTextColor(GREEN); + tft.setTextSize(5); + tft.println("Groop"); + tft.setTextSize(2); + tft.println("I implore thee,"); + tft.setTextSize(1); + tft.println("my foonting turlingdromes."); + tft.println("And hooptiously drangle me"); + tft.println("with crinkly bindlewurdles,"); + tft.println("Or I will rend thee"); + tft.println("in the gobberwarts"); + tft.println("with my blurglecruncheon,"); + tft.println("see if I don't!"); + return micros() - start; +} + +unsigned long testLines(uint16_t color) { + unsigned long start, t; + int x1, y1, x2, y2, + w = tft.width(), + h = tft.height(); + + tft.fillScreen(BLACK); + + x1 = y1 = 0; + y2 = h - 1; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = w - 1; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + t = micros() - start; // fillScreen doesn't count against timing + + tft.fillScreen(BLACK); + + x1 = w - 1; + y1 = 0; + y2 = h - 1; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = 0; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + t += micros() - start; + + tft.fillScreen(BLACK); + + x1 = 0; + y1 = h - 1; + y2 = 0; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = w - 1; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + t += micros() - start; + + tft.fillScreen(BLACK); + + x1 = w - 1; + y1 = h - 1; + y2 = 0; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = 0; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + + return micros() - start; +} + +unsigned long testFastLines(uint16_t color1, uint16_t color2) { + unsigned long start; + int x, y, w = tft.width(), h = tft.height(); + + tft.fillScreen(BLACK); + start = micros(); + for (y = 0; y < h; y += 5) tft.drawFastHLine(0, y, w, color1); + for (x = 0; x < w; x += 5) tft.drawFastVLine(x, 0, h, color2); + + return micros() - start; +} + +unsigned long testRects(uint16_t color) { + unsigned long start; + int n, i, i2, + cx = tft.width() / 2, + cy = tft.height() / 2; + + tft.fillScreen(BLACK); + n = min(tft.width(), tft.height()); + start = micros(); + for (i = 2; i < n; i += 6) { + i2 = i / 2; + tft.drawRect(cx - i2, cy - i2, i, i, color); + } + + return micros() - start; +} + +unsigned long testFilledRects(uint16_t color1, uint16_t color2) { + unsigned long start, t = 0; + int n, i, i2, + cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + n = min(tft.width(), tft.height()); + for (i = n; i > 0; i -= 6) { + i2 = i / 2; + start = micros(); + tft.fillRect(cx - i2, cy - i2, i, i, color1); + t += micros() - start; + // Outlines are not included in timing results + tft.drawRect(cx - i2, cy - i2, i, i, color2); + } + + return t; +} + +unsigned long testFilledCircles(uint8_t radius, uint16_t color) { + unsigned long start; + int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2; + + tft.fillScreen(BLACK); + start = micros(); + for (x = radius; x < w; x += r2) { + for (y = radius; y < h; y += r2) { + tft.fillCircle(x, y, radius, color); + } + } + + return micros() - start; +} + +unsigned long testCircles(uint8_t radius, uint16_t color) { + unsigned long start; + int x, y, r2 = radius * 2, + w = tft.width() + radius, + h = tft.height() + radius; + + // Screen is not cleared for this one -- this is + // intentional and does not affect the reported time. + start = micros(); + for (x = 0; x < w; x += r2) { + for (y = 0; y < h; y += r2) { + tft.drawCircle(x, y, radius, color); + } + } + + return micros() - start; +} + +unsigned long testTriangles() { + unsigned long start; + int n, i, cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + n = min(cx, cy); + start = micros(); + for (i = 0; i < n; i += 5) { + tft.drawTriangle( + cx , cy - i, // peak + cx - i, cy + i, // bottom left + cx + i, cy + i, // bottom right + tft.color565(0, 0, i)); + } + + return micros() - start; +} + +unsigned long testFilledTriangles() { + unsigned long start, t = 0; + int i, cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + start = micros(); + for (i = min(cx, cy); i > 10; i -= 5) { + start = micros(); + tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, + tft.color565(0, i, i)); + t += micros() - start; + tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, + tft.color565(i, i, 0)); + } + + return t; +} + +unsigned long testRoundRects() { + unsigned long start; + int w, i, i2, red, step, + cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + w = min(tft.width(), tft.height()); + start = micros(); + red = 0; + step = (256 * 6) / w; + for (i = 0; i < w; i += 6) { + i2 = i / 2; + red += step; + tft.drawRoundRect(cx - i2, cy - i2, i, i, i / 8, tft.color565(red, 0, 0)); + } + + return micros() - start; +} + +unsigned long testFilledRoundRects() { + unsigned long start; + int i, i2, green, step, + cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + start = micros(); + green = 256; + step = (256 * 6) / min(tft.width(), tft.height()); + for (i = min(tft.width(), tft.height()); i > 20; i -= 6) { + i2 = i / 2; + green -= step; + tft.fillRoundRect(cx - i2, cy - i2, i, i, i / 8, tft.color565(0, green, 0)); + } + + return micros() - start; +} + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_kbv/icons.c b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_kbv/icons.c new file mode 100644 index 0000000..d973df6 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_kbv/icons.c @@ -0,0 +1,542 @@ +#if defined(__arm__) || defined(ESP8266) || defined(ESP32) +#define PROGMEM +#else +#include +#endif + +const unsigned char PROGMEM penguin[3200] = { /* 0X00,0X10,0X28,0X00,0X28,0X00,0X01,0X1B, */ + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF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, 0X7D, 0XEF, 0XCE, 0X83, 0X82, 0X88, 0X00, 0XF8, 0XC4, 0XD8, + 0X0C, 0XF3, 0X8A, 0XFA, 0X82, 0XE8, 0X82, 0XB0, 0X45, 0X69, 0XC7, 0X51, 0X08, 0X42, 0X08, 0X3A, + 0X86, 0X5A, 0X83, 0X9B, 0XA2, 0XBC, 0X22, 0XCD, 0X21, 0XCD, 0XA1, 0XC4, 0X22, 0XB4, 0XC4, 0X7A, + 0X06, 0X3A, 0X86, 0X29, 0X45, 0X29, 0X05, 0X31, 0XC4, 0X50, 0X41, 0X90, 0X00, 0XC0, 0X00, 0XA8, + 0X00, 0XA0, 0X00, 0XA8, 0X00, 0X30, 0X4A, 0X4A, 0XBA, 0XD6, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0X7D, 0XEF, 0X8E, 0X73, 0XC3, 0X18, 0X05, 0X39, 0X82, 0XA8, 0X00, 0XF8, + 0XC3, 0XF8, 0X4D, 0XFB, 0X4D, 0XFB, 0XC7, 0XF9, 0XC3, 0XF0, 0X82, 0XD8, 0XC3, 0XB0, 0X04, 0X81, + 0X45, 0X61, 0X46, 0X51, 0X86, 0X49, 0X86, 0X49, 0X46, 0X41, 0X45, 0X41, 0X45, 0X41, 0X45, 0X41, + 0X05, 0X49, 0X04, 0X61, 0X82, 0X90, 0X41, 0XB0, 0X00, 0XD0, 0X00, 0XC8, 0X00, 0XA8, 0X00, 0XA8, + 0X00, 0XB8, 0X41, 0X58, 0X82, 0X10, 0X82, 0X10, 0XB2, 0X94, 0XBE, 0XF7, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XBE, 0XF7, 0XCF, 0X7B, 0X82, 0X10, 0X04, 0X21, 0X86, 0X29, 0X86, 0X41, 0X04, 0X99, + 0X40, 0XE8, 0X41, 0XF8, 0X86, 0XF9, 0XCB, 0XFA, 0X49, 0XFA, 0X82, 0XF8, 0X00, 0XF8, 0X00, 0XF0, + 0X00, 0XE8, 0X41, 0XD8, 0X41, 0XD0, 0X41, 0XC0, 0X41, 0XC0, 0X41, 0XC0, 0X41, 0XC0, 0X41, 0XC8, + 0X00, 0XD0, 0X00, 0XE0, 0X00, 0XE0, 0X00, 0XD8, 0X00, 0XD0, 0X00, 0XB8, 0X00, 0XA8, 0X41, 0X88, + 0X82, 0X48, 0X82, 0X10, 0X82, 0X10, 0X00, 0X00, 0X45, 0X29, 0X79, 0XCE, 0XFF, 0XFF, 0XFF, 0XFF, + 0XBE, 0XF7, 0XF3, 0X9C, 0X82, 0X10, 0XC3, 0X18, 0X45, 0X29, 0X86, 0X31, 0XC7, 0X31, 0X30, 0X7C, + 0XF3, 0XDC, 0X86, 0XE1, 0X00, 0XF0, 0X00, 0XF8, 0X41, 0XF8, 0X41, 0XF8, 0X00, 0XF8, 0X00, 0XF8, + 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, + 0X00, 0XE8, 0X00, 0XE0, 0X00, 0XE0, 0X00, 0XD8, 0X00, 0XC8, 0X41, 0XA0, 0X8A, 0X9A, 0X0C, 0X63, + 0X04, 0X11, 0X82, 0X10, 0X82, 0X10, 0X41, 0X08, 0X00, 0X00, 0X4D, 0X6B, 0X7D, 0XEF, 0XFF, 0XFF, + 0XFB, 0XDE, 0X08, 0X42, 0X42, 0X10, 0X45, 0X29, 0X86, 0X31, 0X86, 0X31, 0X49, 0X4A, 0X38, 0XBE, + 0XFF, 0XFF, 0X38, 0XD6, 0X86, 0XA9, 0X00, 0XC8, 0X00, 0XE0, 0X00, 0XF0, 0X00, 0XF8, 0X00, 0XF8, + 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF0, 0X00, 0XF0, + 0X00, 0XE8, 0X00, 0XE0, 0X00, 0XD0, 0XC3, 0X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2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0x59, 0x42, + 0x79, 0xC3, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0x59, 0x42, + 0x51, 0x42, 0x79, 0xC3, 0x79, 0xC3, 0x9A, 0x23, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, + 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, + 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, + 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0x92, 0x23, 0x79, 0xC3, 0x79, 0xC3, 0x38, 0xE1, +}; diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_opensmart/graphictest_opensmart.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_opensmart/graphictest_opensmart.ino new file mode 100644 index 0000000..a10660b --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_opensmart/graphictest_opensmart.ino @@ -0,0 +1,586 @@ +// All the mcufriend.com UNO shields have the same pinout. +// i.e. control pins A0-A4. Data D2-D9. microSD D10-D13. +// Touchscreens are normally A1, A2, D7, D6 but the order varies +// +// This demo should work with most Adafruit TFT libraries +// If you are not using a shield, use a full Adafruit constructor() +// e.g. Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); + +#define LCD_CS A3 // Chip Select goes to Analog 3 +#define LCD_CD A2 // Command/Data goes to Analog 2 +#define LCD_WR A1 // LCD Write goes to Analog 1 +#define LCD_RD A0 // LCD Read goes to Analog 0 +#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin + +#include // f.k. for Arduino-1.5.2 +#include "Adafruit_GFX.h"// Hardware-specific library +#include +OPENSMART_kbv tft; +//#include +//Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); + +// Assign human-readable names to some common 16-bit color values: +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF + +#ifndef min +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#endif + +void setup(void); +void loop(void); +unsigned long testFillScreen(); +unsigned long testText(); +unsigned long testLines(uint16_t color); +unsigned long testFastLines(uint16_t color1, uint16_t color2); +unsigned long testRects(uint16_t color); +unsigned long testFilledRects(uint16_t color1, uint16_t color2); +unsigned long testFilledCircles(uint8_t radius, uint16_t color); +unsigned long testCircles(uint8_t radius, uint16_t color); +unsigned long testTriangles(); +unsigned long testFilledTriangles(); +unsigned long testRoundRects(); +unsigned long testFilledRoundRects(); +void progmemPrint(const char *str); +void progmemPrintln(const char *str); + +void runtests(void); + +uint16_t g_identifier; + +extern const uint8_t hanzi[]; +void showhanzi(unsigned int x, unsigned int y, unsigned char index) +{ + uint8_t i, j, c, first = 1; + uint8_t *temp = (uint8_t*)hanzi; + uint16_t color; + tft.setAddrWindow(x, y, x + 31, y + 31); //设置区域 + temp += index * 128; + for (j = 0; j < 128; j++) + { + c = pgm_read_byte(temp); + for (i = 0; i < 8; i++) + { + if ((c & (1 << i)) != 0) + { + color = RED; + } + else + { + color = BLACK; + } + tft.pushColors(&color, 1, first); + first = 0; + } + temp++; + } +} + +void setup(void) { + Serial.begin(9600); + uint32_t when = millis(); + // while (!Serial) ; //hangs a Leonardo until you connect a Serial + if (!Serial) delay(5000); //allow some time for Leonardo + Serial.println("Serial took " + String((millis() - when)) + "ms to start"); + // tft.reset(); //hardware reset + uint16_t ID = tft.readID(); // + Serial.print("ID = 0x"); + Serial.println(ID, HEX); + if (ID == 0xD3D3) ID = 0x9481; // write-only shield +// ID = 0x9329; // force ID + tft.begin(ID); +} + +#if defined(MCUFRIEND_KBV_H_) +uint16_t scrollbuf[320]; // my biggest screen is 320x480 +#define READGRAM(x, y, buf, w, h) tft.readGRAM(x, y, buf, w, h) +#else +uint16_t scrollbuf[320]; // Adafruit only does 240x320 +// Adafruit can read a block by one pixel at a time +int16_t READGRAM(int16_t x, int16_t y, uint16_t *block, int16_t w, int16_t h) +{ + uint16_t *p; + for (int row = 0; row < h; row++) { + p = block + row * w; + for (int col = 0; col < w; col++) { + *p++ = tft.readPixel(x + col, y + row); + } + } +} +#endif + +void windowScroll(int16_t x, int16_t y, int16_t wid, int16_t ht, int16_t dx, int16_t dy, uint16_t *buf) +{ + if (dx) for (int16_t row = 0; row < ht; row++) { + READGRAM(x, y + row, buf, wid, 1); + tft.setAddrWindow(x, y + row, x + wid - 1, y + row); + tft.pushColors(buf + dx, wid - dx, 1); + tft.pushColors(buf + 0, dx, 0); + } + if (dy) for (int16_t col = 0; col < wid; col++) { + READGRAM(x + col, y, buf, 1, ht); + tft.setAddrWindow(x + col, y, x + col, y + ht - 1); + tft.pushColors(buf + dy, ht - dy, 1); + tft.pushColors(buf + 0, dy, 0); + } +} + +void printmsg(int row, const char *msg) +{ + tft.setTextColor(YELLOW, BLACK); + tft.setCursor(0, row); + tft.println(msg); +} + +void loop(void) { + uint8_t aspect; + uint16_t pixel; + const char *aspectname[] = { + "PORTRAIT", "LANDSCAPE", "PORTRAIT_REV", "LANDSCAPE_REV" + }; + const char *colorname[] = { "BLUE", "GREEN", "RED", "GRAY" }; + uint16_t colormask[] = { 0x001F, 0x07E0, 0xF800, 0xFFFF }; + uint16_t dx, rgb, n, wid, ht, msglin; + tft.setRotation(0); + runtests(); + delay(2000); + if (tft.height() > 64) { + for (uint8_t cnt = 0; cnt < 4; cnt++) { + aspect = (cnt + 0) & 3; + tft.setRotation(aspect); + wid = tft.width(); + ht = tft.height(); + msglin = (ht > 160) ? 200 : 112; + testText(); + dx = wid / 32; + for (n = 0; n < 32; n++) { + rgb = n * 8; + rgb = tft.color565(rgb, rgb, rgb); + tft.fillRect(n * dx, 48, dx, 63, rgb & colormask[aspect]); + } + tft.drawRect(0, 48 + 63, wid, 1, WHITE); + tft.setTextSize(2); + tft.setTextColor(colormask[aspect], BLACK); + tft.setCursor(0, 72); + tft.print(colorname[aspect]); + tft.setTextColor(WHITE); + tft.println(" COLOR GRADES"); + tft.setTextColor(WHITE, BLACK); + printmsg(184, aspectname[aspect]); + delay(1000); + tft.drawPixel(0, 0, YELLOW); + pixel = tft.readPixel(0, 0); + tft.setTextSize((ht > 160) ? 2 : 1); //for messages +#if defined(MCUFRIEND_KBV_H_) +#if 1 + extern const uint8_t penguin[]; + tft.setAddrWindow(wid - 40 - 40, 20 + 0, wid - 1 - 40, 20 + 39); + tft.pushColors(penguin, 1600, 1); +#elif 1 + extern const uint8_t wifi_full[]; + tft.setAddrWindow(wid - 40 - 40, 20 + 0, wid - 40 - 40 + 31, 20 + 31); + tft.pushColors(wifi_full, 1024, 1, true); +#elif 1 + extern const uint8_t icon_40x40[]; + tft.setAddrWindow(wid - 40 - 40, 20 + 0, wid - 1 - 40, 20 + 39); + tft.pushColors(icon_40x40, 1600, 1); +#endif + tft.setAddrWindow(0, 0, wid - 1, ht - 1); + if (aspect & 1) tft.drawRect(wid - 1, 0, 1, ht, WHITE); + else tft.drawRect(0, ht - 1, wid, 1, WHITE); + printmsg(msglin, "VERTICAL SCROLL UP"); + uint16_t maxscroll; + if (tft.getRotation() & 1) maxscroll = wid; + else maxscroll = ht; + for (uint16_t i = 1; i <= maxscroll; i++) { + tft.vertScroll(0, maxscroll, i); + delay(10); + } + delay(1000); + printmsg(msglin, "VERTICAL SCROLL DN"); + for (uint16_t i = 1; i <= maxscroll; i++) { + tft.vertScroll(0, maxscroll, 0 - (int16_t)i); + delay(10); + } + tft.vertScroll(0, maxscroll, 0); + printmsg(msglin, "SCROLL DISABLED "); + + delay(1000); + if ((aspect & 1) == 0) { //Portrait + tft.setTextColor(BLUE, BLACK); + printmsg(msglin, "ONLY THE COLOR BAND"); + for (uint16_t i = 1; i <= 64; i++) { + tft.vertScroll(48, 64, i); + delay(20); + } + delay(1000); + } +#endif + tft.setTextColor(YELLOW, BLACK); + if (pixel == YELLOW) { + printmsg(msglin, "SOFTWARE SCROLL "); +#if 0 + // diagonal scroll of block + for (int16_t i = 45, dx = 2, dy = 1; i > 0; i -= dx) { + windowScroll(24, 8, 90, 40, dx, dy, scrollbuf); + } +#else + // plain horizontal scroll of block + n = (wid > 320) ? 320 : wid; + for (int16_t i = n, dx = 4, dy = 0; i > 0; i -= dx) { + windowScroll(0, 200, n, 16, dx, dy, scrollbuf); + } +#endif + } + else if (pixel == CYAN) + tft.println("readPixel() reads as BGR"); + else if ((pixel & 0xF8F8) == 0xF8F8) + tft.println("readPixel() should be 24-bit"); + else { + tft.print("readPixel() reads 0x"); + tft.println(pixel, HEX); + } + delay(5000); + } + } + printmsg(msglin, "INVERT DISPLAY "); + tft.invertDisplay(true); + delay(2000); + tft.invertDisplay(false); +} + +typedef struct { + PGM_P msg; + uint32_t ms; +} TEST; +TEST result[12]; + +#define RUNTEST(n, str, test) { result[n].msg = PSTR(str); result[n].ms = test; delay(500); } + +void runtests(void) +{ + uint8_t i, len = 24, cnt; + uint32_t total; + RUNTEST(0, "FillScreen ", testFillScreen()); + RUNTEST(1, "Text ", testText()); + RUNTEST(2, "Lines ", testLines(CYAN)); + RUNTEST(3, "Horiz/Vert Lines ", testFastLines(RED, BLUE)); + RUNTEST(4, "Rectangles (outline) ", testRects(GREEN)); + RUNTEST(5, "Rectangles (filled) ", testFilledRects(YELLOW, MAGENTA)); + RUNTEST(6, "Circles (filled) ", testFilledCircles(10, MAGENTA)); + RUNTEST(7, "Circles (outline) ", testCircles(10, WHITE)); + RUNTEST(8, "Triangles (outline) ", testTriangles()); + RUNTEST(9, "Triangles (filled) ", testFilledTriangles()); + RUNTEST(10, "Rounded rects (outline) ", testRoundRects()); + RUNTEST(11, "Rounded rects (filled) ", testFilledRoundRects()); + + tft.fillScreen(BLACK); + tft.setTextColor(GREEN); + tft.setCursor(0, 0); + uint16_t wid = tft.width(); + if (wid > 176) { + tft.setTextSize(2); +#if defined(MCUFRIEND_KBV_H_) + tft.print("MCUFRIEND "); +#if MCUFRIEND_KBV_H_ != 0 + tft.print(0.01 * MCUFRIEND_KBV_H_, 2); +#else + tft.print("for"); +#endif + tft.println(" UNO"); +#else + tft.println("Adafruit-Style Tests"); +#endif + } else len = wid / 6 - 8; + tft.setTextSize(1); + total = 0; + for (i = 0; i < 12; i++) { + PGM_P str = result[i].msg; + char c; + if (len > 24) { + if (i < 10) tft.print(" "); + tft.print(i); + tft.print(": "); + } + uint8_t cnt = len; + while ((c = pgm_read_byte(str++)) && cnt--) tft.print(c); + tft.print(" "); + tft.println(result[i].ms); + total += result[i].ms; + } + tft.setTextSize(2); + tft.print("Total:"); + tft.print(0.000001 * total); + tft.println("sec"); + g_identifier = tft.readID(); + tft.print("ID: 0x"); + tft.println(tft.readID(), HEX); +// tft.print("Reg(00):0x"); +// tft.println(tft.readReg(0x00), HEX); + tft.print("F_CPU:"); + tft.print(0.000001 * F_CPU); +#if defined(__OPTIMIZE_SIZE__) + tft.println("MHz -Os"); +#else + tft.println("MHz"); +#endif + + delay(10000); +} + +// Standard Adafruit tests. will adjust to screen size + +unsigned long testFillScreen() { + unsigned long start = micros(); + tft.fillScreen(BLACK); + tft.fillScreen(RED); + tft.fillScreen(GREEN); + tft.fillScreen(BLUE); + tft.fillScreen(BLACK); + return micros() - start; +} + +unsigned long testText() { + unsigned long start; + tft.fillScreen(BLACK); + start = micros(); + tft.setCursor(0, 0); + tft.setTextColor(WHITE); tft.setTextSize(1); + tft.println("Hello World!"); + tft.setTextColor(YELLOW); tft.setTextSize(2); + tft.println(123.45); + tft.setTextColor(RED); tft.setTextSize(3); + tft.println(0xDEADBEEF, HEX); + tft.println(); + tft.setTextColor(GREEN); + tft.setTextSize(5); + tft.println("Groop"); + tft.setTextSize(2); + tft.println("I implore thee,"); + tft.setTextSize(1); + tft.println("my foonting turlingdromes."); + tft.println("And hooptiously drangle me"); + tft.println("with crinkly bindlewurdles,"); + tft.println("Or I will rend thee"); + tft.println("in the gobberwarts"); + tft.println("with my blurglecruncheon,"); + tft.println("see if I don't!"); + return micros() - start; +} + +unsigned long testLines(uint16_t color) { + unsigned long start, t; + int x1, y1, x2, y2, + w = tft.width(), + h = tft.height(); + + tft.fillScreen(BLACK); + + x1 = y1 = 0; + y2 = h - 1; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = w - 1; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + t = micros() - start; // fillScreen doesn't count against timing + + tft.fillScreen(BLACK); + + x1 = w - 1; + y1 = 0; + y2 = h - 1; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = 0; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + t += micros() - start; + + tft.fillScreen(BLACK); + + x1 = 0; + y1 = h - 1; + y2 = 0; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = w - 1; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + t += micros() - start; + + tft.fillScreen(BLACK); + + x1 = w - 1; + y1 = h - 1; + y2 = 0; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = 0; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + + return micros() - start; +} + +unsigned long testFastLines(uint16_t color1, uint16_t color2) { + unsigned long start; + int x, y, w = tft.width(), h = tft.height(); + + tft.fillScreen(BLACK); + start = micros(); + for (y = 0; y < h; y += 5) tft.drawFastHLine(0, y, w, color1); + for (x = 0; x < w; x += 5) tft.drawFastVLine(x, 0, h, color2); + + return micros() - start; +} + +unsigned long testRects(uint16_t color) { + unsigned long start; + int n, i, i2, + cx = tft.width() / 2, + cy = tft.height() / 2; + + tft.fillScreen(BLACK); + n = min(tft.width(), tft.height()); + start = micros(); + for (i = 2; i < n; i += 6) { + i2 = i / 2; + tft.drawRect(cx - i2, cy - i2, i, i, color); + } + + return micros() - start; +} + +unsigned long testFilledRects(uint16_t color1, uint16_t color2) { + unsigned long start, t = 0; + int n, i, i2, + cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + n = min(tft.width(), tft.height()); + for (i = n; i > 0; i -= 6) { + i2 = i / 2; + start = micros(); + tft.fillRect(cx - i2, cy - i2, i, i, color1); + t += micros() - start; + // Outlines are not included in timing results + tft.drawRect(cx - i2, cy - i2, i, i, color2); + } + + return t; +} + +unsigned long testFilledCircles(uint8_t radius, uint16_t color) { + unsigned long start; + int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2; + + tft.fillScreen(BLACK); + start = micros(); + for (x = radius; x < w; x += r2) { + for (y = radius; y < h; y += r2) { + tft.fillCircle(x, y, radius, color); + } + } + + return micros() - start; +} + +unsigned long testCircles(uint8_t radius, uint16_t color) { + unsigned long start; + int x, y, r2 = radius * 2, + w = tft.width() + radius, + h = tft.height() + radius; + + // Screen is not cleared for this one -- this is + // intentional and does not affect the reported time. + start = micros(); + for (x = 0; x < w; x += r2) { + for (y = 0; y < h; y += r2) { + tft.drawCircle(x, y, radius, color); + } + } + + return micros() - start; +} + +unsigned long testTriangles() { + unsigned long start; + int n, i, cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + n = min(cx, cy); + start = micros(); + for (i = 0; i < n; i += 5) { + tft.drawTriangle( + cx , cy - i, // peak + cx - i, cy + i, // bottom left + cx + i, cy + i, // bottom right + tft.color565(0, 0, i)); + } + + return micros() - start; +} + +unsigned long testFilledTriangles() { + unsigned long start, t = 0; + int i, cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + start = micros(); + for (i = min(cx, cy); i > 10; i -= 5) { + start = micros(); + tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, + tft.color565(0, i, i)); + t += micros() - start; + tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, + tft.color565(i, i, 0)); + } + + return t; +} + +unsigned long testRoundRects() { + unsigned long start; + int w, i, i2, red, step, + cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + w = min(tft.width(), tft.height()); + start = micros(); + red = 0; + step = (256 * 6) / w; + for (i = 0; i < w; i += 6) { + i2 = i / 2; + red += step; + tft.drawRoundRect(cx - i2, cy - i2, i, i, i / 8, tft.color565(red, 0, 0)); + } + + return micros() - start; +} + +unsigned long testFilledRoundRects() { + unsigned long start; + int i, i2, green, step, + cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + start = micros(); + green = 256; + step = (256 * 6) / min(tft.width(), tft.height()); + for (i = min(tft.width(), tft.height()); i > 20; i -= 6) { + i2 = i / 2; + green -= step; + tft.fillRoundRect(cx - i2, cy - i2, i, i, i / 8, tft.color565(0, green, 0)); + } + + return micros() - start; +} + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_opensmart/icons.c b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_opensmart/icons.c new file mode 100644 index 0000000..d973df6 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_opensmart/icons.c @@ -0,0 +1,542 @@ +#if defined(__arm__) || defined(ESP8266) || defined(ESP32) +#define PROGMEM +#else +#include +#endif + +const unsigned char PROGMEM penguin[3200] = { /* 0X00,0X10,0X28,0X00,0X28,0X00,0X01,0X1B, */ + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XBE, 0XF7, 0X7D, 0XEF, + 0XBA, 0XD6, 0XB6, 0XB5, 0XF3, 0X9C, 0XB2, 0X94, 0XB3, 0X9C, 0XB2, 0X94, 0X34, 0XA5, 0XF7, 0XBD, + 0XFB, 0XDE, 0X7D, 0XEF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XBE, 0XF7, 0XFB, 0XDE, 0XF3, 0X9C, 0XC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, 0X04, 0X81, + 0X45, 0X61, 0X46, 0X51, 0X86, 0X49, 0X86, 0X49, 0X46, 0X41, 0X45, 0X41, 0X45, 0X41, 0X45, 0X41, + 0X05, 0X49, 0X04, 0X61, 0X82, 0X90, 0X41, 0XB0, 0X00, 0XD0, 0X00, 0XC8, 0X00, 0XA8, 0X00, 0XA8, + 0X00, 0XB8, 0X41, 0X58, 0X82, 0X10, 0X82, 0X10, 0XB2, 0X94, 0XBE, 0XF7, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XBE, 0XF7, 0XCF, 0X7B, 0X82, 0X10, 0X04, 0X21, 0X86, 0X29, 0X86, 0X41, 0X04, 0X99, + 0X40, 0XE8, 0X41, 0XF8, 0X86, 0XF9, 0XCB, 0XFA, 0X49, 0XFA, 0X82, 0XF8, 0X00, 0XF8, 0X00, 0XF0, + 0X00, 0XE8, 0X41, 0XD8, 0X41, 0XD0, 0X41, 0XC0, 0X41, 0XC0, 0X41, 0XC0, 0X41, 0XC0, 0X41, 0XC8, + 0X00, 0XD0, 0X00, 0XE0, 0X00, 0XE0, 0X00, 0XD8, 0X00, 0XD0, 0X00, 0XB8, 0X00, 0XA8, 0X41, 0X88, + 0X82, 0X48, 0X82, 0X10, 0X82, 0X10, 0X00, 0X00, 0X45, 0X29, 0X79, 0XCE, 0XFF, 0XFF, 0XFF, 0XFF, + 0XBE, 0XF7, 0XF3, 0X9C, 0X82, 0X10, 0XC3, 0X18, 0X45, 0X29, 0X86, 0X31, 0XC7, 0X31, 0X30, 0X7C, + 0XF3, 0XDC, 0X86, 0XE1, 0X00, 0XF0, 0X00, 0XF8, 0X41, 0XF8, 0X41, 0XF8, 0X00, 0XF8, 0X00, 0XF8, + 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, + 0X00, 0XE8, 0X00, 0XE0, 0X00, 0XE0, 0X00, 0XD8, 0X00, 0XC8, 0X41, 0XA0, 0X8A, 0X9A, 0X0C, 0X63, + 0X04, 0X11, 0X82, 0X10, 0X82, 0X10, 0X41, 0X08, 0X00, 0X00, 0X4D, 0X6B, 0X7D, 0XEF, 0XFF, 0XFF, + 0XFB, 0XDE, 0X08, 0X42, 0X42, 0X10, 0X45, 0X29, 0X86, 0X31, 0X86, 0X31, 0X49, 0X4A, 0X38, 0XBE, + 0XFF, 0XFF, 0X38, 0XD6, 0X86, 0XA9, 0X00, 0XC8, 0X00, 0XE0, 0X00, 0XF0, 0X00, 0XF8, 0X00, 0XF8, + 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF0, 0X00, 0XF0, + 0X00, 0XE8, 0X00, 0XE0, 0X00, 0XD0, 0XC3, 0X98, 0X8A, 0X8A, 0XB2, 0XA4, 0XBA, 0XC6, 0XF7, 0XB5, + 0X08, 0X42, 0X41, 0X08, 0X82, 0X10, 0X41, 0X08, 0X00, 0X00, 0X45, 0X29, 0XF7, 0XBD, 0XFF, 0XFF, + 0X71, 0X8C, 0X41, 0X08, 0X04, 0X21, 0X45, 0X29, 0X86, 0X31, 0X86, 0X31, 0X0C, 0X63, 0X3C, 0XE7, + 0XFF, 0XFF, 0X79, 0XD6, 0X46, 0XB9, 0X00, 0XE0, 0X42, 0XC8, 0X82, 0XA8, 0X82, 0XB0, 0X41, 0XD8, + 0X82, 0XE8, 0X82, 0XF0, 0X41, 0XE8, 0X41, 0XE8, 0X41, 0XE8, 0X41, 0XF0, 0X41, 0XE8, 0X41, 0XD8, + 0X04, 0XC1, 0X08, 0X92, 0X4D, 0X8B, 0X34, 0XA5, 0XFB, 0XC6, 0XFB, 0XD6, 0XBA, 0XCE, 0X3C, 0XE7, + 0X30, 0X84, 0XC3, 0X18, 0X41, 0X08, 0X41, 0X08, 0X00, 0X00, 0X41, 0X08, 0XCF, 0X7B, 0X7D, 0XEF, + 0X49, 0X4A,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0xA5, + 0xD4, 0xF0, 0xEE, 0x99, 0xEE, 0x78, 0xCC, 0x4D, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0x79, 0xC3, + 0x81, 0xE3, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0x59, 0x42, + 0x79, 0xC3, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, + 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0xB2, 0x84, 0x59, 0x42, + 0x51, 0x42, 0x79, 0xC3, 0x79, 0xC3, 0x9A, 0x23, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, + 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, + 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, + 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0xA2, 0x63, 0x92, 0x23, 0x79, 0xC3, 0x79, 0xC3, 0x38, 0xE1, +}; diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_slim/graphictest_slim.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_slim/graphictest_slim.ino new file mode 100644 index 0000000..e552137 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_slim/graphictest_slim.ino @@ -0,0 +1,21 @@ +#include // f.k. for Arduino-1.5.2 +#include "Adafruit_GFX.h"// Hardware-specific library +#include + +/* + * an empty Leonardo sketch uses 3.5kB + 4kB bootloader + * + * this C++ program avoids Serial and f-p. + * so it just fits in the Flash. + * + * This is a complete dummy sketch. + * its only purpose is to tell the IDE which libraries to use + * + * The actual program is in the graphictest_v25.cpp + * + * This enables me to build an identical AS7 project + * + * Edit the HOW_SLIM macro to build for other chips + * + */ + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_slim/graphictest_v25.cpp b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_slim/graphictest_v25.cpp new file mode 100644 index 0000000..b2bf3f7 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_slim/graphictest_v25.cpp @@ -0,0 +1,552 @@ +#if defined(__AVR_ATmega32U4__) //Leonardo +#define HOW_SLIM 3 +#else +#define HOW_SLIM 0 //no slimming measures +#endif + +// All the mcufriend.com UNO shields have the same pinout. +// i.e. control pins A0-A4. Data D2-D9. microSD D10-D13. +// Touchscreens are normally A1, A2, D7, D6 but the order varies +// +// This demo should work with most Adafruit TFT libraries +// If you are not using a shield, use a full Adafruit constructor() +// e.g. Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); + +#define LCD_CS A3 // Chip Select goes to Analog 3 +#define LCD_CD A2 // Command/Data goes to Analog 2 +#define LCD_WR A1 // LCD Write goes to Analog 1 +#define LCD_RD A0 // LCD Read goes to Analog 0 +#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin + +#if ARDUINO < 165 +#define USE_GFX_KBV +#include "ADA_GFX_kbv.h" +#else +#include "Adafruit_GFX.h" +#endif +#include +MCUFRIEND_kbv tft; +//#include +//Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); + +// Assign human-readable names to some common 16-bit color values: +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF + +#ifndef min +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#endif + +void setup(void); +void loop(void); +unsigned long testFillScreen(); +unsigned long testText(); +unsigned long testLines(uint16_t color); +unsigned long testFastLines(uint16_t color1, uint16_t color2); +unsigned long testRects(uint16_t color); +unsigned long testFilledRects(uint16_t color1, uint16_t color2); +unsigned long testFilledCircles(uint8_t radius, uint16_t color); +unsigned long testCircles(uint8_t radius, uint16_t color); +unsigned long testTriangles(); +unsigned long testFilledTriangles(); +unsigned long testRoundRects(); +unsigned long testFilledRoundRects(); +void progmemPrint(const char *str); +void progmemPrintln(const char *str); + +void runtests(void); + +uint16_t g_identifier; + +void setup(void) { +#if HOW_SLIM < 1 + Serial.begin(9600); + uint32_t when = millis(); + // while (!Serial) ; //hangs a Leonardo until you connect a Serial + if (!Serial) delay(5000); //allow some time for Leonardo + Serial.println("Serial took " + String((millis() - when)) + "ms to start"); +#endif + static uint16_t identifier; + tft.reset(); //we can't read ID on 9341 until begin() + g_identifier = tft.readID(); // +#if HOW_SLIM < 1 + Serial.print("ID = 0x"); + Serial.println(g_identifier, HEX); +#endif + if (g_identifier == 0x00D3) g_identifier = 0x9481; // write-only shield + if (g_identifier == 0xFFFF) g_identifier = 0x9341; // serial + // g_identifier = 0x7789; // force ID + tft.begin(g_identifier); +} + +#if defined(MCUFRIEND_KBV_H_) +uint16_t scrollbuf[480]; // my biggest screen is 320x480 +#define READGRAM(x, y, buf, w, h) tft.readGRAM(x, y, buf, w, h) +#else +uint16_t scrollbuf[320]; // Adafruit only does 240x320 +// Adafruit can read a block by one pixel at a time +int16_t READGRAM(int16_t x, int16_t y, uint16_t *block, int16_t w, int16_t h) +{ + uint16_t *p; + for (int row = 0; row < h; row++) { + p = block + row * w; + for (int col = 0; col < w; col++) { + *p++ = tft.readPixel(x + col, y + row); + } + } +} +#endif + +void windowScroll(int16_t x, int16_t y, int16_t wid, int16_t ht, int16_t dx, int16_t dy, uint16_t *buf) +{ + if (dx) for (int16_t row = 0; row < ht; row++) { + READGRAM(x, y + row, buf, wid, 1); + tft.setAddrWindow(x, y + row, x + wid - 1, y + row); + tft.pushColors(buf + dx, wid - dx, 1); + tft.pushColors(buf + 0, dx, 0); + } + if (dy) for (int16_t col = 0; col < wid; col++) { + READGRAM(x + col, y, buf, 1, ht); + tft.setAddrWindow(x + col, y, x + col, y + ht - 1); + tft.pushColors(buf + dy, ht - dy, 1); + tft.pushColors(buf + 0, dy, 0); + } +} + +void loop(void) { + uint8_t aspect; + uint16_t pixel; + char *aspectname[] = { + "PORTRAIT", "LANDSCAPE", "PORTRAIT_REV", "LANDSCAPE_REV" + }; + char *colorname[] = { "BLUE", "GREEN", "RED", "GRAY" }; + uint16_t colormask[] = { 0x001F, 0x07E0, 0xF800, 0xFFFF }; + uint16_t dx, rgb, n, wid, ht; + tft.setRotation(1); + runtests(); + delay(2000); + if (tft.height() > 64) { + for (uint8_t cnt = 0; cnt < 4; cnt++) { + aspect = (cnt + 0) & 3; + tft.setRotation(aspect); + wid = tft.width(); + ht = tft.height(); + testText(); + dx = wid / 32; + for (n = 0; n < 32; n++) { + rgb = n * 8; + rgb = tft.color565(rgb, rgb, rgb); + tft.fillRect(n * dx, 48, dx, 64, rgb & colormask[aspect]); + } + tft.setTextSize(2); + tft.setTextColor(colormask[aspect], BLACK); + tft.setCursor(0, 72); + tft.print(colorname[aspect]); + tft.setTextColor(WHITE); + tft.println(" COLOR GRADES"); + tft.setTextColor(WHITE, BLACK); + tft.setCursor(0, 184); + tft.println(aspectname[aspect]); + delay(1000); + tft.drawPixel(0, 0, YELLOW); + pixel = tft.readPixel(0, 0); +#if defined(MCUFRIEND_KBV_H_) +#if HOW_SLIM < 3 + extern const uint8_t penguin[]; + tft.setAddrWindow(wid - 40 - 40, 20 + 0, wid - 1 - 40, 20 + 39); + tft.pushColors(penguin, 1600, 1); +#endif + tft.setTextColor(WHITE, BLACK); + tft.println("VERTICAL SCROLL UP"); + uint16_t maxscroll; + if (tft.getRotation() & 1) maxscroll = wid; + else maxscroll = ht; + for (uint16_t i = 1; i <= maxscroll; i++) { + tft.vertScroll(0, maxscroll, i); + delay(10); + } + tft.vertScroll(0, maxscroll, 0); + tft.setCursor(0, 200); + tft.println("VERTICAL SCROLL DN"); + for (uint16_t i = 1; i <= maxscroll; i++) { + tft.vertScroll(0, maxscroll, 0 - (int16_t)i); + delay(10); + } + delay(1000); + tft.vertScroll(0, maxscroll, 0); + if ((aspect & 1) == 0) { //Portrait + tft.setCursor(0, 200); + tft.setTextColor(BLUE, BLACK); + tft.println("ONLY THE COLOR BAND"); + for (uint16_t i = 0; i < 64; i++) { + tft.vertScroll(48, 64, i + 1); + delay(20); + } + delay(1000); + tft.vertScroll(0, maxscroll, 0); + } +#endif + tft.setCursor(0, 200); + tft.setTextColor(YELLOW, BLACK); + if (pixel == YELLOW) { + tft.println("SOFTWARE SCROLL "); +#if 1 + for (int16_t i = 45, dx = 2, dy = 1; i > 0; i -= dx) { + windowScroll(24, 8, 90, 40, dx, dy, scrollbuf); + } +#else + // scroll a whole width of the screen + for (int16_t i = wid, dx = 4, dy = 0; i > 0; i -= dx) { + windowScroll(0, 200, wid, 16, dx, dy, scrollbuf); + } +#endif + } + else if (pixel == CYAN) + tft.println("readPixel() reads as BGR"); + else if (pixel == 0xFFFF) + tft.println("readPixel() should be 24-bit"); + else { + tft.print("readPixel() reads 0x"); + tft.println(pixel, HEX); + } + delay(5000); + } + } + tft.println("INVERT DISPLAY"); + tft.invertDisplay(true); + delay(2000); + tft.invertDisplay(false); +} + +typedef struct { + PGM_P msg; + uint32_t ms; +} TEST; +TEST result[12]; + +#define RUNTEST(n, str, test) { result[n].msg = PSTR(str); result[n].ms = test; delay(500); } + +void runtests(void) +{ + uint8_t i; + uint32_t total; + RUNTEST(0, "FillScreen ", testFillScreen()); + RUNTEST(1, "Text ", testText()); + RUNTEST(2, "Lines ", testLines(CYAN)); + RUNTEST(3, "Horiz/Vert Lines ", testFastLines(RED, BLUE)); + RUNTEST(4, "Rectangles (outline) ", testRects(GREEN)); + RUNTEST(5, "Rectangles (filled) ", testFilledRects(YELLOW, MAGENTA)); + RUNTEST(6, "Circles (filled) ", testFilledCircles(10, MAGENTA)); + RUNTEST(7, "Circles (outline) ", testCircles(10, WHITE)); + RUNTEST(8, "Triangles (outline) ", testTriangles()); + RUNTEST(9, "Triangles (filled) ", testFilledTriangles()); + RUNTEST(10, "Rounded rects (outline) ", testRoundRects()); + RUNTEST(11, "Rounded rects (filled) ", testFilledRoundRects()); + + tft.setRotation(1); + tft.fillScreen(BLACK); + tft.setCursor(0, 0); + tft.setTextSize(2); + tft.println("MCUFRIEND for UNO"); + + tft.setTextSize(1); + total = 0; + for (i = 0; i < 12; i++) { + PGM_P str = result[i].msg; + char c; + if (i < 10) tft.print(" "); + tft.print(i); + tft.print(": "); + while (c = pgm_read_byte(str++)) tft.print(c); + tft.println(result[i].ms); + total += result[i].ms; + } + tft.setTextSize(2); + tft.print("Total:"); +#if HOW_SLIM < 2 + tft.print(0.000001 * total); + tft.println("sec"); +#else + tft.print(total / 1000, DEC); + tft.println(" ms"); +#endif + g_identifier = tft.readID(); + tft.print("ID: 0x"); + tft.println(tft.readID(), HEX); + tft.print("Reg(00):0x"); + tft.println(tft.readReg(0x00), HEX); + tft.print("F_CPU:"); +#if HOW_SLIM < 2 + tft.print(0.000001 * F_CPU); +#else + tft.print((int)(F_CPU/1000000)); +#endif +#if defined(__OPTIMIZE_SIZE__) + tft.println("MHz -Os"); +#else + tft.println("MHz"); +#endif + + delay(10000); +} + +// Standard Adafruit tests. will adjust to screen size + +unsigned long testFillScreen() { + unsigned long start = micros(); + tft.fillScreen(BLACK); + tft.fillScreen(RED); + tft.fillScreen(GREEN); + tft.fillScreen(BLUE); + tft.fillScreen(BLACK); + return micros() - start; +} + +unsigned long testText() { + unsigned long start; + tft.fillScreen(BLACK); + start = micros(); + tft.setCursor(0, 0); + tft.setTextColor(WHITE); tft.setTextSize(1); + tft.println("Hello World!"); + tft.setTextColor(YELLOW); tft.setTextSize(2); +#if HOW_SLIM < 2 + tft.println(123.45); +#else + tft.println("456.78"); +#endif + tft.setTextColor(RED); tft.setTextSize(3); + tft.println(0xDEADBEEF, HEX); + tft.println(); + tft.setTextColor(GREEN); + tft.setTextSize(5); + tft.println("Groop"); + tft.setTextSize(2); + tft.println("I implore thee,"); + tft.setTextSize(1); + tft.println("my foonting turlingdromes."); + tft.println("And hooptiously drangle me"); + tft.println("with crinkly bindlewurdles,"); + tft.println("Or I will rend thee"); + tft.println("in the gobberwarts"); + tft.println("with my blurglecruncheon,"); + tft.println("see if I don't!"); + return micros() - start; +} + +unsigned long testLines(uint16_t color) { + unsigned long start, t; + int x1, y1, x2, y2, + w = tft.width(), + h = tft.height(); + + tft.fillScreen(BLACK); + + x1 = y1 = 0; + y2 = h - 1; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = w - 1; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + t = micros() - start; // fillScreen doesn't count against timing + + tft.fillScreen(BLACK); + + x1 = w - 1; + y1 = 0; + y2 = h - 1; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = 0; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + t += micros() - start; + + tft.fillScreen(BLACK); + + x1 = 0; + y1 = h - 1; + y2 = 0; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = w - 1; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + t += micros() - start; + + tft.fillScreen(BLACK); + + x1 = w - 1; + y1 = h - 1; + y2 = 0; + start = micros(); + for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); + x2 = 0; + for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); + + return micros() - start; +} + +unsigned long testFastLines(uint16_t color1, uint16_t color2) { + unsigned long start; + int x, y, w = tft.width(), h = tft.height(); + + tft.fillScreen(BLACK); + start = micros(); + for (y = 0; y < h; y += 5) tft.drawFastHLine(0, y, w, color1); + for (x = 0; x < w; x += 5) tft.drawFastVLine(x, 0, h, color2); + + return micros() - start; +} + +unsigned long testRects(uint16_t color) { + unsigned long start; + int n, i, i2, + cx = tft.width() / 2, + cy = tft.height() / 2; + + tft.fillScreen(BLACK); + n = min(tft.width(), tft.height()); + start = micros(); + for (i = 2; i < n; i += 6) { + i2 = i / 2; + tft.drawRect(cx - i2, cy - i2, i, i, color); + } + + return micros() - start; +} + +unsigned long testFilledRects(uint16_t color1, uint16_t color2) { + unsigned long start, t = 0; + int n, i, i2, + cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + n = min(tft.width(), tft.height()); + for (i = n; i > 0; i -= 6) { + i2 = i / 2; + start = micros(); + tft.fillRect(cx - i2, cy - i2, i, i, color1); + t += micros() - start; + // Outlines are not included in timing results + tft.drawRect(cx - i2, cy - i2, i, i, color2); + } + + return t; +} + +unsigned long testFilledCircles(uint8_t radius, uint16_t color) { + unsigned long start; + int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2; + + tft.fillScreen(BLACK); + start = micros(); + for (x = radius; x < w; x += r2) { + for (y = radius; y < h; y += r2) { + tft.fillCircle(x, y, radius, color); + } + } + + return micros() - start; +} + +unsigned long testCircles(uint8_t radius, uint16_t color) { + unsigned long start; + int x, y, r2 = radius * 2, + w = tft.width() + radius, + h = tft.height() + radius; + + // Screen is not cleared for this one -- this is + // intentional and does not affect the reported time. + start = micros(); + for (x = 0; x < w; x += r2) { + for (y = 0; y < h; y += r2) { + tft.drawCircle(x, y, radius, color); + } + } + + return micros() - start; +} + +unsigned long testTriangles() { + unsigned long start; + int n, i, cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + n = min(cx, cy); + start = micros(); + for (i = 0; i < n; i += 5) { + tft.drawTriangle( + cx , cy - i, // peak + cx - i, cy + i, // bottom left + cx + i, cy + i, // bottom right + tft.color565(0, 0, i)); + } + + return micros() - start; +} + +unsigned long testFilledTriangles() { + unsigned long start, t = 0; + int i, cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + start = micros(); + for (i = min(cx, cy); i > 10; i -= 5) { + start = micros(); + tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, + tft.color565(0, i, i)); + t += micros() - start; + tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, + tft.color565(i, i, 0)); + } + + return t; +} + +unsigned long testRoundRects() { + unsigned long start; + int w, i, i2, red, step, + cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + w = min(tft.width(), tft.height()); + start = micros(); + red = 0; + step = (256 * 6) / w; + for (i = 0; i < w; i += 6) { + i2 = i / 2; + red += step; + tft.drawRoundRect(cx - i2, cy - i2, i, i, i / 8, tft.color565(red, 0, 0)); + } + + return micros() - start; +} + +unsigned long testFilledRoundRects() { + unsigned long start; + int i, i2, green, step, + cx = tft.width() / 2 - 1, + cy = tft.height() / 2 - 1; + + tft.fillScreen(BLACK); + start = micros(); + green = 256; + step = (256 * 6) / min(tft.width(), tft.height()); + for (i = min(tft.width(), tft.height()); i > 20; i -= 6) { + i2 = i / 2; + green -= step; + tft.fillRoundRect(cx - i2, cy - i2, i, i, i / 8, tft.color565(0, green, 0)); + } + + return micros() - start; +} + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_slim/icons.c b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_slim/icons.c new file mode 100644 index 0000000..97edda8 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/graphictest_slim/icons.c @@ -0,0 +1,408 @@ +#include + +const unsigned char PROGMEM penguin[3200] = { /* 0X00,0X10,0X28,0X00,0X28,0X00,0X01,0X1B, */ + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XBE, 0XF7, 0X7D, 0XEF, + 0XBA, 0XD6, 0XB6, 0XB5, 0XF3, 0X9C, 0XB2, 0X94, 0XB3, 0X9C, 0XB2, 0X94, 0X34, 0XA5, 0XF7, 0XBD, + 0XFB, 0XDE, 0X7D, 0XEF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF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, 0XD6, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0X7D, 0XEF, 0X8E, 0X73, 0XC3, 0X18, 0X05, 0X39, 0X82, 0XA8, 0X00, 0XF8, + 0XC3, 0XF8, 0X4D, 0XFB, 0X4D, 0XFB, 0XC7, 0XF9, 0XC3, 0XF0, 0X82, 0XD8, 0XC3, 0XB0, 0X04, 0X81, + 0X45, 0X61, 0X46, 0X51, 0X86, 0X49, 0X86, 0X49, 0X46, 0X41, 0X45, 0X41, 0X45, 0X41, 0X45, 0X41, + 0X05, 0X49, 0X04, 0X61, 0X82, 0X90, 0X41, 0XB0, 0X00, 0XD0, 0X00, 0XC8, 0X00, 0XA8, 0X00, 0XA8, + 0X00, 0XB8, 0X41, 0X58, 0X82, 0X10, 0X82, 0X10, 0XB2, 0X94, 0XBE, 0XF7, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XBE, 0XF7, 0XCF, 0X7B, 0X82, 0X10, 0X04, 0X21, 0X86, 0X29, 0X86, 0X41, 0X04, 0X99, + 0X40, 0XE8, 0X41, 0XF8, 0X86, 0XF9, 0XCB, 0XFA, 0X49, 0XFA, 0X82, 0XF8, 0X00, 0XF8, 0X00, 0XF0, + 0X00, 0XE8, 0X41, 0XD8, 0X41, 0XD0, 0X41, 0XC0, 0X41, 0XC0, 0X41, 0XC0, 0X41, 0XC0, 0X41, 0XC8, + 0X00, 0XD0, 0X00, 0XE0, 0X00, 0XE0, 0X00, 0XD8, 0X00, 0XD0, 0X00, 0XB8, 0X00, 0XA8, 0X41, 0X88, + 0X82, 0X48, 0X82, 0X10, 0X82, 0X10, 0X00, 0X00, 0X45, 0X29, 0X79, 0XCE, 0XFF, 0XFF, 0XFF, 0XFF, + 0XBE, 0XF7, 0XF3, 0X9C, 0X82, 0X10, 0XC3, 0X18, 0X45, 0X29, 0X86, 0X31, 0XC7, 0X31, 0X30, 0X7C, + 0XF3, 0XDC, 0X86, 0XE1, 0X00, 0XF0, 0X00, 0XF8, 0X41, 0XF8, 0X41, 0XF8, 0X00, 0XF8, 0X00, 0XF8, + 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, + 0X00, 0XE8, 0X00, 0XE0, 0X00, 0XE0, 0X00, 0XD8, 0X00, 0XC8, 0X41, 0XA0, 0X8A, 0X9A, 0X0C, 0X63, + 0X04, 0X11, 0X82, 0X10, 0X82, 0X10, 0X41, 0X08, 0X00, 0X00, 0X4D, 0X6B, 0X7D, 0XEF, 0XFF, 0XFF, + 0XFB, 0XDE, 0X08, 0X42, 0X42, 0X10, 0X45, 0X29, 0X86, 0X31, 0X86, 0X31, 0X49, 0X4A, 0X38, 0XBE, + 0XFF, 0XFF, 0X38, 0XD6, 0X86, 0XA9, 0X00, 0XC8, 0X00, 0XE0, 0X00, 0XF0, 0X00, 0XF8, 0X00, 0XF8, + 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF8, 0X00, 0XF0, 0X00, 0XF0, + 0X00, 0XE8, 0X00, 0XE0, 0X00, 0XD0, 0XC3, 0X98, 0X8A, 0X8A, 0XB2, 0XA4, 0XBA, 0XC6, 0XF7, 0XB5, + 0X08, 0X42, 0X41, 0X08, 0X82, 0X10, 0X41, 0X08, 0X00, 0X00, 0X45, 0X29, 0XF7, 0XBD, 0XFF, 0XFF, + 0X71, 0X8C, 0X41, 0X08, 0X04, 0X21, 0X45, 0X29, 0X86, 0X31, 0X86, 0X31, 0X0C, 0X63, 0X3C, 0XE7, + 0XFF, 0XFF, 0X79, 0XD6, 0X46, 0XB9, 0X00, 0XE0, 0X42, 0XC8, 0X82, 0XA8, 0X82, 0XB0, 0X41, 0XD8, + 0X82, 0XE8, 0X82, 0XF0, 0X41, 0XE8, 0X41, 0XE8, 0X41, 0XE8, 0X41, 0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B, 0XEF, 0X98, 0XDE, 0X56, 0XD6, 0X57, 0XD6, 0X57, 0XD6, 0X56, 0XD6, 0X77, 0XDE, 0X1B, 0XEF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, +}; + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/readpixel_kbv/readpixel_kbv.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/readpixel_kbv/readpixel_kbv.ino new file mode 100644 index 0000000..0fea603 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/readpixel_kbv/readpixel_kbv.ino @@ -0,0 +1,135 @@ +#define LCD_CS A3 // Chip Select goes to Analog 3 +#define LCD_CD A2 // Command/Data goes to Analog 2 +#define LCD_WR A1 // LCD Write goes to Analog 1 +#define LCD_RD A0 // LCD Read goes to Analog 0 +#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin + +#include // Hardware-specific library +#include +MCUFRIEND_kbv tft; + +//#include // Hardware-specific library +//Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); +//Adafruit_TFTLCD tft; + +// Assign human-readable names to some common 16-bit color values: +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF + +void setup(void); +void loop(void); + +uint16_t g_identifier; + +void setup(void) { + tft.reset(); + g_identifier = tft.readID(); + + Serial.begin(9600); + Serial.print("readID = 0x"); + Serial.println(g_identifier, HEX); + if (g_identifier == 0xFFFF) g_identifier = 0x9341; + if (g_identifier == 0) { + Serial.println("Unknown ID"); + while (1); + } + + tft.begin(g_identifier); + tft.setRotation(0); +} + +uint16_t colors[] = { + BLACK, BLUE +}; + +void colordump(uint16_t x, uint16_t y) +{ + uint16_t pixel, pixels[32]; + char i, j, buf[20], dirty; + uint8_t wid = (tft.width() - 9 * 6)/ (5 * 6), ht = (tft.height() / 8) - 1; + tft.setTextColor(WHITE); + tft.setTextSize(1); + for (j = 0; j < ht; j++) { + sprintf(buf, "%3d,%3d:", x, y + j); + tft.print(buf); + dirty = 1; + for (i = 0; i < wid; i++) { +#if 1 && defined(MCUFRIEND_KBV_H_) + if (dirty) tft.readGRAM(x, y + j, pixels, wid, 1); + dirty = 0; + pixel = pixels[i]; +#else + pixel = tft.readPixel(x + i, y + j); +#endif + tft.print(" "); + if (pixel == WHITE) tft.setTextColor(GREEN); + sprintf(buf, "%04X", pixel); + tft.print(buf); + tft.setTextColor(WHITE); + } + tft.println(); + } +} + +uint16_t bgr(uint16_t color) +{ + return ((color & 0xF800) >> 11) | (color & 0x7E0) | (color & 0x1F) << 11; +} + +void duffcolor(uint16_t color) +{ + uint16_t pixel, x, y; + char done, buf[20]; + uint16_t BGR = bgr(color); + for (done = 0, y = 0; y < 320 && !done; y++) { + for (x= 0; x < 240; x++) { + // pixel = readxy(x, y); + pixel = tft.readPixel(x, y); + if (pixel != BGR) { + done = 1; + sprintf(buf, "0x%04X @ %d, %d", pixel, x, y); + tft.println(buf); + break; + } + } + } +} + +uint8_t aspect; +char *aspectname[] = { + "PORTRAIT", "LANDSCAPE", "PORTRAIT_REV", "LANDSCAPE_REV" +}; + +void loop(void) +{ + uint16_t iter, color; + char buf[80]; + aspect = (aspect + 1) & 3; + tft.setRotation(aspect); + for (iter = 0; iter < sizeof(colors) / sizeof(uint16_t); iter++) { + color = colors[iter]; + tft.fillScreen(color); + tft.setTextColor(WHITE); + tft.setTextSize(1); + tft.setCursor(0, 0); + sprintf(buf, "ID=0x%04X Background=%04X %s", + tft.readID(), color, aspectname[aspect]); + tft.println(buf); + colordump(6 * 6, 0); + // duffcolor(color); + delay(5000); + } +} + + + + + + + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/scroll_kbv/scroll_kbv.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/scroll_kbv/scroll_kbv.ino new file mode 100644 index 0000000..a92db93 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/scroll_kbv/scroll_kbv.ino @@ -0,0 +1,49 @@ +#include // Hardware-specific library +#include +MCUFRIEND_kbv tft; + +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF + +// work in line numbers. Font height in ht +int16_t ht = 16, top = 3, line, lines = 15, scroll; + +void setup() +{ + tft.reset(); + uint16_t id = tft.readID(); + tft.begin(id); + tft.setRotation(0); //Portrait + tft.fillScreen(BLACK); + tft.setTextColor(WHITE, BLACK); + tft.setTextSize(2); // System font is 8 pixels. ht = 8*2=16 + tft.setCursor(100, 0); + tft.print("ID = 0x"); + tft.println(id, HEX); + if (id == 0x9320 || id == 0x9325 || id == 0xB509) { + top = 0; // these controllers scroll full screen + lines = tft.height() / ht; // we are in portrait mode + } + if (id == 0x7783) { + tft.println("can NOT scroll"); + while (1); // die. + } + tft.setCursor(0, 0); + for (line = 1; line < 21; line++) tft.println(String(line) + ": "); +} + +void loop() +{ + tft.setCursor(0, (scroll + top) * ht); + if (++scroll >= lines) scroll = 0; + tft.vertScroll(top * ht, lines * ht, (scroll) * ht); + tft.println(String(line) + ": [" + String(scroll) + "] "); + delay(100); + line++; +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/showBMP_kbv_Uno/showBMP_kbv_Uno.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/showBMP_kbv_Uno/showBMP_kbv_Uno.ino new file mode 100644 index 0000000..9711b1d --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/showBMP_kbv_Uno/showBMP_kbv_Uno.ino @@ -0,0 +1,258 @@ +// MCUFRIEND UNO shields have microSD on pins 10, 11, 12, 13 +// The official library only works on the hardware SPI pins +// e.g. 11, 12, 13 on a Uno (or STM32 Nucleo) +// +// copy all your BMP files to the root directory on the microSD with your PC +// (or another directory) + +#include // f.k. for Arduino-1.5.2 +//#define USE_SDFAT +#include // Use the official SD library on hardware pins + +#include // Hardware-specific library +#include +MCUFRIEND_kbv tft; + +#if defined(ESP32) +#define SD_CS 5 +#else +#define SD_CS 10 +#endif +#define NAMEMATCH "" // "" matches any name +//#define NAMEMATCH "tiger" // *tiger*.bmp +#define PALETTEDEPTH 0 // do not support Palette modes +//#define PALETTEDEPTH 8 // support 256-colour Palette + +char namebuf[32] = "/"; //BMP files in root directory +//char namebuf[32] = "/bitmaps/"; //BMP directory e.g. files in /bitmaps/*.bmp + +File root; +int pathlen; + +void setup() +{ + uint16_t ID; + Serial.begin(9600); + Serial.print("Show BMP files on TFT with ID:0x"); + ID = tft.readID(); + Serial.println(ID, HEX); + if (ID == 0x0D3D3) ID = 0x9481; + tft.begin(ID); + tft.fillScreen(0x001F); + tft.setTextColor(0xFFFF, 0x0000); + bool good = SD.begin(SD_CS); + if (!good) { + Serial.print(F("cannot start SD")); + while (1); + } + root = SD.open(namebuf); + pathlen = strlen(namebuf); +} + +void loop() +{ + char *nm = namebuf + pathlen; + File f = root.openNextFile(); + uint8_t ret; + uint32_t start; + if (f != NULL) { +#ifdef USE_SDFAT + f.getName(nm, 32 - pathlen); +#else + strcpy(nm, (char *)f.name()); +#endif + f.close(); + strlwr(nm); + if (strstr(nm, ".bmp") != NULL && strstr(nm, NAMEMATCH) != NULL) { + Serial.print(namebuf); + Serial.print(F(" - ")); + tft.fillScreen(0); + start = millis(); + ret = showBMP(namebuf, 5, 5); + switch (ret) { + case 0: + Serial.print(millis() - start); + Serial.println(F("ms")); + delay(5000); + break; + case 1: + Serial.println(F("bad position")); + break; + case 2: + Serial.println(F("bad BMP ID")); + break; + case 3: + Serial.println(F("wrong number of planes")); + break; + case 4: + Serial.println(F("unsupported BMP format")); + break; + case 5: + Serial.println(F("unsupported palette")); + break; + default: + Serial.println(F("unknown")); + break; + } + } + } + else root.rewindDirectory(); +} + +#define BMPIMAGEOFFSET 54 + +#define BUFFPIXEL 20 + +uint16_t read16(File& f) { + uint16_t result; // read little-endian + f.read((uint8_t*)&result, sizeof(result)); + return result; +} + +uint32_t read32(File& f) { + uint32_t result; + f.read((uint8_t*)&result, sizeof(result)); + return result; +} + +uint8_t showBMP(char *nm, int x, int y) +{ + File bmpFile; + int bmpWidth, bmpHeight; // W+H in pixels + uint8_t bmpDepth; // Bit depth (currently must be 24, 16, 8, 4, 1) + uint32_t bmpImageoffset; // Start of image data in file + uint32_t rowSize; // Not always = bmpWidth; may have padding + uint8_t sdbuffer[3 * BUFFPIXEL]; // pixel in buffer (R+G+B per pixel) + uint16_t lcdbuffer[(1 << PALETTEDEPTH) + BUFFPIXEL], *palette = NULL; + uint8_t bitmask, bitshift; + boolean flip = true; // BMP is stored bottom-to-top + int w, h, row, col, lcdbufsiz = (1 << PALETTEDEPTH) + BUFFPIXEL, buffidx; + uint32_t pos; // seek position + boolean is565 = false; // + + uint16_t bmpID; + uint16_t n; // blocks read + uint8_t ret; + + if ((x >= tft.width()) || (y >= tft.height())) + return 1; // off screen + + bmpFile = SD.open(nm); // Parse BMP header + bmpID = read16(bmpFile); // BMP signature + (void) read32(bmpFile); // Read & ignore file size + (void) read32(bmpFile); // Read & ignore creator bytes + bmpImageoffset = read32(bmpFile); // Start of image data + (void) read32(bmpFile); // Read & ignore DIB header size + bmpWidth = read32(bmpFile); + bmpHeight = read32(bmpFile); + n = read16(bmpFile); // # planes -- must be '1' + bmpDepth = read16(bmpFile); // bits per pixel + pos = read32(bmpFile); // format + if (bmpID != 0x4D42) ret = 2; // bad ID + else if (n != 1) ret = 3; // too many planes + else if (pos != 0 && pos != 3) ret = 4; // format: 0 = uncompressed, 3 = 565 + else if (bmpDepth < 16 && bmpDepth > PALETTEDEPTH) ret = 5; // palette + else { + bool first = true; + is565 = (pos == 3); // ?already in 16-bit format + // BMP rows are padded (if needed) to 4-byte boundary + rowSize = (bmpWidth * bmpDepth / 8 + 3) & ~3; + if (bmpHeight < 0) { // If negative, image is in top-down order. + bmpHeight = -bmpHeight; + flip = false; + } + + w = bmpWidth; + h = bmpHeight; + if ((x + w) >= tft.width()) // Crop area to be loaded + w = tft.width() - x; + if ((y + h) >= tft.height()) // + h = tft.height() - y; + + if (bmpDepth <= PALETTEDEPTH) { // these modes have separate palette + //bmpFile.seek(BMPIMAGEOFFSET); //palette is always @ 54 + bmpFile.seek(bmpImageoffset - (4<>= bmpDepth; + bitshift = 8 - bmpDepth; + n = 1 << bmpDepth; + lcdbufsiz -= n; + palette = lcdbuffer + lcdbufsiz; + for (col = 0; col < n; col++) { + pos = read32(bmpFile); //map palette to 5-6-5 + palette[col] = ((pos & 0x0000F8) >> 3) | ((pos & 0x00FC00) >> 5) | ((pos & 0xF80000) >> 8); + } + } + + // Set TFT address window to clipped image bounds + tft.setAddrWindow(x, y, x + w - 1, y + h - 1); + for (row = 0; row < h; row++) { // For each scanline... + // Seek to start of scan line. It might seem labor- + // intensive to be doing this on every line, but this + // method covers a lot of gritty details like cropping + // and scanline padding. Also, the seek only takes + // place if the file position actually needs to change + // (avoids a lot of cluster math in SD library). + uint8_t r, g, b, *sdptr; + int lcdidx, lcdleft; + if (flip) // Bitmap is stored bottom-to-top order (normal BMP) + pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize; + else // Bitmap is stored top-to-bottom + pos = bmpImageoffset + row * rowSize; + if (bmpFile.position() != pos) { // Need seek? + bmpFile.seek(pos); + buffidx = sizeof(sdbuffer); // Force buffer reload + } + + for (col = 0; col < w; ) { //pixels in row + lcdleft = w - col; + if (lcdleft > lcdbufsiz) lcdleft = lcdbufsiz; + for (lcdidx = 0; lcdidx < lcdleft; lcdidx++) { // buffer at a time + uint16_t color; + // Time to read more pixel data? + if (buffidx >= sizeof(sdbuffer)) { // Indeed + bmpFile.read(sdbuffer, sizeof(sdbuffer)); + buffidx = 0; // Set index to beginning + r = 0; + } + switch (bmpDepth) { // Convert pixel from BMP to TFT format + case 24: + b = sdbuffer[buffidx++]; + g = sdbuffer[buffidx++]; + r = sdbuffer[buffidx++]; + color = tft.color565(r, g, b); + break; + case 16: + b = sdbuffer[buffidx++]; + r = sdbuffer[buffidx++]; + if (is565) + color = (r << 8) | (b); + else + color = (r << 9) | ((b & 0xE0) << 1) | (b & 0x1F); + break; + case 1: + case 4: + case 8: + if (r == 0) + b = sdbuffer[buffidx++], r = 8; + color = palette[(b >> bitshift) & bitmask]; + r -= bmpDepth; + b <<= bmpDepth; + break; + } + lcdbuffer[lcdidx] = color; + + } + tft.pushColors(lcdbuffer, lcdidx, first); + first = false; + col += lcdidx; + } // end cols + } // end rows + tft.setAddrWindow(0, 0, tft.width() - 1, tft.height() - 1); //restore full screen + ret = 0; // good render + } + bmpFile.close(); + return (ret); +} + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/showBMP_not_Uno/showBMP_not_Uno.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/showBMP_not_Uno/showBMP_not_Uno.ino new file mode 100644 index 0000000..6b1c278 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/showBMP_not_Uno/showBMP_not_Uno.ino @@ -0,0 +1,261 @@ +// MCUFRIEND UNO shields have microSD on pins 10, 11, 12, 13 +// The official library only works on the hardware SPI pins +// e.g. 11, 12, 13 on a Uno +// e.g. 50, 51, 52 on a Mega2560 +// e.g. 74, 75, 76 on a Due +// +// if you are not using a UNO, you must use Software SPI: +// +// install v1.0.1 of the library with the Arduino Library Manager. +// edit the src/SdFatConfig.h file to #define ENABLE_SOFTWARE_SPI_CLASS 1 +// +// copy all your BMP files to the root directory on the microSD with your PC +// (or another directory) + +#include // f.k. for Arduino-1.5.2 +#define USE_SDFAT +#include // Use the SdFat library +SdFatSoftSpi<12, 11, 13> SD; //Bit-Bang on the Shield pins + +#include // Hardware-specific library +#include +MCUFRIEND_kbv tft; + +#define SD_CS 10 +#define NAMEMATCH "" // "" matches any name +//#define NAMEMATCH "tiger" // *tiger*.bmp +#define PALETTEDEPTH 8 // support 256-colour Palette + +char namebuf[32] = "/"; //BMP files in root directory +//char namebuf[32] = "/bitmaps/"; //BMP directory e.g. files in /bitmaps/*.bmp + +File root; +int pathlen; + +void setup() +{ + uint16_t ID; + Serial.begin(9600); + Serial.print("Show BMP files on TFT with ID:0x"); + ID = tft.readID(); + Serial.println(ID, HEX); + if (ID == 0x0D3D3) ID = 0x9481; + tft.begin(ID); + tft.fillScreen(0x001F); + tft.setTextColor(0xFFFF, 0x0000); + bool good = SD.begin(SD_CS); + if (!good) { + Serial.print(F("cannot start SD")); + while (1); + } + root = SD.open(namebuf); + pathlen = strlen(namebuf); +} + +void loop() +{ + char *nm = namebuf + pathlen; + File f = root.openNextFile(); + uint8_t ret; + uint32_t start; + if (f != NULL) { +#ifdef USE_SDFAT + f.getName(nm, 32 - pathlen); +#else + strcpy(nm, (char *)f.name()); +#endif + f.close(); + strlwr(nm); + if (strstr(nm, ".bmp") != NULL && strstr(nm, NAMEMATCH) != NULL) { + Serial.print(namebuf); + Serial.print(F(" - ")); + tft.fillScreen(0); + start = millis(); + ret = showBMP(namebuf, 5, 5); + switch (ret) { + case 0: + Serial.print(millis() - start); + Serial.println(F("ms")); + delay(5000); + break; + case 1: + Serial.println(F("bad position")); + break; + case 2: + Serial.println(F("bad BMP ID")); + break; + case 3: + Serial.println(F("wrong number of planes")); + break; + case 4: + Serial.println(F("unsupported BMP format")); + break; + case 5: + Serial.println(F("unsupported palette")); + break; + default: + Serial.println(F("unknown")); + break; + } + } + } + else root.rewindDirectory(); +} + +#define BMPIMAGEOFFSET 54 + +#define BUFFPIXEL 20 + +uint16_t read16(File& f) { + uint16_t result; // read little-endian + f.read(&result, sizeof(result)); + return result; +} + +uint32_t read32(File& f) { + uint32_t result; + f.read(&result, sizeof(result)); + return result; +} + +uint8_t showBMP(char *nm, int x, int y) +{ + File bmpFile; + int bmpWidth, bmpHeight; // W+H in pixels + uint8_t bmpDepth; // Bit depth (currently must be 24, 16, 8, 4, 1) + uint32_t bmpImageoffset; // Start of image data in file + uint32_t rowSize; // Not always = bmpWidth; may have padding + uint8_t sdbuffer[3 * BUFFPIXEL]; // pixel in buffer (R+G+B per pixel) + uint16_t lcdbuffer[(1 << PALETTEDEPTH) + BUFFPIXEL], *palette = NULL; + uint8_t bitmask, bitshift; + boolean flip = true; // BMP is stored bottom-to-top + int w, h, row, col, lcdbufsiz = (1 << PALETTEDEPTH) + BUFFPIXEL, buffidx; + uint32_t pos; // seek position + boolean is565 = false; // + + uint16_t bmpID; + uint16_t n; // blocks read + uint8_t ret; + + if ((x >= tft.width()) || (y >= tft.height())) + return 1; // off screen + + bmpFile = SD.open(nm); // Parse BMP header + bmpID = read16(bmpFile); // BMP signature + (void) read32(bmpFile); // Read & ignore file size + (void) read32(bmpFile); // Read & ignore creator bytes + bmpImageoffset = read32(bmpFile); // Start of image data + (void) read32(bmpFile); // Read & ignore DIB header size + bmpWidth = read32(bmpFile); + bmpHeight = read32(bmpFile); + n = read16(bmpFile); // # planes -- must be '1' + bmpDepth = read16(bmpFile); // bits per pixel + pos = read32(bmpFile); // format + if (bmpID != 0x4D42) ret = 2; // bad ID + else if (n != 1) ret = 3; // too many planes + else if (pos != 0 && pos != 3) ret = 4; // format: 0 = uncompressed, 3 = 565 + else if (bmpDepth < 16 && bmpDepth > PALETTEDEPTH) ret = 5; // palette + else { + bool first = true; + is565 = (pos == 3); // ?already in 16-bit format + // BMP rows are padded (if needed) to 4-byte boundary + rowSize = (bmpWidth * bmpDepth / 8 + 3) & ~3; + if (bmpHeight < 0) { // If negative, image is in top-down order. + bmpHeight = -bmpHeight; + flip = false; + } + + w = bmpWidth; + h = bmpHeight; + if ((x + w) >= tft.width()) // Crop area to be loaded + w = tft.width() - x; + if ((y + h) >= tft.height()) // + h = tft.height() - y; + + if (bmpDepth <= PALETTEDEPTH) { // these modes have separate palette + //bmpFile.seek(BMPIMAGEOFFSET); //palette is always @ 54 + bmpFile.seek(bmpImageoffset - (4<>= bmpDepth; + bitshift = 8 - bmpDepth; + n = 1 << bmpDepth; + lcdbufsiz -= n; + palette = lcdbuffer + lcdbufsiz; + for (col = 0; col < n; col++) { + pos = read32(bmpFile); //map palette to 5-6-5 + palette[col] = ((pos & 0x0000F8) >> 3) | ((pos & 0x00FC00) >> 5) | ((pos & 0xF80000) >> 8); + } + } + + // Set TFT address window to clipped image bounds + tft.setAddrWindow(x, y, x + w - 1, y + h - 1); + for (row = 0; row < h; row++) { // For each scanline... + // Seek to start of scan line. It might seem labor- + // intensive to be doing this on every line, but this + // method covers a lot of gritty details like cropping + // and scanline padding. Also, the seek only takes + // place if the file position actually needs to change + // (avoids a lot of cluster math in SD library). + uint8_t r, g, b, *sdptr; + int lcdidx, lcdleft; + if (flip) // Bitmap is stored bottom-to-top order (normal BMP) + pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize; + else // Bitmap is stored top-to-bottom + pos = bmpImageoffset + row * rowSize; + if (bmpFile.position() != pos) { // Need seek? + bmpFile.seek(pos); + buffidx = sizeof(sdbuffer); // Force buffer reload + } + + for (col = 0; col < w; ) { //pixels in row + lcdleft = w - col; + if (lcdleft > lcdbufsiz) lcdleft = lcdbufsiz; + for (lcdidx = 0; lcdidx < lcdleft; lcdidx++) { // buffer at a time + uint16_t color; + // Time to read more pixel data? + if (buffidx >= sizeof(sdbuffer)) { // Indeed + bmpFile.read(sdbuffer, sizeof(sdbuffer)); + buffidx = 0; // Set index to beginning + r = 0; + } + switch (bmpDepth) { // Convert pixel from BMP to TFT format + case 24: + b = sdbuffer[buffidx++]; + g = sdbuffer[buffidx++]; + r = sdbuffer[buffidx++]; + color = tft.color565(r, g, b); + break; + case 16: + b = sdbuffer[buffidx++]; + r = sdbuffer[buffidx++]; + if (is565) + color = (r << 8) | (b); + else + color = (r << 9) | ((b & 0xE0) << 1) | (b & 0x1F); + break; + case 1: + case 4: + case 8: + if (r == 0) + b = sdbuffer[buffidx++], r = 8; + color = palette[(b >> bitshift) & bitmask]; + r -= bmpDepth; + b <<= bmpDepth; + break; + } + lcdbuffer[lcdidx] = color; + + } + tft.pushColors(lcdbuffer, lcdidx, first); + first = false; + col += lcdidx; + } // end cols + } // end rows + tft.setAddrWindow(0, 0, tft.width() - 1, tft.height() - 1); //restore full screen + ret = 0; // good render + } + bmpFile.close(); + return (ret); +} + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/examples/testcard_kbv/testcard_kbv.ino b/Arduino/Libraries/MCUFRIEND_kbv/examples/testcard_kbv/testcard_kbv.ino new file mode 100644 index 0000000..91bd0a9 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/examples/testcard_kbv/testcard_kbv.ino @@ -0,0 +1,193 @@ +/* + * generate testcard similar to BMP + */ + +#include +#if defined(_GFXFONT_H_) //are we using the new library? +#include +#define ADJ_BASELINE 11 //new fonts setCursor to bottom of letter +#else +#define ADJ_BASELINE 0 //legacy setCursor to top of letter +#endif +#include +MCUFRIEND_kbv tft; + +#define BLACK 0x0000 +#define BLUE 0x001F +#define RED 0xF800 +#define GREEN 0x07E0 +#define CYAN 0x07FF +#define MAGENTA 0xF81F +#define YELLOW 0xFFE0 +#define WHITE 0xFFFF + +#define RGB(r, g, b) (((r&0xF8)<<8)|((g&0xFC)<<3)|(b>>3)) + +#define GREY RGB(127, 127, 127) +#define DARKGREY RGB(64, 64, 64) +#define TURQUOISE RGB(0, 128, 128) +#define PINK RGB(255, 128, 192) +#define OLIVE RGB(128, 128, 0) +#define PURPLE RGB(128, 0, 128) +#define AZURE RGB(0, 128, 255) +#define ORANGE RGB(255,128,64) + +#include + +uint16_t ID; +uint8_t hh, mm, ss; //containers for current time + +uint8_t conv2d(const char* p) +{ + uint8_t v = 0; + if ('0' <= *p && *p <= '9') v = *p - '0'; + return 10 * v + *++p - '0'; +} + +void setup(void) +{ + Serial.begin(9600); + tft.reset(); + ID = tft.readID(); + Serial.print("TFT ID = 0x"); + Serial.println(ID, HEX); + // if (ID == 0xD3D3) ID = 0x9481; // write-only shield + if (ID == 0xD3D3) ID = 0x9486; // write-only shield + tft.begin(ID); + tft.setRotation(1); + tft.fillScreen(BLACK); +#if defined(_GFXFONT_H_) + tft.setFont(&FreeSans9pt7b); +#endif + hh = conv2d(__TIME__); + mm = conv2d(__TIME__ + 3); + ss = conv2d(__TIME__ + 6); + +} + +void loop(void) +{ + int16_t x, y, dx, dy, radius = 108, idx; + uint16_t w, h, len, mask; + uint16_t colors[8] = { BLACK, WHITE, YELLOW, CYAN, GREEN, MAGENTA, RED, BLUE }; + uint16_t height, width; + width = tft.width(); + height = tft.height(); + tft.fillRect(0, 0, 7, 3, WHITE); + tft.fillRect(313, 0, 7, 3, WHITE); + tft.fillRect(0, 237, 7, 3, WHITE); + tft.fillRect(313, 237, 7, 3, WHITE); + for (y = 0, w = 18, h = 3; y < 240; y += 13 * w + h) { + for (x = 25; x < 320 - 18; x += 2 * w) { + tft.fillRect(x, y, w, h, WHITE); + } + } + for (x = 0, w = 7, h = 18; x < 320; x += 17 * h + w) { + for (y = 21; y < 240 - 18; y += 2 * h) { + tft.fillRect(x, y, w, h, WHITE); + } + } + tft.fillRect(7, 3, 17 * 18, 13 * 18, GREY); + for (x = 7, y = 0, w = 1, h = 240; x < 320; x += 18) { + tft.fillRect(x, y, w, h, WHITE); + } + for (x = 0, y = 3, w = 320, h = 1; y < 240; y += 18) { + tft.fillRect(x, y, w, h, WHITE); + } + tft.fillRect(26, 22, 17, 99, TURQUOISE); + tft.fillRect(26, 120, 17, 99, PINK); + tft.fillRect(44, 22, 17, 35, AZURE); + tft.fillRect(44, 184, 17, 35, ORANGE); + tft.fillRect(260, 22, 17, 35, AZURE); + tft.fillRect(260, 184, 17, 35, ORANGE); + tft.fillRect(278, 22, 17, 99, OLIVE); + tft.fillRect(278, 120, 17, 99, PURPLE); + + for (dx = radius; dx > -radius; dx--) { + w = sqrt(radius * radius - dx * dx); + y = 120 - dx; + dy = (y - 3) / 18; + mask = 7; + colors[0] = (dy == 3) ? DARKGREY : BLACK; + switch (dy) { + case 0: + case 1: idx = 1; len = 0; break; + case 2: idx = 0; len = 0; break; + case 3: idx = 0; len = 13; mask = 1; break; + case 4: + case 5: idx = 2; len = 38; break; + case 6: + case 7: + case 8: idx = 0; len = 0; break; + case 9: for (idx = 2; idx < 8; idx++) { + //dy = 0xFF >> (7 - idx); + dy = (idx - 2) * 51; + colors[idx] = tft.color565(dy, dy, dy); + } + idx = 2; len = 38; break; + case 10: idx = 1; len = 0; break; + case 11: + case 12: colors[2] = YELLOW; idx = 2; len = 0; break; + } + if (len == 0) + tft.fillRect(160 - w, y, w * 2, 1, colors[idx]); + + else { + if (mask == 1) idx = 1 + (w) / len; + dy = w % len; + for (x = 160 - w; x < 160 + w; idx++) { + tft.fillRect(x, y, dy, 1, colors[idx & mask]); + x += dy; + if (x + len > 160 + w) dy = w % len; + else dy = len; + } + } + + } + for (x = 72, y = 129, dx = 5, dy = 0; dx > 0; x += 2 * dx) { + tft.fillRect(x, y, dx, 36, WHITE); + dy += dx * 2; + if (dy >= 36) { + dy = 0; + dx--; + } + } + tft.fillRect(160 - 8, 5 * 18 + 3, 17, 3 * 18, BLACK); + for (x = 3 * 18 + 7, y = 6 * 18 + 3, w = 1, h = 18; x < 160 + 108; x += 18) { + tft.fillRect(x, y, w, h, WHITE); + } + tft.fillRect(160 - 108, 120, 108 * 2, 1, WHITE); + tft.fillRect(160, 5 * 18 + 3, 1, 3 * 18, WHITE); + tft.fillRect(108, 2 * 18 + 3, 6 * 18, 18, WHITE); + // tft.fillRect(108, 10 * 18 + 3, 6 * 18, 18, BLACK); + tft.fillRect(160 - 8, 11 * 18 + 3, 17, radius - 18*9/2, RED); + tft.setCursor(160 - 36, 24 + ADJ_BASELINE); + tft.setTextColor(BLACK); + tft.setTextSize(1); + tft.print("320x240"); + tft.setCursor(109, 43 + ADJ_BASELINE); + tft.setTextColor(BLACK); + tft.setTextSize(1); + tft.print("ID=0x"); + tft.print(tft.readID(), HEX); + tft.setTextColor(WHITE, BLACK); + // tft.setFont(NULL); + // tft.setTextSize(2); + while (1) { + if (++ss > 59) { + ss = 0; + mm++; + if (mm > 59) { + mm = 0; + hh++; + if (hh > 23) hh = 0; + } + } + char buf[20]; + sprintf(buf, "%02d:%02d:%02d", hh, mm, ss); + tft.fillRect(108, 10 * 18 + 3, 6 * 18, 18, BLACK); + tft.setCursor(128, 187 + ADJ_BASELINE); + tft.print(buf); + delay(1000); + } +} diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/betty_1.bmp b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/betty_1.bmp new file mode 100644 index 0000000..dc9df3b Binary files /dev/null and b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/betty_1.bmp differ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/betty_4.bmp b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/betty_4.bmp new file mode 100644 index 0000000..b2d1e8c Binary files /dev/null and b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/betty_4.bmp differ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/marilyn_240x240x8.bmp b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/marilyn_240x240x8.bmp new file mode 100644 index 0000000..331b230 Binary files /dev/null and b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/marilyn_240x240x8.bmp differ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/miniwoof.bmp b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/miniwoof.bmp new file mode 100644 index 0000000..d5045d5 Binary files /dev/null and b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/miniwoof.bmp differ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/test.bmp b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/test.bmp new file mode 100644 index 0000000..2d8e2bc Binary files /dev/null and b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/test.bmp differ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger.bmp b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger.bmp new file mode 100644 index 0000000..fab3844 Binary files /dev/null and b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger.bmp differ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger16T.bmp b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger16T.bmp new file mode 100644 index 0000000..b9599d7 Binary files /dev/null and b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger16T.bmp differ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger_178x160x4.bmp b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger_178x160x4.bmp new file mode 100644 index 0000000..7779be6 Binary files /dev/null and b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger_178x160x4.bmp differ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger_240x317x4.bmp b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger_240x317x4.bmp new file mode 100644 index 0000000..4ac6d90 Binary files /dev/null and b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger_240x317x4.bmp differ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger_320x200x24.bmp b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger_320x200x24.bmp new file mode 100644 index 0000000..b43c057 Binary files /dev/null and b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/tiger_320x200x24.bmp differ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/woof.bmp b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/woof.bmp new file mode 100644 index 0000000..8c461e2 Binary files /dev/null and b/Arduino/Libraries/MCUFRIEND_kbv/extras/bitmaps/woof.bmp differ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/mcufriend_history.txt b/Arduino/Libraries/MCUFRIEND_kbv/extras/mcufriend_history.txt new file mode 100644 index 0000000..6573941 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/mcufriend_history.txt @@ -0,0 +1,115 @@ +CHANGE HISTORY: + +Will Never Happen: + R61520, R61526 vert scroll is not possible + ST7781 vert scroll is not implemented + ILI9320, 9325, ... can never vert scroll sub-window i.e. no Band Scroll + +To Be Fixed: + R61505, 0x1511, HX8347-A, S6D0139 + +v2.9.4-beta: + readReg() accepts an optional index argument + pushColors() from Flash accepts an optional bigend argument + added UC8230, R61505, HX8367-A + +v2.9.3: + added R61526 + file structure changed + +v2.9.1: + added HX8357-D, R61581, + +v2.9: posted 05 May 2016 + MCUFRIEND_kbv.cpp: + Added pushCommand() method to send block of 8-bit SRAM data to MIPI controller + SSD1963 fixed aspects. + Added ILI9302 + Added ILI9338 + Added R61520 + ILI9327 defaults to shifted band in REV modes. #define OFFSET_9327 + Conditional S6D0139. #define SUPPORT_0139 Untested + Conditional HX8347-A. #define SUPPORT_8347A Untested + Conditional HX8347-I. #define SUPPORT_8347D + Conditional SSD1289. #define SUPPORT_1289 + UTFTGLUE.h: + implement drawBitmap() method. (no rotations) + LCD_ID_readreg.ino: + write(0xB0, 0x00) after hardware Reset to read manufacturer locations. + added some extra registers. +v2.8: posted 26 February 2016 + MCUFRIEND_kbv.cpp: LANDSCAPE is now 90 degrees instead of 270 degrees + methods branch on MIPI / 9320 style + Added SPFD5408 + Added R61505W Untested + Added HX8347-A Untested + Added SSD1963 Untested + graphictest_kbv.ino: smaller buffer for Software Scroll. Just fits in Uno Flash + TouchScreen_Calibr_kbv: wait for consistent Touch + LCD_ID_readreg: Added some more registers + +v2.7: posted ........ NOT YET +v2.6: posted ........ NOT YET + MCUFRIEND_kbv.cpp: + Added R65105V + +v2.5: posted 11 January 2016 + MCUFRIEND_kbv.cpp: + Added ST7789V + Added RM68090 + Added ILI9481 + Added pushColors() from Flash + Improved downward Vertical Scroll. API is changed. + ILI9327 should work in all aspects. vertical scroll in PORT/LAND_REV + S6D0154 should vertical scroll a subwindow + + graphictest_kbv.ino: smooth colour gradation on rounded rectangle tests on bigger displays + added colour grading range. + added vertical scroll down + improve messages + + graphictest_slim.ino: reduced-fat version of graphictest_kbv.ino + testcard_kbv.ino: drawn version of common BMP photo. + scroll_kbv.ino: changed vertScroll() call for new API + + UTFTGLUE.h: improve calculate width and height of rectangles from coordinates. + +v2.4: posted 10 December 2015 + MCUFRIEND_kbv.cpp: LGDP4535 initialisation table fixed - UNTESTED + +v2.3: posted 8 December 2015 + MCUFRIEND_kbv.cpp: added S6D0139 UNTESTED + detect EXTC=0 ILI9341 shield from DX with ID == 0x0000. drive in RGB mode + ILI9327 should Vertical Scroll now. UNTESTED + UTFTGLUE.h: extra print(const char*) method to avoid warning messages + + graphictest_kbv.ino: software scroll a smaller block at top of screen + GLUE_Demo_320x240: removed unnecessary "include Adafruit_TFTLCD.h" + aspect_kbv.ino: invert display when in different aspects + readpixel_kbv.ino: support smaller geometries + LCD_ID_readreg.ino: report some more regs + TouchScreen_Calibr_kbv: for resistive Touch screens like on Mcufriend shields + UTouch_Calibr_kbv: can use UTouch.h library for hardware Touch Controllers (and UTFT) + +v2.2: posted 15 November 2015 + MCUFRIEND_kbv.cpp: changed readGRAM() for ILI9327, ILI9486, + added REV_SCREEN flag to _lcd_capable + implement invertDisplay() + added LGDP4535 + ILI9327: set Partial Area to 0, 399 + MCUFRIEND_kbv.h: USE_GFX_KBV default argument: println(char *s="") + MCUFRIEND_shield.h: regular Uno shield drivers for Uno, Mega, Leonardo, Due, Zero + MCUFRIEND_special.h: experimental drivers + UTFTGLUE.h: identity kludges for non-UNO shields + LCD_ID_readreg.ino: report reg(0x09) + +v2.1: posted 9 November 2015 + MCUFRIEND_kbv.cpp: return 0x9327 / 0x9481 in readID() + MCUFRIEND_shield.h: increase low pulse width in RD_STROBE + EXAMPLES/: add scroll_kbv.ino sketch + edit readpixel_kbv_ino, aspect_kbv.ino + +v2.0: posted 8 November 2015 + Massive changes from v1.0 + + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/mcufriend_how_to.txt b/Arduino/Libraries/MCUFRIEND_kbv/extras/mcufriend_how_to.txt new file mode 100644 index 0000000..04d84c2 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/mcufriend_how_to.txt @@ -0,0 +1,154 @@ +1. The Arduino Library Manager should find and install MCUFRIEND_kbv library + +2. Install the Adafruit_GFX library if not already in your User libraries. + +3. Insert your Mcufriend style display shield into UNO. Only 28-pin shields are supported. + +4. Build any of the Examples from the File->Examples->Mcufriend_kbv menu. e.g. graphictest_kbv.ino + +5. Most of them will write some text to the Serial window (9600 baud). The BMP examples require you to copy the pictures from the bitmaps/ folder to your microSD (root directory) + +6. This library is only intended for UNO and these specific Shields. It will work on a MEGA2560 but not very fast. + +7. The constructor takes no arguments (because it only works with these shields) + +8. The examples are the standard Adafruit ones. You can see my edits by searching for "kbv" + +9. Any Adafruit sketch should work with the MCUFRIEND_kbv constructor() but should allow extra ID values +An Adafruit constructor(cs, rs, wr, rd, rst) IGNORES any arguments. i.e. it only uses the shield control pins + +MCUFRIEND_kbv inherits all the methods from +the Adafruit_GFX class: https://learn.adafruit.com/adafruit-gfx-graphics-library/overview +and Print class: https://www.arduino.cc/en/Serial/Print + +The only "new" methods are hardware related: +vertScroll(), readGRAM(), readPixel(), setAddrWindow(), pushColors(), readID(), begin() +readReg(), pushCommand(), WriteCmdData() access the controller registers + +10. It currently supports UNO shields with "mcufriend.com" pcbs with controllers: +HX8347-A 240x320 ID=0x8347 #define SUPPORT_8347A *** Untested *** +HX8347-D 240x320 ID=0x4747 #define SUPPORT_8347D +HX8347-G 240x320 ID=0x7575 #define SUPPORT_8347D +HX8347-I 240x320 ID=0x9595 #define SUPPORT_8347D +HX8352-A 240x400 ID=0x5252 #define SUPPORT_8352A +HX8352-B 240x400 ID=0x0065 #define SUPPORT_8352B +HX8357-B 320x480 ID=0x8357 (shares init with 8357-D) +HX8357-C 320x480 ID=0x9090 (ID has changed from 0x8357) +HX8357-D 320x480 ID=0x0099 #define SUPPORT_8357D_GAMMA +HX8367-A 240x320 ID=0x6767 #define SUPPORT_8347D +ILI9163 128x160 ID=0x9163 #define SUPPORT_9163 +ILI9225 176x220 ID=0x9225 #define SUPPORT_9225 +ILI9226 176x220 ID=0x9226 #define SUPPORT_9225 +ILI9302 240x320 ID=0x9302 +ILI9320 240x320 ID=0x9320 +ILI9325 240x320 ID=0x9325 +ILI9326 240x400 ID=0x9326 #define SUPPORT_9326_5420 +ILI9327 240x400 ID=0x9327 +ILI9328 240x320 ID=0x9328 +ILI9329 240x320 ID=0x9329 +ILI9331 240x320 ID=0x9331 +ILI9335 240x320 ID=0x9335 +ILI9338 240x320 ID=0x9338 +ILI9340 240x320 ID=0x9340 +ILI9341 240x320 ID=0x9341 +ILI9342 320x240 ID=0x9342 #define SUPPORT_9342 +ILI9481 320x480 ID=0x9481 +ILI9486 320x480 ID=0x9486 +ILI9487 320x480 ID=0x9487 +ILI9488 320x480 ID=0x9488 (weird 555 display :#define SUPPORT_9488_555) +LGDP4532 240x320 ID=0x4532 #define SUPPORT_4532 +LGDP4535 240x320 ID=0x4535 #define SUPPORT_4535 +NT35310 320x480 ID=0x5310 (hardware must be set for 8-bit parallel) +R61505 240x320 ID=0x1505 works like an ILI9320 +R61505V 240x320 ID=0xB505 +R61505W 240x320 ID=0xC505 +R61509V 240x400 ID=0xB509 #define SUPPORT_B509_7793 +R61520 240x320 ID=0x1520 (no Vertical Scroll) +R61526A 240x320 ID=0x1526 (no Vertical Scroll) configure NVM with sketch +R61580 240x320 ID=0x1580 #define SUPPORT_1580 *** Untested *** +R61581 320x480 ID=0x1581 +RM68090 240x320 ID=0x6809 +RM68130 176x220 ID=0x6813 #define SUPPORT_9225 +RM68140 320x480 ID=0x6814 #define SUPPORT_68140 +S6D0139 240x320 ID=0x0139 #define SUPPORT_0139 (no Band Scroll) +S6D0154 240x320 ID=0x0154 #define SUPPORT_0154 +SPFD5408 240x320 ID=0x5408 +SPFD5420 240x400 ID=0x5420 #define SUPPORT_9326_5420 +SSD1963 800x480 ID=0x1963 +SSD1289 240x320 ID=0x1289 #define SUPPORT_1289 +SSD1297 240x320 ID=0x9797 #define SUPPORT_1289 (unstable readGRAM()) +ST7735 128x160 ID=0x7735 #define SUPPORT_7735 (untested) +ST7781 240x320 ID=0x7783 #define SUPPORT_7781 (no Vertical Scroll) +ST7789V 240x320 ID=0x7789 +ST7793 240x400 ID=0x7793 #define SUPPORT_B509_7793 +ST7796 320x480 ID=0x7796 +UC8230 240x320 ID=0x8230 #define SUPPORT_8230 +UNKNOWN 320x480 ID=0x1511 (scroll directions not correct) +UNKNOWN 240x320 ID=0x1602 readGRAM() does not work +UNKNOWN 240x320 ID=0xAC11 +UNKNOWN 240x320 ID=0x2053 weird controller from BangGood (was ID=0x0000) +UNKNOWN 240x320 ID=0x8031 (no Vertical Scroll) +UNKNOWN 240x320 ID=0x0001 (0x9320 style) + +Most of these controllers are #define SUPPORT_xxxx by default. +You can save Flash memory on a Uno by commenting out the macro(s) in MCUFRIEND_kbv.cpp + +11. It should run on a UNO, MEGA2560, LEONARDO, DUE, ZERO, M0-PRO, +It also runs on NUCLEO-F103 and TEENSY3.2 with Sparkfun Adapter + +12. These Mcufriend-style shields tend to have a resistive TouchScreen on A1, 7, A2, 6 but are not always the same rotation of direction. + The TouchScreen_Calibr_native.ino sketch wiil diagnose Touch Pins, do Calibration, report to Serial Terminal. + The Calibration should work with the TouchScreen.h library from Adafruit. + You can always copy the local TouchScreen_kbv.h library from sketch to the global user libraries folder. + +13. The graphictest_kbv.ino sketch runs the standard Adafruit tests and reports the execution time. + The Scroll tests show each screen rotation, colours, scroll directions, colour inversion. + Vertical scroll is up/down in Portrait modes. Left/right in Landscape + Band Scroll should just move the coloured Band. ILI9320 style will always move the whole screen. + The text "SOFTWARE SCROLL" should move horizontally across the screen or report a readPixel() ERROR. + +14. The scroll_kbv.ino sketch should scroll a window or subwindow for most chips. Not all chips can scroll. + +15. The readpixel_kbv.ino sketch should display memory in each aspect. + +16. The GLUE_Demo_320x240.ino sketch uses a "GLUE" class to display a UTFT sketch on supported mcufriend shields. + It is NOT perfect. Please report any problems. It is designed as a CONVENIENCE for legacy UTFT code. + Please use MCUFRIEND_kbv method()s in new code. + +17. If you do not have a standard Uno Shield, you can add a SPECIAL to the mcufriend_special.h + Edit mcufriend_shield.h: #define USE_SPECIAL + Edit mcufriend_special.h: e.g. #define USE_MEGA_16BIT_SHIELD + If your "special" is write-only, the library can not read the ID. It always returns 0xD3D3 + +18. Please run LCD_ID_readreg.ino to verify your non-standard wiring. Paste the defines to a Forum message. + +19. OPEN-SMART Shields have different wiring to regular Uno Shields: + Edit utility/mcufriend_shield.h: #define USE_SPECIAL + Edit utility/mcufriend_special.h: #define USE_OPENSMART_SHIELD_PINOUT + Edit MCUFRIEND_kbv.cpp: #define SUPPORT_8352B + +20. OPEN-SMART Shields can not read LM75A on a Mega because there are no SDA/SCL pins next on AREF header. + Uno: LM75A on pcb works. Difficult to add external I2C devices when Shield is plugged in. + Uno: All use of SPI bus should use SPI.beginTransaction(), SPI.endTransaction() + Leo: I do not support USE_OPENSMART_SHIELD_PINOUT_LEO + Mega: Old boards do not have SDA/SCL on AREF header. Only external I2C devices on COMMS header + Due: MAX809 Reset chip interferes with 3.3V RST on SPI header. Manual reset for Upload / Run. + +21. BLUEPILL Adapter standard wiring is: + //LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST| |SD_SS|SD_DI|SD_DO|SD_SCK| + //STM32 pin |PA7|PA6|PA5|PA4|PA3|PA2|PA1|PA0| |PB0|PB6|PB7|PB8|PB9| |PA15 |PB5 |PB4 |PB3 | **ALT-SPI1** + + Maple core: to use SPI2 for SPI. edit SPI.cpp for SPIClass SPI(2); + STM Core: to use SPI2 for SPI. edit variant.h to use PA15, PB3, PB4, PB5 for SPI_SS etc + + Touchscreen needs XM, YP to be on Analog capable pins. Measure resistance with DMM to determine X, Y + 300R pair is XP, XM. 500R pair is YP, YM. choose XM, YP from PA7, PA6. XP, YM from PB6, PB7 + Run the Calibration sketch to get accurate TS_LEFT, TS_RT, TS_TOP, TS_BOT values. + Ignore the XP, XM, ... values. They mean nothing on a BluePill + + Adafruit_Touchscreen might need: typedef volatile uint32_t RwReg; + + Maple core: use Touchscreen_kbv library + STM Core: regular Touchscreen libraries should be ok. + +CHANGE HISTORY: is now in "mcufriend_history.txt" diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ILI9341_regValues.txt b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ILI9341_regValues.txt new file mode 100644 index 0000000..4ad1bb0 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ILI9341_regValues.txt @@ -0,0 +1,307 @@ + case 0x9341: + _lcd_capable = AUTO_READINC | TWO_PARM_WINDOW | MV_AXIS; + static const uint8_t ILI9341_regValues_kbv[] PROGMEM = { //.kbv MCUFRIEND_kbv + 0x01, 0, // software reset + TFTLCD_DELAY, 150, // 5ms if awake, 125ms if asleep. + 0xCB, 5, 0x39, 0x2C, 0x00, 0x34, 0x02, //Power Control A [39 2C 00 34 02] + 0xCF, 3, 0x00, 0xC1, 0x30, //Power Control B [00 81 30] + 0xE8, 3, 0x85, 0x00, 0x78, //Driver Timing A [04 11 7A] + 0xEA, 2, 0x00, 0x00, //Driver Timing B [66 00] + 0xED, 4, 0x64, 0x03, 0x12, 0x81, //Power On Seq [55 01 23 01] + 0xF7, 1, 0x20, //Pump Ratio [10] + 0xC0, 1, 0x23, //Power Control 1 [26] + 0xC1, 1, 0x10, //Power Control 2 [00] + 0xC5, 2, 0x3E, 0x28, //VCOM 1 [31 3C] + 0xC7, 1, 0x86, //VCOM 2 [C0] + 0x36, 1, 0x48, //Memory Access [00] + 0xB1, 2, 0x00, 0x18, //Frame Control [00 1B] + 0xB6, 3, 0x08, 0x82, 0x27, //Display Function [0A 82 27 XX] + 0xF2, 1, 0x00, //Enable 3G [02] + 0x26, 1, 0x01, //Gamma Set [01] + 0xE0, 15, 0x0f, 0x31, 0x2b, 0x0c, 0x0e, 0x08, 0x4e, 0xf1, 0x37, 0x07, 0x10, 0x03, 0x0e, 0x09, 0x00, + 0xE1, 15, 0x00, 0x0e, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0f, 0x0c, 0x31, 0x36, 0x0f, + 0x11, 0, //Sleep Out + TFTLCD_DELAY, 150, + 0x29, 0, //Display On + 0x3A, 1, 0x55, //Pixel Format [66] + }; + static const uint8_t ILI9341_regValues_2_6[] PROGMEM = { // LG 2.6" from AN + 0x01, 0, // software reset + 0xCB, 5, 0x39, 0x2C, 0x00, 0x34, 0x02, //Power Control A [39 2C 00 34 02] + 0xCF, 3, 0x00, 0xC1, 0x30, //Power Control B [00 81 30] + 0xE8, 3, 0x85, 0x00, 0x78, //Driver Timing A [04 11 7A] + 0xEA, 2, 0x00, 0x00, //Driver Timing B [66 00] + 0xED, 4, 0x64, 0x03, 0x12, 0x81, //Power On Seq [55 01 23 01] + 0xF7, 1, 0x20, //Pump Ratio [10] + 0xC0, 1, 0x23, //Power Control 1 [26] + 0xC1, 1, 0x10, //Power Control 2 [00] + 0xC5, 2, 0x2B, 0x2B, //VCOM 1 [31 3C] + 0xC7, 1, 0xC0, //VCOM 2 [C0] + 0x36, 1, 0x48, //Memory Access [00] + 0xB1, 2, 0x00, 0x1B, //Frame Control [00 1B] +// 0xB6, 3, 0x0A, 0x02, 0x27, //Display Function [0A 82 27 XX] .kbv REV=0 + 0xF2, 1, 0x00, //Enable 3G [02] + 0x26, 1, 0x01, //Gamma Set [01] + 0xE0, 15, 0x0f, 0x31, 0x2b, 0x0c, 0x0e, 0x08, 0x4e, 0xf1, 0x37, 0x07, 0x10, 0x03, 0x0e, 0x09, 0x00, + 0xE1, 15, 0x00, 0x0e, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0f, 0x0c, 0x31, 0x36, 0x0f, + 0x11, 0, //Sleep Out + TFTLCD_DELAY, 150, + 0x29, 0, //Display On + 0x3A, 1, 0x55, //Pixel Format [66] + }; + static const uint8_t ILI9341_regValues_2_0[] PROGMEM = { // BOE 2.0" + 0x01, 0, // software reset + 0xCF, 3, 0x00, 0x99, 0x30, //Power Control B [00 81 30] + 0xED, 4, 0x64, 0x03, 0x12, 0x81, //Power On Seq [55 01 23 01] + 0xE8, 3, 0x85, 0x10, 0x78, //Driver Timing A [04 11 7A] + 0xCB, 5, 0x39, 0x2C, 0x00, 0x34, 0x02, //Power Control A [39 2C 00 34 02] + 0xF7, 1, 0x20, //Pump Ratio [10] + 0xEA, 2, 0x00, 0x00, //Driver Timing B [66 00] + 0xC0, 1, 0x26, //Power Control 1 [26] + 0xC1, 1, 0x12, //Power Control 2 [00] + 0xC5, 2, 0x2B, 0x2C, //VCOM 1 [31 3C] + 0xC7, 1, 0xC4, //VCOM 2 [C0] + 0x36, 1, 0x08, //Memory Access [00] + 0xB1, 2, 0x00, 0x1B, //Frame Control [00 1B] +// 0xB6, 3, 0x0A, 0xA2, 0x27, //?? Display Function [0A 82 27 XX] .kbv SS=1 + 0xF2, 1, 0x00, //Enable 3G [02] + 0x26, 1, 0x01, //Gamma Set [01] + 0xE0, 15, 0x0f, 0x24, 0x21, 0x0a, 0x0e, 0x09, 0x51, 0xa9, 0x44, 0x07, 0x10, 0x03, 0x2c, 0x0b, 0x00, + 0xE1, 15, 0x00, 0x1b, 0x1e, 0x05, 0x11, 0x06, 0x2e, 0x56, 0x3b, 0x08, 0x0f, 0x0c, 0x13, 0x14, 0x0f, + 0x11, 0, //Sleep Out + TFTLCD_DELAY, 150, + 0x29, 0, //Display On + 0x3A, 1, 0x55, //Pixel Format [66] + }; + static const uint8_t ILI9341_regValues_2_4[] PROGMEM = { // BOE 2.4" + 0x01, 0, // software reset + TFTLCD_DELAY, 50, // .kbv + 0xCF, 3, 0x00, 0x81, 0x30, //Power Control B [00 81 30] + 0xED, 4, 0x64, 0x03, 0x12, 0x81, //Power On Seq [55 01 23 01] + 0xE8, 3, 0x85, 0x10, 0x78, //Driver Timing A [04 11 7A] + 0xCB, 5, 0x39, 0x2C, 0x00, 0x34, 0x02, //Power Control A [39 2C 00 34 02] + 0xF7, 1, 0x20, //Pump Ratio [10] + 0xEA, 2, 0x00, 0x00, //Driver Timing B [66 00] + 0xB1, 2, 0x00, 0x1B, //Frame Control [00 1B] +// 0xB6, 2, 0x0A, 0xA2, 0x27, //Display Function [0A 82 27 XX] .kbv SS=1 + 0xC0, 1, 0x21, //Power Control 1 [26] + 0xC1, 1, 0x11, //Power Control 2 [00] + 0xC5, 2, 0x3F, 0x3C, //VCOM 1 [31 3C] + 0xC7, 1, 0xB5, //VCOM 2 [C0] + 0x36, 1, 0x48, //Memory Access [00] + 0xF2, 1, 0x00, //Enable 3G [02] + 0x26, 1, 0x01, //Gamma Set [01] + 0xE0, 15, 0x0f, 0x26, 0x24, 0x0b, 0x0e, 0x09, 0x54, 0xa8, 0x46, 0x0c, 0x17, 0x09, 0x0f, 0x07, 0x00, + 0xE1, 15, 0x00, 0x19, 0x1b, 0x04, 0x10, 0x07, 0x2a, 0x47, 0x39, 0x03, 0x06, 0x06, 0x30, 0x38, 0x0f, + 0x11, 0, //Sleep Out + TFTLCD_DELAY, 150, + 0x29, 0, //Display On + 0x3A, 1, 0x55, //Pixel Format [66] + }; + static const uint8_t ILI9341_regValues_ada[] PROGMEM = { // Adafruit_TFTLCD only works with EXTC=0 + 0x01, 0, // software reset + TFTLCD_DELAY, 50, + 0x28, 0, //Display Off + 0xC0, 1, 0x23, //Power Control 1 [26] + 0xC1, 1, 0x10, //Power Control 2 [00] + 0xC5, 2, 0x2B, 0x2B, //VCOM 1 [31 3C] + 0xC7, 1, 0xC0, //VCOM 2 [C0] + 0x36, 1, 0x88, //Memory Access [00] + 0xB1, 2, 0x00, 0x1B, //Frame Control [00 1B] + 0xB7, 1, 0x07, //Entry Mode [00] + 0x11, 0, //Sleep Out + TFTLCD_DELAY, 150, + 0x29, 0, //Display On + 0x3A, 1, 0x55, //Pixel Format [66] + }; + static const uint8_t ILI9341_regValues_ada9341[] PROGMEM = { // Adafruit_ILI9341 + 0xEF, 3, 0x03, 0x80, 0x02, // + 0xCF, 3, 0x00, 0xC1, 0x30, //Power Control B [00 81 30] + 0xED, 4, 0x64, 0x03, 0x12, 0x81, //Power On Seq [55 01 23 01] + 0xE8, 3, 0x85, 0x00, 0x78, //Driver Timing A [04 11 7A] + 0xCB, 5, 0x39, 0x2C, 0x00, 0x34, 0x02, //Power Control A [39 2C 00 34 02] + 0xF7, 1, 0x20, //Pump Ratio [10] + 0xEA, 2, 0x00, 0x00, //Driver Timing B [66 00] + 0xC0, 1, 0x23, //Power Control 1 [26] + 0xC1, 1, 0x11, //Power Control 2 [00] + 0xC5, 2, 0x3E, 0x28, //VCOM 1 [31 3C] + 0xC7, 1, 0x86, //VCOM 2 [C0] + 0x36, 1, 0x48, //Memory Access [00] + 0xB1, 2, 0x00, 0x18, //Frame Control [00 1B] + 0xB6, 3, 0x0A, 0x82, 0x27, //?? Display Function [0A 82 27 XX] + 0xF2, 1, 0x00, //Enable 3G [02] + 0x26, 1, 0x01, //Gamma Set [01] + 0xE0, 15, 0x0f, 0x31, 0x2b, 0x0c, 0x0e, 0x08, 0x4e, 0xf1, 0x37, 0x07, 0x10, 0x03, 0x0e, 0x09, 0x00, + 0xE1, 15, 0x00, 0x0e, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0f, 0x0c, 0x31, 0x36, 0x0f, + + 0x11, 0, //Sleep Out + TFTLCD_DELAY, 150, + 0x29, 0, //Display On + 0x3A, 1, 0x55, //Pixel Format [66] + }; +// init_table(ILI9341_regValues_kbv, sizeof(ILI9341_regValues_kbv)); //ok for me +// init_table(ILI9341_regValues_2_0, sizeof(ILI9341_regValues_2_0)); //wrong direction + init_table(ILI9341_regValues_2_4, sizeof(ILI9341_regValues_2_4)); //wrong direction +// init_table(ILI9341_regValues_2_6, sizeof(ILI9341_regValues_2_6)); //inverted +// init_table(ILI9341_regValues_ada, sizeof(ILI9341_regValues_ada)); //white screen +// init_table(ILI9341_regValues_ada9341, sizeof(ILI9341_regValues_ada9341)); //ok for me + break; + + case 0x9486: + _lcd_capable = AUTO_READINC | TWO_PARM_WINDOW | MV_AXIS; + static const uint8_t ILI9486_regValues[] PROGMEM = { + 0x01, 0, //Soft Reset + 0x28, 0, //Display Off + 0xC0, 2, 0x0d, 0x0d, //Power Control 1 [0x0E0E] + 0xC1, 2, 0x43, 0x00, //Power Control 2 [0x4300] + 0xC2, 1, 0x00, //Power Control 3 + 0xC5, 4, 0x00, 0x48, 0x00, 0x48, //VCOM Control 1 [0x00400040] + 0xB6, 3, 0x00, 0x22, 0x3B, // Display Function Control .kbv SS=1 + // 0xE0,15, 0x0f,0x31,0x2b,0x0c,0x0e,0x08,0x4e,0xf1,0x37,0x07,0x10,0x03,0x0e,0x09,0x00, + // 0xE1,15, 0x00,0x0e,0x14,0x03,0x11,0x07,0x31,0xC1,0x48,0x08,0x0f,0x0c,0x31,0x36,0x0f, + 0x20, 0, // Display Inversion OFF + 0x36, 1, 0x0A, //Memory Access + 0x3A, 1, 0x55, //Interlace Pixel +// 0x21, 0, //Invert display !!! + 0x11, 0, //Sleep Out + TFTLCD_DELAY, 50, + 0x29, 0, //Display On + }; + init_table(ILI9486_regValues, sizeof(ILI9486_regValues)); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; + + case 0x9488: + _lcd_capable = AUTO_READINC | TWO_PARM_WINDOW | MV_AXIS; + static const uint8_t ILI9488_regValues[] PROGMEM = { + 0x01, 0, //Soft Reset + 0x28, 0, //Display Off + 0xC0, 2, 0x0E, 0x0E, //Power Control 1 [0E 0E] + 0xC1, 1, 0x43, //Power Control 2 [43] + 0xC5, 4, 0x00, 0x22, 0x80, 0x40, //VCOM Control 1 [00 40 00 40] + 0x36, 1, 0x08, //Memory Access [00] + 0x3A, 1, 0x55, //Interlace Pixel [XX] + 0xB1, 2, 0xB0, 0x11, //Frame Rate Control [B0 11] + 0xB6, 3, 0x02, 0x02, 0x3B, //Display Function [02 02 3B] .kbv SS=0 + 0x11, 0, //Sleep Out + TFTLCD_DELAY, 150, + 0x29, 0, //Display On + // 0x2C, 0, + }; + static const uint8_t ILI9488_regValues_max[] PROGMEM = { // Atmel MaxTouch + 0x01, 0, //Soft Reset + TFTLCD_DELAY, 50, + 0x28, 0, //Display Off + 0xC0, 2, 0x10, 0x10, //Power Control 1 [0E 0E] + 0xC1, 1, 0x41, //Power Control 2 [43] + 0xC5, 4, 0x00, 0x22, 0x80, 0x40, //VCOM Control 1 [00 40 00 40] + 0x36, 1, 0x68, //Memory Access [00] + 0xB0, 1, 0x00, //Interface [00] + 0xB1, 2, 0xB0, 0x11, //Frame Rate Control [B0 11] + 0xB4, 1, 0x02, //Inversion Control [02] + 0xB7, 1, 0xC6, //Entry Mode [06] + 0x3A, 1, 0x55, //Interlace Pixel Format [XX] + 0xF7, 4, 0xA9, 0x51, 0x2C, 0x82, //Adjustment Control 3 [A9 51 2C 82] + 0x11, 0, //Sleep Out + TFTLCD_DELAY, 150, + 0x29, 0, //Display On + }; +// init_table(ILI9488_regValues, sizeof(ILI9488_regValues)); + init_table(ILI9488_regValues_max, sizeof(ILI9488_regValues_max)); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; +// ################################################################################### + case 0x7789: + case 0x8552: + _lcd_capable = AUTO_READINC | TWO_PARM_WINDOW | MV_AXIS; + static const uint8_t ST7789_regValues[] PROGMEM = { + (0x0011); //exit SLEEP mode + TFTLCD_DELAY, 10, + (0x0036), 1, 0x80, //MADCTL: memory data access control + (0x003A), 1, 0x66, //COLMOD: Interface Pixel format *** I use 262K-colors in 18bit/pixel format when using 8-bit interface to allow 3-bytes per pixel +// (0x003A), 1, 0x0055, //COLMOD: Interface Pixel format *** I use 65K-colors in 16bit/pixel (5-6-5) format when using 16-bit interface to allow 1-byte per pixel + (0x00B2), 5, 0x0C, 0x0C, 0x00, 0x33, 0x33, //PORCTRK: Porch setting + (0x00B7), 1, 0x35, //GCTRL: Gate Control + (0x00BB), 1, 0x2B, //VCOMS: VCOM setting + (0x00C0), 1, 0x2C, //LCMCTRL: LCM Control + (0x00C2), 2, 0x01, 0xFF, //VDVVRHEN: VDV and VRH Command Enable + (0x00C3), 1, 0x11, //VRHS: VRH Set + (0x00C4), 1, 0x20, //VDVS: VDV Set + (0x00C6), 1, 0x0F, //FRCTRL2: Frame Rate control in normal mode + (0x00D0), 2, 0xA4, 0xA1, //PWCTRL1: Power Control 1 + (0x00E0), 14, 0xD0, 0x00, 0x05, 0x0E, 0x15, 0x0D, 0x37, 0x43, 0x47, 0x09, 0x15, 0x12, 0x16, 0x19, //PVGAMCTRL: Positive Voltage Gamma control + (0x00E1), 14, 0xD0, 0x00, 0x05, 0x0D, 0x0C, 0x06, 0x2D, 0x44, 0x40, 0x0E, 0x1C, 0x18, 0x16, 0x19, //NVGAMCTRL: Negative Voltage Gamma control + (0x002A), 4, 0x00, 0x00, 0x00, 0xEF, //X address set + (0x002B), 4, 0x00, 0x00, 0x01, 0x3F, //Y address set + TFTLCD_DELAY, 10, + }; + init_table(ST7789_regValues, sizeof(ST7789_regValues)); // + break; + +// #################################################################################### + static const uint16_t ILI9225_regValues[] PROGMEM = { + /* Start Initial Sequence */ + /* Set SS bit and direction output from S528 to S1 */ + ILI9225_POWER_CTRL1, 0x0000, // Set SAP,DSTB,STB + ILI9225_POWER_CTRL2, 0x0000, // Set APON,PON,AON,VCI1EN,VC + ILI9225_POWER_CTRL3, 0x0000, // Set BT,DC1,DC2,DC3 + ILI9225_POWER_CTRL4, 0x0000, // Set GVDD + ILI9225_POWER_CTRL5, 0x0000, // Set VCOMH/VCOML voltage + TFTLCD_DELAY, 40, + + // Power-on sequence + ILI9225_POWER_CTRL2, 0x0018, // Set APON,PON,AON,VCI1EN,VC + ILI9225_POWER_CTRL3, 0x6121, // Set BT,DC1,DC2,DC3 + ILI9225_POWER_CTRL4, 0x006F, // Set GVDD /*007F 0088 */ + ILI9225_POWER_CTRL5, 0x495F, // Set VCOMH/VCOML voltage + ILI9225_POWER_CTRL1, 0x0800, // Set SAP,DSTB,STB + TFTLCD_DELAY, 10, + ILI9225_POWER_CTRL2, 0x103B, // Set APON,PON,AON,VCI1EN,VC + TFTLCD_DELAY, 50, + + ILI9225_DRIVER_OUTPUT_CTRL, 0x011C, // set the display line number and display direction + ILI9225_LCD_AC_DRIVING_CTRL, 0x0100, // set 1 line inversion + ILI9225_ENTRY_MODE, 0x1030, // set GRAM write direction and BGR=1. + ILI9225_DISP_CTRL1, 0x0000, // Display off + ILI9225_BLANK_PERIOD_CTRL1, 0x0808, // set the back porch and front porch + ILI9225_FRAME_CYCLE_CTRL, 0x1100, // set the clocks number per line + ILI9225_INTERFACE_CTRL, 0x0000, // CPU interface + ILI9225_OSC_CTRL, 0x0D01, // Set Osc /*0e01*/ + ILI9225_VCI_RECYCLING, 0x0020, // Set VCI recycling + ILI9225_RAM_ADDR_SET1, 0x0000, // RAM Address + ILI9225_RAM_ADDR_SET2, 0x0000, // RAM Address + + /* Set GRAM area */ + ILI9225_GATE_SCAN_CTRL, 0x0000, + ILI9225_VERTICAL_SCROLL_CTRL1, 0x00DB, + ILI9225_VERTICAL_SCROLL_CTRL2, 0x0000, + ILI9225_VERTICAL_SCROLL_CTRL3, 0x0000, + ILI9225_PARTIAL_DRIVING_POS1, 0x00DB, + ILI9225_PARTIAL_DRIVING_POS2, 0x0000, + ILI9225_HORIZONTAL_WINDOW_ADDR1, 0x00AF, + ILI9225_HORIZONTAL_WINDOW_ADDR2, 0x0000, + ILI9225_VERTICAL_WINDOW_ADDR1, 0x00DB, + ILI9225_VERTICAL_WINDOW_ADDR2, 0x0000, + + /* Set GAMMA curve */ + ILI9225_GAMMA_CTRL1, 0x0000, + ILI9225_GAMMA_CTRL2, 0x0808, + ILI9225_GAMMA_CTRL3, 0x080A, + ILI9225_GAMMA_CTRL4, 0x000A, + ILI9225_GAMMA_CTRL5, 0x0A08, + ILI9225_GAMMA_CTRL6, 0x0808, + ILI9225_GAMMA_CTRL7, 0x0000, + ILI9225_GAMMA_CTRL8, 0x0A00, + ILI9225_GAMMA_CTRL9, 0x0710, + ILI9225_GAMMA_CTRL10, 0x0710, + + ILI9225_DISP_CTRL1, 0x0012, + TFTLCD_DELAY, 50, + ILI9225_DISP_CTRL1, 0x1017, +}; diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/appnote_ilitek.sed b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/appnote_ilitek.sed new file mode 100644 index 0000000..a9260bf --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/appnote_ilitek.sed @@ -0,0 +1,54 @@ +#n does not work. use nsed -n + +###################################################################### +# nsed -f pagebreak.sed file.txt | nsed -n -f appnote_ilitek.sed + +# parse Ilitek App Note sequence. e.g. +# LCD_ILI9486_CMD(0XF2); +# LCD_ILI9486_INDEX(0x18); +# Delayms(1); // Delay 1ms + +:Ilitek +# //Title line +s/^[1-9].*/\/\/ &/ +# //comment to /* comment */ +s/[/][/]\(.*\)/\/\*\1\*\/ / +s/_CMD_INDEX/_CMD/ +s/_CMD_PAs/_INDEX/ +s/_ Parameter (/_INDEX(/ +/LCD_ILI9..._CMD(/b good +/Delayms(/b good +b print +{ +:good + h + :args + n + s/[/][/]\(.*\)/\/\*\1\*\/ / + s/_CMD_INDEX/_CMD/ + s/_CMD_PAs/_INDEX/ + s/_ Parameter (/_INDEX(/ + # append any data to Hold space + /LCD_ILI9..._INDEX(/{ + H + b args + } + /^$/b args + x + # parse command byte to (0xNN), + s/LCD_ILI9..._CMD(\([^)]+\)/ (\1)/ + # parse data byte to 0xNN, + s/\nLCD_ILI9..._INDEX(//g + # parse delay times + s/Delayms(\(.+\));/ TFTLCD_DELAY8, \1, / + s/)\;/,/g + s/0X/0x/g + s/,;/,/ + p + x + b Ilitek +} +:print +p + +:end \ No newline at end of file diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/appnote_novatek.sed b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/appnote_novatek.sed new file mode 100644 index 0000000..ab46823 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/appnote_novatek.sed @@ -0,0 +1,55 @@ +#n does not work. use nsed -n + +###################################################################### +# nsed -f appnote_novatek.sed inputfile +# produce output in: init_sequence.out +# still requires removing some garbage. +# adding array declaration, inserting argument count on each line. + +# parse Novatek App Note sequence. e.g. +# Lcd_Write_Com(0XF2); +# Lcd_Write_Data(0x18); +# delay(100); + +:Novatek +# trim any leading, trailing whitespace. Line scope comments +s/^[\t ]*// +s/[\t ]*$// +s/[\t ]*[/][/]\(.*\)/ \/\*\1\*\/ / +# block start +/Lcd_Write_Com(/b good +/delay(/b good +b print +{ +:good + h + :args + n + s/^[\t ]*// + s/[\t ]*$// + s/[\t ]*[/][/]\(.*\)/ \/\*\1\*\/ / + # append any data to Hold space + /Lcd_Write_Data(/{ + H + b args + } + /^$/b args + x + # trim ( 0xNN ) to (0xNN) + s/( */(/g + s/ *)/)/g + # parse command byte to (0xNN), + s/Lcd_Write_Com(\([^)]+\)/ (\1)/ + # parse data byte to 0xNN, + s/\nLcd_Write_Data(//g + # parse delay times + s/delay(\(.+\));/ TFTLCD_DELAY8, \1, / + s/) *\;/,/g + s/0X/0x/g + s/,;/,/ + winit_sequence.out + x + b Novatek +} +:print +:end diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/appnote_renesas.sed b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/appnote_renesas.sed new file mode 100644 index 0000000..dda50e0 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/appnote_renesas.sed @@ -0,0 +1,47 @@ +#n does not work. use nsed -n + +###################################################################### +# parse Renesas App Note sequence. e.g. +# {setc, [107], W, 0x000B0} +# {setc, 0x000D0} +# {setp, 0x00033} +# {time, 0040,ms} + +:Renesas +# //Title line +s/^[1-9].*/\/\/ &/ +# //comment to /* comment */ +s/[/][/]\(.*\)/\/\*\1\*\/ / +/{setc,/b good +/{time,/b good +b print +{ +:good + h + :args + n + s/[/][/]\(.*\)/\/\*\1\*\/ / + # append any data to Hold space + /setp/{ + H + b args + } +# /^$/b args + x + # verbose format + s/, \[[0-9]+\], W, 0x/, 0x/g + # parse command byte to (0xNN), + s/{setc, 0x000\(..\)}/ (0x\1), / + # parse data byte to 0xNN, + # s/\nLCD_ILI9486_INDEX(//g + s/\n{setp, 0x000\(..\)}/0x\1, /g + s/\n{setp, 0x00\(...\)}/0x\1, /g + # parse delay times + s/{time, 0*\(.*\),ms}/ TFTLCD_DELAY8, \1, / + s/)\;/,/g + p + x + b Renesas +} +:print +p diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ili9341_init.h b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ili9341_init.h new file mode 100644 index 0000000..70786e7 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ili9341_init.h @@ -0,0 +1,138 @@ +/* 1.2 LG 2.6” Initial Code*/ +void ILI9341_LG2.6_Initial(void) +{ +/* VCI=2.8V*/ +/************** Reset LCD Driver ****************//*/ +LCD_nRESET = 1; +delayms(1); /* Delay 1ms*/ +LCD_nRESET = 0; +delayms(10); /* Delay 10ms // This delay time is necessary*/ +LCD_nRESET = 1; +delayms(120); /* Delay 120 ms*/ +/************** Start Initial Sequence **********//*/ + (0xCB),0x39,0x2C,0x00,0x34,0x02, + (0xCF),0x00,0xC1,0x30, + (0xE8),0x85,0x00,0x78, + (0xEA),0x00,0x00, + (0xED),0x64,0x03,0x12,0x81) + (0xF7),0x20, + (0xC0), /*Power control*/ 0x23, /*VRH[5:0]*/ + (0xC1), /*Power control*/ 0x10, /*SAP[2:0];BT[3:0]*/ + (0xC5), /*VCM control*/ 0x2B,0x2B, +/* (0xC7), /*VCM control2*/ */ +/*LCD_ILI9341_INDEX(0xC0,*/ + (0x36), /* Memory Access Control*/ 0x48, + (0xB1),0x00,0x1B, + (0xB6), /* Display Function Control*/ 0x0A,0x02, + (0xF2), /* 3Gamma Function Disable*/ 0x00, + (0x26), /*Gamma curve selected*/ 0x01, + (0xE0), /*Set Gamma*/ 0x0F,0x31,0x2B,0x0C,0x0E,0x08,0x4E,0xF1,0x37,0x07,0x10,0x03,0x0E,0x09,0x00, + (0xE1), /*Set Gamma*/ 0x00,0x0E,0x14,0x03,0x11,0x07,0x31,0xC1,0x48,0x08,0x0F,0x0C,0x31,0x36,0x0F, + (0x11), /*Exit Sleep*/ + TFTLCD_DELAY8, 120, + (0x29), /*Display on*/ +} + + +/* 2.2 BOE 2.0” Initial Code*/ +void ILI9341_BOE2.0_Initial(void) +{ +/* VCI=2.8V*/ +/************** Reset LCD Driver ****************//*/ +LCD_nRESET = 1; +delayms(1); /* Delay 1ms*/ +LCD_nRESET = 0; +delayms(10); /* Delay 10ms // This delay time is necessary*/ +LCD_nRESET = 1; +delayms(120); /* Delay 120 ms*/ +/************** Start Initial Sequence **********//*/ + (0xCF),0x00,0x99,0x30, + (0xED),0x64,0x03,0x12,0x81, + (0xE8),0x85,0x10,0x78, + (0xCB),0x39,0x2C,0x00,0x34,0x02, + (0xF7),0x20, + (0xEA),0x00,0x00, + (0xC0), /*Power control*/ 0x26, /*VRH[5:0]*/ + (0xC1), /*Power control*/ 0x12, /*SAP[2:0];BT[3:0]*/ + (0xC5), /*VCM control*/ 0x2B,0x2C, + (0xC7), /*VCM control2*/ 0xC4, + (0x36), /* Memory Access Control*/ 0x08, + (0xB1),0x00,0x1B, + (0xB6), /* Display Function Control*/ 0x0A,0xA2, + (0xF2), /* 3Gamma Function Disable*/ 0x00, + (0x26), /*Gamma curve selected*/ 0x01, + (0xE0), /*Set Gamma*/ 0x0F,0x24,0x21,0x0A,0x0E,0x09,0x51,0xA9,0x44,0x07,0x10,0x03,0x2C,0x0B,0x00, + (0xE1), /*Set Gamma*/ 0x00,0x1B,0x1E,0x05,0x11,0x06,0x2E,0x56,0x3B,0x08,0x0F,0x0C,0x13,0x14,0x0F, + (0x11), /*Exit Sleep*/ + TFTLCD_DELAY8, 120, + (0x29), /*Display on*/ +} + +/* 2.3 BOE 2.4” Initial Code*/ +void ILI9341_BOE2.4_Initial(void) +{ +/* VCI=2.8V*/ +/************** Reset LCD Driver ****************//*/ +LCD_nRESET = 1; +delayms(1); /* Delay 1ms*/ +LCD_nRESET = 0; +delayms(10); /* Delay 10ms // This delay time is necessary*/ +LCD_nRESET = 1; +delayms(120); /* Delay 120 ms*/ +/************** Start Initial Sequence **********//*/ + (0xCF),0x00,0x81,0x30, + (0xED),0x64,0x03,0x12,0x81, + (0xE8),0x85,0x10,0x78, + (0xCB),0x39,0x2C,0x00,0x34,0x02, + (0xF7),0x20, + (0xEA),0x00,0x00, + (0xB1),0x00,0x1B, + (0xB6), /* Display Function Control*/ 0x0A,0xA2, + (0xC0), /*Power control*/ 0x21, /*VRH[5:0]*/ + (0xC1), /*Power control*/ 0x11, /*SAP[2:0];BT[3:0]*/ + (0xC5), /*VCM control*/ 0x3F,0x3C, + (0xC7), /*VCM control2*/ 0xb5, + (0x36), /* Memory Access Control*/ 0x48, + (0xF2), /* 3Gamma Function Disable*/ 0x00, + (0x26), /*Gamma curve selected*/ 0x01, + (0xE0), /*Set Gamma*/ 0x0F,0x26,0x24,0x0B,0x0E,0x09,0x54,0xA8,0x46,0x0C,0x17,0x09,0x0F,0x07,0x00, + (0xE1), /*Set Gamma*/ 0x00,0x19,0x1B,0x04,0x10,0x07,0x2A,0x47,0x39,0x03,0x06,0x06,0x30,0x38,0x0F, + (0x11), /*Exit Sleep*/ + TFTLCD_DELAY8, 120, + (0x29), /*Display on*/ +} + +/* 3.2 Tianma 2.4” Initial Code*/ +void ILI9341_Tianma2.4_Initial(void) +{ +/* VCI=2.8V*/ +/************** Reset LCD Driver ****************//*/ +LCD_nRESET = 1; +delayms(1); /* Delay 1ms*/ +LCD_nRESET = 0; +delayms(10); /* Delay 10ms // This delay time is necessary*/ +LCD_nRESET = 1; +delayms(120); /* Delay 120 ms*/ +/************** Start Initial Sequence **********//*/ + (0xCF),0x00,0x81,0x30, + (0xED),0x64,0x03,0x12,0x81, + (0xE8),0x85,0x10,0x7A, + (0xCB),0x39,0x2C,0x00,0x34,0x02, + (0xF7),0x20, + (0xEA),0x00,0x00, + (0xC0), /*Power control*/ 0x21, /*VRH[5:0]*/ + (0xC1), /*Power control*/ 0x11, /*SAP[2:0];BT[3:0]*/ + (0xC5), /*VCM control*/ 0x3F,0x3C, + (0xC7), /*VCM control2*/ 0xa7, + (0x36), /* Memory Access Control*/ 0x48, + (0xB1),0x00,0x1B, + (0xB6), /* Display Function Control*/ 0x0A,0xA2, + (0xF2), /* 3Gamma Function Disable*/ 0x00, + (0x26), /*Gamma curve selected*/ 0x01, + (0xE0), /*Set Gamma*/ 0x0F,0x23,0x1F,0x0B,0x0E,0x08,0x4B,0xA8,0x3B,0x0A,0x14,0x06,0x10,0x09,0x00, + (0xE1), /*Set Gamma*/ 0x00,0x1C,0x20,0x04,0x10,0x08,0x34,0x47,0x44,0x05,0x0B,0x09,0x2F,0x36,0x0F, + (0x11), /*Exit Sleep*/ + TFTLCD_DELAY8, 120, + (0x29), /*Display on*/ +} + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ili9481_init.h b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ili9481_init.h new file mode 100644 index 0000000..038929e --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ili9481_init.h @@ -0,0 +1,114 @@ +/* 1.2 CPT 2.9 Inch Initial Code*/ +Void ILI9481_CPT_Initial_Code(void) +{ +/* VCI=2.8V*/ +/************** Reset LCD Driver ****************//*/ +LCD_nRESET = 1; +delayms(1); /* Delay 1ms*/ +LCD_nRESET = 0; +delayms(10); /* Delay 10ms // This delay time is necessary*/ +LCD_nRESET = 1; +delayms(100); /* Delay 100 ms*/ +/************** Start Initial Sequence **********//*/ + (0x11), + TFTLCD_DELAY8, 20, + (0xD0),0x07,0x42,0x1C, + (0xD1),0x,0x02,0x0F, + (0xD2),0x01,0x11, + (0xC0),0x10,0x35,0x,0x02,0x11, + (0xC5), + +LCD_ILI9481_INDEX(0x03); + (0xC8),0x,0x30,0x36,0x45,0x04,0x16,0x37,0x75,0x77,0x54,0x0F,0x, + (0xE4),0xA0, + (0xF0),0x01, + (0xF3),0x02,0x1A) +; + (0x36),0x0A, + (0x2A),0x,0x,0x01,0x3F, + (0x2B),0x,0x,0x01,0xAD, + TFTLCD_DELAY8, 120, + + (0x29), +} + +/* 2.2 PVI 3.5 Inch Initial Code*/ +Void ILI9481_CPT_Initial_Code(void) +{ +/* VCI=2.8V*/ +/************** Reset LCD Driver ****************//*/ +LCD_nRESET = 1; +delayms(1); /* Delay 1ms*/ +LCD_nRESET = 0; +delayms(10); /* Delay 10ms // This delay time is necessary*/ +LCD_nRESET = 1; +delayms(100); /* Delay 100 ms*/ +/************** Start Initial Sequence **********//*/ + (0x11), + TFTLCD_DELAY8, 20, + (0xD0),0x07,0x41,0x1D, + (0xD1),0x,0x2B,0x1F, + (0xD2),0x01,0x11, + (0xC0),0x,0x3B,0x,0x02,0x11, + + (0xC5),0x03, + (0xC8),0x,0x14,0x33,0x10,0x,0x16,0x44,0x36,0x77,0x,0x0f,0x, + (0xE4),0xA0, + (0xF0),0x01, + (0xF3),0x40,0x0A, + (0x36),0x0A, + TFTLCD_DELAY8, 120, + (0x29), + +/* 3.2. AUO 3.17 Inch Initial Code*/ +Void ILI9481_AUO_Initial_Code(void) +{ +/* VCI=2.8V*/ +/************** Reset LCD Driver ****************//*/ +LCD_nRESET = 1; +delayms(1); /* Delay 1ms*/ +LCD_nRESET = 0; +delayms(10); /* Delay 10ms // This delay time is necessary*/ +LCD_nRESET = 1; +delayms(100); /* Delay 100 ms*/ +/************** Start Initial Sequence **********//*/ + (0x11), + TFTLCD_DELAY8, 20, + (0xD0),0x07,0x40,0x1D, + (0xD1),0x,0x18,0x13, + (0xD2),0x01,0x11, + (0xC0),0x10,0x3B,0x,0x02,0x11, + + (0xC5),0x03, + (0xC8),0x,0x44,0x06,0x44,0x0A,0x08,0x17,0x33,0x77,0x44,0x08,0x0c, + (0xE4),0xA0, + (0xF0),0x01, + (0x36),0x0A, + TFTLCD_DELAY8, 120, + (0x29), + +/* 4.2. CMO 3.5 Inch Initial Code*/ + (0x01), +DelayX1ms(120); + (0x11), +DelayX1ms(120); +/*Power Setting*/ + (0xD0),0x07,0x41,0x1D, +DelayX1ms(20); +/*Vcom Setting*/ + (0xD1),0x00,0x1C,/*18*/ 0x1F, +/*Power Setting for normal mode*/ + (0xD2),0x01,0x11, + (0xC0), /*Panel Driving Setting*/ 0x00,0x3B,0x00,0x02,0x11, + (0xC6),0x83, + + (0xC8),0x00,0x26,0x21,0x00,0x00,0x1F,0x65,0x23,0x77,0x00,0x0F,0x00, + (0xF0),0x01, +/* (0xE4),*/ +/*LCD_ILI9481_INDEX(0xA0,*/ + (0x36),0x48,/*0x08 _BGR,0x _RGB*/ +/*Set display on*/ + (0x29), + (0xB4),0x11, + (0x2C), + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ili9486_init.h b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ili9486_init.h new file mode 100644 index 0000000..0b402a7 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/ili9486_init.h @@ -0,0 +1,158 @@ +/* 1.2CPT 3.5 Inch Initial Code*/ +Void ILI9486_CPT_Initial_Code(void) +{/* VCI=2.8V*/ +/************** Reset LCD Driver ****************//*/ +LCD_nRESET = 1; + TFTLCD_DELAY8, 1, /* Delay 1ms*/ +LCD_nRESET = 0; + TFTLCD_DELAY8, 10, /* Delay 10ms // This delay time is necessary*/ +LCD_nRESET = 1; + TFTLCD_DELAY8, 120, /* Delay 120 ms*/ +/************** Start Initial Sequence **********/**/ */ + (0xF2),0x18,0xA3,0x12,0x02,0xB2,0x12,0xFF,0x10,0x00, + (0xF8),0x21,0x04, + (0xF9),0x00,0x08, + (0x36),0x08, + (0xB4),0x00, + (0xC1),0x41, + (0xC5),0x00,0x53, + (0xE0),0x0F,0x1B,0x18,0x0B,0x0E,0x09,0x47,0x94,0x35,0x0A,0x13,0x05,0x08,0x03,0x00, + (0xE1),0x0F,0x3A,0x37,0x0B,0x0C,0x05,0x4A,0x24,0x39,0x07,0x10,0x04,0x27,0x25,0x00, + (0x11), + TFTLCD_DELAY8, 120, + (0x29), +} +Void ILI9486_EnterSleep_Code(void) +{ + (0x28)) + TFTLCD_DELAY8, 10, + (0x10), /* Set_address_mode*/ + TFTLCD_DELAY8, 120, +} +Void ILI9486_ExitSleep_Code(void) +{ + (0x11), /* Set_address_mode*/ + TFTLCD_DELAY8, 120, + (0x29)) +} + +/* 2.2 HSD 3.5 Inch Initial Code*/ +Void ILI9486_HSD_Initial_Code(void) +{/* VCI=2.8V*/ +/************** Reset LCD Driver ****************//*/ +LCD_nRESET = 1; + TFTLCD_DELAY8, 1, /* Delay 1ms*/ +LCD_nRESET = 0; + TFTLCD_DELAY8, 10, /* Delay 10ms // This delay time is necessary*/ +LCD_nRESET = 1; + TFTLCD_DELAY8, 120, /* Delay 120 ms*/ +/************** Start Initial Sequence **********/**/ */ + (0xF2),0x18,0xA3,0x12,0x02,0xB2,0x12,0xFF,0x10,0x00, + (0xF8),0x21,0x04, + (0xF9),0x00,0x08, + (0x36),0x08, + (0xB4),0x00, + (0xB6),0x02,0x22, + (0xC1),0x41, + (0xC5),0x00,0x18, + (0xE0),0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00, + (0xE1),0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00, + (0x11), + TFTLCD_DELAY8, 120, + (0x29), +} +Void ILI9486_EnterSleep_Code(void) +{ + (0x28)) + TFTLCD_DELAY8, 10, + (0x10), + TFTLCD_DELAY8, 120, +} +Void ILI9486_ExitSleep_Code(void) +{ + (0x11), + TFTLCD_DELAY8, 120, + (0x29)) +} + +/* 3.2 TM 3.2 Inch Initial Code*/ +Void ILI9486_TM_Initial_Code(void) +{/* VCI=2.8V*/ +/************** Reset LCD Driver ****************//*/ +LCD_nRESET = 1; + TFTLCD_DELAY8, 1, /* Delay 1ms*/ +LCD_nRESET = 0; + TFTLCD_DELAY8, 10, /* Delay 10ms // This delay time is necessary*/ +LCD_nRESET = 1; + TFTLCD_DELAY8, 120, /* Delay 120 ms*/ +/************** Start Initial Sequence **********/**/ */ + (0xF2),0x18,0xA3,0x12,0x02,0xB2,0x12,0xFF,0x10,0x00, + (0xF8),0x21,0x04, + (0xF9),0x00,0x08, + (0x36),0x08, + (0xB4),0x00, + (0xB6),0x02,0x22, + (0xC1),0x41, + (0xC5),0x00,0x55, + (0xE0),0x0F,0x21,0x1C,0x0B,0x0E,0x08,0x49,0x98,0x38,0x09,0x11,0x03,0x14,0x10,0x00, + (0xE1),0x0F,0x2F,0x2B,0x0C,0x0E,0x06,0x47,0x76,0x37,0x07,0x11,0x04,0x23,0x1E,0x00, + (0x11), + TFTLCD_DELAY8, 120, + (0x29), +} +Void ILI9486_EnterSleep_Code(void) +{ + (0x28)) + TFTLCD_DELAY8, 10, + (0x10), + TFTLCD_DELAY8, 120, +} +Void ILI9486_ExitSleep_Code(void) +{ + (0x11), + TFTLCD_DELAY8, 120, + (0x29)) +} + + +/* 4.2 WTK 3.5 Inch Initial Code*/ +Void ILI9486_WTK_Initial_Code(void) +{/* VCI=2.8V*/ +/************** Reset LCD Driver ****************//*/ +LCD_nRESET = 1; + TFTLCD_DELAY8, 1, /* Delay 1ms*/ +LCD_nRESET = 0; + TFTLCD_DELAY8, 10, /* Delay 10ms // This delay time is necessary*/ +LCD_nRESET = 1; + TFTLCD_DELAY8, 120, /* Delay 120 ms*/ +/************** Start Initial Sequence **********/**/ */ + (0xF2),0x18,0xA3,0x12,0x02,0xB2,0x12,0xFF,0x10,0x00, + (0xF8),0x21,0x04, + (0xF9),0x00,0x08, + (0x21), + (0x36),0x08, + (0xB4),0x00, + (0xB6),0x02,0x22, + (0xC1),0x41, + (0xC5),0x00,0x53, + (0xE0),0x0F,0x10,0x08,0x05,0x09,0x05,0x37,0x98,0x26,0x07,0x0F,0x02,0x09,0x07,0x00, + (0xE1),0x0F,0x38,0x36,0x0D,0x10,0x08,0x59,0x76,0x48,0x0A,0x16,0x0A,0x37,0x2F,0x00, + (0x11), + TFTLCD_DELAY8, 120, + (0x29), +} +Void ILI9486_EnterSleep_Code(void) +{ + (0x28)) + TFTLCD_DELAY8, 10, + (0x10), + TFTLCD_DELAY8, 120, +} +Void ILI9486_ExitSleep_Code(void) +{ + (0x11), + TFTLCD_DELAY8, 120, + (0x29)) +} + + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/mcufriend_special_2.h b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/mcufriend_special_2.h new file mode 100644 index 0000000..ece28f3 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/mcufriend_special_2.h @@ -0,0 +1,1729 @@ + +// ################ edits for 5310 ########################## +ret = readReg32(0xD4); +if (ret == 0x5310) //NT35310: [xx 01 53 10] + return 0x5310; + + +case 0x5310: +_lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | REV_SCREEN | INVERT_GS; +static const uint8_t NT35310_regValues[] PROGMEM = { // + 0xED, 2, 0x01, 0xFE, //CMD2UNLOCK +}; +table8_ads = NT35310_regValues, table_size = sizeof(NT35310_regValues); +p16 = (int16_t *) & HEIGHT; +*p16 = 480; +p16 = (int16_t *) & WIDTH; +*p16 = 320; +break; +{ + { + static const uint8_t NT35310_regValues[] PROGMEM = { // + (0xED), 2, 0x01, 0xFE, + (0xEE), 2, 0xDE, 0x21, + (0xF1), 1, 0x01, + (0xDF), 1, 0x10, + /*VCOMvoltage//*/ + (0xC4), 1, 0x8F, /*5f*/ + (0xC6), 4, 0x00, 0xE2, 0xE2, 0xE2, + (0xBF), 1, 0xAA, + (0xB0), 18, 0x0D, 0x00, 0x0D, 0x00, 0x11, 0x00, 0x19, 0x00, 0x21, 0x00, 0x2D, 0x00, 0x3D, 0x00, 0x5D, 0x00, 0x5D, 0x00, + (0xB1), 6, 0x80, 0x00, 0x8B, 0x00, 0x96, 0x00, + (0xB2), 6, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, + (0xB3), 24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + (0xB4), 6, 0x8B, 0x00, 0x96, 0x00, 0xA1, 0x00, + (0xB5), 6, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, + (0xB6), 2, 0x00, 0x00, + (0xB7), 22, 0x00, 0x00, 0x3F, 0x00, 0x5E, 0x00, 0x64, 0x00, 0x8C, 0x00, 0xAC, 0x00, 0xDC, 0x00, 0x70, 0x00, 0x90, 0x00, 0xEB, 0x00, 0xDC, 0x00, + (0xB8), 8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + (0xBA), 4, 0x24, 0x00, 0x00, 0x00, + (0xC1), 6, 0x20, 0x00, 0x54, 0x00, 0xFF, 0x00, + (0xC2), 4, 0x0A, 0x00, 0x04, 0x00, + (0xC3), 48, 0x3C, 0x00, 0x3A, 0x00, 0x39, 0x00, 0x37, 0x00, 0x3C, 0x00, 0x36, 0x00, 0x32, 0x00, 0x2F, 0x00, 0x2C, 0x00, 0x29, 0x00, 0x26, 0x00, 0x24, 0x00, 0x24, 0x00, 0x23, 0x00, 0x3C, 0x00, 0x36, 0x00, 0x32, 0x00, 0x2F, 0x00, 0x2C, 0x00, 0x29, 0x00, 0x26, 0x00, 0x24, 0x00, 0x24, 0x00, 0x23, 0x00, + (0xC4), 26, 0x62, 0x00, 0x05, 0x00, 0x84, 0x00, 0xF0, 0x00, 0x18, 0x00, 0xA4, 0x00, 0x18, 0x00, 0x50, 0x00, 0x0C, 0x00, 0x17, 0x00, 0x95, 0x00, 0xF3, 0x00, 0xE6, 0x00, + (0xC5), 10, 0x32, 0x00, 0x44, 0x00, 0x65, 0x00, 0x76, 0x00, 0x88, 0x00, + (0xC6), 6, 0x20, 0x00, 0x17, 0x00, 0x01, 0x00, + (0xC7), 4, 0x00, 0x00, 0x00, 0x00, + (0xC8), 4, 0x00, 0x00, 0x00, 0x00, + (0xC9), 16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + (0xE0), 36, 0x16, 0x00, 0x1C, 0x00, 0x21, 0x00, 0x36, 0x00, 0x46, 0x00, 0x52, 0x00, 0x64, 0x00, 0x7A, 0x00, 0x8B, 0x00, 0x99, 0x00, 0xA8, 0x00, 0xB9, 0x00, 0xC4, 0x00, 0xCA, 0x00, 0xD2, 0x00, 0xD9, 0x00, 0xE0, 0x00, 0xF3, 0x00, + (0xE1), 36, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x36, 0x00, 0x45, 0x00, 0x52, 0x00, 0x64, 0x00, 0x7A, 0x00, 0x8B, 0x00, 0x99, 0x00, 0xA8, 0x00, 0xB9, 0x00, 0xC4, 0x00, 0xCA, 0x00, 0xD2, 0x00, 0xD8, 0x00, 0xE0, 0x00, 0xF3, 0x00, + (0xE2), 36, 0x05, 0x00, 0x0B, 0x00, 0x1B, 0x00, 0x34, 0x00, 0x44, 0x00, 0x4F, 0x00, 0x61, 0x00, 0x79, 0x00, 0x88, 0x00, 0x97, 0x00, 0xA6, 0x00, 0xB7, 0x00, 0xC2, 0x00, 0xC7, 0x00, 0xD1, 0x00, 0xD6, 0x00, 0xDD, 0x00, 0xF3, 0x00, + (0xE3), 36, 0x05, 0x00, 0x0A, 0x00, 0x1C, 0x00, 0x33, 0x00, 0x44, 0x00, 0x50, 0x00, 0x62, 0x00, 0x78, 0x00, 0x88, 0x00, 0x97, 0x00, 0xA6, 0x00, 0xB7, 0x00, 0xC2, 0x00, 0xC7, 0x00, 0xD1, 0x00, 0xD5, 0x00, 0xDD, 0x00, 0xF3, 0x00, + (0xE4), 36, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x2A, 0x00, 0x3C, 0x00, 0x4B, 0x00, 0x5D, 0x00, 0x74, 0x00, 0x84, 0x00, 0x93, 0x00, 0xA2, 0x00, 0xB3, 0x00, 0xBE, 0x00, 0xC4, 0x00, 0xCD, 0x00, 0xD3, 0x00, 0xDD, 0x00, 0xF3, 0x00, + (0xE5), 36, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x29, 0x00, 0x3C, 0x00, 0x4B, 0x00, 0x5D, 0x00, 0x74, 0x00, 0x84, 0x00, 0x93, 0x00, 0xA2, 0x00, 0xB3, 0x00, 0xBE, 0x00, 0xC4, 0x00, 0xCD, 0x00, 0xD3, 0x00, 0xDC, 0x00, 0xF3, 0x00, + (0xE6), 32, 0x11, 0x00, 0x34, 0x00, 0x56, 0x00, 0x76, 0x00, 0x77, 0x00, 0x66, 0x00, 0x88, 0x00, 0x99, 0x00, 0xBB, 0x00, 0x99, 0x00, 0x66, 0x00, 0x55, 0x00, 0x55, 0x00, 0x45, 0x00, 0x43, 0x00, 0x44, 0x00, + (0xE7), 32, 0x32, 0x00, 0x55, 0x00, 0x76, 0x00, 0x66, 0x00, 0x67, 0x00, 0x67, 0x00, 0x87, 0x00, 0x99, 0x00, 0xBB, 0x00, 0x99, 0x00, 0x77, 0x00, 0x44, 0x00, 0x56, 0x00, 0x23, 0x00, 0x33, 0x00, 0x45, 0x00, + (0xE8), 32, 0x00, 0x00, 0x99, 0x00, 0x87, 0x00, 0x88, 0x00, 0x77, 0x00, 0x66, 0x00, 0x88, 0x00, 0xAA, 0x00, 0xBB, 0x00, 0x99, 0x00, 0x66, 0x00, 0x55, 0x00, 0x55, 0x00, 0x44, 0x00, 0x44, 0x00, 0x55, 0x00, + (0xE9), 4, 0xAA, 0x00, 0x00, 0x00, + (0x00), 1, 0xAA, + (0xCF), 17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + (0xF0), 5, 0x00, 0x50, 0x00, 0x00, 0x00, + (0xF3), 1, 0x00, + (0xF9), 4, 0x06, 0x10, 0x29, 0x00, + (0x3A), 1, 0x55, /*66*/ + (0x11), 0, + TFTLCD_DELAY8, 100, + (0x29), 0, + (0x35), 1, 0x00, + (0x51), 1, 0xFF, + (0x53), 1, 0x2C, + (0x55), 1, 0x82, + }; + } +} + +// ######################## SPECIAL for Kippert ##################################################### + +//-- Arduino DUE_ELECHOUSE_SHIELD +#define LCD_RST 33 //PC1 +#define LCD_CS 31 //PA7 +#define LCD_RS 22 //PB26 +#define LCD_WR 23 //PA14 +#define LCD_RD 24 //PA15 + +#define LCD_D0 34 //PC2 +#define LCD_D1 35 +#define LCD_D2 36 +#define LCD_D3 37 +#define LCD_D4 38 +#define LCD_D5 39 +#define LCD_D6 40 +#define LCD_D7 41 //PC9 + +// ############### tables generated from Ilitek App Note ############################################################### +{ + { + static const uint8_t ILI9341_LG2.6_Initial[] PROGMEM = { + (0xCB), 5, 0x39, 0x2C, 0x00, 0x34, 0x02, + (0xCF), 3, 0x00, 0xC1, 0x30, + (0xE8), 3, 0x85, 0x00, 0x78, + (0xEA), 2, 0x00, 0x00, + (0xED), 4, 0x64, 0x03, 0x12, 0x81, + (0xF7), 1, 0x20, + (0xC0), 1, /*Power control*/ 0x23, /*VRH[5:0]*/ + (0xC1), 1, /*Power control*/ 0x10, /*SAP[2:0];BT[3:0]*/ + (0xC5), 2, /*VCM control*/ 0x2B, 0x2B, + // (0xC7), 1, /*VCM control2*/ 0xC0, + (0x36), 1, /* Memory Access Control*/ 0x48, + (0xB1), 2, 0x00, 0x1B, + (0xB6), 2, /* Display Function Control*/ 0x0A, 0x02, + (0xF2), 1, /* 3Gamma Function Disable*/ 0x00, + (0x26), 1, /*Gamma curve selected*/ 0x01, + (0xE0), 15, /*Set Gamma*/ 0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, 0x4E, 0xF1, 0x37, 0x07, 0x10, 0x03, 0x0E, 0x09, 0x00, + (0xE1), 15, /*Set Gamma*/ 0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F, + }; + + static const uint8_t ILI9341_BOE2.0_Initial[] PROGMEM = { + (0xCF), 3, 0x00, 0x99, 0x30, + (0xED), 4, 0x64, 0x03, 0x12, 0x81, + (0xE8), 3, 0x85, 0x10, 0x78, + (0xCB), 5, 0x39, 0x2C, 0x00, 0x34, 0x02, + (0xF7), 1, 0x20, + (0xEA), 2, 0x00, 0x00, + (0xC0), 1, /*Power control*/ 0x26, /*VRH[5:0]*/ + (0xC1), 1, /*Power control*/ 0x12, /*SAP[2:0];BT[3:0]*/ + (0xC5), 2, /*VCM control*/ 0x2B, 0x2C, + (0xC7), 1, /*VCM control2*/ 0xC4, + (0x36), 1, /* Memory Access Control*/ 0x08, + (0xB1), 2, 0x00, 0x1B, + (0xB6), 2, /* Display Function Control*/ 0x0A, 0xA2, + (0xF2), 1, /* 3Gamma Function Disable*/ 0x00, + (0x26), 1, /*Gamma curve selected*/ 0x01, + (0xE0), 15, /*Set Gamma*/ 0x0F, 0x24, 0x21, 0x0A, 0x0E, 0x09, 0x51, 0xA9, 0x44, 0x07, 0x10, 0x03, 0x2C, 0x0B, 0x00, + (0xE1), 15, /*Set Gamma*/ 0x00, 0x1B, 0x1E, 0x05, 0x11, 0x06, 0x2E, 0x56, 0x3B, 0x08, 0x0F, 0x0C, 0x13, 0x14, 0x0F, + }; + + static const uint8_t ILI9341_BOE2.4_Initial[] PROGMEM = { + (0xCF), 3, 0x00, 0x81, 0x30, + (0xED), 4, 0x64, 0x03, 0x12, 0x81, + (0xE8), 3, 0x85, 0x10, 0x78, + (0xCB), 5, 0x39, 0x2C, 0x00, 0x34, 0x02, + (0xF7), 1, 0x20, + (0xEA), 2, 0x00, 0x00, + (0xB1), 2, 0x00, 0x1B, + (0xB6), 2, /* Display Function Control*/ 0x0A, 0xA2, + (0xC0), 1, /*Power control*/ 0x21, /*VRH[5:0]*/ + (0xC1), 1, /*Power control*/ 0x11, /*SAP[2:0];BT[3:0]*/ + (0xC5), 2, /*VCM control*/ 0x3F, 0x3C, + (0xC7), 1, /*VCM control2*/ 0xb5, + (0x36), 1, /* Memory Access Control*/ 0x48, + (0xF2), 1, /* 3Gamma Function Disable*/ 0x00, + (0x26), 1, /*Gamma curve selected*/ 0x01, + (0xE0), 15, /*Set Gamma*/ 0x0F, 0x26, 0x24, 0x0B, 0x0E, 0x09, 0x54, 0xA8, 0x46, 0x0C, 0x17, 0x09, 0x0F, 0x07, 0x00, + (0xE1), 15, /*Set Gamma*/ 0x00, 0x19, 0x1B, 0x04, 0x10, 0x07, 0x2A, 0x47, 0x39, 0x03, 0x06, 0x06, 0x30, 0x38, 0x0F, + }; + + static const uint8_t ILI9341_Tianma2.4_Initial[] PROGMEM = { + (0xCF), 3, 0x00, 0x81, 0x30, + (0xED), 4, 0x64, 0x03, 0x12, 0x81, + (0xE8), 3, 0x85, 0x10, 0x7A, + (0xCB), 5, 0x39, 0x2C, 0x00, 0x34, 0x02, + (0xF7), 1, 0x20, + (0xEA), 2, 0x00, 0x00, + (0xC0), 1, /*Power control*/ 0x21, /*VRH[5:0]*/ + (0xC1), 1, /*Power control*/ 0x11, /*SAP[2:0];BT[3:0]*/ + (0xC5), 2, /*VCM control*/ 0x3F, 0x3C, + (0xC7), 1, /*VCM control2*/ 0xa7, + (0x36), 1, /* Memory Access Control*/ 0x48, + (0xB1), 2, 0x00, 0x1B, + (0xB6), 2, /* Display Function Control*/ 0x0A, 0xA2, + (0xF2), 1, /* 3Gamma Function Disable*/ 0x00, + (0x26), 1, /*Gamma curve selected*/ 0x01, + (0xE0), 15, /*Set Gamma*/ 0x0F, 0x23, 0x1F, 0x0B, 0x0E, 0x08, 0x4B, 0xA8, 0x3B, 0x0A, 0x14, 0x06, 0x10, 0x09, 0x00, + (0xE1), 15, /*Set Gamma*/ 0x00, 0x1C, 0x20, 0x04, 0x10, 0x08, 0x34, 0x47, 0x44, 0x05, 0x0B, 0x09, 0x2F, 0x36, 0x0F, + }; + + // table8_ads = ILI9341_LG2.6_Initial, table_size = sizeof(ILI9341_LG2.6_Initial); // + // table8_ads = ILI9341_BOE2.0_Initial, table_size = sizeof(ILI9341_BOE2.0_Initial); // + // table8_ads = ILI9341_BOE2.4_Initial, table_size = sizeof(ILI9341_BOE2.4_Initial); // + // table8_ads = ILI9341_Tianma2.4_Initial, table_size = sizeof(ILI9341_Tianma2.4_Initial); // + } +} + +// ############### R61580 block ############################ +{ + { +#define SUPPORT_1580 +#ifdef SUPPORT_1580 + case 0x1580: + _lcd_capable = 0 | REV_SCREEN | READ_BGR; + static const uint16_t R61580_regValues[] PROGMEM = { + // Synchronization after reset + TFTLCD_DELAY, 2, + 0x0000, 0x0000, + 0x0000, 0x0000, + 0x0000, 0x0000, + 0x0000, 0x0000, + + // Setup display + 0x00A4, 0x0001, // NVM_4 [0000] CALB=1 + TFTLCD_DELAY, 2, + 0x0060, 0xA700, // Driver_2 [2700] GS=1 + 0x0008, 0x0808, // Display_2 [0808] BP=8, FP=8 + 0x0030, 0x0111, // y control + 0x0031, 0x2410, // y control + 0x0032, 0x0501, // y control + 0x0033, 0x050C, // y control + 0x0034, 0x2211, // y control + 0x0035, 0x0C05, // y control + 0x0036, 0x2105, // y control + 0x0037, 0x1004, // y control + 0x0038, 0x1101, // y control + 0x0039, 0x1122, // y control + 0x0090, 0x0019, // Panel_1 [0111] 80Hz + 0x0010, 0x0530, // Power_1 [0530] + 0x0011, 0x0237, // Power_2 [0237] + 0x0012, 0x01BF, // Power_3 [018F] PSON=1, PON=1 + 0x0013, 0x1300, // Power_4 [0000] VDV=0x13 + TFTLCD_DELAY, 100, + + 0x0001, 0x0100, // DRVOUT_1 [0000] SS=1 + 0x0002, 0x0200, // LCD_DRV [0000] BC0=1 + 0x0003, 0x1030, // ENTRY [0030] BGR=1 + 0x0009, 0x0001, // Displ_3 [0001] + 0x000A, 0x0008, // Displ_4 [0000] FMARKOE=1 + 0x000C, 0x0001, // Ext_1 [0000] RIM=1 + 0x000D, 0xD000, // Frame Marker [0000] ???? + 0x000E, 0x0030, // VCOM_LP [0030] + 0x000F, 0x0000, // EXT_2 [0000] + // 0x0020, 0x0000, + // 0x0021, 0x0000, + 0x0029, 0x0077, // NVM_2 [00FF] VCM=0x77 + // 0x0050, 0x0000, + // 0x0051, 0xD0EF, + // 0x0052, 0x0000, + // 0x0053, 0x013F, + 0x0061, 0x0001, // Base_Image [0000] REV=1 + 0x006A, 0x0000, // Vert_scrl [0000] + 0x0080, 0x0000, // Partial_Image [0000] + 0x0081, 0x0000, // [0000] + 0x0082, 0x005F, // [0000] PTE=0x5F + 0x0093, 0x0701, // Panel_3 [0101] VEQWI=3 + 0x0007, 0x0100, // Display_1 [0000] BASEE=1 + }; + static const uint16_t R61580_DEM240320C[] PROGMEM = { //from DEM 240320C TMH-PW-N + 0x00, 0x0000, + 0x00, 0x0000, + TFTLCD_DELAY, 100, + 0x00, 0x0000, + 0x00, 0x0000, + 0x00, 0x0000, + 0x00, 0x0000, + 0xA4, 0x0001, + TFTLCD_DELAY, 100, + 0x60, 0xA700, + 0x08, 0x0808, + /******************************************/ + //Gamma Setting: + 0x30, 0x0203, + 0x31, 0x080F, + 0x32, 0x0401, + 0x33, 0x050B, + 0x34, 0x3330, + 0x35, 0x0B05, + 0x36, 0x0005, + 0x37, 0x0F08, + 0x38, 0x0302, + 0x39, 0x3033, + /******************************************/ + //Power Setting: + 0x90, 0x0018, //80Hz + 0x10, 0x0530, //BT,AP + 0x11, 0x0237, //DC1,DC0,VC + 0x12, 0x01BF, + 0x13, 0x1000, //VCOM + TFTLCD_DELAY, 200, + /******************************************/ + 0x01, 0x0100, + 0x02, 0x0200, + 0x03, 0x1030, + 0x09, 0x0001, + 0x0A, 0x0008, + 0x0C, 0x0000, + 0x0D, 0xD000, + + 0x0E, 0x0030, + 0x0F, 0x0000, + 0x20, 0x0000, //H Start + 0x21, 0x0000, //V Start + 0x29, 0x002E, + 0x50, 0x0000, + 0x51, 0x00EF, + 0x52, 0x0000, + 0x53, 0x013F, + 0x61, 0x0001, + 0x6A, 0x0000, + 0x80, 0x0000, + 0x81, 0x0000, + 0x82, 0x005F, + 0x93, 0x0701, + /******************************************/ + 0x07, 0x0100, + TFTLCD_DELAY, 100, + }; + init_table16(R61580_DEM240320C, sizeof(R61580_DEM240320C)); +// init_table16(R61580_regValues, sizeof(R61580_regValues)); + break; +#endif + } +} + +//################## SSD1963 ############################################## +{ + { + // from UTFTv2.82 initlcd.h + static const uint8_t SSD1963_800NEW_regValues[] PROGMEM = { + (0xE2), 3, 0x1E, 0x02, 0x54, //PLL multiplier, set PLL clock to 120M + (0xE0), 1, 0x01, // PLL enable + TFTLCD_DELAY8, 10, + (0xE0), 1, 0x03, // + TFTLCD_DELAY8, 10, + 0x01, 0, //Soft Reset + TFTLCD_DELAY8, 100, + (0xE6), 3, 0x03, 0xFF, 0xFF, //PLL setting for PCLK, depends on resolution + (0xB0), 7, 0x24, 0x00, 0x03, 0x1F, 0x01, 0xDF, 0x00, //LCD SPECIFICATION + (0xB4), 8, 0x03, 0xA0, 0x00, 0x2E, 0x30, 0x00, 0x0F, 0x00, //HSYNC HT=928, HPS=46, HPW=48, LPS=15 + (0xB6), 7, 0x02, 0x0D, 0x00, 0x10, 0x10, 0x00, 0x08, //VSYNC VT=525, VPS=16, VPW=16, FPS=8 + (0xBA), 1, 0x0F, //GPIO[3:0] out 1 + (0xB8), 2, 0x07, 0x01, //GPIO3=input, GPIO[2:0]=output + (0xF0), 1, 0x03, //pixel data interface + TFTLCD_DELAY8, 1, + 0x28, 0, //Display Off + 0x11, 0, //Sleep Out + TFTLCD_DELAY8, 100, + 0x29, 0, //Display On + (0xBE), 6, 0x06, 0xF0, 0x01, 0xF0, 0x00, 0x00, //set PWM for B/L + (0xD0), 1, 0x0D, + }; + // from UTFTv2.82 initlcd.h + static const uint8_t SSD1963_800ALT_regValues[] PROGMEM = { + (0xE2), 3, 0x23, 0x02, 0x04, //PLL multiplier, set PLL clock to 120M + (0xE0), 1, 0x01, // PLL enable + TFTLCD_DELAY8, 10, + (0xE0), 1, 0x03, // + TFTLCD_DELAY8, 10, + 0x01, 0, //Soft Reset + TFTLCD_DELAY8, 100, + (0xE6), 3, 0x04, 0x93, 0xE0, //PLL setting for PCLK, depends on resolution + (0xB0), 7, 0x00, 0x00, 0x03, 0x1F, 0x01, 0xDF, 0x00, //LCD SPECIFICATION + (0xB4), 8, 0x03, 0xA0, 0x00, 0x2E, 0x30, 0x00, 0x0F, 0x00, //HSYNC HT=928, HPS=46, HPW=48, LPS=15 + (0xB6), 7, 0x02, 0x0D, 0x00, 0x10, 0x10, 0x00, 0x08, //VSYNC VT=525, VPS=16, VPW=16, FPS=8 + (0xBA), 1, 0x0F, //GPIO[3:0] out 1 + (0xB8), 2, 0x07, 0x01, //GPIO3=input, GPIO[2:0]=output + (0xF0), 1, 0x03, //pixel data interface + TFTLCD_DELAY8, 1, + 0x28, 0, //Display Off + 0x11, 0, //Sleep Out + TFTLCD_DELAY8, 100, + 0x29, 0, //Display On + (0xBE), 6, 0x06, 0xF0, 0x01, 0xF0, 0x00, 0x00, //set PWM for B/L + (0xD0), 1, 0x0D, + }; + // from UTFTv2.82 initlcd.h + static const uint8_t SSD1963_480_regValues[] PROGMEM = { + (0xE2), 3, 0x23, 0x02, 0x54, //PLL multiplier, set PLL=120M, N=0x36/0x23 for 6.5M/10M crystal + (0xE0), 1, 0x01, // PLL enable + TFTLCD_DELAY8, 10, + (0xE0), 1, 0x03, // + TFTLCD_DELAY8, 10, + 0x01, 0, //Soft Reset + TFTLCD_DELAY8, 100, + (0xE6), 3, 0x01, 0x1F, 0xFF, //PLL setting for PCLK, depends on resolution + (0xB0), 7, 0x20, 0x00, 0x01, 0xDF, 0x01, 0x0F, 0x00, //LCD SPECIFICATION + (0xB4), 8, 0x02, 0x13, 0x00, 0x08, 0x2B, 0x00, 0x02, 0x00, //HSYNC HT=531, HPS=8, HPW=43, LPS=2 + (0xB6), 7, 0x01, 0x20, 0x00, 0x04, 0x0C, 0x00, 0x02, //VSYNC VT=288, VPS=4, VPW=12, FPS=2 + (0xBA), 1, 0x0F, //GPIO[3:0] out 1 + (0xB8), 2, 0x07, 0x01, //GPIO3=input, GPIO[2:0]=output + (0xF0), 1, 0x03, //pixel data interface + TFTLCD_DELAY8, 1, + 0x28, 0, //Display Off + 0x11, 0, //Sleep Out + TFTLCD_DELAY8, 100, + 0x29, 0, //Display On + (0xBE), 6, 0x06, 0xF0, 0x01, 0xF0, 0x00, 0x00, //set PWM for B/L + (0xD0), 1, 0x0D, + }; + // table8_ads = SSD1963_480_regValues, table_size = sizeof(SSD1963_480_regValues); + // table8_ads = SSD1963_480NEW_regValues, table_size = sizeof(SSD1963_480NEW_regValues); + // table8_ads = SSD1963_800_regValues, table_size = sizeof(SSD1963_800_regValues); + // table8_ads = SSD1963_NHD_50_regValues, table_size = sizeof(SSD1963_NHD_50_regValues); + // table8_ads = SSD1963_NHD_70_regValues, table_size = sizeof(SSD1963_NHD_70_regValues); + table8_ads = SSD1963_800NEW_regValues, table_size = sizeof(SSD1963_800NEW_regValues); + // table8_ads = SSD1963_800ALT_regValues, table_size = sizeof(SSD1963_800ALT_regValues); + + } +} + +//################## ILI9806 ############################################## +#define TFTLCD_DELAY8 0x7F +{ + { +#define SUPPORT_9806 +#ifdef SUPPORT_9806 + case 0x9806: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; + // from ZinggJM + static const uint8_t ILI9806_regValues[] PROGMEM = { + (0xFF), 3, /* EXTC Command Set enable register*/ 0xFF, 0x98, 0x06, + (0xBA), 1, /* SPI Interface Setting*/0xE0, + (0xBC), 21, /* GIP 1*/0x03, 0x0F, 0x63, 0x69, 0x01, 0x01, 0x1B, 0x11, 0x70, 0x73, 0xFF, 0xFF, 0x08, 0x09, 0x05, 0x00, 0xEE, 0xE2, 0x01, 0x00, 0xC1, + (0xBD), 8, /* GIP 2*/0x01, 0x23, 0x45, 0x67, 0x01, 0x23, 0x45, 0x67, + (0xBE), 9, /* GIP 3*/0x00, 0x22, 0x27, 0x6A, 0xBC, 0xD8, 0x92, 0x22, 0x22, + (0xC7), 1, /* Vcom*/0x1E, + (0xED), 3, /* EN_volt_reg*/0x7F, 0x0F, 0x00, + (0xC0), 3, /* Power Control 1*/0xE3, 0x0B, 0x00, + (0xFC), 1, 0x08, + (0xDF), 6, /* Engineering Setting*/0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + (0xF3), 1, /* DVDD Voltage Setting*/0x74, + (0xB4), 3, /* Display Inversion Control*/0x00, 0x00, 0x00, + (0xF7), 1, /* 480x854*/0x81, + (0xB1), 3, /* Frame Rate*/0x00, 0x10, 0x14, + (0xF1), 3, /* Panel Timing Control*/0x29, 0x8A, 0x07, + (0xF2), 4, /*Panel Timing Control*/0x40, 0xD2, 0x50, 0x28, + (0xC1), 4, /* Power Control 2*/0x17, 0x85, 0x85, 0x20, + (0xE0), 16, 0x00, 0x0C, 0x15, 0x0D, 0x0F, 0x0C, 0x07, 0x05, 0x07, 0x0B, 0x10, 0x10, 0x0D, 0x17, 0x0F, 0x00, + (0xE1), 16, 0x00, 0x0D, 0x15, 0x0E, 0x10, 0x0D, 0x08, 0x06, 0x07, 0x0C, 0x11, 0x11, 0x0E, 0x17, 0x0F, 0x00, + (0x35), 1, /*Tearing Effect ON*/0x00, + }; + table8_ads = ILI9806_regValues, table_size = sizeof(ILI9806_regValues); + p16 = (int16_t *) & HEIGHT; + *p16 = 480; + p16 = (int16_t *) & WIDTH; + *p16 = 854; + break; +#endif + } +} + +//################################### UC8230 ############################################ +{ + { + { + ... + if (_lcd_ID == 0x8230) { // UC8230 has strange BGR and READ_BGR behaviour + if (rotation == 1 || rotation == 2) { + val ^= 0x08; // change BGR bit for LANDSCAPE and PORTRAIT_REV + } + } + ... + } +#ifdef SUPPORT_8230 + case 0x8230: //thanks Pappee + _lcd_capable = 0 | REV_SCREEN | INVERT_GS | INVERT_RGB | READ_BGR; + static const uint16_t UC8230_regValues[] PROGMEM = { + //After pin Reset wait at least 100ms + TFTLCD_DELAY, 100, //at least 100ms + 0x0046, 0x0002, //MTP Disable + 0x0010, 0x1590, + 0x0011, 0x0227, + 0x0012, 0x80ff, + 0x0013, 0x9c31, + TFTLCD_DELAY, 10, //at least 10ms + 0x0002, 0x0300, //set N-line = 1 + 0x0003, 0x1030, //set GRAM writing direction & BGR=1 + 0x0060, 0xa700, //GS; gate scan: start position & drive line Q'ty + 0x0061, 0x0001, //REV, NDL, VLE + /*--------------------Gamma control------------------------*/ + 0x0030, 0x0303, + 0x0031, 0x0303, + 0x0032, 0x0303, + 0x0033, 0x0300, + 0x0034, 0x0003, + 0x0035, 0x0303, + 0x0036, 0x1400, + 0x0037, 0x0303, + 0x0038, 0x0303, + 0x0039, 0x0303, + 0x003a, 0x0300, + 0x003b, 0x0003, + 0x003c, 0x0303, + 0x003d, 0x1400, + //-----------------------------------------------------------// + 0x0020, 0x0000, //GRAM horizontal address + 0x0021, 0x0000, //GRAM vertical address + //************** Partial Display control*********************// + 0x0080, 0x0000, + 0x0081, 0x0000, + 0x0082, 0x0000, + 0x0083, 0x0000, + 0x0084, 0x0000, + 0x0085, 0x0000, + //-----------------------------------------------------------// + 0x0092, 0x0200, + 0x0093, 0x0303, + 0x0090, 0x0010, //set clocks/Line + 0x0000, 0x0001, + TFTLCD_DELAY, 200, // Delay 200 ms + 0x0007, 0x0173, //Display on setting + }; + init_table16(UC8230_regValues, sizeof(UC8230_regValues)); + break; +#endif + } +} + +//############################# S6D0144 ############################### +{ + { +#define SUPPORT_0114 +#ifdef SUPPORT_0114 + case 0x0114: + _lcd_capable = REV_SCREEN | INVERT_GS; + static const uint16_t S6D0114_regValues[] PROGMEM = { + + 0x0000, 0x0001, + TFTLCD_DELAY, 300, + 0x00B4, 0x0000, + 0x00B3, 0x0000, + 0x0007, 0x0000, + 0x0012, 0x00B3, + 0x0013, 0x0808, + 0x0014, 0x7DE5, + 0x0010, 0x1A6C, + TFTLCD_DELAY, 900, + 0x0013, 0x081E, + TFTLCD_DELAY, 300, + 0x0001, 0x0114, + 0x0002, 0x0100, + 0x0003, 0x0020, + 0x0008, 0x0202, + 0x000B, 0x0004, + 0x000C, 0x0001, + 0x0030, 0x0303, + 0x0031, 0x0303, + 0x0032, 0x0303, + 0x0033, 0x0000, + 0x0034, 0x0404, + 0x0035, 0x0404, + 0x0036, 0x0404, + 0x0037, 0x0000, + 0x0038, 0x0707, + 0x0040, 0x0000, + 0x0042, 0x9F00, + 0x0043, 0x0000, + 0x0044, 0x7F00, + 0x0045, 0x9F00, + 0x0061, 0x0018, + 0x0069, 0x0000, + 0x0070, 0x0000, + 0x0071, 0x0000, + TFTLCD_DELAY, 500, + 0x0007, 0x0005, + 0x0007, 0x0021, + 0x0007, 0x0023, + TFTLCD_DELAY, 500, + 0x0007, 0x0037, + 0x0021, 0x007F, + 0x0022, 0x0000, + }; + init_table16(S6D0114_regValues, sizeof(S6D0114_regValues)); + p16 = (int16_t *) & HEIGHT; + *p16 = 160; + p16 = (int16_t *) & WIDTH; + *p16 = 128; + break; +#endif + } +} + +//############################# ILI9225 ############################### +{ + { +#define SUPPORT_9225 +#ifdef SUPPORT_9225 +#define ILI9225_DRIVER_OUTPUT_CTRL (0x01u) // Driver Output Control +#define ILI9225_LCD_AC_DRIVING_CTRL (0x02u) // LCD AC Driving Control +#define ILI9225_ENTRY_MODE (0x03u) // Entry Mode +#define ILI9225_DISP_CTRL1 (0x07u) // Display Control 1 +#define ILI9225_BLANK_PERIOD_CTRL1 (0x08u) // Blank Period Control +#define ILI9225_FRAME_CYCLE_CTRL (0x0Bu) // Frame Cycle Control +#define ILI9225_INTERFACE_CTRL (0x0Cu) // Interface Control +#define ILI9225_OSC_CTRL (0x0Fu) // Osc Control +#define ILI9225_POWER_CTRL1 (0x10u) // Power Control 1 +#define ILI9225_POWER_CTRL2 (0x11u) // Power Control 2 +#define ILI9225_POWER_CTRL3 (0x12u) // Power Control 3 +#define ILI9225_POWER_CTRL4 (0x13u) // Power Control 4 +#define ILI9225_POWER_CTRL5 (0x14u) // Power Control 5 +#define ILI9225_VCI_RECYCLING (0x15u) // VCI Recycling +#define ILI9225_RAM_ADDR_SET1 (0x20u) // Horizontal GRAM Address Set +#define ILI9225_RAM_ADDR_SET2 (0x21u) // Vertical GRAM Address Set +#define ILI9225_GRAM_DATA_REG (0x22u) // GRAM Data Register +#define ILI9225_GATE_SCAN_CTRL (0x30u) // Gate Scan Control Register +#define ILI9225_VERTICAL_SCROLL_CTRL1 (0x31u) // Vertical Scroll Control 1 Register +#define ILI9225_VERTICAL_SCROLL_CTRL2 (0x32u) // Vertical Scroll Control 2 Register +#define ILI9225_VERTICAL_SCROLL_CTRL3 (0x33u) // Vertical Scroll Control 3 Register +#define ILI9225_PARTIAL_DRIVING_POS1 (0x34u) // Partial Driving Position 1 Register +#define ILI9225_PARTIAL_DRIVING_POS2 (0x35u) // Partial Driving Position 2 Register +#define ILI9225_HORIZONTAL_WINDOW_ADDR1 (0x36u) // Horizontal Address END Position HEA +#define ILI9225_HORIZONTAL_WINDOW_ADDR2 (0x37u) // Horizontal Address START Position HSA +#define ILI9225_VERTICAL_WINDOW_ADDR1 (0x38u) // Vertical Address END Position VEA +#define ILI9225_VERTICAL_WINDOW_ADDR2 (0x39u) // Vertical Address START Position VSA +#define ILI9225_GAMMA_CTRL1 (0x50u) // Gamma Control 1 +#define ILI9225_GAMMA_CTRL2 (0x51u) // Gamma Control 2 +#define ILI9225_GAMMA_CTRL3 (0x52u) // Gamma Control 3 +#define ILI9225_GAMMA_CTRL4 (0x53u) // Gamma Control 4 +#define ILI9225_GAMMA_CTRL5 (0x54u) // Gamma Control 5 +#define ILI9225_GAMMA_CTRL6 (0x55u) // Gamma Control 6 +#define ILI9225_GAMMA_CTRL7 (0x56u) // Gamma Control 7 +#define ILI9225_GAMMA_CTRL8 (0x57u) // Gamma Control 8 +#define ILI9225_GAMMA_CTRL9 (0x58u) // Gamma Control 9 +#define ILI9225_GAMMA_CTRL10 (0x59u) // Gamma Control 10 + +#define ILI9225C_INVOFF 0x20 +#define ILI9225C_INVON 0x21 + + case 0x9225: + _lcd_capable = REV_SCREEN | INVERT_GS; + static const uint16_t ILI9225_regValues[] PROGMEM = { + /* Start Initial Sequence */ + /* Set SS bit and direction output from S528 to S1 */ + ILI9225_POWER_CTRL1, 0x0000, // Set SAP,DSTB,STB + ILI9225_POWER_CTRL2, 0x0000, // Set APON,PON,AON,VCI1EN,VC + ILI9225_POWER_CTRL3, 0x0000, // Set BT,DC1,DC2,DC3 + ILI9225_POWER_CTRL4, 0x0000, // Set GVDD + ILI9225_POWER_CTRL5, 0x0000, // Set VCOMH/VCOML voltage + TFTLCD_DELAY, 40, + + // Power-on sequence + ILI9225_POWER_CTRL2, 0x0018, // Set APON,PON,AON,VCI1EN,VC + ILI9225_POWER_CTRL3, 0x6121, // Set BT,DC1,DC2,DC3 + ILI9225_POWER_CTRL4, 0x006F, // Set GVDD /*007F 0088 */ + ILI9225_POWER_CTRL5, 0x495F, // Set VCOMH/VCOML voltage + ILI9225_POWER_CTRL1, 0x0800, // Set SAP,DSTB,STB + TFTLCD_DELAY, 10, + ILI9225_POWER_CTRL2, 0x103B, // Set APON,PON,AON,VCI1EN,VC + TFTLCD_DELAY, 50, + + ILI9225_DRIVER_OUTPUT_CTRL, 0x011C, // set the display line number and display direction + ILI9225_LCD_AC_DRIVING_CTRL, 0x0100, // set 1 line inversion + ILI9225_ENTRY_MODE, 0x1030, // set GRAM write direction and BGR=1. + ILI9225_DISP_CTRL1, 0x0000, // Display off + ILI9225_BLANK_PERIOD_CTRL1, 0x0808, // set the back porch and front porch + ILI9225_FRAME_CYCLE_CTRL, 0x1100, // set the clocks number per line + ILI9225_INTERFACE_CTRL, 0x0000, // CPU interface + ILI9225_OSC_CTRL, 0x0D01, // Set Osc /*0e01*/ + ILI9225_VCI_RECYCLING, 0x0020, // Set VCI recycling + ILI9225_RAM_ADDR_SET1, 0x0000, // RAM Address + ILI9225_RAM_ADDR_SET2, 0x0000, // RAM Address + + /* Set GRAM area */ + ILI9225_GATE_SCAN_CTRL, 0x0000, + ILI9225_VERTICAL_SCROLL_CTRL1, 0x00DB, + ILI9225_VERTICAL_SCROLL_CTRL2, 0x0000, + ILI9225_VERTICAL_SCROLL_CTRL3, 0x0000, + ILI9225_PARTIAL_DRIVING_POS1, 0x00DB, + ILI9225_PARTIAL_DRIVING_POS2, 0x0000, + ILI9225_HORIZONTAL_WINDOW_ADDR1, 0x00AF, + ILI9225_HORIZONTAL_WINDOW_ADDR2, 0x0000, + ILI9225_VERTICAL_WINDOW_ADDR1, 0x00DB, + ILI9225_VERTICAL_WINDOW_ADDR2, 0x0000, + + /* Set GAMMA curve */ + ILI9225_GAMMA_CTRL1, 0x0000, + ILI9225_GAMMA_CTRL2, 0x0808, + ILI9225_GAMMA_CTRL3, 0x080A, + ILI9225_GAMMA_CTRL4, 0x000A, + ILI9225_GAMMA_CTRL5, 0x0A08, + ILI9225_GAMMA_CTRL6, 0x0808, + ILI9225_GAMMA_CTRL7, 0x0000, + ILI9225_GAMMA_CTRL8, 0x0A00, + ILI9225_GAMMA_CTRL9, 0x0710, + ILI9225_GAMMA_CTRL10, 0x0710, + + ILI9225_DISP_CTRL1, 0x0012, + TFTLCD_DELAY, 50, + ILI9225_DISP_CTRL1, 0x1017, + }; + init_table16(ILI9225_regValues, sizeof(ILI9225_regValues)); + p16 = (int16_t *) & HEIGHT; + *p16 = 220; + p16 = (int16_t *) & WIDTH; + *p16 = 176; + break; + } +} + +// ############################## ILI9342 ################### +{ + { + case 0x9342: + _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | INVERT_GS | REV_SCREEN; + static const uint8_t ILI9342_regValues_CPT24[] PROGMEM = { //CPT 2.4" + (0xB9), 3, 0xFF, 0x93, 0x42, //[00 00 00] + (0xC0), 2, 0x1D, 0x0A, //[26 09] + (0xC1), 1, 0x02, //[10] + (0xC5), 2, 0x2F, 0x2F, //[31 3C] + (0xC7), 1, 0xC3, //[C0] + (0xB8), 1, 0x0B, //[07] + (0xE0), 15, 0x0F, 0x33, 0x30, 0x0C, 0x0F, 0x08, 0x5D, 0x66, 0x4A, 0x07, 0x13, 0x05, 0x1B, 0x0E, 0x08, + (0xE1), 15, 0x08, 0x0E, 0x11, 0x02, 0x0E, 0x02, 0x24, 0x33, 0x37, 0x03, 0x0A, 0x09, 0x26, 0x33, 0x0F, + }; + static const uint8_t ILI9342_regValues_Tianma23[] PROGMEM = { //Tianma 2.3" + (0xB9), 3, 0xFF, 0x93, 0x42, + (0xC0), 2, 0x1D, 0x0A, + (0xC1), 1, 0x01, + (0xC5), 2, 0x2C, 0x2C, + (0xC7), 1, 0xC6, + (0xB8), 1, 0x09, + (0xE0), 15, 0x0F, 0x26, 0x21, 0x07, 0x0A, 0x03, 0x4E, 0x62, 0x3E, 0x0B, 0x11, 0x00, 0x08, 0x02, 0x00, + (0xE1), 15, 0x00, 0x19, 0x1E, 0x03, 0x0E, 0x03, 0x30, 0x23, 0x41, 0x03, 0x0B, 0x07, 0x2F, 0x36, 0x0F, + }; + static const uint8_t ILI9342_regValues_HSD23[] PROGMEM = { //HSD 2.3" + (0xB9), 3, 0xFF, 0x93, 0x42, + (0xC0), 2, 0x1D, 0x0A, + (0xC1), 1, 0x02, + (0xC5), 2, 0x2F, 0x27, + (0xC7), 1, 0xA4, + (0xB8), 1, 0x0B, + (0xE0), 15, 0x0F, 0x24, 0x21, 0x0C, 0x0F, 0x06, 0x50, 0x75, 0x3F, 0x07, 0x12, 0x05, 0x11, 0x0B, 0x08, + (0xE1), 15, 0x08, 0x1D, 0x20, 0x02, 0x0E, 0x04, 0x31, 0x24, 0x42, 0x03, 0x0B, 0x09, 0x30, 0x36, 0x0F, + }; + table8_ads = ILI9342_regValues_CPT24, table_size = sizeof(ILI9342_regValues_CPT24); // + // table8_ads = ILI9342_regValues_Tianma23, table_size = sizeof(ILI9342_regValues_Tianma23); // + // table8_ads = ILI9342_regValues_HSD23, table_size = sizeof(ILI9342_regValues_HSD23); // + p16 = (int16_t *) & HEIGHT; + *p16 = 240; + p16 = (int16_t *) & WIDTH; + *p16 = 320; + break; + } +} + +// ###################### R61505 init ################################# +{ + { + case 0x1505: //R61505 + _lcd_capable = 0 | REV_SCREEN | READ_LOWHIGH; + static const uint16_t R61505U_regValues[] PROGMEM = { //MCHIP drvTFT001.c + // Setup display + 0x0000, 0x0000, + 0x0007, 0x0001, // DISPCTL1: D = 1 + TFTLCD_DELAY, 5, + 0x0017, 0x0001, // POWCTL6: PSE = 1 + TFTLCD_DELAY, 5, + 0x0010, 0x17b0, // POWCTL1: SAP=1, BT=7, APE=1, AP=7 + 0x0011, 0x0007, // POWCTL2: VC=7 + 0x0012, 0x011a, // POWCTL3: VCMR=1, PON=1, VRH=10 + 0x0013, 0x0f00, // POWCTL4: VDV=15 + 0x0015, 0x0000, // POWCTL5: + 0x0029, 0x0009, // POWCTL7: VCM=9 + 0x00fd, 0x0000, // f.k. + TFTLCD_DELAY, 5, + 0x0012, 0x013a, // POWCTL3: VCMR=1, PSON=1, PON=1, VRH=10 + TFTLCD_DELAY, 50, + 0x0001, 0x0100, // DRVCTL1: SS=1 + 0x0002, 0x0700, // LCDDRV: r/o=1, B/C=1, EOR=1 + + 0x0003, 0x1030, // ENTRYMD: BGR=1, I/D=3 + + 0x0008, 0x0808, // DISPCTL2: FP=8, BP=8 + 0x0009, 0x0000, // DISPCTL3: + 0x000a, 0x0000, // DISPCTL4: + 0x000c, 0x0000, // RGBCTL: + 0x000d, 0x0000, // FRMPOS: FMP=0 + 0x0030, 0x0000, //Gamma + 0x0031, 0x0000, + 0x0032, 0x0000, + 0x0033, 0x0000, + 0x0034, 0x0000, + 0x0035, 0x0000, + 0x0036, 0x0000, + 0x0037, 0x0707, + 0x0038, 0x0707, + 0x0039, 0x0707, + 0x003a, 0x0303, + 0x003b, 0x0303, + 0x003c, 0x0707, + 0x003d, 0x0808, + 0x0050, 0x0000, // + 0x0051, 0x00ef, + 0x0052, 0x0000, + 0x0053, 0x013f, + 0x0060, 0x2700, // DRVCTL2: NL=32 + 0x0061, 0x0001, // BASIMG: REV=1 + 0x006a, 0x0000, // VERTSCRL: + 0x0090, 0x0010, // PANCTL1: DIV100=1 + 0x0092, 0x0000, + 0x0093, 0x0000, + 0x0007, 0x0021, // DISPCTL1: GON=1, D=1 + TFTLCD_DELAY, 1, + 0x0007, 0x0061, // DISPCTL1: VON=1, GON=1, D=1 + TFTLCD_DELAY, 50, + 0x0007, 0x0173, // DISPCTL1: BASEE=1, VON=1, GON=1, DTE=1, D=1 + 0x0020, 0x0000, + 0x0021, 0x0000, + 0x0022, 0x0000, + 0x0030, 0x0707, // GAMMA + 0x0031, 0x0407, + 0x0032, 0x0203, + 0x0033, 0x0303, + 0x0034, 0x0303, + 0x0035, 0x0202, + 0x0036, 0x001f, + 0x0037, 0x0707, + 0x0038, 0x0407, + 0x0039, 0x0203, + 0x003a, 0x0303, + 0x003b, 0x0303, + 0x003c, 0x0202, + 0x003d, 0x001f, + 0x0020, 0x0000, + 0x0021, 0x0000, + }; + init_table16(R61505U_regValues, sizeof(R61505U_regValues)); + break; + } +} + +// ################## for auto-format ######################### +#if 0 +// ################## UNO SPECIAL for Stojanjos ############### +#define USE_STOJANOS +... +#elif defined(__AVR_ATmega328P__) && defined(USE_STOJANOS) // +#warning SPECIAL for USE_STOJANOS +#define RD_PORT PORTC +#define RD_PIN 0 +#define WR_PORT PORTC +#define WR_PIN 1 +#define CD_PORT PORTC +#define CD_PIN 2 +#define CS_PORT PORTC +#define CS_PIN 3 +#define RESET_PORT PORTC +#define RESET_PIN 4 + +#define BMASK 0x03 //0x0F +#define DMASK 0xFC //0xF0 +#define write_8(x) { PORTB = (PORTB & ~BMASK) | ((x) & BMASK); PORTD = (PORTD & ~DMASK) | ((x) & DMASK); } +#define read_8() ( (PINB & BMASK) | (PIND & DMASK) ) +#define setWriteDir() { DDRB |= BMASK; DDRD |= DMASK; } +#define setReadDir() { DDRB &= ~BMASK; DDRD &= ~DMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +//################################ UNO LCD_D2 on A5 ###################################### +#define USE_D2_ON_A5 +... +#elif defined(__AVR_ATmega328P__) && defined(USE_D2_ON_A5) +#define RD_PORT PORTC +#define RD_PIN 0 +#define WR_PORT PORTC +#define WR_PIN 1 +#define CD_PORT PORTC +#define CD_PIN 2 +#define CS_PORT PORTC +#define CS_PIN 3 +#define RESET_PORT PORTC +#define RESET_PIN 4 + +#define BMASK 0x03 //more intuitive style for mixed Ports +#define CMASK (1<<5) +#define DMASK 0xF8 //does exactly the same as previous +#define write_8(x) { PORTB = (PORTB & ~BMASK) | ((x) & BMASK); PORTC = (PORTC & ~CMASK) | (((x)<<3) & CMASK); PORTD = (PORTD & ~DMASK) | ((x) & DMASK); } +#define read_8() ( (PINB & BMASK) | ((PINC & CMASK)>>3) | (PIND & DMASK) ) +#define setWriteDir() { DDRB |= BMASK; DDRC |= CMASK; DDRD |= DMASK; } +#define setReadDir() { DDRB &= ~BMASK; DDRC &= ~CMASK; DDRD &= ~DMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +//################################ UNO LCD_D2 on D10 ###################################### +#define USE_D2_ON_D10 +... +#elif defined(__AVR_ATmega328P__) && defined(USE_D2_ON_D10) +#warning USE_D2_ON_D10 +#define RD_PORT PORTC +#define RD_PIN 0 +#define WR_PORT PORTC +#define WR_PIN 1 +#define CD_PORT PORTC +#define CD_PIN 2 +#define CS_PORT PORTC +#define CS_PIN 3 +#define RESET_PORT PORTC +#define RESET_PIN 4 + +#define BMASK 0x07 //more intuitive style for mixed Ports +#define DMASK 0xF8 //does exactly the same as previous +#define write_8(x) { PORTB = (PORTB & ~BMASK) | ((x) & BMASK); PORTD = (PORTD & ~DMASK) | ((x) & DMASK); } +#define read_8() ( (PINB & BMASK) | (PIND & DMASK) ) +#define setWriteDir() { DDRB |= BMASK; DDRD |= DMASK; } +#define setReadDir() { DDRB &= ~BMASK; DDRD &= ~DMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +//################################ UNO LCD_D0 on D10 ###################################### +#define USE_D0_ON_D10 +... +#elif defined(__AVR_ATmega328P__) && defined(USE_D0_ON_D10) +#warning USE_D0_ON_D10 +#define RD_PORT PORTC +#define RD_PIN 0 +#define WR_PORT PORTC +#define WR_PIN 1 +#define CD_PORT PORTC +#define CD_PIN 2 +#define CS_PORT PORTC +#define CS_PIN 3 +#define RESET_PORT PORTC +#define RESET_PIN 4 + +#define BMASK 0x06 //more intuitive style for mixed Ports +#define DMASK 0xFC //does exactly the same as previous +#define write_8(x) { PORTB = (PORTB & ~BMASK) | ((x) & (1<<1)) | (((x) & (1<<0)) << 2); PORTD = (PORTD & ~DMASK) | ((x) & DMASK); } +#define read_8() ( ((PINB & (1<<2)) >> 2) | (PINB & (1<<1)) | (PIND & DMASK) ) +#define setWriteDir() { DDRB |= BMASK; DDRD |= DMASK; } +#define setReadDir() { DDRB &= ~BMASK; DDRD &= ~DMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +//################################### MXxxxx UNO SHIELD on TEENSY #################################################### +#elif defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) // regular UNO shield on a Teensy 3.x +#warning regular UNO shield on a Teensy 3.x + +#if defined(__MK20DX128__) || defined(__MK20DX256__) // Teensy3.0 || 3.2 96MHz +#define WRITE_DELAY { WR_ACTIVE; WR_ACTIVE; } +#define READ_DELAY { RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; } +#elif defined(__MK64FX512__) // Teensy3.5 120MHz thanks to PeteJohno +#define WRITE_DELAY { WR_ACTIVE; WR_ACTIVE; WR_ACTIVE; WR_ACTIVE; } +#define READ_DELAY { RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; } +#elif defined(__MK66FX1M0__) // Teensy3.6 180MHz untested. delays can possibly be reduced. +#define WRITE_DELAY { WR_ACTIVE; WR_ACTIVE; WR_ACTIVE; WR_ACTIVE; WR_ACTIVE; WR_ACTIVE; WR_ACTIVE; WR_ACTIVE; } +#define READ_DELAY { RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; } +#else +#error unspecified delays +#endif + +#define RD_PORT GPIOD +#define RD_PIN 1 +#define WR_PORT GPIOC +#define WR_PIN 0 +#define CD_PORT GPIOB +#define CD_PIN 0 +#define CS_PORT GPIOB +#define CS_PIN 1 +#define RESET_PORT GPIOB +#define RESET_PIN 3 + +// configure macros for the data pins +#define AMASK ((1<<12)|(1<<13)) +#define CMASK ((1<<3)) +#define DMASK ((1<<0)|(1<<2)|(1<<3)|(1<<4)|(1<<7)) + +#define write_8(d) { \ + GPIOA_PCOR = AMASK; GPIOC_PCOR = CMASK; GPIOD_PCOR = DMASK; \ + GPIOA_PSOR = (((d) & (1 << 3)) << 9) \ + | (((d) & (1 << 4)) << 9); \ + GPIOC_PSOR = (((d) & (1 << 1)) << 2); \ + GPIOD_PSOR = (((d) & (1 << 0)) << 3) \ + | (((d) & (1 << 2)) >> 2) \ + | (((d) & (1 << 5)) << 2) \ + | (((d) & (1 << 6)) >> 2) \ + | (((d) & (1 << 7)) >> 5); \ + } +#define read_8() ((((GPIOD_PDIR & (1<<3)) >> 3) \ + | ((GPIOC_PDIR & (1 << 3)) >> 2) \ + | ((GPIOD_PDIR & (1 << 0)) << 2) \ + | ((GPIOA_PDIR & (1 << 12)) >> 9) \ + | ((GPIOA_PDIR & (1 << 13)) >> 9) \ + | ((GPIOD_PDIR & (1 << 7)) >> 2) \ + | ((GPIOD_PDIR & (1 << 4)) << 2) \ + | ((GPIOD_PDIR & (1 << 2)) << 5))) +#define setWriteDir() {GPIOA_PDDR |= AMASK;GPIOC_PDDR |= CMASK;GPIOD_PDDR |= DMASK; } +#define setReadDir() {GPIOA_PDDR &= ~AMASK;GPIOC_PDDR &= ~CMASK;GPIOD_PDDR &= ~DMASK; } +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } //PJ adjusted +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } //PJ adjusted +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PASTE(x, y) x ## y + +#define PIN_LOW(port, pin) PASTE(port, _PCOR) = (1<<(pin)) +#define PIN_HIGH(port, pin) PASTE(port, _PSOR) = (1<<(pin)) +#define PIN_OUTPUT(port, pin) PASTE(port, _PDDR) |= (1<<(pin)) + +//################################### SAM3X ELECHOUSE_DUE_16BIT_SHIELD ON DUE #################################################### +#define USE_ELECHOUSE_DUE_16BIT_SHIELD +... +#elif defined(__SAM3X8E__) && defined(USE_DUE_ELECHOUSE_SHIELD) //ELECHOUSE shield on DUE +#warning USE_ELECHOUSE_DUE_16BIT_SHIELD +#define USES_16BIT_BUS +// configure macros for the control pins +#define RD_PORT PIOA +#define RD_PIN 15 //D24 Graham +#define WR_PORT PIOA +#define WR_PIN 14 //D23 +#define CD_PORT PIOB +#define CD_PIN 26 //D22 +#define CS_PORT PIOA +#define CS_PIN 7 //D31 +#define RESET_PORT PIOC +#define RESET_PIN 1 //D33 +// configure macros for data bus +// DB0..DB7 on PIOC2..PIOC9, DB8..DB15 on PIOC12..PIOC19 +// +#define CMASKH (0xFF00<<4) +#define CMASKL (0x00FF<<2) +#define CMASK (CMASKH | CMASKL) +#define write_8(x) { PIOC->PIO_CODR = CMASKL; PIOC->PIO_SODR = (((x)&0x00FF)<<2); } +#define write_16(x) { PIOC->PIO_CODR = CMASK; \ + PIOC->PIO_SODR = (((x)&0x00FF)<<2)|(((x)&0xFF00)<<4); } +#define read_16() (((PIOC->PIO_PDSR & CMASKH)>>4)|((PIOC->PIO_PDSR & CMASKL)>>2) ) +#define read_8() (read_16() & 0xFF) +#define setWriteDir() { PIOC->PIO_OER = CMASK; PIOC->PIO_PER = CMASK; } +#define setReadDir() { PMC->PMC_PCER0 = (1 << ID_PIOC); PIOC->PIO_ODR = CMASK; } +#define write8(x) { write16(x & 0xFF); } +#define write16(x) { write_16(x); WR_ACTIVE; WR_STROBE; WR_IDLE; WR_IDLE; } +#define READ_16(dst) { RD_STROBE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; dst = read_16(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_8(dst) { READ_16(dst); dst &= 0xFF; } + +// Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) + +//################################### SAM3X TIKY ON DUE #################################################### +#define USE_TIKY_ON_DUE +... +#elif defined(__SAM3X8E__) && defined(USE_TIKY_ON_DUE) //TIKY_ON_DUE +#warning USE_TIKY_ON_DUE +#define USES_16BIT_BUS +// configure macros for the control pins +#define RD_PORT PIOD +#define RD_PIN 0 //D25 PD0 +#define WR_PORT PIOA +#define WR_PIN 15 //D24 PA15 +#define CD_PORT PIOA +#define CD_PIN 14 //D23 PA14 +#define CS_PORT PIOB +#define CS_PIN 26 //D22 PB26 +#define RESET_PORT PIOD +#define RESET_PIN 1 //D26 PD1 +// configure macros for data bus +// +#define AMASK ((1<<7)|(1<<19)) //PA7, PA19 +#define CMASK (0x1FF<<1) //PC1-PC9 +#define DMASK ((3<<2)|(1<<6)|(3<<9)) //PD2-PD3, PD6, PD9-PD10 + +#define write_16(x) { PIOA->PIO_CODR = AMASK; PIOC->PIO_CODR = CMASK; PIOD->PIO_CODR = DMASK; \ + PIOD->PIO_SODR = (((x)&(3<<0))<<2); \ + PIOD->PIO_SODR = (((x)&(1<<2))<<4); \ + PIOD->PIO_SODR = (((x)&(1<<3))<<6); \ + PIOA->PIO_SODR = (((x)&(1<<4))<<3); \ + PIOD->PIO_SODR = (((x)&(1<<5))<<5); \ + PIOC->PIO_SODR = (((x)&(0x1FF<<6))>>5); \ + PIOA->PIO_SODR = (((x)&(1<<15))<<4); \ + } + +#define read_16() ( 0\ + |((PIOD->PIO_PDSR & (1<<2))>>2)\ + |((PIOD->PIO_PDSR & (1<<3))>>2)\ + |((PIOD->PIO_PDSR & (1<<6))>>4)\ + |((PIOD->PIO_PDSR & (1<<9))>>6)\ + |((PIOA->PIO_PDSR & (1<<7))>>3)\ + |((PIOD->PIO_PDSR & (1<<10))>>5)\ + |((PIOC->PIO_PDSR & (0x1FF<<1))<<5)\ + |((PIOA->PIO_PDSR & (1<<19)>>4))\ + ) +#define read_8() (read_16() & 0xFF) +#define setWriteDir() {\ + PIOA->PIO_OER = AMASK; PIOA->PIO_PER = AMASK; \ + PIOC->PIO_OER = CMASK; PIOC->PIO_PER = CMASK; \ + PIOD->PIO_OER = DMASK; PIOD->PIO_PER = DMASK; \ + } +#define setReadDir() { \ + PMC->PMC_PCER0 = (1 << ID_PIOA)|(1 << ID_PIOC)|(1 << ID_PIOD); \ + PIOA->PIO_ODR = AMASK; \ + PIOC->PIO_ODR = CMASK; \ + PIOD->PIO_ODR = DMASK; \ + } +#define write8(x) { write16(x & 0xFF); } +// ILI9486 is slower than ILI9481 +#define write16(x) { write_16(x); WR_ACTIVE; WR_ACTIVE; WR_STROBE; } +#define READ_16(dst) { RD_STROBE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; dst = read_16(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_8(dst) { READ_16(dst); dst &= 0xFF; } + +// Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) + +//############################## STM32 MY BLUEPILL ########################################### +#define USE_MY_BLUEPILL +... +#elif defined(USE_MY_BLUEPILL) && (defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_NUCLEO_F103C8)) +#warning Uno Shield on BLUEPILL +#define RD_PORT GPIOB +#define RD_PIN 1 +#define WR_PORT GPIOB +#define WR_PIN 0 +#define CD_PORT GPIOA +#define CD_PIN 7 +#define CS_PORT GPIOA +#define CS_PIN 6 +#define RESET_PORT GPIOA +#define RESET_PIN 5 + +// configure macros for the data pins +#define AMASK 0x060F +#define BMASK 0x00C0 +#define write_8(d) { GPIOA->REGS(BSRR) = AMASK << 16; GPIOB->REGS(BSRR) = BMASK << 16; \ + GPIOA->REGS(BSRR) = (((d) & 3) << 9) | (((d) & 0xF0) >> 4); \ + GPIOB->REGS(BSRR) = (((d) & 0x0C) << 4); \ + } +#define read_8() (((GPIOA->REGS(IDR) & (3<<9)) >> 9) | ((GPIOA->REGS(IDR) & (0x0F)) << 4) | ((GPIOB->REGS(IDR) & (3<<6)) >> 4)) +// PA10,PA9 PA3-PA0 PB7,PB6 +#define setWriteDir() {GP_OUT(GPIOA, CRH, 0xFF0); GP_OUT(GPIOA, CRL, 0xFFFF); GP_OUT(GPIOB, CRL, 0xFF000000); } +#define setReadDir() {GP_INP(GPIOA, CRH, 0xFF0); GP_INP(GPIOA, CRL, 0xFFFF); GP_INP(GPIOB, CRL, 0xFF000000); } + +//####################################### STM32L476 ############################ +#elif defined(ARDUINO_NUCLEO_L476RG) // Uno Shield on NUCLEO-L476 +#warning regular Uno Shield on NUCLEO-L476 +#define RD_PORT GPIOA +#define RD_PIN 0 +#define WR_PORT GPIOA +#define WR_PIN 1 +#define CD_PORT GPIOA +#define CD_PIN 4 +#define CS_PORT GPIOB +#define CS_PIN 0 +#define RESET_PORT GPIOC +#define RESET_PIN 1 + +#define REGS(x) x +#define PIN_MODE2(reg, pin, mode) reg=(reg&~(0x3<<((pin)<<1)))|(mode<<((pin)<<1)) +#define GPIO_INIT() { RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN | RCC_AHB2ENR_GPIOBEN | RCC_AHB2ENR_GPIOCEN; } +// configure macros for the data pins +#define write_8(d) { \ + GPIOA->REGS(BSRR) = 0x0700 << 16; \ + GPIOB->REGS(BSRR) = 0x0438 << 16; \ + GPIOC->REGS(BSRR) = 0x0080 << 16; \ + GPIOA->REGS(BSRR) = ( ((d) & (1<<0)) << 9) \ + | (((d) & (1<<2)) << 8) \ + | (((d) & (1<<7)) << 1); \ + GPIOB->REGS(BSRR) = ( ((d) & (1<<3)) << 0) \ + | (((d) & (1<<4)) << 1) \ + | (((d) & (1<<5)) >> 1) \ + | (((d) & (1<<6)) << 4); \ + GPIOC->REGS(BSRR) = ( ((d) & (1<<1)) << 6); \ + } + +#define read_8() ( ( ( (GPIOA->REGS(IDR) & (1<<9)) >> 9) \ + | ((GPIOC->REGS(IDR) & (1<<7)) >> 6) \ + | ((GPIOA->REGS(IDR) & (1<<10)) >> 8) \ + | ((GPIOB->REGS(IDR) & (1<<3)) >> 0) \ + | ((GPIOB->REGS(IDR) & (1<<5)) >> 1) \ + | ((GPIOB->REGS(IDR) & (1<<4)) << 1) \ + | ((GPIOB->REGS(IDR) & (1<<10)) >> 4) \ + | ((GPIOA->REGS(IDR) & (1<<8)) >> 1))) + +// PA10,PA9,PA8 PB10,PB5,PB4,PB3 PC7 +#define setWriteDir() { setReadDir(); \ + GPIOA->MODER |= 0x150000; GPIOB->MODER |= 0x100540; GPIOC->MODER |= 0x4000; } +#define setReadDir() { GPIOA->MODER &= ~0x3F0000; GPIOB->MODER &= ~0x300FC0; GPIOC->MODER &= ~0xC000; } + +#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; dst = read_8(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(port, pin) (port)->BSRR = (1<<((pin)+16)) +#define PIN_HIGH(port, pin) (port)->BSRR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +// #################################### STM32 XINGGJM ####################################### +#define USE_XINGGJM_BLUEPILL +... +#elif defined(USE_XINGGJM_BLUEPILL) && defined(__STM32F1__) // Uno Shield on BluePill +#warning Uno Shield on USE_XINGGJM_BLUEPILL +#define USES_16BIT_BUS +// tidied up for MAPLECORE and ST CORE +#if defined(ARDUINO_NUCLEO_F103C8) //regular CMSIS libraries +#define REGS(x) x +#define GPIO_INIT() { RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN | RCC_APB2ENR_IOPDEN | RCC_APB2ENR_AFIOEN; \ + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_1;} +#else //weird Maple libraries +#define REGS(x) regs->x +#endif + +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE; } +#define GROUP_MODE(port, reg, mask, val) {port->REGS(reg) = (port->REGS(reg) & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) +#define PIN_OUTPUT(port, pin) {\ + if (pin < 8) {GP_OUT(port, CRL, 0xF<<((pin)<<2));} \ + else {GP_OUT(port, CRH, 0xF<<((pin&7)<<2));} \ + } +#define PIN_INPUT(port, pin) { \ + if (pin < 8) { GP_INP(port, CRL, 0xF<<((pin)<<2)); } \ + else { GP_INP(port, CRH, 0xF<<((pin&7)<<2)); } \ + } + +#define PIN_HIGH(port, pin) (port)-> REGS(BSRR) = (1<<(pin)) +#define PIN_LOW(port, pin) (port)-> REGS(BSRR) = (1<<((pin)+16)) + +#define RD_PORT GPIOB +#define RD_PIN 13 +#define WR_PORT GPIOB +#define WR_PIN 10 +#define CD_PORT GPIOB +#define CD_PIN 12 +#define CS_PORT GPIOB +#define CS_PIN 11 +#define RESET_PORT GPIOB +#define RESET_PIN 1 + +// configure macros for the data pins +#define write_16(d) { \ + GPIOA->REGS(BSRR) = (0x81FE) << 16; \ + GPIOB->REGS(BSRR) = (0xC079) << 16; \ + GPIOA->REGS(BSRR) = 0 \ + | (((d) & (1<<3)) << 4) \ + | (((d) & (1<<4)) << 4) \ + | (((d) & (1<<5)) << 2) \ + | (((d) & (1<<6)) << 9) \ + | (((d) & (1<<7)) >> 2) \ + | (((d) & (1<<9)) >> 5) \ + | (((d) & (1<<11)) >> 8) \ + | (((d) & (1<<13)) >> 11) \ + | (((d) & (1<<15)) >> 14); \ + GPIOB->REGS(BSRR) = 0 \ + | (((d) & (1<<0)) << 14) \ + | (((d) & (1<<1)) >> 1) \ + | (((d) & (1<<2)) << 13) \ + | (((d) & (1<<8)) >> 5) \ + | (((d) & (1<<10)) >> 6) \ + | (((d) & (1<<12)) >> 7) \ + | (((d) & (1<<14)) >> 8); \ + } + +#define read_16() (((GPIOB->REGS(IDR) & (1<<14)) >> 14) \ + | ((GPIOB->REGS(IDR) & (1<<0)) << 1) \ + | ((GPIOB->REGS(IDR) & (1<<15)) >> 13) \ + | ((GPIOA->REGS(IDR) & (1<<7)) >> 4) \ + | ((GPIOB->REGS(IDR) & (1<<8)) >> 4) \ + | ((GPIOA->REGS(IDR) & (1<<6)) >> 1) \ + | ((GPIOA->REGS(IDR) & (1<<15)) >> 9) \ + | ((GPIOA->REGS(IDR) & (1<<5)) << 2) \ + | ((GPIOB->REGS(IDR) & (1<<3)) << 5) \ + | ((GPIOA->REGS(IDR) & (1<<4)) << 5) \ + | ((GPIOB->REGS(IDR) & (1<<4)) << 6) \ + | ((GPIOA->REGS(IDR) & (1<<3)) << 8) \ + | ((GPIOB->REGS(IDR) & (1<<5)) << 7) \ + | ((GPIOA->REGS(IDR) & (1<<2)) << 11) \ + | ((GPIOB->REGS(IDR) & (1<<6)) << 8) \ + | ((GPIOA->REGS(IDR) & (1<<1)) << 14))) + +// PA15,PA8 PA7-PA1 PB15,PB14 PB6-PB3,PB0 +#define setWriteDir() {GP_OUT(GPIOA, CRH, 0xF000000F); GP_OUT(GPIOA, CRL, 0xFFFFFFF0); GP_OUT(GPIOB, CRH, 0xFF000000); GP_OUT(GPIOB, CRL, 0x0FFFF00F); } +#define setReadDir() {GP_INP(GPIOA, CRH, 0xF000000F); GP_INP(GPIOA, CRL, 0xFFFFFFF0); GP_INP(GPIOB, CRH, 0xFF000000); GP_INP(GPIOB, CRL, 0x0FFFF00F); } + +#define write8(x) { write16((x) & 0xFF); } +#define write16(x) { write_16(x); WRITE_DELAY; WR_STROBE; WR_IDLE; WR_IDLE; } +#define READ_16(dst) { RD_STROBE; READ_DELAY; dst = read_16(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_8(dst) { READ_16(dst); dst &= 0xFF; } + +// #################################### STM32 XINGGJM ####################################### +#define USE_XINGGJM_BLUEDEV +... +#elif defined(__STM32F1__) && defined(USE_XINGGJM_BLUEDEV) // Uno Shield on Blue Controller board +#warning Uno Shield on USE_XINGGJM_BLUEDEV +#define USES_16BIT_BUS +// be wise to clear all four mode bits properly. +#define GROUP_MODE(port, reg, mask, val) {port->regs->reg = (port->regs->reg & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) + +#define RD_PORT GPIOB +#define RD_PIN 13 +#define WR_PORT GPIOD +#define WR_PIN 5 +#define CD_PORT GPIOD +#define CD_PIN 11 +#define CS_PORT GPIOD +#define CS_PIN 7 +#define RESET_PORT GPIOD +#define RESET_PIN 13 + +// configure macros for the data pins +#define write_16(d) { \ + GPIOD->regs->BSRR = (0xC703) << 16; \ + GPIOE->regs->BSRR = (0xFF80) << 16; \ + GPIOD->regs->BSRR = 0 \ + | (((d) & (3<<0)) << 14) \ + | (((d) & (3<<2)) >> 2) \ + | (((d) & (7<<13)) >> 5); \ + GPIOE->regs->BSRR = 0 \ + | (((d) & (0x1FF<<4)) << 3); \ + } + +#define read_16() (((GPIOD->regs->IDR & (3<<14)) >> 14) \ + | ((GPIOD->regs->IDR & (3<<0)) << 2) \ + | ((GPIOE->regs->IDR & (0x1FF<<7)) >> 3) \ + | ((GPIOD->regs->IDR & (7<<13)) >> 5))) + +// PD15-14,PD10-8 PD1-PD0 PE15-PE8 PE7 +#define setWriteDir() {GP_OUT(GPIOD, CRH, 0xFF000FFF); GP_OUT(GPIOD, CRL, 0x000000FF); GP_OUT(GPIOE, CRH, 0xFFFFFFFF); GP_OUT(GPIOE, CRL, 0xF0000000); } +#define setReadDir() {GP_INP(GPIOD, CRH, 0xFF000FFF); GP_INP(GPIOD, CRL, 0x000000FF); GP_INP(GPIOE, CRH, 0xFFFFFFFF); GP_INP(GPIOE, CRL, 0xF0000000); } + +#define write8(x) { write16(x & 0xFF); } +#define write16(x) { write_16(x); WR_ACTIVE; WR_STROBE; WR_IDLE; WR_IDLE; } +#define READ_16(dst) { RD_STROBE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; dst = read_16(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_8(dst) { READ_16(dst); dst &= 0xFF; } + +#define PIN_HIGH(port, pin) (port)->regs->BSRR = (1<<(pin)) +//#define PIN_LOW(port, pin) (port)->regs->BSRR = (1<<((pin)+16)) +#define PIN_LOW(port, pin) (port)->regs->ODR &= ~(1<<(pin)) +#define PIN_OUTPUT(port, pin) gpio_set_mode(port, pin, GPIO_OUTPUT_PP) //50MHz push-pull only 0-7 +#define PIN_INPUT(port, pin) gpio_set_mode(port, pin, GPIO_INPUT_FLOATING) //digital input + +// ############################ STM32 BAART ##################################### +#define USE_BLUEPILL_ADAPTER +... +#elif defined(USE_BLUEPILL_ADAPTER) && defined(__STM32F1__) // Uno Shield on BLUEPILL_ADAPTER +#warning Uno Shield on USE_BLUEPILL_ADAPTER +// tidied up for MAPLECORE and ST CORE +#if defined(ARDUINO_NUCLEO_F103C8) //regular CMSIS libraries +#define REGS(x) x +#define GPIO_INIT() { RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN | RCC_APB2ENR_IOPDEN | RCC_APB2ENR_AFIOEN; \ + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_1;} +#else //weird Maple libraries +#define REGS(x) regs->x +#endif + +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; } +#define GROUP_MODE(port, reg, mask, val) {port->REGS(reg) = (port->REGS(reg) & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) +#define PIN_OUTPUT(port, pin) {\ + if (pin < 8) {GP_OUT(port, CRL, 0xF<<((pin)<<2));} \ + else {GP_OUT(port, CRH, 0xF<<((pin&7)<<2));} \ + } +#define PIN_INPUT(port, pin) { \ + if (pin < 8) { GP_INP(port, CRL, 0xF<<((pin)<<2)); } \ + else { GP_INP(port, CRH, 0xF<<((pin&7)<<2)); } \ + } + +#define PIN_HIGH(port, pin) (port)-> REGS(BSRR) = (1<<(pin)) +#define PIN_LOW(port, pin) (port)-> REGS(BSRR) = (1<<((pin)+16)) + +#define RD_PORT GPIOB +#define RD_PIN 5 +#define WR_PORT GPIOB +#define WR_PIN 6 +#define CD_PORT GPIOB +#define CD_PIN 7 +#define CS_PORT GPIOB +#define CS_PIN 8 +#define RESET_PORT GPIOB +#define RESET_PIN 9 + +// configure macros for the data pins +// MANOLO8888's wiring scheme is far simpler: +#define write_8(d) { GPIOA->REGS(BSRR) = 0x00FF << 16; GPIOA->REGS(BSRR) = (d) & 0xFF; } +#define read_8() (GPIOA->REGS(IDR) & 0xFF) +// PA7 ..PA0 +#define setWriteDir() {GP_OUT(GPIOA, CRL, 0xFFFFFFFF); } +#define setReadDir() {GP_INP(GPIOA, CRL, 0xFFFFFFFF); } + +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +// ######################### STM32 PA8-15 ################### +#define USE_MAGFLIP +... +#elif defined(USE_MAGFLIP) && (defined(__STM32F1__) || defined(STM32F103xB)) // MAPLECORE or STM32CORE +#warning USE_MAGFLIP + +#if defined(ARDUINO_NUCLEO_F103C8) //regular CMSIS libraries +#define REGS(x) x +#define GPIO_INIT() { RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN | RCC_APB2ENR_IOPDEN | RCC_APB2ENR_AFIOEN; \ + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_1;} +#else //weird Maple libraries +#define REGS(x) regs->x +#endif + +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE; } +#define GROUP_MODE(port, reg, mask, val) {port->REGS(reg) = (port->REGS(reg) & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) +#define PIN_OUTPUT(port, pin) {\ + if (pin < 8) {GP_OUT(port, CRL, 0xF<<((pin)<<2));} \ + else {GP_OUT(port, CRH, 0xF<<((pin&7)<<2));} \ + } +#define PIN_INPUT(port, pin) { \ + if (pin < 8) { GP_INP(port, CRL, 0xF<<((pin)<<2)); } \ + else { GP_INP(port, CRH, 0xF<<((pin&7)<<2)); } \ + } +#define PIN_HIGH(port, pin) (port)-> REGS(BSRR) = (1<<(pin)) +#define PIN_LOW(port, pin) (port)-> REGS(BSRR) = (1<<((pin)+16)) + +#define RD_PORT GPIOA +#define RD_PIN 0 +#define WR_PORT GPIOA +#define WR_PIN 1 +#define CD_PORT GPIOA +#define CD_PIN 2 +#define CS_PORT GPIOA +#define CS_PIN 3 +#define RESET_PORT GPIOB +#define RESET_PIN 9 + +// configure macros for the data pins +#define write_8(d) { GPIOA->REGS(BSRR) = 0xFF00 << 16; GPIOA->REGS(BSRR) = ((d) << 8) & 0xFF00; } +#define read_8() ((GPIOA->REGS(IDR) & 0xFF00) >> 8)) +// PA15..PA8 +#define setWriteDir() {GP_OUT(GPIOA, CRH, 0xFFFFFFFF); } +#define setReadDir() {GP_INP(GPIOA, CRH, 0xFFFFFFFF); } + +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +// #################################### STM32 PIONSCOR ####################################### +#define USE_PIONSCOR_BLUEPILL +... +#elif defined(USE_PIONSCOR_BLUEPILL) && (defined(__STM32F1__) || defined(STM32F103xB)) // MAPLECORE or STM32CORE +#warning SSD1963 on USE_PIONSCOR_BLUEPILL +#define USES_16BIT_BUS +#if defined(ARDUINO_NUCLEO_F103C8) //regular CMSIS libraries +#define REGS(x) x +#define GPIO_INIT() { RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN | RCC_APB2ENR_IOPDEN | RCC_APB2ENR_AFIOEN; \ + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_1;} +#else //weird Maple libraries +#define REGS(x) regs->x +#endif + +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE; } +// +#define GROUP_MODE(port, reg, mask, val) {port->REGS(reg) = (port->REGS(reg) & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) +#define PIN_OUTPUT(port, pin) {\ + if (pin < 8) {GP_OUT(port, CRL, 0xF<<((pin)<<2));} \ + else {GP_OUT(port, CRH, 0xF<<((pin&7)<<2));} \ + } +#define PIN_INPUT(port, pin) { \ + if (pin < 8) { GP_INP(port, CRL, 0xF<<((pin)<<2)); } \ + else { GP_INP(port, CRH, 0xF<<((pin&7)<<2)); } \ + } + +#define PIN_HIGH(port, pin) (port)-> REGS(BSRR) = (1<<(pin)) +#define PIN_LOW(port, pin) (port)-> REGS(BSRR) = (1<<((pin)+16)) + +#define RD_PORT GPIOA +#define RD_PIN 0 +#define WR_PORT GPIOA +#define WR_PIN 1 +#define CD_PORT GPIOA +#define CD_PIN 2 +#define CS_PORT GPIOA +#define CS_PIN 3 +#define RESET_PORT GPIOA +#define RESET_PIN 8 + +// configure macros for the data pins DB2 on PA15. All others on PB0-1, PB3-15 +#define BMASK 0xFFFB +#define write_16(d) { \ + GPIOA->REGS(BSRR) = (1<<15) << 16; \ + GPIOB->REGS(BSRR) = (BMASK) << 16; \ + GPIOA->REGS(BSRR) = ((d) & (1<<2)) << 13; \ + GPIOB->REGS(BSRR) = (d) & BMASK; \ + } + +#define read_16() ( ((GPIOA->REGS(IDR) & (1<<15)) >> 13) | (GPIOB->REGS(IDR) & BMASK) ) + +// PA15 PB15-PB8 PB7-PB3,PB1-PB0 +#define setWriteDir() {GP_OUT(GPIOA, CRH, 0xF0000000); GP_OUT(GPIOB, CRH, 0xFFFFFFFF); GP_OUT(GPIOB, CRL, 0xFFFFF0FF); } +#define setReadDir() {GP_INP(GPIOA, CRH, 0xF0000000); GP_INP(GPIOB, CRH, 0xFFFFFFFF); GP_INP(GPIOB, CRL, 0xFFFFF0FF); } + +#define write8(x) { write16((x) & 0xFF); } +#define write16(x) { write_16(x); WRITE_DELAY; WR_STROBE; WR_IDLE; WR_IDLE; } +#define READ_16(dst) { RD_STROBE; READ_DELAY; dst = read_16(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_8(dst) { READ_16(dst); dst &= 0xFF; } + +// ######################### STM32 PB0-PB7 VADIMEL ################### +#define USE_VADIMEL_MAPLEMINI +... +#elif defined(USE_VADIMEL_MAPLEMINI) && (defined(__STM32F1__) || defined(STM32F103xB)) // MAPLECORE or STM32CORE +#warning USE_VADIMEL_MAPLEMINI + +#if defined(ARDUINO_NUCLEO_F103C8) //regular CMSIS libraries +#define REGS(x) x +#define GPIO_INIT() { RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN | RCC_APB2ENR_IOPDEN | RCC_APB2ENR_AFIOEN; \ + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_1;} +#else //weird Maple libraries +#define REGS(x) regs->x +#endif + +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE; } +#define GROUP_MODE(port, reg, mask, val) {port->REGS(reg) = (port->REGS(reg) & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) +#define PIN_OUTPUT(port, pin) {\ + if (pin < 8) {GP_OUT(port, CRL, 0xF<<((pin)<<2));} \ + else {GP_OUT(port, CRH, 0xF<<((pin&7)<<2));} \ + } +#define PIN_INPUT(port, pin) { \ + if (pin < 8) { GP_INP(port, CRL, 0xF<<((pin)<<2)); } \ + else { GP_INP(port, CRH, 0xF<<((pin&7)<<2)); } \ + } + +#define PIN_HIGH(port, pin) (port)-> REGS(BSRR) = (1<<(pin)) +#define PIN_LOW(port, pin) (port)-> REGS(BSRR) = (1<<((pin)+16)) + +#define RD_PORT GPIOA +#define RD_PIN 0 +#define WR_PORT GPIOA +#define WR_PIN 1 +#define CD_PORT GPIOA +#define CD_PIN 2 +#define CS_PORT GPIOA +#define CS_PIN 3 +#define RESET_PORT GPIOA +#define RESET_PIN 8 + +// configure macros for the data pins +#define write_8(d) { GPIOB->REGS(BSRR) = 0x00FF << 16; GPIOB->REGS(BSRR) = ((d)) & 0x00FF; } +#define read_8() ((GPIOB->REGS(IDR) & 0x00FF)) +// PB7..PB0 +#define setWriteDir() {GP_OUT(GPIOB, CRL, 0xFFFFFFFF); } +#define setReadDir() {GP_INP(GPIOB, CRL, 0xFFFFFFFF); } + +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +// ######################### STM32 PB8-PB15 RAVI_KANCHAN ################### +#define USE_RAVI_KANCHAN_BLUEPILL +... +#elif defined(USE_RAVI_KANCHAN_BLUEPILL) && (defined(__STM32F1__) || defined(STM32F103xB)) // MAPLECORE or STM32CORE +#warning USE_RAVI_KANCHAN_BLUEPILL + +#if defined(ARDUINO_NUCLEO_F103C8) //regular CMSIS libraries +#define REGS(x) x +#define GPIO_INIT() { RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN | RCC_APB2ENR_IOPDEN | RCC_APB2ENR_AFIOEN; \ + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_1;} +#else //weird Maple libraries +#define REGS(x) regs->x +#endif + +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE; } +#define GROUP_MODE(port, reg, mask, val) {port->REGS(reg) = (port->REGS(reg) & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) +#define PIN_OUTPUT(port, pin) {\ + if (pin < 8) {GP_OUT(port, CRL, 0xF<<((pin)<<2));} \ + else {GP_OUT(port, CRH, 0xF<<((pin&7)<<2));} \ + } +#define PIN_INPUT(port, pin) { \ + if (pin < 8) { GP_INP(port, CRL, 0xF<<((pin)<<2)); } \ + else { GP_INP(port, CRH, 0xF<<((pin&7)<<2)); } \ + } + +#define PIN_HIGH(port, pin) (port)-> REGS(BSRR) = (1<<(pin)) +#define PIN_LOW(port, pin) (port)-> REGS(BSRR) = (1<<((pin)+16)) + +#define RD_PORT GPIOA +#define RD_PIN 0 +#define WR_PORT GPIOA +#define WR_PIN 1 +#define CD_PORT GPIOA +#define CD_PIN 2 +#define CS_PORT GPIOA +#define CS_PIN 3 +#define RESET_PORT GPIOB +#define RESET_PIN 0 + +// configure macros for the data pins +#define write_8(d) { GPIOB->REGS(BSRR) = 0xFF00 << 16; GPIOB->REGS(BSRR) = ((d) << 8) & 0xFF00; } +#define read_8() ((GPIOB->REGS(IDR) & 0xFF00) >> 8) +// PB15..PB8 +#define setWriteDir() {GP_OUT(GPIOB, CRH, 0xFFFFFFFF); } +#define setReadDir() {GP_INP(GPIOB, CRH, 0xFFFFFFFF); } + +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +// ######################### ESP32 on TTGO D1 R32 ################### +#elif defined(ESP32) //regular UNO shield on TTGO D1 R32 (ESP32) +#define LCD_RD 2 //LED +#define LCD_WR 4 +#define LCD_RS 15 //hard-wired to A2 (GPIO35) +#define LCD_CS 33 //hard-wired to A3 (GPIO34) +#define LCD_RST 32 //hard-wired to A4 (GPIO36) + +#define LCD_D0 12 +#define LCD_D1 13 +#define LCD_D2 26 +#define LCD_D3 25 +#define LCD_D4 17 +#define LCD_D5 16 +#define LCD_D6 27 +#define LCD_D7 14 + +#define RD_PORT PORTC +#define RD_PIN LCD_RD +#define WR_PORT PORTC +#define WR_PIN LCD_WR +#define CD_PORT PORTC +#define CD_PIN LCD_RS +#define CS_PORT PORTC +#define CS_PIN LCD_CS +#define RESET_PORT PORTC +#define RESET_PIN LCD_RST + +static inline uint32_t map_8(uint32_t d) +{ + return ( + 0 + | ((d & (1 << 0)) << (LCD_D0 - 0)) + | ((d & (1 << 1)) << (LCD_D1 - 1)) + | ((d & (1 << 2)) << (LCD_D2 - 2)) + | ((d & (1 << 3)) << (LCD_D3 - 3)) + | ((d & (1 << 4)) << (LCD_D4 - 4)) + | ((d & (1 << 5)) << (LCD_D5 - 5)) + | ((d & (1 << 6)) << (LCD_D6 - 6)) + | ((d & (1 << 7)) << (LCD_D7 - 7)) + ); +} + +static inline uint8_t map_32(uint32_t d) +{ + return ( + 0 + | ((d & (1 << LCD_D0)) >> (LCD_D0 - 0)) + | ((d & (1 << LCD_D1)) >> (LCD_D1 - 1)) + | ((d & (1 << LCD_D2)) >> (LCD_D2 - 2)) + | ((d & (1 << LCD_D3)) >> (LCD_D3 - 3)) + | ((d & (1 << LCD_D4)) >> (LCD_D4 - 4)) + | ((d & (1 << LCD_D5)) >> (LCD_D5 - 5)) + | ((d & (1 << LCD_D6)) >> (LCD_D6 - 6)) + | ((d & (1 << LCD_D7)) >> (LCD_D7 - 7)) + ); +} + +static inline void write_8(uint16_t data) +{ + GPIO.out_w1tc = map_8(0xFF); //could define once as DMASK + GPIO.out_w1ts = map_8(data); +} + +static inline uint8_t read_8() +{ + return map_32(GPIO.in); +} +static void setWriteDir() +{ + pinMode(LCD_D0, OUTPUT); + pinMode(LCD_D1, OUTPUT); + pinMode(LCD_D2, OUTPUT); + pinMode(LCD_D3, OUTPUT); + pinMode(LCD_D4, OUTPUT); + pinMode(LCD_D5, OUTPUT); + pinMode(LCD_D6, OUTPUT); + pinMode(LCD_D7, OUTPUT); +} + +static void setReadDir() +{ + pinMode(LCD_D0, INPUT); + pinMode(LCD_D1, INPUT); + pinMode(LCD_D2, INPUT); + pinMode(LCD_D3, INPUT); + pinMode(LCD_D4, INPUT); + pinMode(LCD_D5, INPUT); + pinMode(LCD_D6, INPUT); + pinMode(LCD_D7, INPUT); +} + +#define WRITE_DELAY { } +#define READ_DELAY { } + +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (digitalWrite(b, LOW)) +#define PIN_HIGH(p, b) (digitalWrite(b, HIGH)) +#define PIN_OUTPUT(p, b) (pinMode(b, OUTPUT)) + +// ######################### ################### diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/mcufriend_special_3.h b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/mcufriend_special_3.h new file mode 100644 index 0000000..c4c6b43 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/mcufriend_special_3.h @@ -0,0 +1,490 @@ +//################################# SSD1289 SHIELD ####################### +#define SSD1289_JUMPERS 2 //Uno Shield with VERY different pin-out to Mcufriend +//#define USE_SSD1289_SHIELD_UNO +//#define USE_SSD1289_SHIELD_MEGA +//#define USE_SSD1289_SHIELD_DUE + +#elif defined(__AVR_ATmega328P__) && defined(USE_SSD1289_SHIELD_UNO) //on UNO +#warning using SSD1289 Shield for mega328 +#define RD_PORT PORTC +#define RD_PIN 3 +#define WR_PORT PORTC +#define WR_PIN 2 +#define CD_PORT PORTC +#define CD_PIN 1 +#define CS_PORT PORTC +#define CS_PIN 0 +#define RESET_PORT PORTB +#define RESET_PIN 1 //actually SD_CS + +// SSD1289 shield has LCD_D0 on RXD0. Fine for write-only +// For any Read operations, put jumper from D0 to D8, Switch #2 to OFF. +// If using Serial, jumper D1 to A5, Switch #1 to OFF +#if SSD1289_JUMPERS == 0 +#warning no jumpers. Switch #1=ON, #2=ON +#define BMASK 0x00 //0x00 for output, 0x01 for Read + Serial +#define CMASK 0x00 //0x20 for Read + Serial +#define DMASK (~BMASK) +#define write8(x) { PORTD = x; WR_STROBE; } +#define read_8() ( PIND ) +#elif SSD1289_JUMPERS == 1 +#warning jumper D0 to D8. Switch #1=ON, #2=OFF +#define BMASK 0x01 //0x00 for output, 0x01 for Read + Serial +#define CMASK 0x00 //0x20 for Read + Serial +#define DMASK (~BMASK) +#define write8(x) { PORTD = (PORTD & ~DMASK) | (x & DMASK); PORTB = (PORTB & ~BMASK) | (x & BMASK); WR_STROBE; } +#define read_8() ( (PIND & DMASK)|(PINB & BMASK) ) +#elif SSD1289_JUMPERS == 2 +#warning jumper D0 to D8, D1 to A5. Switch #1=OFF, #2=OFF +#define BMASK (1<<0) //0x00 for output, 0x01 for Read + Serial +#define CMASK (1<<5) //0x20 for Read + Serial +#define DMASK (0xFC) +#define write8(x) { PORTC = (PORTC & ~CMASK) | ((x<<4) & CMASK);\ + PORTD = (PORTD & ~DMASK) | (x & DMASK);\ + PORTB = (PORTB & ~BMASK) | (x & BMASK); WR_STROBE; } +#define read_8() ( ((PINC & CMASK)>>4)|(PIND & DMASK)|(PINB & BMASK) ) +#endif +#define setWriteDir() { DDRC |= CMASK; DDRD |= DMASK; DDRB |= BMASK; } +#define setReadDir() { DDRC &= ~CMASK; DDRD &= ~DMASK; DDRB &= ~BMASK; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__AVR_ATmega2560__) && defined(USE_SSD1289_SHIELD_MEGA) //on MEGA2560 +#warning using SSD1289 Shield for mega2560 +#define RD_PORT PORTF +#define RD_PIN 3 //A3 +#define WR_PORT PORTF +#define WR_PIN 2 //A2 +#define CD_PORT PORTF +#define CD_PIN 1 //A1 +#define CS_PORT PORTF +#define CS_PIN 0 //A0 +#define RESET_PORT PORTH +#define RESET_PIN 6 //D9 DS_CS, D10=T_CS, D9=SD_CS, D8=n.c. + +// only for SSD1289 data bus on D2..D9 UNTESTED +#if (SSD1289_JUMPERS == 0) //Switch #1=ON, #2=ON +#warning no jumpers Switch #1=ON, #2=ON +#define EMASK 0x3B +#define FMASK 0x00 +#define HMASK 0x18 +#define GMASK 0x20 +#define write_8(x) { PORTH &= ~HMASK; PORTG &= ~GMASK; PORTE &= ~EMASK; \ + PORTE |= (((x) & (1<<0)) << 0); \ + PORTE |= (((x) & (1<<1)) << 0); \ + PORTE |= (((x) & (3<<2)) << 2); \ + PORTG |= (((x) & (1<<4)) << 1); \ + PORTE |= (((x) & (1<<5)) >> 2); \ + PORTH |= (((x) & (3<<6)) >> 3); \ +} + +#define read_8() ( ((PINE & (1<<0)) >> 0)\ + | ((PINE & (1<<1)) >> 0)\ + | ((PINE & (3<<4)) >> 2)\ + | ((PING & (1<<5)) >> 1)\ + | ((PINE & (1<<3)) << 2)\ + | ((PINH & (3<<3)) << 3)\ + ) +#elif (SSD1289_JUMPERS == 1) //jumper D0 to D8. Switch #1=ON, #2=OFF +#warning jumper D0 to D8. Switch #1=ON, #2=OFF +#define EMASK 0x3A +#define FMASK 0x00 +#define HMASK 0x38 +#define GMASK 0x20 +#define write_8(x) { PORTH &= ~HMASK; PORTG &= ~GMASK; PORTE &= ~EMASK; \ + PORTH |= (((x) & (1<<0)) << 5); \ + PORTE |= (((x) & (1<<1)) << 0); \ + PORTE |= (((x) & (3<<2)) << 2); \ + PORTG |= (((x) & (1<<4)) << 1); \ + PORTE |= (((x) & (1<<5)) >> 2); \ + PORTH |= (((x) & (3<<6)) >> 3); \ +} + +#define read_8() ( ((PINH & (1<<5)) >> 5)\ + | ((PINE & (1<<1)) >> 0)\ + | ((PINE & (3<<4)) >> 2)\ + | ((PING & (1<<5)) >> 1)\ + | ((PINE & (1<<3)) << 2)\ + | ((PINH & (3<<3)) << 3)\ + ) +#elif (SSD1289_JUMPERS == 2) //jumper D0 to D8, D1 to A5. Switch #1=OFF, #2=OFF +#warning jumper D0 to D8, D1 to A5. Switch #1=OFF, #2=OFF +#define FMASK 0x20 +#define EMASK 0x38 +#define HMASK 0x38 +#define GMASK 0x20 +#define write_8(x) { PORTH &= ~HMASK; PORTG &= ~GMASK; PORTF &= ~FMASK; PORTE &= ~EMASK; \ + PORTH |= (((x) & (1<<0)) << 5); \ + PORTF |= (((x) & (1<<1)) << 4); \ + PORTE |= (((x) & (3<<2)) << 2); \ + PORTG |= (((x) & (1<<4)) << 1); \ + PORTE |= (((x) & (1<<5)) >> 2); \ + PORTH |= (((x) & (3<<6)) >> 3); \ +} + +#define read_8() ( ((PINH & (1<<5)) >> 5)\ + | ((PINF & (1<<5)) >> 4)\ + | ((PINE & (3<<4)) >> 2)\ + | ((PING & (1<<5)) >> 1)\ + | ((PINE & (1<<3)) << 2)\ + | ((PINH & (3<<3)) << 3)\ + ) +#endif +#define setWriteDir() { DDRH |= HMASK; DDRG |= GMASK; DDRF |= FMASK; DDRE |= EMASK; } +#define setReadDir() { DDRH &= ~HMASK; DDRG &= ~GMASK; DDRF &= ~FMASK; DDRE &= ~EMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { RD_STROBE; dst = read_8(); RD_IDLE; RD_STROBE; dst = (dst<<8) | read_8(); RD_IDLE; } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__SAM3X8E__) && defined(USE_SSD1289_SHIELD_DUE) // on DUE +#warning USE_SSD1289_SHIELD_DUE +// configure macros for the control pins +#define RD_PORT PIOA +#define RD_PIN 22 //A3 +#define WR_PORT PIOA +#define WR_PIN 23 //A2 +#define CD_PORT PIOA +#define CD_PIN 24 //A1 +#define CS_PORT PIOA +#define CS_PIN 16 //A0 +#define RESET_PORT PIOC +#define RESET_PIN 21 //D9 Touch CS +// configure macros for data bus +// only for SSD1289 data bus on D2..D9 UNTESTED +#if SSD1289_JUMPERS == 0 +#warning no jumpers Switch #1=ON, #2=ON +#define AMASK (3<<8) +#define BMASK (1<<25) +#define CMASK (0xBC << 21) +#define write_8(x) { PIOA->PIO_CODR = AMASK; PIOB->PIO_CODR = BMASK; PIOC->PIO_CODR = CMASK; \ + PIOA->PIO_SODR = (((x) & (1<<0)) << 8); \ + PIOA->PIO_SODR = (((x) & (1<<1)) << 8); \ + PIOB->PIO_SODR = (((x) & (1<<2)) << 23); \ + PIOC->PIO_SODR = (((x) & (1<<3)) << 25); \ + PIOC->PIO_SODR = (((x) & (1<<4)) << 22); \ + PIOC->PIO_SODR = (((x) & (1<<5)) << 20); \ + PIOC->PIO_SODR = (((x) & (1<<6)) << 18); \ + PIOC->PIO_SODR = (((x) & (1<<7)) << 16); \ +} + +#define read_8() ( ((PIOA->PIO_PDSR & (1<<8)) >> 8)\ + | ((PIOA->PIO_PDSR & (1<<9)) >> 8)\ + | ((PIOB->PIO_PDSR & (1<<25)) >> 23)\ + | ((PIOC->PIO_PDSR & (1<<28)) >> 25)\ + | ((PIOC->PIO_PDSR & (1<<26)) >> 22)\ + | ((PIOC->PIO_PDSR & (1<<25)) >> 20)\ + | ((PIOC->PIO_PDSR & (1<<24)) >> 18)\ + | ((PIOC->PIO_PDSR & (1<<23)) >> 16)\ + ) +#elif SSD1289_JUMPERS == 1 +#warning jumper D0 to D8. Switch #1=ON, #2=OFF +#define AMASK (1<<9) +#define BMASK (1<<25) +#define CMASK (0xBE << 21) +#define write_8(x) { PIOA->PIO_CODR = AMASK; PIOB->PIO_CODR = BMASK; PIOC->PIO_CODR = CMASK; \ + PIOC->PIO_SODR = (((x) & (1<<0)) << 22); \ + PIOA->PIO_SODR = (((x) & (1<<1)) << 8); \ + PIOB->PIO_SODR = (((x) & (1<<2)) << 23); \ + PIOC->PIO_SODR = (((x) & (1<<3)) << 25); \ + PIOC->PIO_SODR = (((x) & (1<<4)) << 22); \ + PIOC->PIO_SODR = (((x) & (1<<5)) << 20); \ + PIOC->PIO_SODR = (((x) & (1<<6)) << 18); \ + PIOC->PIO_SODR = (((x) & (1<<7)) << 16); \ +} + +#define read_8() ( ((PIOC->PIO_PDSR & (1<<22)) >> 22)\ +| ((PIOA->PIO_PDSR & (1<<9)) >> 8)\ +| ((PIOB->PIO_PDSR & (1<<25)) >> 23)\ +| ((PIOC->PIO_PDSR & (1<<28)) >> 25)\ +| ((PIOC->PIO_PDSR & (1<<26)) >> 22)\ +| ((PIOC->PIO_PDSR & (1<<25)) >> 20)\ +| ((PIOC->PIO_PDSR & (1<<24)) >> 18)\ +| ((PIOC->PIO_PDSR & (1<<23)) >> 16)\ +) +#elif SSD1289_JUMPERS == 2 +#warning jumper D0 to D8, D1 to A5. Switch #1=OFF, #2=OFF +#define AMASK (1<<4) +#define BMASK (1<<25) +#define CMASK (0xBE << 21) +#define write_8(x) { PIOA->PIO_CODR = AMASK; PIOB->PIO_CODR = BMASK; PIOC->PIO_CODR = CMASK; \ + PIOC->PIO_SODR = (((x) & (1<<0)) << 22); \ + PIOA->PIO_SODR = (((x) & (1<<1)) << 3); \ + PIOB->PIO_SODR = (((x) & (1<<2)) << 23); \ + PIOC->PIO_SODR = (((x) & (1<<3)) << 25); \ + PIOC->PIO_SODR = (((x) & (1<<4)) << 22); \ + PIOC->PIO_SODR = (((x) & (1<<5)) << 20); \ + PIOC->PIO_SODR = (((x) & (1<<6)) << 18); \ + PIOC->PIO_SODR = (((x) & (1<<7)) << 16); \ + } + +#define read_8() ( ((PIOC->PIO_PDSR & (1<<22)) >> 22)\ + | ((PIOA->PIO_PDSR & (1<<4)) >> 3)\ + | ((PIOB->PIO_PDSR & (1<<25)) >> 23)\ + | ((PIOC->PIO_PDSR & (1<<28)) >> 25)\ + | ((PIOC->PIO_PDSR & (1<<26)) >> 22)\ + | ((PIOC->PIO_PDSR & (1<<25)) >> 20)\ + | ((PIOC->PIO_PDSR & (1<<24)) >> 18)\ + | ((PIOC->PIO_PDSR & (1<<23)) >> 16)\ + ) +#endif +#define setWriteDir() { PIOA->PIO_OER = AMASK; PIOB->PIO_OER = BMASK; PIOC->PIO_OER = CMASK; } +#define setReadDir() { \ + PMC->PMC_PCER0 = (1 << ID_PIOA)|(1 << ID_PIOB)|(1 << ID_PIOC);\ + PIOA->PIO_ODR = AMASK; PIOB->PIO_ODR = BMASK; PIOC->PIO_ODR = CMASK;\ +} +#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; WR_IDLE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; RD_ACTIVE4; dst = read_8(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } +// Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) + +//##################################### USE_FRDM_K20 ################################################### +//#define USE_FRDM_K20 +#elif defined(__MK20DX128__) && defined(USE_FRDM_K20) // Uno Shield on FRDM-K20 +#warning Uno Shield on FRDM-K20 +#define RD_PORT GPIOC +#define RD_PIN 0 +#define WR_PORT GPIOC +#define WR_PIN 1 +#define CD_PORT GPIOD +#define CD_PIN 6 +#define CS_PORT GPIOD +#define CS_PIN 5 +#define RESET_PORT GPIOB +#define RESET_PIN 1 + +// configure macros for the data pins +#define AMASK ((1<<12)|(1<<5)|(1<<2)|(1<<1)) +#define CMASK ((1<<8)|(1<<4)|(1<<3)) +#define DMASK ((1<<4)) + #define write_8(d) { \ + GPIOA_PCOR = AMASK; GPIOC_PCOR = CMASK; GPIOD_PCOR = DMASK; \ + GPIOA_PSOR = (((d) & (1<<0)) << 12) \ + | (((d) & (1<<1)) << 1) \ + | (((d) & (1<<2)) << 3) \ + | (((d) & (1<<5)) >> 4); \ + GPIOC_PSOR = (((d) & (1<<4)) << 4) \ + | (((d) & (3<<6)) >> 3); \ + GPIOD_PSOR = (((d) & (1<<3)) << 1); \ + } + #define read_8() ( (((GPIOA_PDIR & (1<<5)) >> 3) \ + | ((GPIOA_PDIR & (1<<1)) << 4) \ + | ((GPIOA_PDIR & (1<<12)) >> 12) \ + | ((GPIOA_PDIR & (1<<2)) >> 1) \ + | ((GPIOC_PDIR & (1<<8)) >> 4) \ + | ((GPIOC_PDIR & (3<<3)) << 3) \ + | ((GPIOD_PDIR & (1<<4)) >> 1))) + #define setWriteDir() {GPIOA_PDDR |= AMASK;GPIOC_PDDR |= CMASK;GPIOD_PDDR |= DMASK; } + #define setReadDir() {GPIOA_PDDR &= ~AMASK;GPIOC_PDDR &= ~CMASK;GPIOD_PDDR &= ~DMASK; } + +#define write8(x) { write_8(x); WR_ACTIVE2; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; RD_ACTIVE4; RD_ACTIVE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PASTE(x, y) x ## y + +#define PIN_LOW(port, pin) PASTE(port, _PCOR) = (1<<(pin)) +#define PIN_HIGH(port, pin) PASTE(port, _PSOR) = (1<<(pin)) +#define PIN_OUTPUT(port, pin) PASTE(port, _PDDR) |= (1<<(pin)) + +//####################################### D21_XPRO ########################################################### +#elif defined(__SAMD21J18A__) //regular UNO shield on D21_XPRO +#warning regular UNO shield on D21_XPRO +#include "samd21.h" +// configure macros for the control pins +#define RD_PORT PORT->Group[1] +#define RD_PIN 0 +#define WR_PORT PORT->Group[1] +#define WR_PIN 1 +#define CD_PORT PORT->Group[0] +#define CD_PIN 10 +#define CS_PORT PORT->Group[0] +#define CS_PIN 11 +#define RESET_PORT PORT->Group[0] +#define RESET_PIN 8 +// configure macros for data bus +#define AMASK 0x00220000 +#define BMASK 0x0000C0E4 +#define write_8(d) { \ + PORT->Group[0].OUT.reg = (PORT->Group[0].OUT.reg & ~AMASK) \ + | (((d) & (1<<5)) << 16) \ + | (((d) & (1<<7)) << 10); \ + PORT->Group[1].OUT.reg = (PORT->Group[1].OUT.reg & ~BMASK) \ + | (((d) & (3<<0)) << 6) \ + | (((d) & (1<<2)) << 12) \ + | (((d) & (1<<3)) >> 1) \ + | (((d) & (1<<4)) << 1) \ + | (((d) & (1<<6)) << 9); \ +} +#define read_8() ( (((PORT->Group[0].IN.reg & (1<<21)) >> 16) \ +| ((PORT->Group[0].IN.reg & (1<<17)) >> 10) \ +| ((PORT->Group[1].IN.reg & (3<<6)) >> 6) \ +| ((PORT->Group[1].IN.reg & (1<<14)) >> 12) \ +| ((PORT->Group[1].IN.reg & (1<<2)) << 1) \ +| ((PORT->Group[1].IN.reg & (1<<5)) >> 1) \ +| ((PORT->Group[1].IN.reg & (1<<15)) >> 9))) +#define setWriteDir() { \ + PORT->Group[0].DIRSET.reg = AMASK; \ + PORT->Group[1].DIRSET.reg = BMASK; \ + PORT->Group[0].WRCONFIG.reg = (AMASK>>16) | (0<<22) | (0<<28) | (1<<30) | (1<<31); \ + PORT->Group[1].WRCONFIG.reg = (BMASK & 0xFFFF) | (0<<22) | (0<<28) | (1<<30); \ +} +#define setReadDir() { \ + PORT->Group[0].DIRCLR.reg = AMASK; \ + PORT->Group[1].DIRCLR.reg = BMASK; \ + PORT->Group[0].WRCONFIG.reg = (AMASK>>16) | (1<<17) | (0<<28) | (1<<30) | (1<<31); \ + PORT->Group[1].WRCONFIG.reg = (BMASK & 0xFFFF) | (1<<17) | (0<<28) | (1<<30); \ +} + +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { RD_STROBE; dst = read_8(); RD_IDLE; RD_STROBE; dst = (dst<<8) | read_8(); RD_IDLE; } +// Shield Control macros. +#define PIN_LOW(port, pin) (port).OUTCLR.reg = (1<<(pin)) +#define PIN_HIGH(port, pin) (port).OUTSET.reg = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port).DIR.reg |= (1<<(pin)) + +//###################################### TEENSY 4 BETA #################################### +#elif defined(__IMXRT1052__)// regular UNO shield on a Teensy 4.x +#warning regular UNO shield on UNKNOWN Teensy 4.0 + +//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST | A5 +//MXRT pin |4.16|4.17|2.7|2.6|2.5|2.4|4.11|4.10| |1.18|1.19|1.23|1.22|1.17|1.16 + +#if 0 +#elif defined(__IMXRT1052__) +#define WRITE_DELAY { WR_ACTIVE8;WR_ACTIVE8; } +#define IDLE_DELAY { WR_IDLE2;WR_IDLE; } +#define READ_DELAY { RD_ACTIVE16;RD_ACTIVE16; } +#else +#error unspecified delays +#endif + +#define RD_PORT GPIO1 +#define RD_PIN 18 +#define WR_PORT GPIO1 +#define WR_PIN 19 +#define CD_PORT GPIO1 +#define CD_PIN 23 +#define CS_PORT GPIO1 +#define CS_PIN 22 +#define RESET_PORT GPIO1 +#define RESET_PIN 17 + +// configure macros for the data pins +#define DMASK ((1<<16)|(1<<17)|(1<<11)|(1<<10)) +#define BMASK ((1<<7)|(1<<6)|(1<<5)|(1<<4)) + +#define write_8(d) { \ + GPIO4_DR_CLEAR = DMASK; GPIO2_DR_CLEAR = BMASK; \ + GPIO4_DR_SET = (((d) & (1 << 0)) << 10) \ + | (((d) & (1 << 1)) << 10) \ + | (((d) & (1 << 6)) << 11) \ + | (((d) & (1 << 7)) << 9); \ + GPIO2_DR_SET = (((d) & (1 << 2)) << 2) \ + | (((d) & (1 << 3)) << 2) \ + | (((d) & (1 << 4)) << 2) \ + | (((d) & (1 << 5)) << 2); \ + } +#define read_8() ((((GPIO4_PSR & (1 << 10)) >> 10) \ + | ((GPIO4_PSR & (1 << 11)) >> 10) \ + | ((GPIO2_PSR & (1 << 4)) >> 2) \ + | ((GPIO2_PSR & (1 << 5)) >> 2) \ + | ((GPIO2_PSR & (1 << 6)) >> 2) \ + | ((GPIO2_PSR & (1 << 7)) >> 2) \ + | ((GPIO4_PSR & (1 << 17)) >> 11) \ + | ((GPIO4_PSR & (1 << 16)) >> 9))) +#define setWriteDir() {GPIO4_GDIR |= DMASK;GPIO2_GDIR |= BMASK; } +#define setReadDir() {GPIO4_GDIR &= ~DMASK;GPIO2_GDIR &= ~BMASK; } +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; IDLE_DELAY; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE2; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } +#define GPIO_INIT() {for (int i = 2; i <= 9; i++) pinMode(i, OUTPUT); for (int i = A0; i <= A4; i++) pinMode(i, OUTPUT);} + +#define PASTE(x, y) x ## y + +#define PIN_LOW(port, pin) PASTE(port, _DR_CLEAR) = (1<<(pin)) +#define PIN_HIGH(port, pin) PASTE(port, _DR_SET) = (1<<(pin)) +#define PIN_OUTPUT(port, pin) PASTE(port, _GDIR) |= (1<<(pin)) + +//####################################### NANO IOT 33 ############################ +#elif defined(__SAMD21G18A__) && defined(ARDUINO_SAMD_NANO_33_IOT) //regular UNO shield on NANO IOT 33 +#warning building for NANO IOT 33 +//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST | +//SAMD21 pin |PA6 |PA4 |PA5 |PA7 |PB11|PB10|PA20|PA18| |PA2|PB2|PA11|PA10|PB08| +#define WRITE_DELAY { WR_ACTIVE4; } +#define IDLE_DELAY { WR_IDLE2; } +#define READ_DELAY { RD_ACTIVE8;} +// configure macros for the control pins +#define RD_PORT PORT->Group[0] //PA02 +#define RD_PIN 2 +#define WR_PORT PORT->Group[1] //PB02 +#define WR_PIN 2 +#define CD_PORT PORT->Group[0] //PA11 +#define CD_PIN 11 +#define CS_PORT PORT->Group[0] //PA10 +#define CS_PIN 10 +#define RESET_PORT PORT->Group[1] //PB08 +#define RESET_PIN 8 +// configure macros for data bus +#define AMASK ((15<<4)|(1<<18)|(1<<20)) +#define BMASK (3<<10) // +#define WRMASK ((0<<22) | (1<<28) | (1<<30)) // +#define RDMASK ((1<<17) | (1<<28) | (1<<30)) // +#define write_8(x) { \ + PORT->Group[0].OUTCLR.reg = AMASK; PORT->Group[1].OUTCLR.reg = BMASK; \ + PORT->Group[0].OUTSET.reg = \ + (((x) & (1<<0)) << 18) | (((x) & (1<<1)) << 19) | \ + (((x) & (1<<4)) << 3) | (((x) & (1<<5)) << 0) | \ + (((x) & (1<<6)) >> 2) | (((x) & (1<<7)) >> 1); \ + PORT->Group[1].OUTSET.reg = (((x) & (3<<2)) << 8); \ + } + +#define read_8() ( \ + ((PORT->Group[0].IN.reg & (1<<18)) >> 18)\ + | ((PORT->Group[0].IN.reg & (1<<20)) >> 19)\ + | ((PORT->Group[0].IN.reg & (1<<7)) >> 3)\ + | ((PORT->Group[0].IN.reg & (1<<5)) >> 0)\ + | ((PORT->Group[0].IN.reg & (1<<4)) << 2)\ + | ((PORT->Group[0].IN.reg & (1<<6)) << 1)\ + | ((PORT->Group[1].IN.reg & (3<<10)) >> 8)\ + ) +#define setWriteDir() { \ + PORT->Group[0].DIRSET.reg = AMASK; \ + PORT->Group[0].WRCONFIG.reg = (AMASK & 0xFFFF) | WRMASK; \ + PORT->Group[1].DIRSET.reg = BMASK; \ + PORT->Group[1].WRCONFIG.reg = (BMASK & 0xFFFF) | WRMASK; \ + } +#define setReadDir() { \ + PORT->Group[0].DIRCLR.reg = AMASK; \ + PORT->Group[0].WRCONFIG.reg = (AMASK & 0xFFFF) | RDMASK; \ + PORT->Group[1].DIRCLR.reg = BMASK; \ + PORT->Group[1].WRCONFIG.reg = (BMASK & 0xFFFF) | RDMASK; \ + } +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; IDLE_DELAY; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE2; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +// Shield Control macros. +#define PIN_LOW(port, pin) (port).OUTCLR.reg = (1<<(pin)) +#define PIN_HIGH(port, pin) (port).OUTSET.reg = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port).DIRSET.reg = (1<<(pin)) + +//################################################################################################################# diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/mcufriend_special_4.h b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/mcufriend_special_4.h new file mode 100644 index 0000000..2965ad4 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/mcufriend_special_4.h @@ -0,0 +1,188 @@ +#define SSD1289_JUMPERS 2 //Uno Shield with VERY different pin-out to Mcufriend +//#define USE_SSD1289_SHIELD_UNO +//#define USE_SSD1289_SHIELD_MEGA +#define USE_SSD1289_SHIELD_DUE //Due only works with JUMPERS==2 + +#if 0 + +//################################# SSD1289 SHIELD ####################### +// SSD1289 shield has LCD_D0 on RXD0. SD_CS=D8, T_IRQ=D9, T_CS=D10 +// This is fine for write-only operations with NO Serial. A4, A5 are available for I2C +// NOTE THAT Serial.end() IS REQUIRED FOR NO JUMPERS +// Read operations, lose I2C (on Uno) but gain Serial, Bootloader etc +// jumper D0 to A4, D1 to A5, Switch #1 to OFF, #2 to OFF +#elif defined(__AVR_ATmega328P__) && defined(USE_SSD1289_SHIELD_UNO) //on UNO +#warning using SSD1289 Shield for mega328 +#define RD_PORT PORTC +#define RD_PIN 3 +#define WR_PORT PORTC +#define WR_PIN 2 +#define CD_PORT PORTC +#define CD_PIN 1 +#define CS_PORT PORTC +#define CS_PIN 0 +#define RESET_PORT PORTB +#define RESET_PIN 1 //D9 actually T_IRQ + +#if SSD1289_JUMPERS == 0 //data bus on D0..D7 +#warning no jumpers. Switch #1=ON, #2=ON +#define BMASK 0x00 //0x00 for output, 0x01 for Read + Serial +#define CMASK 0x00 //0x20 for Read + Serial +#define DMASK 0xFF +#define write8(x) { PORTD = x; WR_STROBE; } +#define read_8() ( 0xAB ) //this shield is WRITE-ONLY +#elif SSD1289_JUMPERS == 2 +#warning jumper D0 to A4, D1 to A5. Switch #1=OFF, #2=OFF +#define BMASK 0x00 //D8 is unused now +#define CMASK ((1<<4)|(1<<5)) //A4, A5 +#define DMASK (0xFC) +#define write8(x) { PORTC = (PORTC & ~CMASK) | ((x<<4) & CMASK);\ + PORTD = (PORTD & ~DMASK) | (x & DMASK); WR_STROBE; } +#define read_8() ( ((PINC & CMASK)>>4)|(PIND & DMASK) ) +#endif +#define setWriteDir() { DDRC |= CMASK; DDRD |= DMASK; DDRB |= BMASK; } +#define setReadDir() { DDRC &= ~CMASK; DDRD &= ~DMASK; DDRB &= ~BMASK; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__AVR_ATmega2560__) && defined(USE_SSD1289_SHIELD_MEGA) +#warning using SSD1289 Shield for mega2560 +#define RD_PORT PORTF +#define RD_PIN 3 //A3 +#define WR_PORT PORTF +#define WR_PIN 2 //A2 +#define CD_PORT PORTF +#define CD_PIN 1 //A1 +#define CS_PORT PORTF +#define CS_PIN 0 //A0 +#define RESET_PORT PORTH +#define RESET_PIN 6 //D9 (D10=T_CS, D9=T_IRQ, D8=SD_CS) + +#if (SSD1289_JUMPERS == 0) //data bus on D0..D7 +#warning no jumpers Switch #1=ON, #2=ON +#define EMASK ((1<<0)|(1<<1)|(1<<4)|(1<<5)|(1<<3)) +#define FMASK 0x00 +#define HMASK ((1<<3)|(1<<4)) +#define GMASK (1<<5) +#define write_8(x) { PORTH &= ~HMASK; PORTG &= ~GMASK; PORTF &= ~FMASK; PORTE &= ~EMASK; \ + PORTE |= (((x) & (1<<0)) << 0); \ + PORTE |= (((x) & (1<<1)) << 0); \ + PORTE |= (((x) & (3<<2)) << 2); \ + PORTG |= (((x) & (1<<4)) << 1); \ + PORTE |= (((x) & (1<<5)) >> 2); \ + PORTH |= (((x) & (3<<6)) >> 3); \ +} + +#define read_8() ( 0xBC ) //this shield is WRITE-ONLY + +#elif (SSD1289_JUMPERS == 2) //jumper D0 to A4, D1 to A5. Switch #1=OFF, #2=OFF +#warning jumper D0 to A4, D1 to A5. Switch #1=OFF, #2=OFF +#define EMASK ((1<<4)|(1<<5)|(1<<3)) +#define FMASK ((1<<4)|(1<<5)) +#define HMASK ((1<<3)|(1<<4)) +#define GMASK (1<<5) +#define write_8(x) { PORTH &= ~HMASK; PORTG &= ~GMASK; PORTF &= ~FMASK; PORTE &= ~EMASK; \ + PORTF |= (((x) & (1<<0)) << 4); \ + PORTF |= (((x) & (1<<1)) << 4); \ + PORTE |= (((x) & (3<<2)) << 2); \ + PORTG |= (((x) & (1<<4)) << 1); \ + PORTE |= (((x) & (1<<5)) >> 2); \ + PORTH |= (((x) & (3<<6)) >> 3); \ +} + +#define read_8() ( ((PINF & (1<<4)) >> 4)\ + | ((PINF & (1<<5)) >> 4)\ + | ((PINE & (3<<4)) >> 2)\ + | ((PING & (1<<5)) >> 1)\ + | ((PINE & (1<<3)) << 2)\ + | ((PINH & (3<<3)) << 3)\ + ) +#endif +#define setWriteDir() { DDRH |= HMASK; DDRG |= GMASK; DDRF |= FMASK; DDRE |= EMASK; } +#define setReadDir() { DDRH &= ~HMASK; DDRG &= ~GMASK; DDRF &= ~FMASK; DDRE &= ~EMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { RD_STROBE; dst = read_8(); RD_IDLE; RD_STROBE; dst = (dst<<8) | read_8(); RD_IDLE; } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__SAM3X8E__) && defined(USE_SSD1289_SHIELD_DUE) // on DUE +#warning USE_SSD1289_SHIELD_DUE +// configure macros for the control pins +#define RD_PORT PIOA +#define RD_PIN 22 //A3 +#define WR_PORT PIOA +#define WR_PIN 23 //A2 +#define CD_PORT PIOA +#define CD_PIN 24 //A1 +#define CS_PORT PIOA +#define CS_PIN 16 //A0 +#define RESET_PORT PIOC +#define RESET_PIN 21 //D9 Touch_IRQ +// configure macros for data bus +#if SSD1289_JUMPERS == 0 //data bus on D0..D7 +#warning no jumpers Switch #1=ON, #2=ON +#define AMASK ((1<<8)|(1<<9)) //D0, D1 +#define BMASK (1<<25) +#define CMASK ((1<<28)|(1<<26)|(1<<25)|(1<<24)|(1<<23)) +#define write_8(x) { PIOA->PIO_CODR = AMASK; PIOB->PIO_CODR = BMASK; PIOC->PIO_CODR = CMASK; \ + PIOA->PIO_SODR = (((x) & (1<<0)) << 8); \ + PIOA->PIO_SODR = (((x) & (1<<1)) << 8); \ + PIOB->PIO_SODR = (((x) & (1<<2)) << 23); \ + PIOC->PIO_SODR = (((x) & (1<<3)) << 25); \ + PIOC->PIO_SODR = (((x) & (1<<4)) << 22); \ + PIOC->PIO_SODR = (((x) & (1<<5)) << 20); \ + PIOC->PIO_SODR = (((x) & (1<<6)) << 18); \ + PIOC->PIO_SODR = (((x) & (1<<7)) << 16); \ + } + +#define read_8() ( 0xCD ) //this shield is WRITE-ONLY + +#elif SSD1289_JUMPERS == 2 //jumper D0 to A4, D1 to A5. Switch #1=OFF, #2=OFF +#warning jumper D0 to A4, D1 to A5. Switch #1=OFF, #2=OFF +#define AMASK ((1<<6)|(1<<4)) //A4, A5 +#define BMASK (1<<25) +#define CMASK ((1<<28)|(1<<26)|(1<<25)|(1<<24)|(1<<23)) +#define write_8(x) { PIOA->PIO_CODR = AMASK; PIOB->PIO_CODR = BMASK; PIOC->PIO_CODR = CMASK; \ + PIOA->PIO_SODR = (((x) & (1<<0)) << 6); \ + PIOA->PIO_SODR = (((x) & (1<<1)) << 3); \ + PIOB->PIO_SODR = (((x) & (1<<2)) << 23); \ + PIOC->PIO_SODR = (((x) & (1<<3)) << 25); \ + PIOC->PIO_SODR = (((x) & (1<<4)) << 22); \ + PIOC->PIO_SODR = (((x) & (1<<5)) << 20); \ + PIOC->PIO_SODR = (((x) & (1<<6)) << 18); \ + PIOC->PIO_SODR = (((x) & (1<<7)) << 16); \ + } + +#define read_8() ( ((PIOA->PIO_PDSR & (1<<6)) >> 6)\ + | ((PIOA->PIO_PDSR & (1<<4)) >> 3)\ + | ((PIOB->PIO_PDSR & (1<<25)) >> 23)\ + | ((PIOC->PIO_PDSR & (1<<28)) >> 25)\ + | ((PIOC->PIO_PDSR & (1<<26)) >> 22)\ + | ((PIOC->PIO_PDSR & (1<<25)) >> 20)\ + | ((PIOC->PIO_PDSR & (1<<24)) >> 18)\ + | ((PIOC->PIO_PDSR & (1<<23)) >> 16)\ + ) +#endif +#define setWriteDir() { PIOA->PIO_OER = AMASK; PIOB->PIO_OER = BMASK; PIOC->PIO_OER = CMASK; } +#define setReadDir() { \ + PMC->PMC_PCER0 = (1 << ID_PIOA)|(1 << ID_PIOB)|(1 << ID_PIOC);\ + PIOA->PIO_ODR = AMASK; PIOB->PIO_ODR = BMASK; PIOC->PIO_ODR = CMASK;\ +} +#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; WR_IDLE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; RD_ACTIVE4; dst = read_8(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } +// Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/pagebreak.sed b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/pagebreak.sed new file mode 100644 index 0000000..923af2b --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/pagebreak.sed @@ -0,0 +1,3 @@ +# skip the PDF page footers. +/^a-.*/,/^Page.*/d +/^[0-9]+$/,/^.2010.*/d diff --git a/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/r61526_init.h b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/r61526_init.h new file mode 100644 index 0000000..9ead4f7 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/extras/unused/r61526_init.h @@ -0,0 +1,279 @@ +/* 2. HSD 2.2” Gamma 2.2 Initial Code(1/2)*/ +/*R61526 for Hannstar 2.2" Gamma 2.2*/ + (0xB0), 0x3F, 0x3F, + TFTLCD_DELAY8, 5, + (0xB3), 0x02, 0x00, 0x00, 0x00, 0x00, + (0xB4), 0x00, + (0xC0), 0x33, 0x4F, 0x00, 0x10, 0xA2, 0x00, 0x01, 0x00, + (0xC1), 0x01, 0x02, 0x1B, 0x08, 0x08, + TFTLCD_DELAY8, 25, + (0xC3), 0x01, 0x00, 0x1B, 0x08, 0x08, + TFTLCD_DELAY8, 25, + (0xC4), 0x21, 0x01, 0x200, 0x02, 0x00, +/*Gamma setting start*/ + (0xC8), 0x09, 0x09, 0x0B, 0x0B, 0x0F, 0x00, 0x00, 0x06, 0x15, 0x13, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x0E, 0x1D, 0x0B, 0x11, 0x0C, 0x0C, 0x03, + (0xC9), 0x09, 0x09, 0x0B, 0x0B, 0x0F, 0x00, 0x00, 0x06, 0x15, 0x13, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x0E, 0x1D, 0x0B, 0x11, 0x0C, 0x0C, 0x03, + +/* 2. HSD 2.2” Gamma 2.2 Initial Code(2/2)*/ + (0xCA), 0x09, 0x09, 0x0B, 0x0B, 0x0F, 0x00, 0x00, 0x06, 0x15, 0x13, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x0E, 0x1D, 0x0B, 0x11, 0x0C, 0x0C, 0x03, +/*Gamma setting end*/ +/*Power setting start*/ + (0xD0), 0x33, 0x53, 0x85, 0x35, 0x00, 0x00, + (0xD1), 0x53, 0x7A, 0x10, + (0xD2), 0x03, 0x24, + (0xD4), 0x03, 0x24, + (0xE2), 0x3F, +/*Power setting End*/ +/*Other setting*/ + (0x35), 0x00, + (0x36), 0x00, + (0x3A), 0x66, + (0x2A), 0x00, 0x00, 0x00, 0xEF, + (0x2B), 0x00, 0x00, 0x01, 0x3F, + (0x2C), + (0x11), + TFTLCD_DELAY8, 30, + (0x29), +/*End Gamma 2.2 Setting*/ + +/* 2. HSD 2.2” Gamma 2.5 Initial Code(1/2)*/ +/*R61526 for Hannstar 2.2" Gamma 2.5*/ + (0xB0), 0x3F, 0x3F, + TFTLCD_DELAY8, 5, + (0xB3), 0x02, 0x00, 0x00, 0x00, 0x00, + (0xB4), 0x00, + (0xC0), 0x33, 0x4F, 0x00, 0x10, 0xA2, 0x00, 0x01, 0x00, + (0xC1), 0x01, 0x02, 0x1B, 0x08, 0x08, + TFTLCD_DELAY8, 25, + (0xC3), 0x01, 0x00, 0x1B, 0x08, 0x08, + TFTLCD_DELAY8, 25, + (0xC4), 0x21, 0x01, 0x300, 0x02, 0x00, +/*Gamma setting start*/ + (0xC8), 0x09, 0x09, 0x0B, 0x10, 0x09, 0x01, 0x03, 0x0A, 0x1F, 0x06, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x14, 0x18, 0x0A, 0x11, 0x0C, 0x0C, 0x03, + (0xC9), 0x09, 0x09, 0x0B, 0x10, 0x09, 0x01, 0x03, 0x0A, 0x1F, 0x06, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x14, 0x18, 0x0A, 0x11, 0x0C, 0x0C, 0x03, + +/* 2. HSD 2.2” Gamma 2.5 Initial Code(2/2)*/ + (0xCA), 0x09, 0x09, 0x0B, 0x10, 0x09, 0x01, 0x03, 0x0A, 0x1F, 0x06, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x14, 0x18, 0x0A, 0x11, 0x0C, 0x0C, 0x03, +/*Gamma setting end*/ +/*Power setting start*/ + (0xD0), 0x33, 0x53, 0x85, 0x35, 0x00, 0x00, + (0xD1), 0x54, /*VCM 1B~7F*/ 0x7A, /*VDV 25~7F*/ 0x10, + (0xD2), 0x03, 0x24, + (0xD4), 0x03, 0x24, + (0xE2), 0x3F, +/*Power setting End*/ +/*Other setting*/ + (0x35), 0x00, + (0x36), 0x00, + (0x3A), 0x66, /*66->18 bit, 55->16bit.*/ + (0x2A), 0x00, 0x00, 0x00, 0xEF, + (0x2B), 0x00, 0x00, 0x01, 0x3F, + (0x2C), + (0x11), + TFTLCD_DELAY8, 30, + (0x29), + + (0xB0), 0x3F, 0x3F, + (0xFE), 0x00, 0x00, 0x00, 0x21, 0xB4, + (0xB3), 0x00, 0x10, + (0xE0), 0x00, 0x40, + TFTLCD_DELAY8, 5 , + (0xB3), 0x00, 0x00, + (0xFE), 0x00, 0x00, 0x00, 0x21, 0x30, + (0xB0), 0x3F, 0x3F, + (0xB3), 0x02, 0x00, 0x00, 0x00, + (0xB4), 0x00, + (0xC0), 0x03, 0x4F, 0x00, 0x10, 0xA2, 0x00, 0x01, 0x00, + (0xC1), 0x01, 0x02, 0x28, 0x08, 0x08, + TFTLCD_DELAY8, 25 , + (0xC3), 0x01, 0x00, 0x28, 0x08, 0x08, + TFTLCD_DELAY8, 25 , + (0xC4), 0x11, 0x01, 0x00, 0x00, + (0xC8), /*Gamma*/ 0x0C, 0x0C, 0x0D, 0x14, 0x18, 0x0E, 0x09, 0x09, 0x03, 0x05, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x15, 0x12, 0x0A, 0x0E, 0x0A, 0x0A, 0x00, +/* 3. LGD 2.6” Gamma 2.2 Initial Code(1/2)*/ + + (0xC9), /*Gamma*/ 0x0C, 0x0C, 0x0D, 0x14, 0x18, 0x0E, 0x09, 0x09, 0x03, 0x05, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x15, 0x12, 0x0A, 0x0E, 0x0A, 0x0A, 0x00, + (0xCA), /*Gamma*/ 0x0C, 0x0C, 0x0D, 0x14, 0x18, 0x0E, 0x09, 0x09, 0x03, 0x05, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x15, 0x12, 0x0A, 0x0E, 0x0A, 0x0A, 0x00, + (0xD0), 0x63, 0x53, 0x82, 0x3F, + (0xD1), 0x6A, 0x64, + (0xD2), 0x03, 0x24, + (0xD4), 0x03, 0x24, + (0xE2), 0x3F, + (0x35), 0x00, + (0x36), 0x00, + (0x3A), 0x55, + (0x2A), 0x00, 0x00, 0x00, 0xEF, + (0x2B), 0x00, 0x00, 0x01, 0x3F, + (0x2C), + (0x11), + TFTLCD_DELAY8, 40 , + (0x29), + (0x2C), +/* 3. LGD 2.6” Gamma 2.2 Initial Code(2/2)*/ + + (0xB0), 0x3F, 0x3F, + (0xFE), 0x00, 0x00, 0x00, 0x21, 0xB4, + (0xB3), 0x00, 0x10, + (0xE0), 0x00, 0x40, + TFTLCD_DELAY8, 5 , + (0xB3), 0x00, 0x00, + (0xFE), 0x00, 0x00, 0x00, 0x21, 0x30, + (0xB0), 0x3F, 0x3F, + (0xB3), 0x02, 0x00, 0x00, 0x00, + (0xB4), 0x00, + (0xC0), 0x03, 0x4F, 0x00, 0x10, 0xA2, 0x00, 0x01, 0x00, + (0xC1), 0x01, 0x02, 0x28, 0x08, 0x08, + TFTLCD_DELAY8, 25 , + (0xC3), 0x01, 0x00, 0x28, 0x08, 0x08, + TFTLCD_DELAY8, 25 , + (0xC4), 0x11, 0x01, 0x00, 0x00, + (0xC8), /*Gamma*/ 0x09, 0x09, 0x0B, 0x13, 0x16, 0x0C, 0x09, 0x09, 0x03, 0x05, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x15, 0x12, 0x09, 0x0D, 0x0C, 0x0C, 0x03, +/* 3. LGD 2.6” Gamma 2.5 Initial Code(1/2)*/ + + (0xC9), /*Gamma*/ 0x09, 0x09, 0x0B, 0x13, 0x16, 0x0C, 0x09, 0x09, 0x03, 0x05, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x15, 0x12, 0x09, 0x0D, 0x0C, 0x0C, 0x03, + (0xCA), /*Gamma*/ 0x09, 0x09, 0x0B, 0x13, 0x16, 0x0C, 0x09, 0x09, 0x03, 0x05, 0x00, 0x03, 0x08, 0x07, 0x0E, 0x15, 0x12, 0x09, 0x0D, 0x0C, 0x0C, 0x03, + (0xD0), 0x63, 0x53, 0x82, 0x3F, + (0xD1), 0x6A, 0x64, + (0xD2), 0x03, 0x24, + (0xD4), 0x03, 0x24, + (0xE2), 0x3F, + (0x35), 0x00, + (0x36), 0x00, + (0x3A), /*16/18 bit*/ 0x55, /*66->18 bit, 55->16bit.*/ + (0x2A), 0x00, 0x00, 0x00, 0xEF, + (0x2B), 0x00, 0x00, 0x01, 0x3F, + (0x2C), + (0x11), + TFTLCD_DELAY8, 40 , + (0x29), + (0x2C), +/* 3. LGD 2.6” Gamma 2.5 Initial Code(2/2)*/ + + (0xB0), 0x3F, 0x3F, + TFTLCD_DELAY8, 5, + (0xB3), 0x02, 0x00, 0x00, 0x00, 0x00, + (0xB4), 0x00, + (0xC0), 0x33, 0x4F, 0x00, 0x10, 0xA2, 0x00, 0x01, 0x00, + (0xC1), 0x01, 0x02, 0x24, 0x04, 0x04, + TFTLCD_DELAY8, 25, + (0xC4), 0x11, 0x01, 0x00, 0x00, 0x00, +/*Gamma setting start*/ + (0xC8), /*Gamma*/ 0x07, 0x09, 0x0A, 0x11, 0x17, 0x0A, 0x08, 0x04, 0x07, 0x03, 0x00, 0x03, 0x07, 0x04, 0x08, 0x0A, 0x17, 0x11, 0x0A, 0x09, 0x07, 0x00, + (0xC9), /*Gamma*/ 0x07, 0x09, 0x0A, 0x11, 0x17, 0x0A, 0x08, 0x04, 0x07, 0x03, 0x00, 0x03, 0x07, 0x04, 0x08, 0x0A, 0x17, 0x11, 0x0A, 0x09, 0x07, 0x00, + (0xCA), /*Gamma*/ 0x07, 0x09, 0x0A, 0x11, 0x17, 0x0A, 0x08, 0x04, 0x07, 0x03, 0x00, 0x03, 0x07, 0x04, 0x08, 0x0A, 0x17, 0x11, 0x0A, 0x09, 0x07, 0x00, +/* 4. TIAMMA 2.4” Gamma 2.2 Initial Code(1/2)*/ + +/*Power setting start*/ + (0xD0), 0x33, 0x53, 0x85, 0x3A, 0x30, 0x00, + (0xD1), 0x5F, /*VCM 1B~7F*/ 0x78, /*VDV 25~7F*/ 0x10, + (0xD2), 0x03, 0x24, + (0xE2), 0x3F, +/*Power setting End*/ + (0x35), 0x00, + (0x36), 0x00, + (0x3A), 0x66, /*66->18 bit, 55->16bit.*/ + (0x2A), 0x00, 0x00, 0x00, 0xEF, + (0x2B), 0x00, 0x00, 0x01, 0x3F, + (0x2C), + (0x11), + TFTLCD_DELAY8, 40, + (0x29), + (0x2C), +/* 4. TIAMMA 2.4” Gamma 2.2 Initial Code(2/2)*/ + + (0xB0), 0x3F, 0x3F, + TFTLCD_DELAY8, 5, + (0xB3), 0x02, 0x00, 0x00, 0x00, 0x00, + (0xB4), 0x00, + (0xC0), 0x33, 0x4F, 0x00, 0x10, 0xA2, 0x00, 0x01, 0x00, + (0xC1), 0x01, 0x02, 0x24, 0x04, 0x04, + TFTLCD_DELAY8, 25, + (0xC4), 0x11, 0x01, 0x00, 0x00, 0x00, +/*Gamma setting start*/ + (0xC8), /*Gamma*/ 0x07, 0x09, 0x0A, 0x0C, 0x18, 0x0D, 0x05, 0x04, 0x07, 0x03, 0x00, 0x03, 0x07, 0x04, 0x05, 0x0D, 0x18, 0x0C, 0x0A, 0x09, 0x07, 0x00, + (0xC9), /*Gamma*/ 0x07, 0x09, 0x0A, 0x0C, 0x18, 0x0D, 0x05, 0x04, 0x07, 0x03, 0x00, 0x03, 0x07, 0x04, 0x05, 0x0D, 0x18, 0x0C, 0x0A, 0x09, 0x07, 0x00, + (0xCA), /*Gamma*/ 0x07, 0x09, 0x0A, 0x0C, 0x18, 0x0D, 0x05, 0x04, 0x07, 0x03, 0x00, 0x03, 0x07, 0x04, 0x05, 0x0D, 0x18, 0x0C, 0x0A, 0x09, 0x07, 0x00, +/* 4. TIAMMA 2.4” Gamma 2.5 Initial Code(1/2)*/ + +/*Power setting start*/ + (0xD0), 0x33, 0x53, 0x85, 0x3D, 0x30, 0x00, + (0xD1), 0x5F, /*VCM 1B~7F*/ 0x78, /*VDV 25~7F*/ 0x10, + (0xD2), 0x03, 0x24, + (0xE2), 0x3F, +/*Power setting End*/ + (0x35), 0x00, + (0x36), 0x00, + (0x3A), 0x66, /*66->18 bit, 55->16bit.*/ + (0x2A), 0x00, 0x00, 0x00, 0xEF, + (0x2B), 0x00, 0x00, 0x01, 0x3F, + (0x2C), + (0x11), + TFTLCD_DELAY8, 40, + (0x29), + (0x2C), +/* 4. TIAMMA 2.4” Gamma 2.5 Initial Code(2/2)*/ + + (0xB0), 0x3F, 0x3F, + TFTLCD_DELAY8, 5, + (0xB3), 0x02, 0x00, 0x00, 0x00, 0x00, + (0xB4), 0x00, + (0xC0), 0x33, 0x4F, 0x00, 0x10, 0xA2, 0x00, 0x01, 0x00, + (0xC1), 0x01, 0x02, 0x1A, /*86Hz*/ 0x04, 0x04, + TFTLCD_DELAY8, 25, + (0xC4), 0x11, 0x01, 0x00, 0x00, 0x00, +/*Gamma setting start*/ + (0xC8), /*GAMMA*/ 0x05, /*V0*/ 0x00, /*V1*/ 0x07, /*V4*/ 0x14, /*V8*/ 0x20, /*V20*/ 0x02, /*V43*/ 0x09, /*V55*/ 0x00, /*V59*/ 0x01, /*V62*/ 0x01, /*V63*/ 0x00, 0x01, /*V63*/ 0x01, /*V62*/ 0x00, /*V59*/ 0x09, /*V55*/ 0x02, /*V43*/ 0x20, /*V20*/ 0x14, /*V8*/ 0x07, /*V4*/ 0x00, /*V1*/ 0x05, /*V0*/ 0x00, + (0xC9), /*GAMMA*/ 0x05, /*V0*/ 0x00, /*V1*/ 0x07, /*V4*/ 0x14, /*V8*/ 0x20, /*V20*/ 0x02, /*V43*/ 0x09, /*V55*/ 0x00, /*V59*/ 0x01, /*V62*/ 0x01, /*V63*/ 0x00, 0x01, /*V63*/ 0x01, /*V62*/ 0x00, /*V59*/ 0x09, /*V55*/ 0x02, /*V43*/ 0x20, /*V20*/ 0x14, /*V8*/ 0x07, /*V4*/ 0x00, /*V1*/ 0x05, /*V0*/ 0x00, + (0xCA), /*GAMMA*/ 0x05, /*V0*/ 0x00, /*V1*/ 0x07, /*V4*/ 0x14, /*V8*/ 0x20, /*V20*/ 0x02, /*V43*/ 0x09, /*V55*/ 0x00, /*V59*/ 0x01, /*V62*/ 0x01, /*V63*/ 0x00, 0x01, /*V63*/ 0x01, /*V62*/ 0x00, /*V59*/ 0x09, /*V55*/ 0x02, /*V43*/ 0x20, /*V20*/ 0x14, /*V8*/ 0x07, /*V4*/ 0x00, /*V1*/ 0x05, /*V0*/ 0x00, +/* 5. BOE 2.0” Gamma 2.2 Initial Code(1/2)*/ + +/*Power setting start*/ + (0xD0), 0x33, 0x53, 0x85, 0x3A, 0x37, 0x00, + (0xD1), 0x41, /*VCM 1B~7F*/ 0x78, /*VDV 25~7F*/ 0x10, + (0xD2), 0x03, 0x22, + (0xE2), 0x3F, +/*Power setting End*/ + (0x35), 0x00, + (0x36), 0x00, + (0x3A), 0x66, /*66->18 bit, 55->16bit.*/ + (0x2A), 0x00, 0x00, 0x00, 0xEF, + (0x2B), 0x00, 0x00, 0x01, 0x3F, + (0x2C), + (0x11), + TFTLCD_DELAY8, 40, + (0x29), + (0x2C), +/* 5. BOE 2.0” Gamma 2.2 Initial Code(2/2)*/ + + (0xB0), 0x3F, 0x3F, + TFTLCD_DELAY8, 5, + (0xB3), 0x02, 0x00, 0x00, 0x00, 0x00, + (0xB4), 0x00, + (0xC0), 0x33, 0x4F, 0x00, 0x10, 0xA2, 0x00, 0x01, 0x00, + (0xC1), 0x01, 0x02, 0x1A, /*86Hz*/ 0x04, 0x04, + TFTLCD_DELAY8, 25, + (0xC4), 0x11, 0x01, 0x00, 0x00, 0x00, +/*Gamma setting start*/ + (0xC8), /*GAMMA*/ 0x05, /*V0*/ 0x00, /*V1*/ 0x05, /*V4*/ 0x11, /*V8*/ 0x31, /*V20*/ 0x01, /*V43*/ 0x0B, /*V55*/ 0x00, /*V59*/ 0x01, /*V62*/ 0x05, /*V63*/ 0x00, 0x05, /*V63*/ 0x01, /*V62*/ 0x00, /*V59*/ 0x0B, /*V55*/ 0x01, /*V43*/ 0x31, /*V20*/ 0x11, /*V8*/ 0x05, /*V4*/ 0x00, /*V1*/ 0x05, /*V0*/ 0x00, + (0xC9), /*GAMMA*/ 0x05, /*V0*/ 0x00, /*V1*/ 0x05, /*V4*/ 0x11, /*V8*/ 0x31, /*V20*/ 0x01, /*V43*/ 0x0B, /*V55*/ 0x00, /*V59*/ 0x01, /*V62*/ 0x05, /*V63*/ 0x00, 0x05, /*V63*/ 0x01, /*V62*/ 0x00, /*V59*/ 0x0B, /*V55*/ 0x01, /*V43*/ 0x31, /*V20*/ 0x11, /*V8*/ 0x05, /*V4*/ 0x00, /*V1*/ 0x05, /*V0*/ 0x00, + (0xCA), /*GAMMA*/ 0x05, /*V0*/ 0x00, /*V1*/ 0x05, /*V4*/ 0x11, /*V8*/ 0x31, /*V20*/ 0x01, /*V43*/ 0x0B, /*V55*/ 0x00, /*V59*/ 0x01, /*V62*/ 0x05, /*V63*/ 0x00, 0x05, /*V63*/ 0x01, /*V62*/ 0x00, /*V59*/ 0x0B, /*V55*/ 0x01, /*V43*/ 0x31, /*V20*/ 0x11, /*V8*/ 0x05, /*V4*/ 0x00, /*V1*/ 0x05, /*V0*/ 0x00, +/* 5. BOE 2.0” Gamma 2.5 Initial Code(1/2)*/ + +/*Power setting start*/ + (0xD0), 0x33, 0x53, 0x85, 0x3A, 0x37, 0x00, + (0xD1), 0x5B, /*VCM 1B~7F*/ 0x78, /*VDV 25~7F*/ 0x10, + (0xD2), 0x03, 0x22, + (0xE2), 0x3F, +/*Power setting End*/ + (0x35), 0x00, + (0x36), 0x00, + (0x3A), 0x66, /*66->18 bit, 55->16bit.*/ + (0x2A), 0x00, 0x00, 0x00, 0xEF, + (0x2B), 0x00, 0x00, 0x01, 0x3F, + (0x2C), + (0x11), + TFTLCD_DELAY8, 40, + (0x29), + (0x2C), +/* 5. BOE 2.0” Gamma 2.5 Initial Code(2/2)*/ + diff --git a/Arduino/Libraries/MCUFRIEND_kbv/keywords.txt b/Arduino/Libraries/MCUFRIEND_kbv/keywords.txt new file mode 100644 index 0000000..e13ddc1 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/keywords.txt @@ -0,0 +1,67 @@ +####################################### +# Syntax Coloring Map For Mcufriend_kbv +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +MCUFRIEND_kbv KEYWORD1 +#UTFTGLUE KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +#InitLCD KEYWORD2 +#LCD_Write_DATA KEYWORD2 +WriteCmdData KEYWORD2 +begin KEYWORD2 +#clrScr KEYWORD2 +color565 KEYWORD2 +#dispBitmap KEYWORD2 +#drawBitmap KEYWORD2 +drawCircle KEYWORD2 +drawFastHLine KEYWORD2 +drawFastVLine KEYWORD2 +drawLine KEYWORD2 +drawPixel KEYWORD2 +drawRect KEYWORD2 +drawRoundRect KEYWORD2 +fillCircle KEYWORD2 +fillRect KEYWORD2 +fillRoundRect KEYWORD2 +#fillScr KEYWORD2 +fillScreen KEYWORD2 +#getDisplayXSize KEYWORD2 +#getDisplayYSize KEYWORD2 +height KEYWORD2 +invertDisplay KEYWORD2 +#lcdOff KEYWORD2 +#lcdOn KEYWORD2 +#ltoa KEYWORD2 +#print KEYWORD2 +#printNumF KEYWORD2 +#printNumI KEYWORD2 +#println KEYWORD2 +pushColors KEYWORD2 +readGRAM KEYWORD2 +readID KEYWORD2 +readPixel KEYWORD2 +readReg KEYWORD2 +readReg32 KEYWORD2 +reset KEYWORD2 +setAddrWindow KEYWORD2 +#setBackColor KEYWORD2 +#setColor KEYWORD2 +#setContrast KEYWORD2 +setCursor KEYWORD2 +#setFont KEYWORD2 +setRotation KEYWORD2 +#setrgb KEYWORD2 +setTextColor KEYWORD2 +setTextSize KEYWORD2 +#settextcursor KEYWORD2 +vertScroll KEYWORD2 +width KEYWORD2 +#write_data_block KEYWORD2 diff --git a/Arduino/Libraries/MCUFRIEND_kbv/library.properties b/Arduino/Libraries/MCUFRIEND_kbv/library.properties new file mode 100644 index 0000000..8af829b --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/library.properties @@ -0,0 +1,9 @@ +name=MCUFRIEND_kbv +version=2.9.9-Beta +author=David Prentice +maintainer=David Prentice +sentence=TFT Library for 2.4, 2.8, 3.5, 3.6, 3.95 inch mcufriend UNO Shields +paragraph=TFT Library for 2.4, 2.8, 3.5, 3.6, 3.95 inch mcufriend UNO Shields. Must have /RD pin to be readable. +category=Display +url=https://github.com/prenticedavid/MCUFRIEND_kbv +architectures=* diff --git a/Arduino/Libraries/MCUFRIEND_kbv/license.txt b/Arduino/Libraries/MCUFRIEND_kbv/license.txt new file mode 100644 index 0000000..c90cc54 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/license.txt @@ -0,0 +1,85 @@ +/* + * MCUFRIEND_kbv class inherits from Adafruit_GFX class and the Arduino Print class. + * Any use of MCUFRIEND_kbv class and examples is dependent on Adafruit and Arduino licenses + * The license texts are in the accompanying license.txt file + */ + + +ADAFRUIT: Adafruit_GFX library + +Software License Agreement (BSD License) + +Copyright (c) 2012 Adafruit Industries. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +ARDUINO: Print class +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + + +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvStartvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv +Software License Agreement (FreeBSD License) + +Copyright (c) 2018 David Prentice (https://github.com/prenticedavid/MCUFRIEND_kbv/) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those +of the authors and should not be interpreted as representing official policies, +either expressed or implied, of the FreeBSD Project. +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^End^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_keil.h b/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_keil.h new file mode 100644 index 0000000..09aabfc --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_keil.h @@ -0,0 +1,118 @@ +#ifndef MCUFRIEND_KEIL_H_ +#define MCUFRIEND_KEIL_H_ + +#if defined(USE_SERIAL) +#include "mcufriend_keil_spi.h" +#else +#include "pin_shield_1.h" //shield pin macros e.g. A2_PORT, PIN_OUTPUT() +#include "pin_shield_8.h" //macros for write_8(), read_8(), setWriteDir(), ... + +// control pins as used in MCUFRIEND shields + #define RD_PORT A0_PORT + #define RD_PIN A0_PIN + #define WR_PORT A1_PORT + #define WR_PIN A1_PIN + #define CD_PORT A2_PORT + #define CD_PIN A2_PIN + #define CS_PORT A3_PORT + #define CS_PIN A3_PIN + #define RESET_PORT A4_PORT + #define RESET_PIN A4_PIN + +// general purpose pin macros + #define RD_ACTIVE PIN_LOW(RD_PORT, RD_PIN) + #define RD_IDLE PIN_HIGH(RD_PORT, RD_PIN) + #define RD_OUTPUT PIN_OUTPUT(RD_PORT, RD_PIN) + #define WR_ACTIVE PIN_LOW(WR_PORT, WR_PIN) + #define WR_IDLE PIN_HIGH(WR_PORT, WR_PIN) + #define WR_OUTPUT PIN_OUTPUT(WR_PORT, WR_PIN) + #define CD_COMMAND PIN_LOW(CD_PORT, CD_PIN) + #define CD_DATA PIN_HIGH(CD_PORT, CD_PIN) + #define CD_OUTPUT PIN_OUTPUT(CD_PORT, CD_PIN) + #define CS_ACTIVE PIN_LOW(CS_PORT, CS_PIN) + #define CS_IDLE PIN_HIGH(CS_PORT, CS_PIN) + #define CS_OUTPUT PIN_OUTPUT(CS_PORT, CS_PIN) + #define RESET_ACTIVE PIN_LOW(RESET_PORT, RESET_PIN) + #define RESET_IDLE PIN_HIGH(RESET_PORT, RESET_PIN) + #define RESET_OUTPUT PIN_OUTPUT(RESET_PORT, RESET_PIN) + +#define WR_ACTIVE2 {WR_ACTIVE; WR_ACTIVE;} +#define WR_ACTIVE4 {WR_ACTIVE2; WR_ACTIVE2;} +#define WR_ACTIVE8 {WR_ACTIVE4; WR_ACTIVE4;} +#define RD_ACTIVE2 {RD_ACTIVE; RD_ACTIVE;} +#define RD_ACTIVE4 {RD_ACTIVE2; RD_ACTIVE2;} +#define RD_ACTIVE8 {RD_ACTIVE4; RD_ACTIVE4;} +#define RD_ACTIVE16 {RD_ACTIVE8; RD_ACTIVE8;} +#define WR_IDLE2 {WR_IDLE; WR_IDLE;} +#define WR_IDLE4 {WR_IDLE2; WR_IDLE2;} +#define RD_IDLE2 {RD_IDLE; RD_IDLE;} +#define RD_IDLE4 {RD_IDLE2; RD_IDLE2;} + +// General macros. IOCLR registers are 1 cycle when optimised. +#define WR_STROBE { WR_ACTIVE; WR_IDLE; } //PWLW=TWRL=50ns +#define RD_STROBE RD_IDLE, RD_ACTIVE, RD_ACTIVE, RD_ACTIVE //PWLR=TRDL=150ns + +#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || __TARGET_ARCH_THUMB == 4 // -O2: F411@100MHz = 1.44s +//#define WRITE_DELAY { WR_ACTIVE; WR_ACTIVE; WR_ACTIVE; WR_ACTIVE; } +//#define READ_DELAY { RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; RD_ACTIVE; } +#if 0 +#elif defined(MK20D5) +#warning 50Hz +#define WRITE_DELAY { } //50MHz +#define READ_DELAY { RD_ACTIVE; } +#elif defined(STM32F103xB) +#warning 72MHz +#define WRITE_DELAY { } //72MHz +#define READ_DELAY { RD_ACTIVE; } +#elif defined(STM32L476xx) +#warning 80MHz +#define WRITE_DELAY { WR_ACTIVE2; } //80MHz +#define READ_DELAY { RD_ACTIVE4; } +#elif defined(__SAM3X8E__) +#warning 84MHz +#define WRITE_DELAY { WR_ACTIVE; } //84MHz +#define READ_DELAY { RD_ACTIVE; } +#elif defined(STM32F401xE) +#warning 84MHz +#define WRITE_DELAY { WR_ACTIVE2; } //100MHz +#define READ_DELAY { RD_ACTIVE4; } +#elif defined(STM32F411xE) +#define WRITE_DELAY { WR_ACTIVE2; WR_ACTIVE; } //100MHz +#define READ_DELAY { RD_ACTIVE4; RD_ACTIVE2; } +#elif defined(STM32F446xx) +#warning 180MHz +#define WRITE_DELAY { WR_ACTIVE8; } //180MHz +#define IDLE_DELAY { WR_IDLE2;WR_IDLE; } +#define READ_DELAY { RD_ACTIVE16;} +#elif defined(STM32F767xx) +#warning 216MHz +#define WRITE_DELAY { WR_ACTIVE8; WR_ACTIVE8; } //216MHz +#define IDLE_DELAY { WR_IDLE4;WR_IDLE4; } +#define READ_DELAY { RD_ACTIVE16;RD_ACTIVE16;RD_ACTIVE16;} +#elif defined(STM32H743xx) //STM32H743 GPIO needs testing +#define WRITE_DELAY { WR_ACTIVE8;WR_ACTIVE2; } //F_CPU=400MHz +#define IDLE_DELAY { WR_IDLE2;WR_IDLE; } +#define READ_DELAY { RD_ACTIVE16;RD_ACTIVE16;RD_ACTIVE4;} +#else +#error check specific STM32 +#endif +#elif defined(__ARM_ARCH_6M__) // -O2: F072@48MHz = 5.03s +#define WRITE_DELAY { } +#define READ_DELAY { } +#endif + +#ifndef IDLE_DELAY +#define IDLE_DELAY { WR_IDLE; } +#endif + +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; IDLE_DELAY; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE2; RD_IDLE; } // read 250ns after RD_ACTIVE goes low +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define CTL_INIT() { RD_OUTPUT; WR_OUTPUT; CD_OUTPUT; CS_OUTPUT; RESET_OUTPUT; } +#define WriteCmd(x) { CD_COMMAND; write16(x); CD_DATA; } +#define WriteData(x) { write16(x); } + +#endif //!USE_SERIAL +#endif //MCUFRIEND_KEIL_H_ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_mbed.h b/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_mbed.h new file mode 100644 index 0000000..2d7fae6 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_mbed.h @@ -0,0 +1,100 @@ +#ifndef MCUFRIEND_MBED_H_ +#define MCUFRIEND_MBED_H_ + +#include + +#if defined(USE_SERIAL) +#include "mcufriend_keil_spi.h" +#else + +BusOut digitalL(D0, D1, D2, D3, D4, D5, D6, D7); +BusOut digitalH(D8, D9, D10, D11, D12, D13, NC, NC); +BusOut analog(A0, A1, A2, A3, A4, A5, NC, NC); + +#include "pin_shield_1.h" //shield pin macros e.g. A2_PORT, PIN_OUTPUT() +#include "pin_shield_8.h" //macros for write_8(), read_8(), setWriteDir(), ... + +// control pins as used in MCUFRIEND shields + #define RD_PORT A0_PORT + #define RD_PIN A0_PIN + #define WR_PORT A1_PORT + #define WR_PIN A1_PIN + #define CD_PORT A2_PORT + #define CD_PIN A2_PIN + #define CS_PORT A3_PORT + #define CS_PIN A3_PIN + #define RESET_PORT A4_PORT + #define RESET_PIN A4_PIN + +// general purpose pin macros + #define RD_ACTIVE PIN_LOW(RD_PORT, RD_PIN) + #define RD_IDLE PIN_HIGH(RD_PORT, RD_PIN) + #define RD_OUTPUT PIN_OUTPUT(RD_PORT, RD_PIN) + #define WR_ACTIVE PIN_LOW(WR_PORT, WR_PIN) + #define WR_IDLE PIN_HIGH(WR_PORT, WR_PIN) + #define WR_OUTPUT PIN_OUTPUT(WR_PORT, WR_PIN) + #define CD_COMMAND PIN_LOW(CD_PORT, CD_PIN) + #define CD_DATA PIN_HIGH(CD_PORT, CD_PIN) + #define CD_OUTPUT PIN_OUTPUT(CD_PORT, CD_PIN) + #define CS_ACTIVE PIN_LOW(CS_PORT, CS_PIN) + #define CS_IDLE PIN_HIGH(CS_PORT, CS_PIN) + #define CS_OUTPUT PIN_OUTPUT(CS_PORT, CS_PIN) + #define RESET_ACTIVE PIN_LOW(RESET_PORT, RESET_PIN) + #define RESET_IDLE PIN_HIGH(RESET_PORT, RESET_PIN) + #define RESET_OUTPUT PIN_OUTPUT(RESET_PORT, RESET_PIN) + +#define WR_ACTIVE2 {WR_ACTIVE; WR_ACTIVE;} +#define WR_ACTIVE4 {WR_ACTIVE2; WR_ACTIVE2;} +#define WR_ACTIVE8 {WR_ACTIVE4; WR_ACTIVE4;} +#define RD_ACTIVE2 {RD_ACTIVE; RD_ACTIVE;} +#define RD_ACTIVE4 {RD_ACTIVE2; RD_ACTIVE2;} +#define RD_ACTIVE8 {RD_ACTIVE4; RD_ACTIVE4;} +#define RD_ACTIVE16 {RD_ACTIVE8; RD_ACTIVE8;} +#define WR_IDLE2 {WR_IDLE; WR_IDLE;} +#define WR_IDLE4 {WR_IDLE2; WR_IDLE2;} +#define RD_IDLE2 {RD_IDLE; RD_IDLE;} +#define RD_IDLE4 {RD_IDLE2; RD_IDLE2;} + +#if defined(__MK20DX128__) || defined(___MK20DX256__) // Teensy3.0 || 3.2 96MHz +#define WRITE_DELAY { WR_ACTIVE2; } +#define READ_DELAY { RD_ACTIVE4; RD_ACTIVE; } +#elif defined(__MK64FX512__) || defined(TARGET_M4) // Teensy3.5 120MHz thanks to PeteJohno +#define WRITE_DELAY { WR_ACTIVE4; } +#define READ_DELAY { RD_ACTIVE8; } +#elif defined(__MK66FX1M0__) || defined(TARGET_M4) // Teensy3.6 180MHz untested. delays can possibly be reduced. +#define WRITE_DELAY { WR_ACTIVE8; } +#define READ_DELAY { RD_ACTIVE8; RD_ACTIVE8; } +#elif defined(TARGET_M7) // Nucleo-F767 216MHz untested. delays can possibly be reduced. +#define WRITE_DELAY { WR_ACTIVE8; WR_ACTIVE2; } +#define IDLE_DELAY { WR_IDLE2;WR_IDLE; } +#define READ_DELAY { RD_ACTIVE16; RD_ACTIVE16; RD_ACTIVE4; } +#define READ_IDLE { RD_IDLE2;RD_IDLE; } +#else +//#error unspecified delays +//#define WRITE_DELAY { WR_ACTIVE2; } +//#define READ_DELAY { RD_ACTIVE4; RD_ACTIVE; } +#define WRITE_DELAY +#define READ_DELAY +#endif + +#if !defined(IDLE_DELAY) +#define IDLE_DELAY WR_IDLE +#endif +#if !defined(READ_IDLE) +#define READ_IDLE RD_IDLE +#endif + +// General macros. IOCLR registers are 1 cycle when optimised. +#define WR_STROBE { WR_ACTIVE; WR_IDLE; } //PWLW=TWRL=50ns +#define RD_STROBE RD_IDLE, RD_ACTIVE, RD_ACTIVE, RD_ACTIVE //PWLR=TRDL=150ns +#define write8(d) { write_8(d); WRITE_DELAY; WR_STROBE; IDLE_DELAY; } // STROBEs are defined later +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); READ_IDLE; } // read 250ns after RD_ACTIVE goes low +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define CTL_INIT() { RD_OUTPUT; WR_OUTPUT; CD_OUTPUT; CS_OUTPUT; RESET_OUTPUT; } +#define WriteCmd(x) { CD_COMMAND; write16(x); CD_DATA; } +#define WriteData(x) { write16(x); } + +#endif //!USE_SERIAL +#endif //MCUFRIEND_KEIL_H_ diff --git a/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_serial.h b/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_serial.h new file mode 100644 index 0000000..93720ec --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_serial.h @@ -0,0 +1,243 @@ +#if ARDUINO >= 165 +#include +#endif + +#if 0 +#elif defined(__AVR_ATmega328P__) + +#define SPI_INIT() { DDRB |= (1<<5)|(1<<3)|(1<<2); SPCR = (1<>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { dst = xchg8(0); } +#define READ_16(dst) { dst = xchg8(0); dst = (dst << 8) | xchg8(0); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) +#elif defined(__SAMD21G18A__) + +#define SPI_INIT() { SPI.begin(); SPI.setDataMode(SPI_MODE0); SPI.setClockDivider(6); } + +#define CD_PORT PORT->Group[0] +#define CD_PIN 7 +#define CS_PORT PORT->Group[0] +#define CS_PIN 18 +#define RESET_PORT PORT->Group[0] +#define RESET_PIN 6 +#define RD_IDLE +#define WR_IDLE + + +uint8_t running; +static inline void write8(uint8_t c) +{ + running = 1; + while( SERCOM1->SPI.INTFLAG.bit.DRE == 0) ; + SERCOM1->SPI.DATA.bit.DATA = c; // Writing data into Data register +} + +static inline void flush(void) +{ + if (running) while( SERCOM1->SPI.INTFLAG.bit.TXC == 0) ; + running = 0; +} + +static inline uint8_t xchg8(uint8_t c) +{ +// flush(); + while( SERCOM1->SPI.INTFLAG.bit.RXC != 0) SERCOM1->SPI.DATA.bit.DATA; //eat up + while( SERCOM1->SPI.INTFLAG.bit.DRE == 0) ; + SERCOM1->SPI.DATA.bit.DATA = c; // Writing data into Data register + while( SERCOM1->SPI.INTFLAG.bit.RXC == 0) ; + return SERCOM1->SPI.DATA.bit.DATA; +} + + +#define setWriteDir() { } +#define setReadDir() { } +//#define flush() +//#define write8(x) xchg8(x) +//#define xchg8(x) SPI.transfer(x) +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { dst = xchg8(0); } +#define READ_16(dst) { dst = xchg8(0); dst = (dst << 8) | xchg8(0); } + +// Shield Control macros. +#define PIN_LOW(port, pin) (port).OUTCLR.reg = (1<<(pin)) +#define PIN_HIGH(port, pin) (port).OUTSET.reg = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port).DIR.reg |= (1<<(pin)) + +#elif defined(__AVR_ATxmega128A1__) //3.49s @ 32MHz -O2 + #define CD_PORT VPORT2 + #define CD_PIN 1 + #define CS_PORT VPORT3 + #define CS_PIN 4 + #define RESET_PORT VPORT2 + #define RESET_PIN 0 +#define SPCRVAL (USART_CLK2X_bm | USART_RXEN_bm | USART_TXEN_bm) +#define SETDDR {VPORT3.DIR |= (1<<4)|(1<<5)|(1<<7); VPORT2.DIR |= 0x03; } +#define SPI_INIT() { PORTCFG.VPCTRLB=PORTCFG_VP3MAP_PORTF_gc | PORTCFG_VP2MAP_PORTC_gc; CS_IDLE; RESET_IDLE; SETDDR; spi_init(); } + +void spi_init(void) +{ + SPIF.CTRL=SPI_ENABLE_bm | SPI_MODE_3_gc | (1<>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { dst = xchg8(0); } +#define READ_16(dst) { dst = xchg8(0); dst = (dst << 8) | xchg8(0); } + +#define PIN_LOW(p, b) (p).OUT &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p).OUT |= (1<<(b)) +#define PIN_OUTPUT(p, b) (p).DIR |= (1<<(b)) + +#endif + +#define CD_COMMAND {flush(); PIN_LOW(CD_PORT, CD_PIN); } +#define CD_DATA {flush(); PIN_HIGH(CD_PORT, CD_PIN); } +#define CD_OUTPUT PIN_OUTPUT(CD_PORT, CD_PIN) +#define CS_ACTIVE PIN_LOW(CS_PORT, CS_PIN) +#define CS_IDLE {flush(); PIN_HIGH(CS_PORT, CS_PIN); } +#define CS_OUTPUT PIN_OUTPUT(CS_PORT, CS_PIN) +#define RESET_ACTIVE PIN_LOW(RESET_PORT, RESET_PIN) +#define RESET_IDLE PIN_HIGH(RESET_PORT, RESET_PIN) +#define RESET_OUTPUT PIN_OUTPUT(RESET_PORT, RESET_PIN) + +// General macros. IOCLR registers are 1 cycle when optimised. + +#define CTL_INIT() { CD_OUTPUT; CS_OUTPUT; RESET_OUTPUT; SPI_INIT(); } +#define WriteCmd(x) { CD_COMMAND; write8(x); } +#define WriteData(x) { CD_DATA; write16(x); } diff --git a/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_shield.h b/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_shield.h new file mode 100644 index 0000000..a240381 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_shield.h @@ -0,0 +1,1113 @@ +//#define USE_SPECIAL //check for custom drivers + +#define WR_ACTIVE2 {WR_ACTIVE; WR_ACTIVE;} +#define WR_ACTIVE4 {WR_ACTIVE2; WR_ACTIVE2;} +#define WR_ACTIVE8 {WR_ACTIVE4; WR_ACTIVE4;} +#define RD_ACTIVE2 {RD_ACTIVE; RD_ACTIVE;} +#define RD_ACTIVE4 {RD_ACTIVE2; RD_ACTIVE2;} +#define RD_ACTIVE8 {RD_ACTIVE4; RD_ACTIVE4;} +#define RD_ACTIVE16 {RD_ACTIVE8; RD_ACTIVE8;} +#define WR_IDLE2 {WR_IDLE; WR_IDLE;} +#define WR_IDLE4 {WR_IDLE2; WR_IDLE2;} +#define RD_IDLE2 {RD_IDLE; RD_IDLE;} +#define RD_IDLE4 {RD_IDLE2; RD_IDLE2;} + +#if defined(USE_SPECIAL) +#include "mcufriend_special.h" +#if !defined(USE_SPECIAL_FAIL) +#warning WE ARE USING A SPECIAL CUSTOM DRIVER +#endif +#endif +#if !defined(USE_SPECIAL) || defined (USE_SPECIAL_FAIL) + +#if 0 +//################################### UNO ############################## +#elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328PB__) //regular UNO shield on UNO +#define RD_PORT PORTC +#define RD_PIN 0 +#define WR_PORT PORTC +#define WR_PIN 1 +#define CD_PORT PORTC +#define CD_PIN 2 +#define CS_PORT PORTC +#define CS_PIN 3 +#define RESET_PORT PORTC +#define RESET_PIN 4 + +#define BMASK 0x03 //more intuitive style for mixed Ports +#define DMASK 0xFC //does exactly the same as previous +#define write_8(x) { PORTB = (PORTB & ~BMASK) | ((x) & BMASK); PORTD = (PORTD & ~DMASK) | ((x) & DMASK); } +#define read_8() ( (PINB & BMASK) | (PIND & DMASK) ) +#define setWriteDir() { DDRB |= BMASK; DDRD |= DMASK; } +#define setReadDir() { DDRB &= ~BMASK; DDRD &= ~DMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +//################################### MEGA2560 ############################## +#elif defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) //regular UNO shield on MEGA2560 +#define RD_PORT PORTF +#define RD_PIN 0 +#define WR_PORT PORTF +#define WR_PIN 1 +#define CD_PORT PORTF +#define CD_PIN 2 +#define CS_PORT PORTF +#define CS_PIN 3 +#define RESET_PORT PORTF +#define RESET_PIN 4 + +#define EMASK 0x38 +#define GMASK 0x20 +#define HMASK 0x78 +#define write_8(x) { PORTH &= ~HMASK; PORTG &= ~GMASK; PORTE &= ~EMASK; \ + PORTH |= (((x) & (3<<0)) << 5); \ + PORTE |= (((x) & (3<<2)) << 2); \ + PORTG |= (((x) & (1<<4)) << 1); \ + PORTE |= (((x) & (1<<5)) >> 2); \ + PORTH |= (((x) & (3<<6)) >> 3); \ + } + +#define read_8() ( ((PINH & (3<<5)) >> 5)\ + | ((PINE & (3<<4)) >> 2)\ + | ((PING & (1<<5)) >> 1)\ + | ((PINE & (1<<3)) << 2)\ + | ((PINH & (3<<3)) << 3)\ + ) +#define setWriteDir() { DDRH |= HMASK; DDRG |= GMASK; DDRE |= EMASK; } +#define setReadDir() { DDRH &= ~HMASK; DDRG &= ~GMASK; DDRE &= ~EMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +//################################### MEGA4809 NANO_EVERY 4808 ############################## +#elif defined(__AVR_ATmega4808__) // Thinary EVERY-4808 with Nano-Shield_Adapter +#warning EVERY-4808 with Nano-Shield_Adapter +#define RD_PORT VPORTD // +#define RD_PIN 0 +#define WR_PORT VPORTD +#define WR_PIN 1 +#define CD_PORT VPORTD +#define CD_PIN 2 +#define CS_PORT VPORTD +#define CS_PIN 3 +#define RESET_PORT VPORTF +#define RESET_PIN 2 + +#define AMASK 0xFF +#define write_8(x) { VPORTA.OUT = ((x) << 6) | ((x) >> 2); } +#define read_8() ( (VPORTA.IN >> 6) | (VPORTA.IN << 2) ) +#define setWriteDir() { VPORTA_DIR |= AMASK; } +#define setReadDir() { VPORTA_DIR &= ~AMASK; } + +//#define WRITE_DELAY { WR_ACTIVE; WR_ACTIVE; } //6.47s no_inline +#define WRITE_DELAY { WR_ACTIVE2; WR_ACTIVE; } //-Os=5.43s @20MHz always_inline. (-O1=5.41s, -O3=5.25s) +#define READ_DELAY { RD_ACTIVE4; } //ID=0x7789 +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p).OUT &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p).OUT |= (1<<(b)) +#define PIN_OUTPUT(p, b) (p).DIR |= (1<<(b)) + +//########################## MEGA4809 NANO_EVERY or UNO_WIFI_REV2 ############################## +#elif defined(__AVR_ATmega4809__) && (defined(ARDUINO_AVR_NANO_EVERY) || defined(ARDUINO_AVR_UNO_WIFI_REV2)) +#if defined(ARDUINO_AVR_NANO_EVERY) +#warning EVERY-4809 with Nano-Shield_Adapter using VPORT.OUT and BLD/BST +#define RD_PORT VPORTD // +#define RD_PIN 3 +#define WR_PORT VPORTD +#define WR_PIN 2 +#define CD_PORT VPORTD +#define CD_PIN 1 +#define CS_PORT VPORTD +#define CS_PIN 0 +#define RESET_PORT VPORTF +#define RESET_PIN 2 +#elif defined(ARDUINO_AVR_UNO_WIFI_REV2) +#warning UNO_WIFI_REV2 using VPORT.OUT and BLD/BST +#define RD_PORT VPORTD // +#define RD_PIN 0 +#define WR_PORT VPORTD +#define WR_PIN 1 +#define CD_PORT VPORTD +#define CD_PIN 2 +#define CS_PORT VPORTD +#define CS_PIN 3 +#define RESET_PORT VPORTD +#define RESET_PIN 4 +#endif + +#define AMASK (3<<0) +#define BMASK (5<<0) +#define CMASK (1<<6) +#define EMASK (1<<3) +#define FMASK (3<<4) +static __attribute((always_inline)) +void write_8(uint8_t val) +{ + asm volatile("in __tmp_reg__,0x01" "\n\t" //VPORTA.OUT + "BST %0,2" "\n\t" "BLD __tmp_reg__,0" "\n\t" + "BST %0,7" "\n\t" "BLD __tmp_reg__,1" "\n\t" + "out 0x01,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x05" "\n\t" //VPORTB.OUT + "BST %0,1" "\n\t" "BLD __tmp_reg__,0" "\n\t" + "BST %0,5" "\n\t" "BLD __tmp_reg__,2" "\n\t" + "out 0x05,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x09" "\n\t" //VPORTC.OUT + "BST %0,4" "\n\t" "BLD __tmp_reg__,6" "\n\t" + "out 0x09,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x11" "\n\t" //VPORTE.OUT + "BST %0,0" "\n\t" "BLD __tmp_reg__,3" "\n\t" + "out 0x11,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x15" "\n\t" //VPORTF.OUT + "BST %0,3" "\n\t" "BLD __tmp_reg__,5" "\n\t" + "BST %0,6" "\n\t" "BLD __tmp_reg__,4" "\n\t" + "out 0x15,__tmp_reg__" : : "a" (val)); +} + +#define read_8() ( 0 \ + | ((VPORTA_IN & (1<<0)) << 2)\ + | ((VPORTA_IN & (1<<1)) << 6)\ + | ((VPORTB_IN & (1<<0)) << 1)\ + | ((VPORTB_IN & (1<<2)) << 3)\ + | ((VPORTC_IN & CMASK) >> 2)\ + | ((VPORTE_IN & EMASK) >> 3)\ + | ((VPORTF_IN & (1<<5)) >> 2)\ + | ((VPORTF_IN & (1<<4)) << 2)\ + ) +#define setWriteDir() { VPORTA_DIR |= AMASK; VPORTB_DIR |= BMASK; VPORTC_DIR |= CMASK; VPORTE_DIR |= EMASK; VPORTF_DIR |= FMASK; } +#define setReadDir() { VPORTA_DIR &= ~AMASK; VPORTB_DIR &= ~BMASK; VPORTC_DIR &= ~CMASK; VPORTE_DIR &= ~EMASK; VPORTF_DIR &= ~FMASK; } + +//#define WRITE_DELAY { WR_ACTIVE; WR_ACTIVE; } //6.47s no_inline +#define WRITE_DELAY { WR_ACTIVE2; WR_ACTIVE; } //-Os=5.43s @20MHz always_inline. (-O1=5.41s, -O3=5.25s) +#define READ_DELAY { RD_ACTIVE4; } //ID=0x7789 +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p).OUT &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p).OUT |= (1<<(b)) +#define PIN_OUTPUT(p, b) (p).DIR |= (1<<(b)) + +//################################### TEENSY++2.0 ############################## +#elif defined(__AVR_AT90USB1286__) //regular UNO shield on TEENSY++ 2.0 thanks tysonlt + +//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST| +//AVR pin |PD7|PD6|PD5|PD4|PD3|PD2|PE1|PE0| |PF0|PF1|PF2|PF3|PF4| + +#define RD_PORT PORTF +#define RD_PIN 0 +#define WR_PORT PORTF +#define WR_PIN 1 +#define CD_PORT PORTF +#define CD_PIN 2 +#define CS_PORT PORTF +#define CS_PIN 3 +#define RESET_PORT PORTF +#define RESET_PIN 4 + +#define EMASK 0x03 //more intuitive style for mixed Ports +#define DMASK 0xFC //does exactly the same as previous +#define write_8(x) { PORTE = (PORTE & ~EMASK) | ((x) & EMASK); PORTD = (PORTD & ~DMASK) | ((x) & DMASK); } +#define read_8() ( (PINE & EMASK) | (PIND & DMASK) ) +#define setWriteDir() { DDRE |= EMASK; DDRD |= DMASK; } +#define setReadDir() { DDRE &= ~EMASK; DDRD &= ~DMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +//################################# ZERO and M0_PRO ############################ +#elif defined(__SAMD21G18A__) //regular UNO shield on ZERO or M0_PRO +#include "sam.h" + // configure macros for the control pins +#define RD_PORT PORT->Group[0] +#define RD_PIN 2 +#define WR_PORT PORT->Group[1] +#define WR_PIN 8 +#define CD_PORT PORT->Group[1] +#define CD_PIN 9 +#define CS_PORT PORT->Group[0] +#define CS_PIN 4 +#define RESET_PORT PORT->Group[0] +#define RESET_PIN 5 + // configure macros for data bus +#define DMASK 0x0030C3C0 + // #define write_8(x) PORT->Group[0].OUT.reg = (PORT->Group[0].OUT.reg & ~DMASK)|(((x) & 0x0F) << 6)|(((x) & 0x30) << 10)|(((x) & 0xC0)<<14) +#if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_ZERO) // American ZERO +//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST | +//SAMD21 pin |PA21|PA20|PA15|PB8 |PB9 |PA14|PA7 |PA6 | |PA2|PB8|PB9 |PA4 |PA5 | +#define write_8(x) {\ + PORT->Group[0].OUTCLR.reg = DMASK;\ + PORT->Group[0].OUTSET.reg = (((x) & 0x0B) << 6)\ + |(((x) & (1<<2)) << 12)\ + |(((x) & (1<<4)) << 4)\ + |(((x) & (1<<5)) << 10)\ + |(((x) & 0xC0) << 14);\ + } +#define read_8() (((PORT->Group[0].IN.reg >> 6) & 0x0B)\ + |((PORT->Group[0].IN.reg >> 12) & (1<<2))\ + |((PORT->Group[0].IN.reg >> 4) & (1<<4))\ + |((PORT->Group[0].IN.reg >> 10) & (1<<5))\ + |((PORT->Group[0].IN.reg >> 14) & 0xC0)) +#else //default to an M0_PRO on v1.6.5 or 1.7.6 +//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST | +//SAMD21 pin |PA21|PA20|PA15|PA14|PB9 |PB8 |PA7 |PA6 | |PA2|PB8|PB9 |PA4 |PA5 | +#define write_8(x) {\ + PORT->Group[0].OUTCLR.reg = DMASK;\ + PORT->Group[0].OUTSET.reg = (((x) & 0x0F) << 6)\ + |(((x) & 0x30) << 10)\ + |(((x) & 0xC0) << 14);\ + } +#define read_8() (((PORT->Group[0].IN.reg >> 6) & 0x0F)|((PORT->Group[0].IN.reg >> 10) & 0x30)|((PORT->Group[0].IN.reg >> 14) & 0xC0)) +#endif +#define setWriteDir() { PORT->Group[0].DIRSET.reg = DMASK; \ + PORT->Group[0].WRCONFIG.reg = (DMASK & 0xFFFF) | (0<<22) | (1<<28) | (1<<30); \ + PORT->Group[0].WRCONFIG.reg = (DMASK>>16) | (0<<22) | (1<<28) | (1<<30) | (1<<31); \ + } +#define setReadDir() { PORT->Group[0].DIRCLR.reg = DMASK; \ + PORT->Group[0].WRCONFIG.reg = (DMASK & 0xFFFF) | (1<<17) | (1<<28) | (1<<30); \ + PORT->Group[0].WRCONFIG.reg = (DMASK>>16) | (1<<17) | (1<<28) | (1<<30) | (1<<31); \ + } +#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + // Shield Control macros. +#define PIN_LOW(port, pin) (port).OUTCLR.reg = (1<<(pin)) +#define PIN_HIGH(port, pin) (port).OUTSET.reg = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port).DIR.reg |= (1<<(pin)) + +//####################################### GRAND CENTRAL M4 ############################ +#elif defined(__SAMD51P20A__) //regular UNO shield on GRAND CENTRAL M4 +//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST| +//SAMD51 pin |PD21|PD20|PC21|PC20|PC19|PC18|PB2|PB18| |PA2|PA5|PB3|PC0|PC1| +#define WRITE_DELAY { WR_ACTIVE4; } +#define IDLE_DELAY { WR_IDLE2; } +#define READ_DELAY { RD_ACTIVE8;} + // configure macros for the control pins +#define RD_PORT PORT->Group[0] +#define RD_PIN 2 +#define WR_PORT PORT->Group[0] +#define WR_PIN 5 +#define CD_PORT PORT->Group[1] +#define CD_PIN 3 +#define CS_PORT PORT->Group[2] +#define CS_PIN 0 +#define RESET_PORT PORT->Group[2] +#define RESET_PIN 1 + // configure macros for data bus +#define BMASK ((1<<18)|(1<<2)) //BMASK has bits in H and L for WRCONFIG +#define CMASK (0x0F << 18) //CMASK only has bits in H +#define DMASK (0x03 << 20) +#define WRMASK ((0<<22) | (1<<28) | (1<<30)) // +#define RDMASK ((1<<17) | (1<<28) | (1<<30)) // +#define write_8(x) { PORT->Group[1].OUTCLR.reg = BMASK; PORT->Group[2].OUTCLR.reg = CMASK; PORT->Group[3].OUTCLR.reg = DMASK; \ + PORT->Group[1].OUTSET.reg = (((x) & (1<<0)) << 18) | (((x) & (1<<1)) << 1); \ + PORT->Group[2].OUTSET.reg = (((x) & (15<<2)) << 16); \ + PORT->Group[3].OUTSET.reg = (((x) & (3<<6)) << 14); \ + } + +#define read_8() ( ((PORT->Group[1].IN.reg & (1<<18)) >> 18)\ + | ((PORT->Group[1].IN.reg & (1<<2)) >> 1)\ + | ((PORT->Group[2].IN.reg & (15<<18)) >> 16)\ + | ((PORT->Group[3].IN.reg & (3<<20)) >> 14)\ + ) +#define setWriteDir() { \ + PORT->Group[1].DIRSET.reg = BMASK; \ + PORT->Group[1].WRCONFIG.reg = (BMASK & 0xFFFF) | WRMASK; \ + PORT->Group[1].WRCONFIG.reg = (BMASK >> 16) | WRMASK | (1<<31); \ + PORT->Group[2].DIRSET.reg = CMASK; \ + PORT->Group[2].WRCONFIG.reg = (CMASK >> 16) | WRMASK | (1<<31); \ + PORT->Group[3].DIRSET.reg = DMASK; \ + PORT->Group[3].WRCONFIG.reg = (DMASK >> 16) | WRMASK | (1<<31); \ + } +#define setReadDir() { \ + PORT->Group[1].DIRCLR.reg = BMASK; \ + PORT->Group[1].WRCONFIG.reg = (BMASK & 0xFFFF) | RDMASK; \ + PORT->Group[1].WRCONFIG.reg = (BMASK >> 16) | RDMASK | (1<<31); \ + PORT->Group[2].DIRCLR.reg = CMASK; \ + PORT->Group[2].WRCONFIG.reg = (CMASK >> 16) | RDMASK | (1<<31); \ + PORT->Group[3].DIRCLR.reg = DMASK; \ + PORT->Group[3].WRCONFIG.reg = (DMASK >> 16) | RDMASK | (1<<31); \ + } +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; IDLE_DELAY; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE2; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + + // Shield Control macros. +#define PIN_LOW(port, pin) (port).OUTCLR.reg = (1<<(pin)) +#define PIN_HIGH(port, pin) (port).OUTSET.reg = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port).DIRSET.reg = (1<<(pin)) + +//####################################### DUE ############################ +#elif defined(__SAM3X8E__) //regular UNO shield on DUE +#define WRITE_DELAY { WR_ACTIVE; } +#define IDLE_DELAY { WR_IDLE; } +#define READ_DELAY { RD_ACTIVE;} + // configure macros for the control pins +#define RD_PORT PIOA +#define RD_PIN 16 +#define WR_PORT PIOA +#define WR_PIN 24 +#define CD_PORT PIOA +#define CD_PIN 23 +#define CS_PORT PIOA +#define CS_PIN 22 +#define RESET_PORT PIOA +#define RESET_PIN 6 + // configure macros for data bus +#define BMASK (1<<25) +#define CMASK (0xBF << 21) +#define write_8(x) { PIOB->PIO_CODR = BMASK; PIOC->PIO_CODR = CMASK; \ + PIOB->PIO_SODR = (((x) & (1<<2)) << 23); \ + PIOC->PIO_SODR = (((x) & (1<<0)) << 22) \ + | (((x) & (1<<1)) << 20) \ + | (((x) & (1<<3)) << 25) \ + | (((x) & (1<<4)) << 22) \ + | (((x) & (1<<5)) << 20) \ + | (((x) & (1<<6)) << 18) \ + | (((x) & (1<<7)) << 16); \ + } + +#define read_8() ( ((PIOC->PIO_PDSR & (1<<22)) >> 22)\ + | ((PIOC->PIO_PDSR & (1<<21)) >> 20)\ + | ((PIOB->PIO_PDSR & (1<<25)) >> 23)\ + | ((PIOC->PIO_PDSR & (1<<28)) >> 25)\ + | ((PIOC->PIO_PDSR & (1<<26)) >> 22)\ + | ((PIOC->PIO_PDSR & (1<<25)) >> 20)\ + | ((PIOC->PIO_PDSR & (1<<24)) >> 18)\ + | ((PIOC->PIO_PDSR & (1<<23)) >> 16)\ + ) +#define setWriteDir() { PIOB->PIO_OER = BMASK; PIOC->PIO_OER = CMASK; } +#define setReadDir() { \ + PMC->PMC_PCER0 = (1 << ID_PIOB)|(1 << ID_PIOC);\ + PIOB->PIO_ODR = BMASK; PIOC->PIO_ODR = CMASK;\ + } +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; IDLE_DELAY; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + + // Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) + +//################################### LEONARDO ############################## +#elif defined(__AVR_ATmega32U4__) //regular UNO shield on Leonardo +#define RD_PORT PORTF +#define RD_PIN 7 +#define WR_PORT PORTF +#define WR_PIN 6 +#define CD_PORT PORTF +#define CD_PIN 5 +#define CS_PORT PORTF +#define CS_PIN 4 +#define RESET_PORT PORTF +#define RESET_PIN 1 + +#define BMASK (3<<4) +#define CMASK (1<<6) +#define DMASK ((1<<7)|(1<<4)|(3<<0)) +#define EMASK (1<<6) +static inline //hope we use r24 +void write_8(uint8_t x) +{ + PORTB &= ~BMASK; + PORTC &= ~CMASK; + PORTD &= ~DMASK; + PORTE &= ~EMASK; + PORTB |= (((x) & (3 << 0)) << 4); + PORTD |= (((x) & (1 << 2)) >> 1); + PORTD |= (((x) & (1 << 3)) >> 3); + PORTD |= (((x) & (1 << 4)) << 0); + PORTC |= (((x) & (1 << 5)) << 1); + PORTD |= (((x) & (1 << 6)) << 1); + PORTE |= (((x) & (1 << 7)) >> 1); +} + +#define read_8() ( ((PINB & (3<<4)) >> 4)\ +| ((PIND & (1<<1)) << 1)\ +| ((PIND & (1<<0)) << 3)\ +| ((PIND & (1<<4)) >> 0)\ +| ((PINC & (1<<6)) >> 1)\ +| ((PIND & (1<<7)) >> 1)\ +| ((PINE & (1<<6)) << 1)\ +) +#define setWriteDir() { DDRB |= BMASK; DDRC |= CMASK; DDRD |= DMASK; DDRE |= EMASK; } +#define setReadDir() { DDRB &= ~BMASK; DDRC &= ~CMASK; DDRD &= ~DMASK; DDRE &= ~EMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +//################################### UNO SHIELD on BOBUINO ############################## +#elif defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega644P__) //UNO shield on BOBUINO +#warning regular UNO shield on BOBUINO + +//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST| +//AVR pin |PB3|PB2|PB1|PB0|PD3|PD2|PD6|PD5| |PA7|PA6|PA5|PA4|PA3| + +#define RD_PORT PORTA +#define RD_PIN 7 +#define WR_PORT PORTA +#define WR_PIN 6 +#define CD_PORT PORTA +#define CD_PIN 5 +#define CS_PORT PORTA +#define CS_PIN 4 +#define RESET_PORT PORTA +#define RESET_PIN 3 + +#define BMASK 0x0F // +#define DMASK 0x6C // +#define write_8(x) { PORTB = (PORTB & ~BMASK) | ((x) >> 4); \ + PORTD = (PORTD & ~DMASK) | ((x) & 0x0C) | (((x) & 0x03) << 5); } +#define read_8() ( (PINB << 4) | (PIND & 0x0C) | ((PIND & 0x60) >> 5) ) +#define setWriteDir() { DDRB |= BMASK; DDRD |= DMASK; } +#define setReadDir() { DDRB &= ~BMASK; DDRD &= ~DMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +//####################################### TEENSY 4.0 ############################ +#elif defined(__IMXRT1062__) // regular UNO shield on a Teensy 4.x +#warning regular UNO shield on a Teensy 4.0 + +//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST | A5 +//MXRT pin |7.17|7.10|9.8|9.6|9.5|9.4|7.11|7.16| |6.18|6.19|6.23|6.22|6.17|6.16 + +#if 0 +#elif defined(__IMXRT1062__) +#define WRITE_DELAY { WR_ACTIVE8;WR_ACTIVE8; } +#define IDLE_DELAY { WR_IDLE2;WR_IDLE; } +#define READ_DELAY { RD_ACTIVE16;RD_ACTIVE16; } +#else +#error unspecified delays +#endif + +#define RD_PORT GPIO6 +#define RD_PIN 18 +#define WR_PORT GPIO6 +#define WR_PIN 19 +#define CD_PORT GPIO6 +#define CD_PIN 23 +#define CS_PORT GPIO6 +#define CS_PIN 22 +#define RESET_PORT GPIO6 +#define RESET_PIN 17 + +// configure macros for the data pins +#define GMASK ((1<<17)|(1<<10)|(1<<11)|(1<<16)) +#define IMASK ((1<<8)|(1<<6)|(1<<5)|(1<<4)) + +#define write_8(d) { \ + GPIO7_DR_CLEAR = GMASK; GPIO9_DR_CLEAR = IMASK; \ + GPIO7_DR_SET = (((d) & (1 << 0)) << 16) \ + | (((d) & (1 << 1)) << 10) \ + | (((d) & (1 << 6)) << 4) \ + | (((d) & (1 << 7)) << 10); \ + GPIO9_DR_SET = (((d) & (1 << 2)) << 2) \ + | (((d) & (1 << 3)) << 2) \ + | (((d) & (1 << 4)) << 2) \ + | (((d) & (1 << 5)) << 3); \ + } +#define read_8() ((((GPIO7_PSR & (1 << 16)) >> 16) \ + | ((GPIO7_PSR & (1 << 11)) >> 10) \ + | ((GPIO9_PSR & (1 << 4)) >> 2) \ + | ((GPIO9_PSR & (1 << 5)) >> 2) \ + | ((GPIO9_PSR & (1 << 6)) >> 2) \ + | ((GPIO9_PSR & (1 << 8)) >> 3) \ + | ((GPIO7_PSR & (1 << 10)) >> 4) \ + | ((GPIO7_PSR & (1 << 17)) >> 10))) +#define setWriteDir() {GPIO7_GDIR |= GMASK;GPIO9_GDIR |= IMASK; } +#define setReadDir() {GPIO7_GDIR &= ~GMASK;GPIO9_GDIR &= ~IMASK; } +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; IDLE_DELAY; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE2; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } +#define GPIO_INIT() {for (int i = 2; i <= 9; i++) pinMode(i, OUTPUT); for (int i = A0; i <= A4; i++) pinMode(i, OUTPUT);} + +#define PASTE(x, y) x ## y + +#define PIN_LOW(port, pin) PASTE(port, _DR_CLEAR) = (1<<(pin)) +#define PIN_HIGH(port, pin) PASTE(port, _DR_SET) = (1<<(pin)) +#define PIN_OUTPUT(port, pin) PASTE(port, _GDIR) |= (1<<(pin)) + +//####################################### TEENSY 3.x ############################ +#elif defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) // regular UNO shield on a Teensy 3.x +#warning regular UNO shield on a Teensy 3.x + +//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST| +//MK20 pin |PD2|PD4|PD7|PA13|PA12|PD2|PC3|PD3| |PD1|PC0|PB0|PB1|PB3| + +#if defined(__MK20DX128__) || defined(__MK20DX256__) // Teensy3.0 || 3.2 96MHz +#define WRITE_DELAY { WR_ACTIVE2; } +#define IDLE_DELAY { } +#define READ_DELAY { RD_ACTIVE8; RD_ACTIVE; } +#elif defined(__MK64FX512__) // Teensy3.5 120MHz thanks to PeteJohno +#define WRITE_DELAY { WR_ACTIVE4; } +#define IDLE_DELAY { WR_IDLE; } +#define READ_DELAY { RD_ACTIVE8; } +#elif defined(__MK66FX1M0__) // Teensy3.6 180MHz untested. delays can possibly be reduced. +#define WRITE_DELAY { WR_ACTIVE8; } +#define IDLE_DELAY { WR_IDLE2; } +#define READ_DELAY { RD_ACTIVE16; } +#else +#error unspecified delays +#endif + +#define RD_PORT GPIOD +#define RD_PIN 1 +#define WR_PORT GPIOC +#define WR_PIN 0 +#define CD_PORT GPIOB +#define CD_PIN 0 +#define CS_PORT GPIOB +#define CS_PIN 1 +#define RESET_PORT GPIOB +#define RESET_PIN 3 + +// configure macros for the data pins +#define AMASK ((1<<12)|(1<<13)) +#define CMASK ((1<<3)) +#define DMASK ((1<<0)|(1<<2)|(1<<3)|(1<<4)|(1<<7)) + +#define write_8(d) { \ + GPIOA_PCOR = AMASK; GPIOC_PCOR = CMASK; GPIOD_PCOR = DMASK; \ + GPIOA_PSOR = (((d) & (1 << 3)) << 9) \ + | (((d) & (1 << 4)) << 9); \ + GPIOC_PSOR = (((d) & (1 << 1)) << 2); \ + GPIOD_PSOR = (((d) & (1 << 0)) << 3) \ + | (((d) & (1 << 2)) >> 2) \ + | (((d) & (1 << 5)) << 2) \ + | (((d) & (1 << 6)) >> 2) \ + | (((d) & (1 << 7)) >> 5); \ + } +#define read_8() ((((GPIOD_PDIR & (1<<3)) >> 3) \ + | ((GPIOC_PDIR & (1 << 3)) >> 2) \ + | ((GPIOD_PDIR & (1 << 0)) << 2) \ + | ((GPIOA_PDIR & (1 << 12)) >> 9) \ + | ((GPIOA_PDIR & (1 << 13)) >> 9) \ + | ((GPIOD_PDIR & (1 << 7)) >> 2) \ + | ((GPIOD_PDIR & (1 << 4)) << 2) \ + | ((GPIOD_PDIR & (1 << 2)) << 5))) +#define setWriteDir() {GPIOA_PDDR |= AMASK;GPIOC_PDDR |= CMASK;GPIOD_PDDR |= DMASK; } +#define setReadDir() {GPIOA_PDDR &= ~AMASK;GPIOC_PDDR &= ~CMASK;GPIOD_PDDR &= ~DMASK; } +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; IDLE_DELAY; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } //PJ adjusted +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } +//#define GPIO_INIT() {SIM_SCGC5 |= 0x3E00;} //PORTA-PORTE +#define GPIO_INIT() {for (int i = 2; i <= 9; i++) pinMode(i, OUTPUT); for (int i = A0; i <= A4; i++) pinMode(i, OUTPUT);} + +#define PASTE(x, y) x ## y + +#define PIN_LOW(port, pin) PASTE(port, _PCOR) = (1<<(pin)) +#define PIN_HIGH(port, pin) PASTE(port, _PSOR) = (1<<(pin)) +#define PIN_OUTPUT(port, pin) PASTE(port, _PDDR) |= (1<<(pin)) + +//####################################### STM32 ############################ +// NUCLEO: ARDUINO_NUCLEO_xxxx from ST Core or ARDUINO_STM_NUCLEO_F103RB from MapleCore +// BLUEPILL: ARDUINO_NUCLEO_F103C8 / ARDUINO_BLUEPILL_F103C8 from ST Core or ARDUINO_GENERIC_STM32F103C from MapleCore +// MAPLE_REV3: n/a from ST Core or ARDUINO_MAPLE_REV3 from MapleCore +// ST Core: ARDUINO_ARCH_STM32 +// MapleCore: __STM32F1__ +#elif defined(__STM32F1__) || defined(ARDUINO_ARCH_STM32) //MapleCore or ST Core +#define IS_NUCLEO64 ( defined(ARDUINO_STM_NUCLEO_F103RB) \ + || defined(ARDUINO_NUCLEO_F030R8) || defined(ARDUINO_NUCLEO_F091RC) \ + || defined(ARDUINO_NUCLEO_F103RB) || defined(ARDUINO_NUCLEO_F303RE) \ + || defined(ARDUINO_NUCLEO_F401RE) || defined(ARDUINO_NUCLEO_F411RE) \ + || defined(ARDUINO_NUCLEO_F446RE) || defined(ARDUINO_NUCLEO_L053R8) \ + || defined(ARDUINO_NUCLEO_L152RE) || defined(ARDUINO_NUCLEO_L476RG) \ + || defined(ARDUINO_NUCLEO_F072RB) \ + ) +#define IS_NUCLEO144 ( defined(ARDUINO_NUCLEO_F207ZG) \ + || defined(ARDUINO_NUCLEO_F429ZI) || defined(ARDUINO_NUCLEO_F767ZI) \ + || defined(ARDUINO_NUCLEO_L496ZG) || defined(ARDUINO_NUCLEO_L496ZG_P) \ + || defined(ARDUINO_NUCLEO_H743ZI) \ + ) +// F1xx, F4xx, L4xx have different registers and styles. General Macros +#if defined(__STM32F1__) //weird Maple Core +#define REGS(x) regs->x +#else //regular ST Core +#define REGS(x) x +#endif +#define PIN_HIGH(port, pin) (port)-> REGS(BSRR) = (1<<(pin)) +#define PIN_LOW(port, pin) (port)-> REGS(BSRR) = (1<<((pin)+16)) +#define PIN_MODE2(reg, pin, mode) reg=(reg&~(0x3<<((pin)<<1)))|(mode<<((pin)<<1)) +#define GROUP_MODE(port, reg, mask, val) {port->REGS(reg) = (port->REGS(reg) & ~(mask)) | ((mask)&(val)); } + +// Family specific Macros. F103 needs ST and Maple compatibility +// note that ILI9320 class of controller has much slower Read cycles +#if 0 +#elif defined(__STM32F1__) || defined(ARDUINO_NUCLEO_F103C8) || defined(ARDUINO_BLUEPILL_F103C8) || defined(ARDUINO_NUCLEO_F103RB) +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE; } +#if defined(__STM32F1__) //MapleCore crts.o does RCC. not understand regular syntax anyway +#define GPIO_INIT() +#else +#define GPIO_INIT() { RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN | RCC_APB2ENR_IOPDEN | RCC_APB2ENR_AFIOEN; \ + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_1;} +#endif +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) +#define PIN_OUTPUT(port, pin) {\ + if (pin < 8) {GP_OUT(port, CRL, 0xF<<((pin)<<2));} \ + else {GP_OUT(port, CRH, 0xF<<((pin&7)<<2));} \ + } +#define PIN_INPUT(port, pin) { \ + if (pin < 8) { GP_INP(port, CRL, 0xF<<((pin)<<2)); } \ + else { GP_INP(port, CRH, 0xF<<((pin&7)<<2)); } \ + } + +// should be easy to add F030, F091, F303, L053, ... +#elif defined(STM32F030x8) +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE; } +#define GPIO_INIT() { RCC->AHBENR |= RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN | RCC_AHBENR_GPIOCEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32F072xB) +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE; } +#define GPIO_INIT() { RCC->AHBENR |= RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN | RCC_AHBENR_GPIOCEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32F091xC) +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE; } +#define GPIO_INIT() { RCC->AHBENR |= RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN | RCC_AHBENR_GPIOCEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32F207xx) +#warning DELAY macros untested yet +#define WRITE_DELAY { WR_ACTIVE8; } //120MHz +#define IDLE_DELAY { WR_IDLE2;WR_IDLE; } +#define READ_DELAY { RD_ACTIVE16;} +#define GPIO_INIT() { RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOCEN | RCC_AHB1ENR_GPIODEN | RCC_AHB1ENR_GPIOEEN | RCC_AHB1ENR_GPIOFEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32F303xE) +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE8; } //thanks MasterT +#define GPIO_INIT() { RCC->AHBENR |= RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN | RCC_AHBENR_GPIOCEN; \ + /* AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_1; */ } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) //thanks fpiSTM + +#elif defined(STM32F401xE) +#define WRITE_DELAY { WR_ACTIVE2; } //84MHz +#define READ_DELAY { RD_ACTIVE4; } +#define GPIO_INIT() { RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOBEN | RCC_AHB1ENR_GPIOCEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32F411xE) +#define WRITE_DELAY { WR_ACTIVE2; WR_ACTIVE; } //100MHz +#define READ_DELAY { RD_ACTIVE4; RD_ACTIVE2; } +#define GPIO_INIT() { RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOBEN | RCC_AHB1ENR_GPIOCEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32F429xx) +#warning DELAY macros untested yet +#define WRITE_DELAY { WR_ACTIVE8; } //180MHz +#define IDLE_DELAY { WR_IDLE2;WR_IDLE; } +#define READ_DELAY { RD_ACTIVE16;} +#define GPIO_INIT() { RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOCEN | RCC_AHB1ENR_GPIODEN | RCC_AHB1ENR_GPIOEEN | RCC_AHB1ENR_GPIOFEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32F446xx) +#define WRITE_DELAY { WR_ACTIVE8; } //180MHz +#define IDLE_DELAY { WR_IDLE2;WR_IDLE; } +#define READ_DELAY { RD_ACTIVE16;} +#define GPIO_INIT() { RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOBEN | RCC_AHB1ENR_GPIOCEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32F767xx) +#warning DELAY macros untested yet +#define WRITE_DELAY { WR_ACTIVE8;WR_ACTIVE2; } //216MHz +#define IDLE_DELAY { WR_IDLE2;WR_IDLE; } +#define READ_DELAY { RD_ACTIVE16;RD_ACTIVE16;RD_ACTIVE4;} +#define GPIO_INIT() { RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOCEN | RCC_AHB1ENR_GPIODEN | RCC_AHB1ENR_GPIOEEN | RCC_AHB1ENR_GPIOFEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32H743xx) // thanks MagicianT +#warning STM32H743xx< DELAY macros untested yet +#define WRITE_DELAY { WR_ACTIVE8;WR_ACTIVE2; } //F_CPU=400MHz +#define IDLE_DELAY { WR_IDLE2;WR_IDLE; } +#define READ_DELAY { RD_ACTIVE16;RD_ACTIVE16;RD_ACTIVE4;} +#define GPIO_INIT() { RCC->AHB4ENR |= RCC_AHB4ENR_GPIOAEN | RCC_AHB4ENR_GPIOCEN | RCC_AHB4ENR_GPIODEN | RCC_AHB4ENR_GPIOEEN | RCC_AHB4ENR_GPIOFEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32L053xx) +#define WRITE_DELAY { } //32MHz M0+ +#define READ_DELAY { RD_ACTIVE; } +#define GPIO_INIT() { RCC->IOPENR |= RCC_IOPENR_GPIOAEN | RCC_IOPENR_GPIOBEN | RCC_IOPENR_GPIOCEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32L152xE) +#define WRITE_DELAY { } //32MHz M3 +#define READ_DELAY { RD_ACTIVE; } +#define GPIO_INIT() { RCC->AHBENR |= RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN | RCC_AHBENR_GPIOCEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32L476xx) +#define WRITE_DELAY { WR_ACTIVE2; } //80MHz +#define READ_DELAY { RD_ACTIVE4; RD_ACTIVE; } +#define GPIO_INIT() { RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN | RCC_AHB2ENR_GPIOBEN | RCC_AHB2ENR_GPIOCEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#elif defined(STM32L496xx) +#warning DELAY macros untested yet +#define WRITE_DELAY { WR_ACTIVE2; } //80MHz +#define READ_DELAY { RD_ACTIVE4; RD_ACTIVE; } +#define GPIO_INIT() { RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN | RCC_AHB2ENR_GPIOCEN | RCC_AHB2ENR_GPIODEN | RCC_AHB2ENR_GPIOEEN | RCC_AHB2ENR_GPIOFEN; } +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) + +#else +#error unsupported STM32 +#endif + +#if 0 +#elif defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_NUCLEO_F103C8) || defined(ARDUINO_BLUEPILL_F103C8) +#warning Uno Shield on BLUEPILL + +//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST| |SD_SS|SD_DI|SD_DO|SD_SCK| +//STM32 pin |PA7|PA6|PA5|PA4|PA3|PA2|PA1|PA0| |PB0|PB6|PB7|PB8|PB9| |PA15 |PB5 |PB4 |PB3 | **ALT-SPI1** + +#define RD_PORT GPIOB +//#define RD_PIN 5 +#define RD_PIN 0 //hardware mod to Adapter. Allows use of PB5 for SD Card +#define WR_PORT GPIOB +#define WR_PIN 6 +#define CD_PORT GPIOB +#define CD_PIN 7 +#define CS_PORT GPIOB +#define CS_PIN 8 +#define RESET_PORT GPIOB +#define RESET_PIN 9 + +// configure macros for the data pins +#define write_8(d) { GPIOA->REGS(BSRR) = 0x00FF << 16; GPIOA->REGS(BSRR) = (d) & 0xFF; } +#define read_8() (GPIOA->REGS(IDR) & 0xFF) +// PA7 ..PA0 +#define setWriteDir() {GP_OUT(GPIOA, CRL, 0xFFFFFFFF); } +#define setReadDir() {GP_INP(GPIOA, CRL, 0xFFFFFFFF); } + +#elif IS_NUCLEO64 // Uno Shield on NUCLEO-64 +#warning Uno Shield on NUCLEO-64 +#define RD_PORT GPIOA //PA0 +#define RD_PIN 0 +#define WR_PORT GPIOA //PA1 +#define WR_PIN 1 +#define CD_PORT GPIOA //PA4 +#define CD_PIN 4 +#define CS_PORT GPIOB //PB0 +#define CS_PIN 0 +#define RESET_PORT GPIOC //PC1 +#define RESET_PIN 1 + +// configure macros for the data pins +#define AMASK ((1<<9)|(1<<10)|(1<<8)) //#0, #2, #7 +#define BMASK ((1<<3)|(1<<5)|(1<<4)|(1<<10)) //#3, #4, #5, #6 +#define CMASK ((1<<7)) //#1 + +#define write_8(d) { \ + GPIOA->REGS(BSRR) = AMASK << 16; \ + GPIOB->REGS(BSRR) = BMASK << 16; \ + GPIOC->REGS(BSRR) = CMASK << 16; \ + GPIOA->REGS(BSRR) = ( ((d) & (1<<0)) << 9) \ + | (((d) & (1<<2)) << 8) \ + | (((d) & (1<<7)) << 1); \ + GPIOB->REGS(BSRR) = ( ((d) & (1<<3)) << 0) \ + | (((d) & (1<<4)) << 1) \ + | (((d) & (1<<5)) >> 1) \ + | (((d) & (1<<6)) << 4); \ + GPIOC->REGS(BSRR) = ( ((d) & (1<<1)) << 6); \ + } + +#define read_8() ( ( ( (GPIOA->REGS(IDR) & (1<<9)) >> 9) \ + | ((GPIOC->REGS(IDR) & (1<<7)) >> 6) \ + | ((GPIOA->REGS(IDR) & (1<<10)) >> 8) \ + | ((GPIOB->REGS(IDR) & (1<<3)) >> 0) \ + | ((GPIOB->REGS(IDR) & (1<<5)) >> 1) \ + | ((GPIOB->REGS(IDR) & (1<<4)) << 1) \ + | ((GPIOB->REGS(IDR) & (1<<10)) >> 4) \ + | ((GPIOA->REGS(IDR) & (1<<8)) >> 1))) + + +#if defined(ARDUINO_NUCLEO_F103RB) || defined(ARDUINO_STM_NUCLEO_F103RB) //F103 has unusual GPIO modes +// PA10,PA9,PA8 PB10 PB5,PB4,PB3 PC7 +#define setWriteDir() {GP_OUT(GPIOA, CRH, 0xFFF); GP_OUT(GPIOB, CRH, 0xF00); GP_OUT(GPIOB, CRL, 0xFFF000); GP_OUT(GPIOC, CRL, 0xF0000000); } +#define setReadDir() {GP_INP(GPIOA, CRH, 0xFFF); GP_INP(GPIOB, CRH, 0xF00); GP_INP(GPIOB, CRL, 0xFFF000); GP_INP(GPIOC, CRL, 0xF0000000); } +#else //F0xx, F3xx, F4xx, L0xx, L1xx, L4xx use MODER +// PA10,PA9,PA8 PB10,PB5,PB4,PB3 PC7 +#define setWriteDir() { setReadDir(); \ + GPIOA->MODER |= 0x150000; GPIOB->MODER |= 0x100540; GPIOC->MODER |= 0x4000; } +#define setReadDir() { GPIOA->MODER &= ~0x3F0000; GPIOB->MODER &= ~0x300FC0; GPIOC->MODER &= ~0xC000; } +#endif + +#elif IS_NUCLEO144 // Uno Shield on NUCLEO-144 +#warning Uno Shield on NUCLEO-144 +#define RD_PORT GPIOA //PA3 +#define RD_PIN 3 +#define WR_PORT GPIOC //PC0 +#define WR_PIN 0 +#define CD_PORT GPIOC //PC3 +#define CD_PIN 3 +#define CS_PORT GPIOF //PF3 +#define CS_PIN 3 +#define RESET_PORT GPIOF //PF5 +#define RESET_PIN 5 + +// configure macros for the data pins +#define DMASK ((1<<15)) //#1 +#define EMASK ((1<<13)|(1<<11)|(1<<9)) //#3, #5, #6 +#define FMASK ((1<<12)|(1<<15)|(1<<14)|(1<<13)) //#0, #2, #4, #7 + +#define write_8(d) { \ + GPIOD->REGS(BSRR) = DMASK << 16; \ + GPIOE->REGS(BSRR) = EMASK << 16; \ + GPIOF->REGS(BSRR) = FMASK << 16; \ + GPIOD->REGS(BSRR) = ( ((d) & (1<<1)) << 14); \ + GPIOE->REGS(BSRR) = ( ((d) & (1<<3)) << 10) \ + | (((d) & (1<<5)) << 6) \ + | (((d) & (1<<6)) << 3); \ + GPIOF->REGS(BSRR) = ( ((d) & (1<<0)) << 12) \ + | (((d) & (1<<2)) << 13) \ + | (((d) & (1<<4)) << 10) \ + | (((d) & (1<<7)) << 6); \ + } + +#define read_8() ( ( ( (GPIOF->REGS(IDR) & (1<<12)) >> 12) \ + | ((GPIOD->REGS(IDR) & (1<<15)) >> 14) \ + | ((GPIOF->REGS(IDR) & (1<<15)) >> 13) \ + | ((GPIOE->REGS(IDR) & (1<<13)) >> 10) \ + | ((GPIOF->REGS(IDR) & (1<<14)) >> 10) \ + | ((GPIOE->REGS(IDR) & (1<<11)) >> 6) \ + | ((GPIOE->REGS(IDR) & (1<<9)) >> 3) \ + | ((GPIOF->REGS(IDR) & (1<<13)) >> 6))) + + +// PD15 PE13,PE11,PE9 PF15,PF14,PF13,PF12 +#define setWriteDir() { setReadDir(); \ + GPIOD->MODER |= 0x40000000; GPIOE->MODER |= 0x04440000; GPIOF->MODER |= 0x55000000; } +#define setReadDir() { GPIOD->MODER &= ~0xC0000000; GPIOE->MODER &= ~0x0CCC0000; GPIOF->MODER &= ~0xFF000000; } + +#elif defined(ARDUINO_MAPLE_REV3) // Uno Shield on MAPLE_REV3 board +#warning Uno Shield on MAPLE_REV3 board +#define RD_PORT GPIOC +#define RD_PIN 0 +#define WR_PORT GPIOC +#define WR_PIN 1 +#define CD_PORT GPIOC +#define CD_PIN 2 +#define CS_PORT GPIOC +#define CS_PIN 3 +#define RESET_PORT GPIOC +#define RESET_PIN 4 + +// configure macros for the data pins +#define write_8(d) { \ + GPIOA->REGS(BSRR) = 0x0703 << 16; \ + GPIOB->REGS(BSRR) = 0x00E0 << 16; \ + GPIOA->REGS(BSRR) = ( ((d) & (1<<0)) << 10) \ + | (((d) & (1<<2)) >> 2) \ + | (((d) & (1<<3)) >> 2) \ + | (((d) & (1<<6)) << 2) \ + | (((d) & (1<<7)) << 2); \ + GPIOB->REGS(BSRR) = ( ((d) & (1<<1)) << 6) \ + | (((d) & (1<<4)) << 1) \ + | (((d) & (1<<5)) << 1); \ + } + +#define read_8() ( ( ( (GPIOA->REGS(IDR) & (1<<10)) >> 10) \ + | ((GPIOB->REGS(IDR) & (1<<7)) >> 6) \ + | ((GPIOA->REGS(IDR) & (1<<0)) << 2) \ + | ((GPIOA->REGS(IDR) & (1<<1)) << 2) \ + | ((GPIOB->REGS(IDR) & (1<<5)) >> 1) \ + | ((GPIOB->REGS(IDR) & (1<<6)) >> 1) \ + | ((GPIOA->REGS(IDR) & (1<<8)) >> 2) \ + | ((GPIOA->REGS(IDR) & (1<<9)) >> 2))) + +// PA10,PA9,PA8 PA1,PA0 PB7,PB6,PB5 +#define setWriteDir() {GP_OUT(GPIOA, CRH, 0xFFF); GP_OUT(GPIOA, CRL, 0xFF); GP_OUT(GPIOB, CRL, 0xFFF00000); } +#define setReadDir() {GP_INP(GPIOA, CRH, 0xFFF); GP_INP(GPIOA, CRL, 0xFF); GP_INP(GPIOB, CRL, 0xFFF00000); } + +#else +#error REGS group +#endif + +#ifndef IDLE_DELAY +#define IDLE_DELAY { WR_IDLE; } +#endif + +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; IDLE_DELAY; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE2; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +//################################### ESP32 ############################## +#elif defined(ESP32) //regular UNO shield on TTGO D1 R32 (ESP32) +#define LCD_RD 2 //LED +#define LCD_WR 4 +#define LCD_RS 15 //hard-wired to A2 (GPIO35) +#define LCD_CS 33 //hard-wired to A3 (GPIO34) +#define LCD_RST 32 //hard-wired to A4 (GPIO36) + +#define LCD_D0 12 +#define LCD_D1 13 +#define LCD_D2 26 +#define LCD_D3 25 +#define LCD_D4 17 +#define LCD_D5 16 +#define LCD_D6 27 +#define LCD_D7 14 + +#define RD_PORT GPIO.out +#define RD_PIN LCD_RD +#define WR_PORT GPIO.out +#define WR_PIN LCD_WR +#define CD_PORT GPIO.out +#define CD_PIN LCD_RS +#define CS_PORT GPIO.out1.val +#define CS_PIN LCD_CS +#define RESET_PORT GPIO.out1.val +#define RESET_PIN LCD_RST + +static inline uint32_t map_8(uint32_t d) +{ + return ( + 0 + | ((d & (1 << 0)) << (LCD_D0 - 0)) + | ((d & (1 << 1)) << (LCD_D1 - 1)) + | ((d & (1 << 2)) << (LCD_D2 - 2)) + | ((d & (1 << 3)) << (LCD_D3 - 3)) + | ((d & (1 << 4)) << (LCD_D4 - 4)) + | ((d & (1 << 5)) << (LCD_D5 - 5)) + | ((d & (1 << 6)) << (LCD_D6 - 6)) + | ((d & (1 << 7)) << (LCD_D7 - 7)) + ); +} + +static inline uint8_t map_32(uint32_t d) +{ + return ( + 0 + | ((d & (1 << LCD_D0)) >> (LCD_D0 - 0)) + | ((d & (1 << LCD_D1)) >> (LCD_D1 - 1)) + | ((d & (1 << LCD_D2)) >> (LCD_D2 - 2)) + | ((d & (1 << LCD_D3)) >> (LCD_D3 - 3)) + | ((d & (1 << LCD_D4)) >> (LCD_D4 - 4)) + | ((d & (1 << LCD_D5)) >> (LCD_D5 - 5)) + | ((d & (1 << LCD_D6)) >> (LCD_D6 - 6)) + | ((d & (1 << LCD_D7)) >> (LCD_D7 - 7)) + ); +} + +static inline void write_8(uint16_t data) +{ + GPIO.out_w1tc = map_8(0xFF); //could define once as DMASK + GPIO.out_w1ts = map_8(data); +} + +static inline uint8_t read_8() +{ + return map_32(GPIO.in); +} +static void setWriteDir() +{ + pinMode(LCD_D0, OUTPUT); + pinMode(LCD_D1, OUTPUT); + pinMode(LCD_D2, OUTPUT); + pinMode(LCD_D3, OUTPUT); + pinMode(LCD_D4, OUTPUT); + pinMode(LCD_D5, OUTPUT); + pinMode(LCD_D6, OUTPUT); + pinMode(LCD_D7, OUTPUT); +} + +static void setReadDir() +{ + pinMode(LCD_D0, INPUT); + pinMode(LCD_D1, INPUT); + pinMode(LCD_D2, INPUT); + pinMode(LCD_D3, INPUT); + pinMode(LCD_D4, INPUT); + pinMode(LCD_D5, INPUT); + pinMode(LCD_D6, INPUT); + pinMode(LCD_D7, INPUT); +} + +#define WRITE_DELAY { } +#define READ_DELAY { } + +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (digitalWrite(b, LOW)) +#define PIN_HIGH(p, b) (digitalWrite(b, HIGH)) +#define PIN_OUTPUT(p, b) (pinMode(b, OUTPUT)) + +#else +#error MCU unsupported +#endif // regular UNO shields on Arduino boards + +#endif //!defined(USE_SPECIAL) || defined (USE_SPECIAL_FAIL) + +#define RD_ACTIVE PIN_LOW(RD_PORT, RD_PIN) +#define RD_IDLE PIN_HIGH(RD_PORT, RD_PIN) +#define RD_OUTPUT PIN_OUTPUT(RD_PORT, RD_PIN) +#define WR_ACTIVE PIN_LOW(WR_PORT, WR_PIN) +#define WR_IDLE PIN_HIGH(WR_PORT, WR_PIN) +#define WR_OUTPUT PIN_OUTPUT(WR_PORT, WR_PIN) +#define CD_COMMAND PIN_LOW(CD_PORT, CD_PIN) +#define CD_DATA PIN_HIGH(CD_PORT, CD_PIN) +#define CD_OUTPUT PIN_OUTPUT(CD_PORT, CD_PIN) +#define CS_ACTIVE PIN_LOW(CS_PORT, CS_PIN) +#define CS_IDLE PIN_HIGH(CS_PORT, CS_PIN) +#define CS_OUTPUT PIN_OUTPUT(CS_PORT, CS_PIN) +#define RESET_ACTIVE PIN_LOW(RESET_PORT, RESET_PIN) +#define RESET_IDLE PIN_HIGH(RESET_PORT, RESET_PIN) +#define RESET_OUTPUT PIN_OUTPUT(RESET_PORT, RESET_PIN) + + // General macros. IOCLR registers are 1 cycle when optimised. +#define WR_STROBE { WR_ACTIVE; WR_IDLE; } //PWLW=TWRL=50ns +#define RD_STROBE RD_IDLE, RD_ACTIVE, RD_ACTIVE, RD_ACTIVE //PWLR=TRDL=150ns, tDDR=100ns + +#if !defined(GPIO_INIT) +#define GPIO_INIT() +#endif +#define CTL_INIT() { GPIO_INIT(); RD_OUTPUT; WR_OUTPUT; CD_OUTPUT; CS_OUTPUT; RESET_OUTPUT; } +#define WriteCmd(x) { CD_COMMAND; write16(x); CD_DATA; } +#define WriteData(x) { write16(x); } diff --git a/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_special.h b/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_special.h new file mode 100644 index 0000000..fbf9565 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/utility/mcufriend_special.h @@ -0,0 +1,1020 @@ +// only define one "USE_XXX" macro at any time + +//#define USE_MEGA_8BIT_PROTOSHIELD +//#define USE_MEGA_8BIT_SHIELD // 4.7sec Mega2560 Shield +//#define USE_MEGA_8BIT_PORTC_SHIELD // 4.7sec Mega2560 Shield +//#define USE_MEGA_16BIT_SHIELD // 2.14sec Mega2560 Shield +//#define USE_BLD_BST_MEGA32U4 +//#define USE_BLD_BST_MEGA2560 // 12.23sec Uno Shield (17.38s C) +//#define USE_BLD_BST_MEGA4809 // 5.43sec XPRO-Adapter (7.09s C) +//#define USE_DUE_8BIT_PROTOSHIELD +//#define USE_DUE_16BIT_SHIELD //RD on PA15 (D24) +//#define USE_BOBCACHELOT_TEENSY +//#define USE_OPENSMART_SHIELD_PINOUT_UNO +//#define USE_OPENSMART_SHIELD_PINOUT_MEGA +//#define USE_OPENSMART_SHIELD_PINOUT_DUE //thanks Michel53 +//#define USE_ELECHOUSE_DUE_16BIT_SHIELD //Untested yet +//#define USE_MY_BLUEPILL +//#define USE_ADIGITALEU_TEENSY +//#define USE_MIKROELEKTRONIKA +//#define USE_XPRO_MEGA4809 + +/* +HX8347A tWC =100ns tWRH = 35ns tRCFM = 450ns tRC = ? ns +HX8347D tWC = 66ns tWRH = 15ns tRCFM = 450ns tRC = 160ns +HX8347I tWC =100ns tWRH = 15ns tRCFM = 600ns tRC = 160ns +HX8357C tWC = 50ns tWRH = 15ns tRCFM = 450ns tRC = 160ns +ILI9320 tWC =100ns tWRH = 50ns tRCFM = 300ns tRC = 300ns +ILI9341 tWC = 66ns tWRH = 15ns tRCFM = 450ns tRC = 160ns +ILI9481 tWC =100ns tWRH = 30ns tRCFM = 450ns tRC = 450ns +ILI9486 tWC = 66ns tWRH = 15ns tRCFM = 450ns tRC = 160ns (tWCFM= 286ns on mystery 9486_16) +ILI9486L tWC = 50ns tWRH = 15ns tRCFM = 450ns tRC = 160ns +ILI9488 tWC = 30ns tWRH = 15ns tRCFM = 450ns tRC = 160ns +NT35310 tWC = 40ns tWRH = 19ns tRCFM = 400ns tRC = 160ns +RM68140 tWC = 50ns tWRH = 15ns tRCFM = 450ns tRC = 160ns (tWCFM= 119ns) +SPFD5408 tWC =125ns tWRH = 70ns tRCFM = 450ns tRC = 450ns +SSD1289 tWC =100ns tWRH = 50ns tRCFM =1000ns tRC =1000ns (tWCFM= 238ns) +SSD1963 tWC = 26ns tWRH = 13ns tRCFM = 110ns tRC = 72ns +ST7789V tWC = 66ns tWRH = 15ns tRCFM = 450ns tRC = 160ns +ST7793 tWC = 75ns tWRH = 25ns tRCFM = 450ns tRC = 450ns +ST7796S tWC = 66ns tWRH = 15ns tRCFM = 450ns tRC = 160ns +*/ + +#if 0 + +#elif defined(__AVR_ATxmega128A1__) // Xplained or MIKROE +#if defined(USE_MIKROELEKTRONIKA) // HX8347-D 16.2ns@62MHz 20.9ns@48MHz +#if F_CPU > 46000000 +#error MIKROELEKTRONIKA must be less than 48MHz +#else +#warning MIKROELEKTRONIKA DEV BOARD (48MHz max) +#endif +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE4; } +#define VPMAP10 0x58 // VPORT0=J, 1=F, 2=K, 3=D +#define VPMAP32 0x39 // VPORT0=J, 1=F, 2=K, 3=D +#define RD_PORT VPORT0 //PJ2. +#define RD_PIN 2 +#define WR_PORT VPORT0 +#define WR_PIN 3 +#define CD_PORT VPORT0 +#define CD_PIN 4 +#define CS_PORT VPORT0 +#define CS_PIN 5 +#define RESET_PORT VPORT0 //PJ1 +#define RESET_PIN 1 +#else +#warning Home made shield with Xplained CTL=J1 (PC), DATA=J4 (PF) +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE4; } +#define VPMAP10 0x15 // VPORT0=F, 1=B, 2=C, 3=D +#define VPMAP32 0x32 // VPORT0=F, 1=B, 2=C, 3=D +#define RD_PORT VPORT0 //PF0. +#define RD_PIN 0 +#define WR_PORT VPORT0 +#define WR_PIN 1 +#define CD_PORT VPORT0 +#define CD_PIN 2 +#define CS_PORT VPORT0 +#define CS_PIN 3 +#define RESET_PORT VPORT0 //PK4 +#define RESET_PIN 4 +#endif + +// VPORTs are very fast. CBI, SBI are only one cycle. Hence all those RD_ACTIVEs +// ILI9320 data sheet says tDDR=100ns. We need 218ns to read REGs correctly. +#define write_8(x) { VPORT2.OUT = x; } +#define read_8() ( VPORT2.IN ) +#define setWriteDir() { PORTCFG.VPCTRLA=VPMAP10; PORTCFG.VPCTRLB=VPMAP32; VPORT2.DIR = 0xFF; } +#define setReadDir() { VPORT2.DIR = 0x00; } +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +//#define READ_8(dst) { RD_STROBE; RD_ACTIVE2; RD_ACTIVE; dst = read_8(); RD_IDLE; } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p).OUT &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p).OUT |= (1<<(b)) +#define PIN_OUTPUT(p, b) (p).DIR |= (1<<(b)) + +#elif defined(__AVR_ATxmega32A4U__) || defined(__AVR_ATxmega128A4U__) // Home made shield with Batsocks module +#warning Home made shield with Batsocks module +#define RD_PORT VPORT1 //PB0. VPORT0=A, 1=B, 2=C, 3=D +#define RD_PIN 0 +#define WR_PORT VPORT1 +#define WR_PIN 1 +#define CD_PORT VPORT1 +#define CD_PIN 2 +#define CS_PORT VPORT1 +#define CS_PIN 3 +#define RESET_PORT PORTE +#define RESET_PIN 0 + +// VPORTs are very fast. CBI, SBI are only one cycle. Hence all those RD_ACTIVEs +// ILI9320 data sheet says tDDR=100ns. We need 218ns to read REGs correctly. +// S6D0154 data sheet says tDDR=250ns. We need ~500ns to read REGs correctly. +// ST7789 data sheet says tRC=450ns. We need ~167ns to read REGs correctly. (10 cycles @ 60MHz ) +// ST7789 says tRC=160ns for ID and tRC=450ns for Frame Memory +// ILI9341 says tRC=160ns for ID and tRC=450ns for Frame Memory. They are FASTER +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE4; } +#define write_8(x) { VPORT2.OUT = x; } +#define read_8() ( VPORT2.IN ) +#define setWriteDir() { PORTCFG.VPCTRLA=0x10; PORTCFG.VPCTRLB=0x32; VPORT2.DIR = 0xFF; } +#define setReadDir() { VPORT2.DIR = 0x00; } +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p).OUT &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p).OUT |= (1<<(b)) +#define PIN_OUTPUT(p, b) (p).DIR |= (1<<(b)) + +#elif defined(__AVR_ATxmega32E5__) // Xplained E5 F_CPU <= 46MHz +#warning Home made shield with Xplained E5: CTL=J2 (PD), DATA=J0 (PA) +#define CTLPORT VPORT2 //PORTD on J2 +#define DATPORT VPORT0 //PORTA on J3, SW103=hdr +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE4; } +#define RD_PORT CTLPORT +#define RD_PIN 0 +#define WR_PORT CTLPORT +#define WR_PIN 1 +#define CD_PORT CTLPORT +#define CD_PIN 2 +#define CS_PORT CTLPORT +#define CS_PIN 3 +#define RESET_PORT CTLPORT //10k p.u. to 3V3 +#define RESET_PIN 4 + +// VPORTs are very fast. CBI, SBI are only one cycle. Hence all those RD_ACTIVEs +// ILI9320 data sheet says tDDR=100ns. We need 218ns to read REGs correctly. +#define write_8(x) { DATPORT.OUT = x; } +#define read_8() ( DATPORT.IN ) +#define setWriteDir() { DATPORT.DIR = 0xFF; } +#define setReadDir() { DATPORT.DIR = 0x00; } +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p).OUT &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p).OUT |= (1<<(b)) +#define PIN_OUTPUT(p, b) (p).DIR |= (1<<(b)) + +//################################# XPRO-4809 with XPRO-Shield_Adapter ############################ +#elif defined(__AVR_ATmega4809__) && !defined(USE_BLD_BST_MEGA4809) && defined(USE_XPRO_MEGA4809) // XPRO-4809 with XPRO-Shield_Adapter +#warning XPRO-4809 with XPRO-Shield_Adapter using PORT.OUTSET +#define RD_PORT PORTD // +#define RD_PIN 2 +#define WR_PORT PORTD +#define WR_PIN 3 +#define CD_PORT PORTD +#define CD_PIN 4 +#define CS_PORT PORTD +#define CS_PIN 5 +#define RESET_PORT PORTC +#define RESET_PIN 2 + +// PORT.OUTSET is fast but still 2 cycles. Hence all those RD_ACTIVEs +#define AMASK (3<<2) +#define BMASK (3<<2) +#define CMASK (3<<6) +#define EMASK (1<<1) +#define FMASK (1<<6) +#define write_8(x) { \ + PORTA.OUTCLR = AMASK; PORTA.OUTSET = (((x) & (3<<0)) << 2); \ + PORTB.OUTCLR = BMASK; PORTB.OUTSET = (((x) & (1<<2))) | (((x) & (1<<6)) >> 3); \ + PORTC.OUTCLR = CMASK; PORTC.OUTSET = (((x) & (3<<3)) << 3); \ + PORTE.OUTCLR = EMASK; PORTE.OUTSET = (((x) & (1<<7)) >> 6); \ + PORTF.OUTCLR = FMASK; PORTF.OUTSET = (((x) & (1<<5)) << 1); \ + } +#define read_8() ( ((PORTA.IN & AMASK) >> 2)\ +| ((PORTB.IN & (1<<2)) >> 0)\ +| ((PORTB.IN & (1<<3)) << 3)\ +| ((PORTC.IN & CMASK) >> 3)\ +| ((PORTE.IN & EMASK) << 6)\ +| ((PORTF.IN & FMASK) >> 1)\ +) +#define setWriteDir() { PORTA.DIRSET = AMASK; PORTB.DIRSET = BMASK; PORTC.DIRSET = CMASK; PORTE.DIRSET = EMASK; PORTF.DIRSET = FMASK; } +#define setReadDir() { PORTA.DIRCLR = AMASK; PORTB.DIRCLR = BMASK; PORTC.DIRCLR = CMASK; PORTE.DIRCLR = EMASK; PORTF.DIRCLR = FMASK; } + +#define WRITE_DELAY { WR_ACTIVE2; WR_ACTIVE; } //-Os=7.09s @20MHz (-O1=8.13s, -O3=6.03s) +#define READ_DELAY { RD_ACTIVE2; } //ID=0x7789 +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p).OUTCLR = (1<<(b)) +#define PIN_HIGH(p, b) (p).OUTSET = (1<<(b)) +#define PIN_OUTPUT(p, b) (p).DIRSET = (1<<(b)) + +#elif defined(__AVR_ATmega4809__) && defined(USE_BLD_BST_MEGA4809) && defined(USE_XPRO_MEGA4809) // XPRO-4809 with XPRO-Shield_Adapter +#warning XPRO-4809 with XPRO-Shield_Adapter using VPORT.OUT and BLD/BST +#define RD_PORT VPORTD // +#define RD_PIN 2 +#define WR_PORT VPORTD +#define WR_PIN 3 +#define CD_PORT VPORTD +#define CD_PIN 4 +#define CS_PORT VPORTD +#define CS_PIN 5 +#define RESET_PORT VPORTC +#define RESET_PIN 2 + +#define AMASK (3<<2) +#define BMASK (3<<2) +#define CMASK (3<<6) +#define EMASK (1<<1) +#define FMASK (1<<6) +static __attribute((always_inline)) + void write_8(uint8_t val) +{ + asm volatile("in __tmp_reg__,0x01" "\n\t" //VPORTA.OUT + "BST %0,0" "\n\t" "BLD __tmp_reg__,2" "\n\t" + "BST %0,1" "\n\t" "BLD __tmp_reg__,3" "\n\t" + "out 0x01,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x05" "\n\t" //VPORTB.OUT + "BST %0,2" "\n\t" "BLD __tmp_reg__,2" "\n\t" + "BST %0,6" "\n\t" "BLD __tmp_reg__,3" "\n\t" + "out 0x05,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x09" "\n\t" //VPORTC.OUT + "BST %0,3" "\n\t" "BLD __tmp_reg__,6" "\n\t" + "BST %0,4" "\n\t" "BLD __tmp_reg__,7" "\n\t" + "out 0x09,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x11" "\n\t" //VPORTE.OUT + "BST %0,7" "\n\t" "BLD __tmp_reg__,1" "\n\t" + "out 0x11,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x15" "\n\t" //VPORTF.OUT + "BST %0,5" "\n\t" "BLD __tmp_reg__,6" "\n\t" + "out 0x15,__tmp_reg__" : : "a" (val)); +} + +#define read_8() ( ((VPORTA_IN & AMASK) >> 2)\ +| ((VPORTB_IN & (1<<2)) >> 0)\ +| ((VPORTB_IN & (1<<3)) << 3)\ +| ((VPORTC_IN & CMASK) >> 3)\ +| ((VPORTE_IN & EMASK) << 6)\ +| ((VPORTF_IN & FMASK) >> 1)\ +) +#define setWriteDir() { VPORTA_DIR |= AMASK; VPORTB_DIR |= BMASK; VPORTC_DIR |= CMASK; VPORTE_DIR |= EMASK; VPORTF_DIR |= FMASK; } +#define setReadDir() { VPORTA_DIR &= ~AMASK; VPORTB_DIR &= ~BMASK; VPORTC_DIR &= ~CMASK; VPORTE_DIR &= ~EMASK; VPORTF_DIR &= ~FMASK; } + +//#define WRITE_DELAY { WR_ACTIVE; WR_ACTIVE; } //6.47s no_inline +#define WRITE_DELAY { WR_ACTIVE2; WR_ACTIVE; } //-Os=5.43s @20MHz always_inline. (-O1=5.41s, -O3=5.25s) +#define READ_DELAY { RD_ACTIVE4; } //ID=0x7789 +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p).OUT &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p).OUT |= (1<<(b)) +#define PIN_OUTPUT(p, b) (p).DIR |= (1<<(b)) + +#elif defined(__AVR_ATmega328P__) && defined(USE_OPENSMART_SHIELD_PINOUT_UNO) +#define RD_PORT PORTC +#define RD_PIN 0 +#define WR_PORT PORTC +#define WR_PIN 1 +#define CD_PORT PORTC +#define CD_PIN 2 +#define CS_PORT PORTC +#define CS_PIN 3 +#define RESET_PORT PORTC +#define RESET_PIN 1 // n/a. so mimic WR_PIN + +#define BMASK B00101111 +#define DMASK B11010000 + +#define write_8(x) { \ + PORTD = (PORTD & ~DMASK) | ((x) & DMASK); \ + PORTB = (PORTB & ~BMASK) | ((x) & BMASK);} // STROBEs are defined later + +#define read_8() ((PIND & DMASK) | (PINB & BMASK)) + +#define setWriteDir() { DDRD |= DMASK; DDRB |= BMASK; } +#define setReadDir() { DDRD &= ~DMASK; DDRB &= ~BMASK; } + + +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__AVR_ATmega2560__) && defined(USE_OPENSMART_SHIELD_PINOUT_MEGA) +#define RD_PORT PORTF +#define RD_PIN 0 +#define WR_PORT PORTF +#define WR_PIN 1 +#define CD_PORT PORTF +#define CD_PIN 2 +#define CS_PORT PORTF +#define CS_PIN 3 +#define RESET_PORT PORTF +#define RESET_PIN 1 // n/a. so mimic WR_PIN + +#define BMASK B10110000 //D13, D11, D10 +#define GMASK 0x20 //D4 +#define HMASK 0x78 //D6, D7, D8, D9 + +#if defined(USE_BLD_BST_MEGA2560) +static __attribute((always_inline)) void write_8(uint8_t val) +{ + asm volatile("lds __tmp_reg__,0x0102" "\n\t" //PORTH + "BST %0,0" "\n\t" "BLD __tmp_reg__,5" "\n\t" + "BST %0,1" "\n\t" "BLD __tmp_reg__,6" "\n\t" + "BST %0,6" "\n\t" "BLD __tmp_reg__,3" "\n\t" + "BST %0,7" "\n\t" "BLD __tmp_reg__,4" "\n\t" + "sts 0x0102,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x05" "\n\t" //PORTB + "BST %0,2" "\n\t" "BLD __tmp_reg__,4" "\n\t" + "BST %0,3" "\n\t" "BLD __tmp_reg__,5" "\n\t" + "BST %0,5" "\n\t" "BLD __tmp_reg__,7" "\n\t" + "out 0x05,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x14" "\n\t" //PORTG + "BST %0,4" "\n\t" "BLD __tmp_reg__,5" "\n\t" + "out 0x14,__tmp_reg__" : : "a" (val)); +} +#else +#define write_8(x) { \ + PORTH = (PORTH&~HMASK)|(((x)&B11000000)>>3)|(((x)&B00000011)<<5); \ + PORTB = (PORTB&~BMASK)|(((x)&B00101100)<<2); \ + PORTG = (PORTG&~GMASK)|(((x)&B00010000)<<1); \ + } +#endif + +#define read_8()(\ + ((PINH & B00011000) << 3) | ((PINB & BMASK) >> 2) | \ + ((PING & GMASK) >> 1) | ((PINH & B01100000) >> 5) ) +#define setWriteDir() { DDRH |= HMASK; DDRB |= BMASK; DDRG |= GMASK; } +#define setReadDir() { DDRH &= ~HMASK; DDRB &= ~BMASK; DDRG &= ~GMASK; } + +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__SAM3X8E__) && defined(USE_OPENSMART_SHIELD_PINOUT_DUE) //OPENSMART shield on DUE +#warning USE_OPENSMART_SHIELD_PINOUT on DUE + // configure macros for the control pins +#define RD_PORT PIOA +#define RD_PIN 16 +#define WR_PORT PIOA +#define WR_PIN 24 +#define CD_PORT PIOA +#define CD_PIN 23 +#define CS_PORT PIOA +#define CS_PIN 22 +#define RESET_PORT PIOA +#define RESET_PIN 24 // n/a. so mimic WR_PIN + // configure macros for data bus +#define BMASK (1<<27) +#define CMASK (0x12F << 21) +#define DMASK (1<<7) +#define write_8(x) { PIOB->PIO_CODR = BMASK; PIOC->PIO_CODR = CMASK; PIOD->PIO_CODR = DMASK; \ + PIOC->PIO_SODR = (((x) & (1<<0)) << 22); \ + PIOC->PIO_SODR = (((x) & (1<<1)) << 20); \ + PIOC->PIO_SODR = (((x) & (1<<2)) << 27); \ + PIOD->PIO_SODR = (((x) & (1<<3)) << 4); \ + PIOC->PIO_SODR = (((x) & (1<<4)) << 22); \ + PIOB->PIO_SODR = (((x) & (1<<5)) << 22); \ + PIOC->PIO_SODR = (((x) & (1<<6)) << 18); \ + PIOC->PIO_SODR = (((x) & (1<<7)) << 16); \ + } + +#define read_8() ( ((PIOC->PIO_PDSR & (1<<22)) >> 22)\ + | ((PIOC->PIO_PDSR & (1<<21)) >> 20)\ + | ((PIOC->PIO_PDSR & (1<<29)) >> 27)\ + | ((PIOD->PIO_PDSR & (1<<7)) >> 4)\ + | ((PIOC->PIO_PDSR & (1<<26)) >> 22)\ + | ((PIOB->PIO_PDSR & (1<<27)) >> 22)\ + | ((PIOC->PIO_PDSR & (1<<24)) >> 18)\ + | ((PIOC->PIO_PDSR & (1<<23)) >> 16)\ + ) +#define setWriteDir() { PIOB->PIO_OER = BMASK; PIOC->PIO_OER = CMASK; PIOD->PIO_OER = DMASK; } +#define setReadDir() { \ + PMC->PMC_PCER0 = (1 << ID_PIOB)|(1 << ID_PIOC)|(1 << ID_PIOD);\ + PIOB->PIO_ODR = BMASK; PIOC->PIO_ODR = CMASK; PIOD->PIO_ODR = DMASK;\ + } +#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; } +//#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; WR_IDLE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; RD_ACTIVE; dst = read_8(); RD_IDLE; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + // Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) + +#elif defined(__AVR_ATmega2560__) && defined(USE_BLD_BST_MEGA2560) //regular UNO shield on MEGA2560 using BLD/BST +#warning regular UNO shield on MEGA2560 using BLD/BST +#define RD_PORT PORTF +#define RD_PIN 0 +#define WR_PORT PORTF +#define WR_PIN 1 +#define CD_PORT PORTF +#define CD_PIN 2 +#define CS_PORT PORTF +#define CS_PIN 3 +#define RESET_PORT PORTF +#define RESET_PIN 4 + +#define EMASK 0x38 +#define GMASK 0x20 +#define HMASK 0x78 +static __attribute((always_inline)) void write_8(uint8_t val) +{ + asm volatile("lds __tmp_reg__,0x0102" "\n\t" + "BST %0,0" "\n\t" "BLD __tmp_reg__,5" "\n\t" + "BST %0,1" "\n\t" "BLD __tmp_reg__,6" "\n\t" + "BST %0,6" "\n\t" "BLD __tmp_reg__,3" "\n\t" + "BST %0,7" "\n\t" "BLD __tmp_reg__,4" "\n\t" + "sts 0x0102,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x0E" "\n\t" + "BST %0,2" "\n\t" "BLD __tmp_reg__,4" "\n\t" + "BST %0,3" "\n\t" "BLD __tmp_reg__,5" "\n\t" + "BST %0,5" "\n\t" "BLD __tmp_reg__,3" "\n\t" + "out 0x0E,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x14" "\n\t" + "BST %0,4" "\n\t" "BLD __tmp_reg__,5" "\n\t" + "out 0x14,__tmp_reg__" : : "a" (val)); +} + +#define read_8() ( ((PINH & (3<<5)) >> 5)\ +| ((PINE & (3<<4)) >> 2)\ +| ((PING & (1<<5)) >> 1)\ +| ((PINE & (1<<3)) << 2)\ +| ((PINH & (3<<3)) << 3)\ +) +#define setWriteDir() { DDRH |= HMASK; DDRG |= GMASK; DDRE |= EMASK; } +#define setReadDir() { DDRH &= ~HMASK; DDRG &= ~GMASK; DDRE &= ~EMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { RD_STROBE; dst = read_8(); RD_IDLE; RD_STROBE; dst = (dst<<8) | read_8(); RD_IDLE; } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__AVR_ATmega2560__) && defined(USE_MEGA_16BIT_SHIELD) +#warning USE_MEGA_16BIT_SHIELD +#define USES_16BIT_BUS +#define RD_PORT PORTL +#define RD_PIN 6 //PL6 (D43). Graham has PA15 (D24) on Due Shield +#define WR_PORT PORTG +#define WR_PIN 2 //D39 CTE +#define CD_PORT PORTD +#define CD_PIN 7 //D38 CTE +#define CS_PORT PORTG +#define CS_PIN 1 //D40 CTE +#define RESET_PORT PORTG +#define RESET_PIN 0 //D41 CTE + +#define write_8(x) { PORTC = x; } +#define write_16(x) { PORTA = (x) >> 8; PORTC = x; } + +#define read_16() ( (PINA<<8) | (PINC) ) +#define setWriteDir() { DDRC = 0xFF; DDRA = 0xff; } +#define setReadDir() { DDRC = 0x00; DDRA = 0x00; } +//#define write8(x) { write_8(x); WR_STROBE; } +#define write8(x) { write16((x) & 0xFF); } +#define write16(x) { write_16(x); WR_ACTIVE; WR_STROBE; } +#define READ_16(dst) { RD_STROBE; dst = read_16(); RD_IDLE; } +#define READ_8(dst) { READ_16(dst); dst &= 0x00FF; } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__AVR_ATmega2560__) && defined(USE_MEGA_8BIT_SHIELD) +#warning USE_MEGA_8BIT_SHIELD for vagos21 +#define RD_PORT PORTL +#define RD_PIN 6 //PL6 (D43). Graham has PA15 (D24) on Due Shield +#define WR_PORT PORTG +#define WR_PIN 2 //D39 CTE +#define CD_PORT PORTD +#define CD_PIN 7 //D38 CTE +#define CS_PORT PORTG +#define CS_PIN 1 //D40 CTE +#define RESET_PORT PORTG +#define RESET_PIN 0 //D41 CTE + +#define write_8(x) { PORTA = x;} + +#define read_8() ( PINA ) +#define setWriteDir() { DDRA = 0xFF; } +#define setReadDir() { DDRA = 0x00; } +#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; } // HX8357-D is slower +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { RD_STROBE; dst = read_8(); RD_IDLE; RD_STROBE; dst = (dst<<8) | read_8(); RD_IDLE; } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__AVR_ATmega2560__) && defined(USE_MEGA_8BIT_PORTC_SHIELD) +#warning USE_MEGA_8BIT_PORTC_SHIELD for Mihael54 +#define RD_PORT PORTL +#define RD_PIN 6 //PL6 (D43). Graham has PA15 (D24) on Due Shield +#define WR_PORT PORTG +#define WR_PIN 2 //D39 CTE +#define CD_PORT PORTD +#define CD_PIN 7 //D38 CTE +#define CS_PORT PORTG +#define CS_PIN 1 //D40 CTE +#define RESET_PORT PORTG +#define RESET_PIN 0 //D41 CTE + +#define write_8(x) { PORTC = x;} + +#define read_8() ( PINC ) +#define setWriteDir() { DDRC = 0xFF; } +#define setReadDir() { DDRC = 0x00; } +#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; } // HX8357-D is slower +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { RD_STROBE; dst = read_8(); RD_IDLE; RD_STROBE; dst = (dst<<8) | read_8(); RD_IDLE; } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__AVR_ATmega2560__) && defined(USE_MEGA_8BIT_PROTOSHIELD) +#warning USE_MEGA_8BIT_PROTOSHIELD +#define RD_PORT PORTF +#define RD_PIN 0 +#define WR_PORT PORTF +#define WR_PIN 1 +#define CD_PORT PORTF +#define CD_PIN 2 +#define CS_PORT PORTF +#define CS_PIN 3 +#define RESET_PORT PORTF +#define RESET_PIN 4 + +#define write_8(x) { PORTA = x;} + +#define read_8() ( PINA ) +#define setWriteDir() { DDRA = 0xFF; } +#define setReadDir() { DDRA = 0x00; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { RD_STROBE; dst = read_8(); RD_IDLE; RD_STROBE; dst = (dst<<8) | read_8(); RD_IDLE; } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__AVR_ATmega32U4__) && defined(USE_BLD_BST_MEGA32U4) //regular UNO shield on Leonardo using BST/BLD +#warning regular UNO shield on Leonardo using BST/BLD +#define RD_PORT PORTF +#define RD_PIN 7 +#define WR_PORT PORTF +#define WR_PIN 6 +#define CD_PORT PORTF +#define CD_PIN 5 +#define CS_PORT PORTF +#define CS_PIN 4 +#define RESET_PORT PORTF +#define RESET_PIN 1 + +#define BMASK (3<<4) +#define CMASK (1<<6) +#define DMASK ((1<<7)|(1<<4)|(3<<0)) +#define EMASK (1<<6) +static __attribute((always_inline)) void write_8(uint8_t val) +{ + asm volatile("in __tmp_reg__,0x05" "\n\t" + "BST %0,0" "\n\t" "BLD __tmp_reg__,4" "\n\t" + "BST %0,1" "\n\t" "BLD __tmp_reg__,5" "\n\t" + "out 0x05,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x0B" "\n\t" + "BST %0,2" "\n\t" "BLD __tmp_reg__,1" "\n\t" + "BST %0,3" "\n\t" "BLD __tmp_reg__,0" "\n\t" + "BST %0,4" "\n\t" "BLD __tmp_reg__,4" "\n\t" + "BST %0,6" "\n\t" "BLD __tmp_reg__,7" "\n\t" + "out 0x0B,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x08" "\n\t" + "BST %0,5" "\n\t" "BLD __tmp_reg__,6" "\n\t" + "out 0x08,__tmp_reg__" : : "a" (val)); + asm volatile("in __tmp_reg__,0x0E" "\n\t" + "BST %0,7" "\n\t" "BLD __tmp_reg__,6" "\n\t" + "out 0x0E,__tmp_reg__" : : "a" (val)); +} +#define read_8() ( ((PINB & (3<<4)) >> 4)\ +| ((PIND & (1<<1)) << 1)\ +| ((PIND & (1<<0)) << 3)\ +| ((PIND & (1<<4)) >> 0)\ +| ((PINC & (1<<6)) >> 1)\ +| ((PIND & (1<<7)) >> 1)\ +| ((PINE & (1<<6)) << 1)\ +) +#define setWriteDir() { DDRB |= BMASK; DDRC |= CMASK; DDRD |= DMASK; DDRE |= EMASK; } +#define setReadDir() { DDRB &= ~BMASK; DDRC &= ~CMASK; DDRD &= ~DMASK; DDRE &= ~EMASK; } +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { RD_STROBE; dst = read_8(); RD_IDLE; RD_STROBE; dst = (dst<<8) | read_8(); RD_IDLE; } + +#define PIN_LOW(p, b) (p) &= ~(1<<(b)) +#define PIN_HIGH(p, b) (p) |= (1<<(b)) +#define PIN_OUTPUT(p, b) *(&p-1) |= (1<<(b)) + +#elif defined(__SAM3X8E__) && defined(USE_DUE_8BIT_PROTOSHIELD) //regular UNO shield on DUE +#warning USE_DUE_8BIT_PROTOSHIELD +// configure macros for the control pins + #define RD_PORT PIOA + #define RD_PIN 16 //A0 + #define WR_PORT PIOA + #define WR_PIN 24 //A1 + #define CD_PORT PIOA + #define CD_PIN 23 //A2 + #define CS_PORT PIOA + #define CS_PIN 22 //A3 + #define RESET_PORT PIOA + #define RESET_PIN 6 //A4 +// configure macros for data bus +#define DMASK (0xFF<<0) +#define write_8(x) { PIOD->PIO_CODR = DMASK; PIOD->PIO_SODR = x; } + +#define read_8() ( PIOD->PIO_PDSR & DMASK) + #define setWriteDir() { PIOD->PIO_OER = DMASK; PIOD->PIO_PER = DMASK; } + #define setReadDir() { PMC->PMC_PCER0 = (1 << ID_PIOD); PIOD->PIO_ODR = DMASK;} +#define write8(x) { write_8(x); WR_ACTIVE; WR_STROBE; WR_IDLE; WR_IDLE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; RD_ACTIVE4; dst = read_8(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } +// Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) + +#elif defined(__SAM3X8E__) && defined(USE_DUE_16BIT_SHIELD) //regular CTE shield on DUE +#warning USE_DUE_16BIT_SHIELD +#define USES_16BIT_BUS +// configure macros for the control pins +#define RD_PORT PIOA +#define RD_PIN 15 //D24 Graham +#define WR_PORT PIOD +#define WR_PIN 1 //D26 +#define CD_PORT PIOD +#define CD_PIN 0 //D25 +#define CS_PORT PIOD +#define CS_PIN 2 //D27 +#define RESET_PORT PIOD +#define RESET_PIN 3 //D28 +// configure macros for data bus +// DB0..DB7 on PIOC1..PIOC8, DB8..DB15 on PIOC12..PIOC19 +// +#define CMASKH (0xFF00<<4) +#define CMASKL (0x00FF<<1) +#define CMASK (CMASKH | CMASKL) +#define write_8(x) { PIOC->PIO_CODR = CMASKL; PIOC->PIO_SODR = (((x)&0x00FF)<<1); } +#define write_16(x) { PIOC->PIO_CODR = CMASK; \ + PIOC->PIO_SODR = (((x)&0x00FF)<<1)|(((x)&0xFF00)<<4); } +#define read_16() (((PIOC->PIO_PDSR & CMASKH)>>4)|((PIOC->PIO_PDSR & CMASKL)>>1) ) +#define read_8() (read_16() & 0xFF) +#define setWriteDir() { PIOC->PIO_OER = CMASK; PIOC->PIO_PER = CMASK; } +#define setReadDir() { PMC->PMC_PCER0 = (1 << ID_PIOC); PIOC->PIO_ODR = CMASK; } +#define write8(x) { write16(x & 0xFF); } +#define write16(x) { write_16(x); WR_ACTIVE; WR_STROBE; WR_IDLE; WR_IDLE; } +#define READ_16(dst) { RD_STROBE; RD_ACTIVE4; dst = read_16(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_8(dst) { READ_16(dst); dst &= 0xFF; } + +// Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) + +#elif defined(__SAM3X8E__) && defined(USE_ELECHOUSE_DUE_16BIT_SHIELD) //ELECHOUSE_DUE shield on DUE +#warning USE_ELECHOUSE_DUE_16BIT_SHIELD +#define USES_16BIT_BUS +// configure macros for the control pins +#define RD_PORT PIOA +#define RD_PIN 15 //D24 Graham +#define WR_PORT PIOA +#define WR_PIN 14 //D23 +#define CD_PORT PIOB +#define CD_PIN 26 //D22 +#define CS_PORT PIOA +#define CS_PIN 7 //D31 +#define RESET_PORT PIOC +#define RESET_PIN 1 //D33 +// configure macros for data bus +// DB0..DB7 on PIOC2..PIOC9, DB8..DB15 on PIOC12..PIOC19 +// +#define CMASKH (0xFF00<<4) +#define CMASKL (0x00FF<<2) +#define CMASK (CMASKH | CMASKL) +#define write_8(x) { PIOC->PIO_CODR = CMASKL; PIOC->PIO_SODR = (((x)&0x00FF)<<2); } +#define write_16(x) { PIOC->PIO_CODR = CMASK; \ + PIOC->PIO_SODR = (((x)&0x00FF)<<2)|(((x)&0xFF00)<<4); } +#define read_16() (((PIOC->PIO_PDSR & CMASKH)>>4)|((PIOC->PIO_PDSR & CMASKL)>>2) ) +#define read_8() (read_16() & 0xFF) +#define setWriteDir() { PIOC->PIO_OER = CMASK; PIOC->PIO_PER = CMASK; } +#define setReadDir() { PMC->PMC_PCER0 = (1 << ID_PIOC); PIOC->PIO_ODR = CMASK; } +#define write8(x) { write16(x & 0xFF); } +#define write16(x) { write_16(x); WR_ACTIVE; WR_STROBE; WR_IDLE; WR_IDLE; } +#define READ_16(dst) { RD_STROBE; RD_ACTIVE4; dst = read_16(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_8(dst) { READ_16(dst); dst &= 0xFF; } + +// Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) + +#elif defined(__SAM3X8E__) && defined(USE_MEGA_16BIT_SHIELD) //regular MEGA shield on DUE +#warning USE_MEGA_16BIT_SHIELD +#define USES_16BIT_BUS +// configure macros for the control pins +#define RD_PORT PIOA +#define RD_PIN 20 //D43 +#define WR_PORT PIOC +#define WR_PIN 7 //D39 +#define CD_PORT PIOC +#define CD_PIN 6 //D38 +#define CS_PORT PIOC +#define CS_PIN 8 //D40 +#define RESET_PORT PIOC +#define RESET_PIN 9 //D41 +// configure macros for data bus +// +#define AMASK ((1<<7)|(3<<14)) //PA7, PA14-PA15 +#define BMASK (1<<26) //PB26 +#define CMASK (31<<1) //PC1-PC5 +#define DMASK ((15<<0)|(1<<6)|(3<<9)) //PD0-PD3, PD6, PD9-PD10 + +#define write_16(x) { PIOA->PIO_CODR = AMASK; PIOB->PIO_CODR = BMASK; PIOC->PIO_CODR = CMASK; PIOD->PIO_CODR = DMASK; \ + PIOA->PIO_SODR = (((x)&(1<<6))<<1)|(((x)&(3<<9))<<5); \ + PIOB->PIO_SODR = (((x)&(1<<8))<<18); \ + PIOC->PIO_SODR = (((x)&(1<<0))<<5); \ + PIOC->PIO_SODR = (((x)&(1<<1))<<3); \ + PIOC->PIO_SODR = (((x)&(1<<2))<<1); \ + PIOC->PIO_SODR = (((x)&(1<<3))>>1); \ + PIOC->PIO_SODR = (((x)&(1<<4))>>3); \ + PIOD->PIO_SODR = (((x)&(1<<7))<<2)|(((x)&(1<<5))<<5)|(((x)&(15<<11))>>11)|(((x)&(1<<15))>>9); \ + } + +/* +#define write_16(VL) { PIOA->PIO_CODR = AMASK; PIOC->PIO_CODR = CMASK; PIOD->PIO_CODR = DMASK; \ + REG_PIOA_SODR=((((VL)>>8) & 0x06)<<13) | ((VL & 0x40)<<1);\ + if ((VL)&(1<<8)) REG_PIOB_SODR=(1<<26); else REG_PIOB_CODR=(1<<26);\ + REG_PIOC_SODR=((VL & 0x01)<<5) | ((VL & 0x02)<<3) | ((VL & 0x04)<<1) | ((VL & 0x08)>>1) | ((VL & 0x10)>>3);\ + REG_PIOD_SODR=((((VL)>>8) & 0x78)>>3) | ((((VL)>>8) & 0x80)>>1) | ((VL & 0x20)<<5) | ((VL & 0x80)<<2);\ +} +*/ +#define read_16() ( 0\ + |((PIOC->PIO_PDSR & (1<<5))>>5)\ + |((PIOC->PIO_PDSR & (1<<4))>>3)\ + |((PIOC->PIO_PDSR & (1<<3))>>1)\ + |((PIOC->PIO_PDSR & (1<<2))<<1)\ + |((PIOC->PIO_PDSR & (1<<1))<<3)\ + |((PIOD->PIO_PDSR & (1<<10))>>5)\ + |((PIOA->PIO_PDSR & (1<<7))>>1)\ + |((PIOD->PIO_PDSR & (1<<9))>>2)\ + |((PIOB->PIO_PDSR & (1<<26))>>18)\ + |((PIOA->PIO_PDSR & (3<<14))>>5)\ + |((PIOD->PIO_PDSR & (15<<0))<<11)\ + |((PIOD->PIO_PDSR & (1<<6))<<9)\ + ) +#define read_8() (read_16() & 0xFF) +#define setWriteDir() {\ + PIOA->PIO_OER = AMASK; PIOA->PIO_PER = AMASK; \ + PIOB->PIO_OER = BMASK; PIOB->PIO_PER = BMASK; \ + PIOC->PIO_OER = CMASK; PIOC->PIO_PER = CMASK; \ + PIOD->PIO_OER = DMASK; PIOD->PIO_PER = DMASK; \ + } +#define setReadDir() { \ + PMC->PMC_PCER0 = (1 << ID_PIOA)|(1 << ID_PIOB)|(1 << ID_PIOC)|(1 << ID_PIOD); \ + PIOA->PIO_ODR = AMASK; \ + PIOB->PIO_ODR = BMASK; \ + PIOC->PIO_ODR = CMASK; \ + PIOD->PIO_ODR = DMASK; \ + } +#define write8(x) { write16(x & 0xFF); } +// ILI9486 is slower than ILI9481 +#define write16(x) { write_16(x); WR_ACTIVE8; WR_STROBE; WR_IDLE4;} +#define READ_16(dst) { RD_STROBE; RD_ACTIVE4; dst = read_16(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_8(dst) { READ_16(dst); dst &= 0xFF; } + +// Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) + +#elif defined(__SAM3X8E__) && defined(USE_MEGA_8BIT_SHIELD) //regular CTE shield on DUE +#warning USE_MEGA_8BIT_SHIELD for peloxp +// configure macros for the control pins +#define RD_PORT PIOA +#define RD_PIN 20 //D43 +#define WR_PORT PIOC +#define WR_PIN 7 //D39 +#define CD_PORT PIOC +#define CD_PIN 6 //D38 +#define CS_PORT PIOC +#define CS_PIN 8 //D40 +#define RESET_PORT PIOC +#define RESET_PIN 9 //D41 +// configure macros for data bus +// +#define AMASK ((3<<14)) //PA14-PA15 D23-D24 +#define BMASK (1<<26) //PB26 D22 +#define DMASK ((15<<0)|(1<<6)) //PD0-PD3, PD6 D25-D28,D29 + +#define write_8(x) { PIOA->PIO_CODR = AMASK; PIOB->PIO_CODR = BMASK; PIOD->PIO_CODR = DMASK; \ + PIOB->PIO_SODR = (((x)&(1<<0))<<26); \ + PIOA->PIO_SODR = (((x)&(3<<1))<<13); \ + PIOD->PIO_SODR = (((x)&(15<<3))>>3); \ + PIOD->PIO_SODR = (((x)&(1<<7))>>1); \ + } + +#define read_8() ( 0\ + |((PIOB->PIO_PDSR & (1<<26))>>26)\ + |((PIOA->PIO_PDSR & (3<<14))>>13)\ + |((PIOD->PIO_PDSR & (15<<0))<<3)\ + |((PIOD->PIO_PDSR & (1<<6))<<1)\ + ) + +#define setWriteDir() {\ + PIOA->PIO_OER = AMASK; PIOA->PIO_PER = AMASK; \ + PIOB->PIO_OER = BMASK; PIOB->PIO_PER = BMASK; \ + PIOD->PIO_OER = DMASK; PIOD->PIO_PER = DMASK; \ + } +#define setReadDir() { \ + PMC->PMC_PCER0 = (1 << ID_PIOA)|(1 << ID_PIOB)|(1 << ID_PIOC)|(1 << ID_PIOD); \ + PIOA->PIO_ODR = AMASK; \ + PIOB->PIO_ODR = BMASK; \ + PIOD->PIO_ODR = DMASK; \ + } + +// ILI9486 is slower than ILI9481. HX8357-D is slower +#define write8(x) { write_8(x); WR_ACTIVE4; WR_STROBE; WR_IDLE; WR_IDLE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; RD_ACTIVE4; dst = read_8(); RD_IDLE; RD_IDLE; RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +// Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) + +#elif defined(__MK20DX256__) && defined(USE_BOBCACHELOT_TEENSY) // special for BOBCACHEALOT_TEENSY +#warning special for BOBCACHEALOT_TEENSY +#define RD_PORT GPIOD +#define RD_PIN 1 +#define WR_PORT GPIOC +#define WR_PIN 0 +#define CD_PORT GPIOB +#define CD_PIN 0 +#define CS_PORT GPIOB +#define CS_PIN 1 +#define RESET_PORT GPIOB +#define RESET_PIN 3 + +// configure macros for the data pins +#define CMASK ((1<<3)) +#define DMASK ((1<<0)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)) + + #define write_8(d) { \ + GPIOC_PCOR = CMASK; GPIOD_PCOR = DMASK; \ + GPIOC_PSOR = (((d) & (1<<1)) << 2); \ + GPIOD_PSOR = (d) & DMASK; \ + } + #define read_8() ( (GPIOD_PDIR & DMASK) | (GPIOC_PDIR & (1<<3)) >> 2 ) + #define setWriteDir() {GPIOC_PDDR |= CMASK;GPIOD_PDDR |= DMASK; } + #define setReadDir() {GPIOC_PDDR &= ~CMASK;GPIOD_PDDR &= ~DMASK; } + +#define write8(x) { write_8(x); WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +#define PASTE(x, y) x ## y + +#define PIN_LOW(port, pin) PASTE(port, _PCOR) = (1<<(pin)) +#define PIN_HIGH(port, pin) PASTE(port, _PSOR) = (1<<(pin)) +#define PIN_OUTPUT(port, pin) PASTE(port, _PDDR) |= (1<<(pin)) + +#elif defined(USE_MY_BLUEPILL) && (defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)) +#warning Uno Shield on MY BLUEPILL + +//LCD pins |D7 |D6 |D5 |D4 |D3 |D2 |D1 |D0 | |RD |WR |RS |CS |RST| |SD_SS|SD_DI|SD_DO|SD_SCK| |SDA|SCL| +//STM32 pin |PA3 |PA2 |PA1|PA0|PB7|PB6|PA10|PA9| |PB1|PB0|PA7|PA6|PA5| |PB12 |PB15 |PB14 |PB13 | |PB9|PB8| + +#if defined(ARDUINO_BLUEPILL_F103C8) //regular CMSIS libraries +#define REGS(x) x +#define GPIO_INIT() { RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN | RCC_APB2ENR_IOPDEN | RCC_APB2ENR_AFIOEN; \ + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_1;} +#else //weird Maple libraries +#define REGS(x) regs->x +#endif + +#define WRITE_DELAY { } +#define READ_DELAY { RD_ACTIVE; } +#define GROUP_MODE(port, reg, mask, val) {port->REGS(reg) = (port->REGS(reg) & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) +#define PIN_OUTPUT(port, pin) {\ + if (pin < 8) {GP_OUT(port, CRL, 0xF<<((pin)<<2));} \ + else {GP_OUT(port, CRH, 0xF<<((pin&7)<<2));} \ + } +#define PIN_INPUT(port, pin) { \ + if (pin < 8) { GP_INP(port, CRL, 0xF<<((pin)<<2)); } \ + else { GP_INP(port, CRH, 0xF<<((pin&7)<<2)); } \ + } +#define PIN_HIGH(port, pin) (port)-> REGS(BSRR) = (1<<(pin)) +#define PIN_LOW(port, pin) (port)-> REGS(BSRR) = (1<<((pin)+16)) + +#define RD_PORT GPIOB +#define RD_PIN 1 +#define WR_PORT GPIOB +#define WR_PIN 0 +#define CD_PORT GPIOA +#define CD_PIN 7 +#define CS_PORT GPIOA +#define CS_PIN 6 +#define RESET_PORT GPIOA +#define RESET_PIN 5 + +// configure macros for the data pins +#define AMASK 0x060F +#define BMASK 0x00C0 +#define write_8(d) { GPIOA->REGS(BSRR) = AMASK << 16; GPIOB->REGS(BSRR) = BMASK << 16; \ + GPIOA->REGS(BSRR) = (((d) & 3) << 9) | (((d) & 0xF0) >> 4); \ + GPIOB->REGS(BSRR) = (((d) & 0x0C) << 4); \ + } +#define read_8() (((GPIOA->REGS(IDR) & (3<<9)) >> 9) | ((GPIOA->REGS(IDR) & (0x0F)) << 4) | ((GPIOB->REGS(IDR) & (3<<6)) >> 4)) +// PA10,PA9 PA3-PA0 PB7,PB6 +#define setWriteDir() {GP_OUT(GPIOA, CRH, 0xFF0); GP_OUT(GPIOA, CRL, 0xFFFF); GP_OUT(GPIOB, CRL, 0xFF000000); } +#define setReadDir() {GP_INP(GPIOA, CRH, 0xFF0); GP_INP(GPIOA, CRL, 0xFFFF); GP_INP(GPIOB, CRL, 0xFF000000); } + +#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; } +#define write16(x) { uint8_t h = (x)>>8, l = x; write8(h); write8(l); } +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { uint8_t hi; READ_8(hi); READ_8(dst); dst |= (hi << 8); } + +//####################################### ADIGITALEU_TEENSY ############################ +//UNTESTED +#elif defined(__MK66FX1M0__) && defined(USE_ADIGITALEU_TEENSY) // 16bit on a Teensy 3.6 +#warning "Teensy 3.6 16bit port C & D only (for now)" +// Note: Port usage explained in UTFT Teensy edition ...\libraries\UTFT\hardware\arm\HW_Teensy3.h" + +#define USES_16BIT_BUS + +#define WRITE_DELAY { WR_ACTIVE8; } +#define READ_DELAY { RD_ACTIVE16; } + +#define RD_PORT GPIOA +#define RD_PIN 16 //28 RD +#define WR_PORT GPIOA +#define WR_PIN 5 //25 WR +#define CD_PORT GPIOE +#define CD_PIN 26 //24 RS +#define CS_PORT GPIOA +#define CS_PIN 14 //26 CS +#define RESET_PORT GPIOA +#define RESET_PIN 15 //27 Reset + +#define write_8(d) { GPIOC_PDOR = d; } +#define write_16(d) { GPIOC_PDOR = d; GPIOD_PDOR = (d >> 8);} + +#define read_8() (GPIOC_PDIR) +#define read_16() (GPIOC_PDIR | GPIOD_PDIR << 8) + +#define setWriteDir() {GPIOC_PDDR |= 0xFF; GPIOD_PDDR |= 0xFF; } +#define setReadDir() {GPIOC_PDDR &= ~0xFF; GPIOD_PDDR &= ~0xFF; } + +#define write8(x) {write_8(x); WRITE_DELAY; WR_STROBE } +#define write16(x) {write_16(x); WRITE_DELAY; WR_STROBE } + +#define READ_8(dst) { RD_STROBE; READ_DELAY; dst = read_8(); RD_IDLE; } +#define READ_16(dst) { RD_STROBE; READ_DELAY; dst = read_16(); RD_IDLE;} + +//Data: Teensy pins -> D0-D15 : +// Teensy probably initialises some pins for Analog, Timer, Alternate, ... +// so it is probably wise to use pinMode(n, OUTPUT) for all the control and data lines +#define GPIO_INIT() {pinMode(2, OUTPUT); for (int i = 5; i <= 15; i++) pinMode(i, OUTPUT); for (int i = 20; i <= 28; i++) pinMode(i, OUTPUT);} + +#define PASTE(x, y) x ## y + +#define PIN_LOW(port, pin) PASTE(port, _PCOR) = (1<<(pin)) +#define PIN_HIGH(port, pin) PASTE(port, _PSOR) = (1<<(pin)) +#define PIN_OUTPUT(port, pin) PASTE(port, _PDDR) |= (1<<(pin)) + +#else +#define USE_SPECIAL_FAIL +#endif diff --git a/Arduino/Libraries/MCUFRIEND_kbv/utility/pin_shield_1.h b/Arduino/Libraries/MCUFRIEND_kbv/utility/pin_shield_1.h new file mode 100644 index 0000000..4f45b7f --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/utility/pin_shield_1.h @@ -0,0 +1,1008 @@ +#ifndef PIN_SHIELD_1_H_ +#define PIN_SHIELD_1_H_ + +// just provide macros for the Arduino pins +// i.e. PIN_LOW(), PIN_HIGH(), PIN_OUTPUT(), PIN_INPUT(), PIN_READ() + +#define LPC810 810 +#define LPC812 812 +#define LPC1343 1343 +#define LPC1768 1768 +#define LPC2103 2103 +#define LPC2148 2148 + +#define ISTARGET_NUCLEO64 (0 \ + || defined(TARGET_NUCLEO_F072RB) \ + || defined(TARGET_NUCLEO_F103RB) \ + || defined(TARGET_NUCLEO_F401RE) \ + || defined(TARGET_NUCLEO_F411RE) \ + || defined(TARGET_NUCLEO_F446RE) \ + || defined(TARGET_NUCLEO_L433RC_P) \ + || defined(TARGET_NUCLEO_L476RG) \ + ) + +#define ISTARGET_NUCLEO144 (0 \ + || defined(TARGET_NUCLEO_F767ZI) \ + ) + +//#warning Using pin_SHIELD_1.h + +#if 0 +#elif defined(MY_BLUEPILL) +#define PIN_MODE2(reg, pin, mode) reg=(reg&~(0x3<<((pin)<<1)))|(mode<<((pin)<<1)) + #if defined(__CC_ARM) + #include + #else + #include + #endif + #define D0_PORT GPIOB + #define D0_PIN 11 + #define D1_PORT GPIOB + #define D1_PIN 10 + #define D2_PORT GPIOB + #define D2_PIN 6 + #define D3_PORT GPIOB + #define D3_PIN 7 + #define D4_PORT GPIOA + #define D4_PIN 0 + #define D5_PORT GPIOA + #define D5_PIN 1 + #define D6_PORT GPIOA + #define D6_PIN 2 + #define D7_PORT GPIOA + #define D7_PIN 3 + #define D8_PORT GPIOA + #define D8_PIN 9 + #define D9_PORT GPIOA + #define D9_PIN 10 + #define D10_PORT GPIOB + #define D10_PIN 12 + #define D11_PORT GPIOB + #define D11_PIN 15 + #define D12_PORT GPIOB + #define D12_PIN 14 + #define D13_PORT GPIOB + #define D13_PIN 13 + #define A0_PORT GPIOB + #define A0_PIN 1 + #define A1_PORT GPIOB + #define A1_PIN 0 + #define A2_PORT GPIOA + #define A2_PIN 7 + #define A3_PORT GPIOA + #define A3_PIN 6 + #define A4_PORT GPIOA + #define A4_PIN 5 + #define A5_PORT GPIOB + #define A5_PIN 4 +// Shield Control macros +#define PIN_LOW(port, pin) (port)->BSRR = (1<<((pin)+16)) +#define PIN_HIGH(port, pin) (port)->BSRR = (1<<(pin)) +#define PIN_READ(port, pin) (port)->IDR & (1<<(pin)) +#define PIN_MODE4(reg, pin, mode) reg=(reg&~(0xF<<((pin)<<2)))|(mode<<((pin)<<2)) +#define PIN_OUTPUT(port, pin) {if (pin > 7) PIN_MODE4((port)->CRH, (pin&7), 0x3); else PIN_MODE4((port)->CRL, pin, 0x3); } //50MHz push-pull only 0-7 +#define PIN_INPUT(port, pin) {if (pin > 7) PIN_MODE4((port)->CRH, (pin&7), 0x4); else PIN_MODE4((port)->CRL, pin, 0x4); } //input + + +#elif defined(BLUEPILL) +#define PIN_MODE2(reg, pin, mode) reg=(reg&~(0x3<<((pin)<<1)))|(mode<<((pin)<<1)) + #if defined(__CC_ARM) + #include + #else + #include + #endif + #define D0_PORT GPIOA + #define D0_PIN 10 + #define D1_PORT GPIOA + #define D1_PIN 9 + #define D2_PORT GPIOA + #define D2_PIN 2 + #define D3_PORT GPIOA + #define D3_PIN 3 + #define D4_PORT GPIOA + #define D4_PIN 4 + #define D5_PORT GPIOA + #define D5_PIN 5 + #define D6_PORT GPIOA + #define D6_PIN 6 + #define D7_PORT GPIOA + #define D7_PIN 7 + #define D8_PORT GPIOA + #define D8_PIN 0 + #define D9_PORT GPIOA + #define D9_PIN 1 + #define D10_PORT GPIOA + #define D10_PIN 15 + #define D11_PORT GPIOB + #define D11_PIN 5 + #define D12_PORT GPIOB + #define D12_PIN 4 + #define D13_PORT GPIOB + #define D13_PIN 3 + #define A0_PORT GPIOB +// #define A0_PIN 5 //original pcb uses SPI pin + #define A0_PIN 0 //hardware mod to Adapter to PB0. Allows use of PB5 for SD Card + #define A1_PORT GPIOB + #define A1_PIN 6 + #define A2_PORT GPIOB + #define A2_PIN 7 + #define A3_PORT GPIOB + #define A3_PIN 8 + #define A4_PORT GPIOB + #define A4_PIN 9 + #define A5_PORT GPIOB + #define A5_PIN 10 +// Shield Control macros +#define PIN_LOW(port, pin) (port)->BSRR = (1<<((pin)+16)) +#define PIN_HIGH(port, pin) (port)->BSRR = (1<<(pin)) +#define PIN_READ(port, pin) (port)->IDR & (1<<(pin)) +#define PIN_MODE4(reg, pin, mode) reg=(reg&~(0xF<<((pin)<<2)))|(mode<<((pin)<<2)) +#define PIN_OUTPUT(port, pin) {if (pin > 7) PIN_MODE4((port)->CRH, (pin&7), 0x3); else PIN_MODE4((port)->CRL, pin, 0x3); } //50MHz push-pull only 0-7 +#define PIN_INPUT(port, pin) {if (pin > 7) PIN_MODE4((port)->CRH, (pin&7), 0x4); else PIN_MODE4((port)->CRL, pin, 0x4); } //input + + +#elif defined(ITEADMAPLE) +#define PIN_MODE2(reg, pin, mode) reg=(reg&~(0x3<<((pin)<<1)))|(mode<<((pin)<<1)) + #if defined(__CC_ARM) + #include + #else + #include + #endif + #define D0_PORT GPIOA + #define D0_PIN 3 + #define D1_PORT GPIOA + #define D1_PIN 2 + #define D2_PORT GPIOA + #define D2_PIN 0 + #define D3_PORT GPIOA + #define D3_PIN 1 + #define D4_PORT GPIOB + #define D4_PIN 5 + #define D5_PORT GPIOB + #define D5_PIN 6 + #define D6_PORT GPIOA + #define D6_PIN 8 + #define D7_PORT GPIOA + #define D7_PIN 9 + #define D8_PORT GPIOA + #define D8_PIN 10 + #define D9_PORT GPIOB + #define D9_PIN 7 + #define D10_PORT GPIOA + #define D10_PIN 4 + #define D11_PORT GPIOA + #define D11_PIN 7 + #define D12_PORT GPIOA + #define D12_PIN 6 + #define D13_PORT GPIOA + #define D13_PIN 5 + #define A0_PORT GPIOC + #define A0_PIN 0 + #define A1_PORT GPIOC + #define A1_PIN 1 + #define A2_PORT GPIOC + #define A2_PIN 2 + #define A3_PORT GPIOC + #define A3_PIN 3 + #define A4_PORT GPIOC + #define A4_PIN 4 + #define A5_PORT GPIOC + #define A5_PIN 5 +// Shield Control macros +#define PIN_LOW(port, pin) (port)->BSRR = (1<<((pin)+16)) +#define PIN_HIGH(port, pin) (port)->BSRR = (1<<(pin)) +#define PIN_READ(port, pin) (port)->IDR & (1<<(pin)) +#define PIN_MODE4(reg, pin, mode) reg=(reg&~(0xF<<((pin)<<2)))|(mode<<((pin)<<2)) +#define PIN_OUTPUT(port, pin) {if (pin > 7) PIN_MODE4((port)->CRH, (pin&7), 0x3); else PIN_MODE4((port)->CRL, pin, 0x3); } //50MHz push-pull only 0-7 +#define PIN_INPUT(port, pin) {if (pin > 7) PIN_MODE4((port)->CRH, (pin&7), 0x4); else PIN_MODE4((port)->CRL, pin, 0x4); } //input + + +#elif defined(NUCLEO144) || ISTARGET_NUCLEO144 +#define PIN_MODE2(reg, pin, mode) reg=(reg&~(0x3<<((pin)<<1)))|(mode<<((pin)<<1)) +#if __MBED__ +#warning MBED knows everything +#elif defined(STM32F767xx) + #include +#endif + #define D0_PORT GPIOG + #define D0_PIN 9 + #define D1_PORT GPIOG + #define D1_PIN 14 + #define D2_PORT GPIOF + #define D2_PIN 15 + #define D3_PORT GPIOE + #define D3_PIN 13 + #define D4_PORT GPIOF + #define D4_PIN 14 + #define D5_PORT GPIOE + #define D5_PIN 11 + #define D6_PORT GPIOE + #define D6_PIN 9 + #define D7_PORT GPIOF + #define D7_PIN 13 + #define D8_PORT GPIOF + #define D8_PIN 12 + #define D9_PORT GPIOD + #define D9_PIN 15 + #define D10_PORT GPIOD + #define D10_PIN 14 + #define D11_PORT GPIOA + #define D11_PIN 7 + #define D12_PORT GPIOA + #define D12_PIN 6 + #define D13_PORT GPIOA + #define D13_PIN 5 + #define A0_PORT GPIOA + #define A0_PIN 3 + #define A1_PORT GPIOC + #define A1_PIN 0 + #define A2_PORT GPIOC + #define A2_PIN 3 + #define A3_PORT GPIOF + #define A3_PIN 3 + #define A4_PORT GPIOF + #define A4_PIN 5 + #define A5_PORT GPIOF + #define A5_PIN 10 +// Shield Control macros +#define PIN_LOW(port, pin) (port)->BSRR = (1<<((pin)+16)) +#define PIN_HIGH(port, pin) (port)->BSRR = (1<<(pin)) +//#define PIN_LOW(port, pin) (port)->ODR &= ~(1<<(pin)) +//#define PIN_HIGH(port, pin) (port)->ODR |= (1<<(pin)) +#define PIN_READ(port, pin) (port)->IDR & (1<<(pin)) +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) +#define PIN_INPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x0) //.kbv check this + +#elif defined(NUCLEO) || ISTARGET_NUCLEO64 +#define PIN_MODE2(reg, pin, mode) reg=(reg&~(0x3<<((pin)<<1)))|(mode<<((pin)<<1)) +#if __MBED__ +#warning MBED knows everything +#elif defined(STM32F072xB) + #include +#elif defined(STM32F103xB) + #if defined(__CC_ARM) + #include + #else + #include + #endif +#elif defined(STM32L476xx) || defined(STM32L433xx) + #include +#elif defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) + #include +#endif + #define D0_PORT GPIOA + #define D0_PIN 3 + #define D1_PORT GPIOA + #define D1_PIN 2 + #define D2_PORT GPIOA + #define D2_PIN 10 + #define D3_PORT GPIOB + #define D3_PIN 3 + #define D4_PORT GPIOB + #define D4_PIN 5 + #define D5_PORT GPIOB + #define D5_PIN 4 + #define D6_PORT GPIOB + #define D6_PIN 10 + #define D7_PORT GPIOA + #define D7_PIN 8 + #define D8_PORT GPIOA + #define D8_PIN 9 + #define D9_PORT GPIOC + #define D9_PIN 7 + #define D10_PORT GPIOB + #define D10_PIN 6 + #define D11_PORT GPIOA + #define D11_PIN 7 + #define D12_PORT GPIOA + #define D12_PIN 6 + #define D13_PORT GPIOA + #define D13_PIN 5 + #define A0_PORT GPIOA + #define A0_PIN 0 + #define A1_PORT GPIOA + #define A1_PIN 1 + #define A2_PORT GPIOA + #define A2_PIN 4 + #define A3_PORT GPIOB + #define A3_PIN 0 + #define A4_PORT GPIOC + #define A4_PIN 1 + #define A5_PORT GPIOC + #define A5_PIN 0 +// Shield Control macros +#define PIN_LOW(port, pin) (port)->BSRR = (1<<((pin)+16)) +#define PIN_HIGH(port, pin) (port)->BSRR = (1<<(pin)) +//#define PIN_LOW(port, pin) (port)->ODR &= ~(1<<(pin)) +//#define PIN_HIGH(port, pin) (port)->ODR |= (1<<(pin)) +#define PIN_READ(port, pin) (port)->IDR & (1<<(pin)) +#if defined(STM32F103xB) + #warning STM32F103xB ****************************** +#define PIN_MODE4(reg, pin, mode) reg=(reg&~(0xF<<((pin)<<2)))|(mode<<((pin)<<2)) +#define PIN_OUTPUT(port, pin) PIN_MODE4((port)->CRL, pin, 0x3) //50MHz push-pull only 0-7 +#define PIN_INPUT(port, pin) PIN_MODE4((port)->CRL, pin, 0x4) //digital input +#else +#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) +#define PIN_INPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x0) //.kbv check this +#endif + +#elif __TARGET_PROCESSOR == LPC1768 + #include +// configure macros for the control pins + #define D0_PORT LPC_GPIO0 + #define D0_PIN 3 + #define D1_PORT LPC_GPIO0 + #define D1_PIN 2 + #define D2_PORT LPC_GPIO0 + #define D2_PIN 24 //p16 + #define D3_PORT LPC_GPIO0 + #define D3_PIN 23 //p15 + #define D4_PORT LPC_GPIO0 + #define D4_PIN 16 //p14 + #define D5_PORT LPC_GPIO0 + #define D5_PIN 15 //p13 + #define D6_PORT LPC_GPIO0 + #define D6_PIN 17 //p12 + #define D7_PORT LPC_GPIO0 + #define D7_PIN 18 //p11 + #define D8_PORT LPC_GPIO0 + #define D8_PIN 1 //p10 + #define D9_PORT LPC_GPIO0 + #define D9_PIN 0 //p9 + #define D10_PORT LPC_GPIO0 + #define D10_PIN 6 //p8 + #define D11_PORT LPC_GPIO0 + #define D11_PIN 9 //p5 + #define D12_PORT LPC_GPIO0 + #define D12_PIN 8 //p6 miso + #define D13_PORT LPC_GPIO0 + #define D13_PIN 7 //p7 + #define A0_PORT LPC_GPIO0 + #define A0_PIN 25 //p17 + #define A1_PORT LPC_GPIO0 + #define A1_PIN 26 //p18 + #define A2_PORT LPC_GPIO1 + #define A2_PIN 30 //p19 + #define A3_PORT LPC_GPIO1 + #define A3_PIN 31 //p20 + #define A4_PORT LPC_GPIO0 + #define A4_PIN 10 //p28 + #define A5_PORT LPC_GP100 + #define A5_PIN 11 //p27 +// Shield Control macros +#define PIN_LOW(port, pin) (port)->FIOCLR = (1u<<(pin)) +#define PIN_HIGH(port, pin) (port)->FIOSET = (1u<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->FIODIR |= (1u<<(pin)) +#define PIN_INPUT(port, pin) (port)->FIODIR &= ~(1u<<(pin)) +#define PIN_READ(port, pin) (port)->FIOPIN & (1u<<(pin)) + +#elif (defined(MK20D7) && defined(TEENSY)) || defined(TARGET_TEENSY3_1) +#if __MBED__ +#warning MBED knows everything +#else + #include +#endif + #define D0_PORT PTB + #define D0_PIN 16 + #define D1_PORT PTB + #define D1_PIN 17 + #define D2_PORT PTD + #define D2_PIN 0 + #define D3_PORT PTA + #define D3_PIN 12 + #define D4_PORT PTA + #define D4_PIN 13 + #define D5_PORT PTD + #define D5_PIN 7 + #define D6_PORT PTD + #define D6_PIN 4 + #define D7_PORT PTD + #define D7_PIN 2 + #define D8_PORT PTD + #define D8_PIN 3 + #define D9_PORT PTC + #define D9_PIN 3 + #define D10_PORT PTC + #define D10_PIN 4 + #define D11_PORT PTC + #define D11_PIN 6 + #define D12_PORT PTC + #define D12_PIN 7 + #define D13_PORT PTC + #define D13_PIN 5 + #define A0_PORT PTD + #define A0_PIN 1 + #define A1_PORT PTC + #define A1_PIN 0 + #define A2_PORT PTB + #define A2_PIN 0 + #define A3_PORT PTB + #define A3_PIN 1 + #define A4_PORT PTB + #define A4_PIN 3 + #define A5_PORT PTB + #define A5_PIN 2 +// Shield Control macros. Deliberately avoid the IOSET registers +#define PIN_LOW(port, pin) (port)->PCOR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PSOR = (1<<(pin)) +//#define PIN_LOW(port, pin) (port)->PDOR &= ~(1<<(pin)) +//#define PIN_HIGH(port, pin) (port)->PDOR |= (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PDDR |= (1<<(pin)) +#define PIN_INPUT(port, pin) (port)->PDDR &= ~(1u<<(pin)) +#define PIN_READ(port, pin) (port)->PDIR & (1u<<(pin)) + + +#elif defined(MKL25Z4) || defined(TARGET_KL25Z) + #include + #define D0_PORT PTA + #define D0_PIN 1 + #define D1_PORT PTA + #define D1_PIN 2 + #define D2_PORT PTD + #define D2_PIN 4 + #define D3_PORT PTA + #define D3_PIN 12 + #define D4_PORT PTA + #define D4_PIN 4 + #define D5_PORT PTA + #define D5_PIN 5 + #define D6_PORT PTC + #define D6_PIN 8 + #define D7_PORT PTC + #define D7_PIN 9 + #define D8_PORT PTA + #define D8_PIN 13 + #define D9_PORT PTD + #define D9_PIN 5 + #define D10_PORT PTD + #define D10_PIN 0 + #define D11_PORT PTD + #define D11_PIN 2 + #define D12_PORT PTD + #define D12_PIN 3 + #define D13_PORT PTD + #define D13_PIN 1 + #define A0_PORT PTB + #define A0_PIN 0 + #define A1_PORT PTB + #define A1_PIN 1 + #define A2_PORT PTB + #define A2_PIN 2 + #define A3_PORT PTB + #define A3_PIN 3 + #define A4_PORT PTC + #define A4_PIN 2 + #define A5_PORT PTC + #define A5_PIN 1 +// Shield Control macros. Deliberately avoid the IOSET registers +#define PIN_LOW(port, pin) (port)->PCOR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PSOR = (1<<(pin)) +//#define PIN_LOW(port, pin) (port)->PDOR &= ~(1<<(pin)) +//#define PIN_HIGH(port, pin) (port)->PDOR |= (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PDDR |= (1<<(pin)) +#define PIN_INPUT(port, pin) (port)->PDDR &= ~(1u<<(pin)) +#define PIN_READ(port, pin) (port)->PDIR & (1u<<(pin)) + +#elif defined(MKL26Z4) + #include + #define D0_PORT PTA + #define D0_PIN 1 + #define D1_PORT PTA + #define D1_PIN 2 + #define D2_PORT PTD + #define D2_PIN 3 //PTD4 on KL25 + #define D3_PORT PTA + #define D3_PIN 12 + #define D4_PORT PTA + #define D4_PIN 4 + #define D5_PORT PTA + #define D5_PIN 5 + #define D6_PORT PTC + #define D6_PIN 8 + #define D7_PORT PTC + #define D7_PIN 9 + #define D8_PORT PTA + #define D8_PIN 13 + #define D9_PORT PTD + #define D9_PIN 2 //PTD5 on KL25 + #define D10_PORT PTD + #define D10_PIN 4 //PTD0 + #define D11_PORT PTD + #define D11_PIN 6 //PTD2 + #define D12_PORT PTD + #define D12_PIN 7 //PTD3 + #define D13_PORT PTD + #define D13_PIN 5 //PTD1 + #define A0_PORT PTB + #define A0_PIN 0 + #define A1_PORT PTB + #define A1_PIN 1 + #define A2_PORT PTB + #define A2_PIN 2 + #define A3_PORT PTB + #define A3_PIN 3 + #define A4_PORT PTC + #define A4_PIN 2 + #define A5_PORT PTC + #define A5_PIN 1 +// Shield Control macros. Deliberately avoid the IOSET registers +#define PIN_LOW(port, pin) (port)->PCOR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PSOR = (1<<(pin)) +//#define PIN_LOW(port, pin) (port)->PDOR &= ~(1<<(pin)) +//#define PIN_HIGH(port, pin) (port)->PDOR |= (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PDDR |= (1<<(pin)) +#define PIN_INPUT(port, pin) (port)->PDDR &= ~(1u<<(pin)) +#define PIN_READ(port, pin) (port)->PDIR & (1u<<(pin)) + +#elif defined(MKL05Z4) || defined(TARGET_KL05Z) + #include + #define D0_PORT PTB + #define D0_PIN 2 + #define D1_PORT PTB + #define D1_PIN 1 + #define D2_PORT PTA + #define D2_PIN 11 + #define D3_PORT PTB + #define D3_PIN 5 + #define D4_PORT PTA + #define D4_PIN 10 + #define D5_PORT PTA + #define D5_PIN 12 + #define D6_PORT PTB + #define D6_PIN 6 + #define D7_PORT PTB + #define D7_PIN 7 + #define D8_PORT PTB + #define D8_PIN 13 + #define D9_PORT PTB + #define D9_PIN 5 + #define D10_PORT PTA + #define D10_PIN 0 + #define D11_PORT PTA + #define D11_PIN 2 + #define D12_PORT PTA + #define D12_PIN 3 + #define D13_PORT PTB + #define D13_PIN 1 + #define A0_PORT PTB + #define A0_PIN 8 + #define A1_PORT PTB + #define A1_PIN 9 + #define A2_PORT PTA + #define A2_PIN 8 + #define A3_PORT PTA + #define A3_PIN 0 + #define A4_PORT PTA + #define A4_PIN 9 + #define A5_PORT PTB + #define A5_PIN 13 +// Shield Control macros +//#define PIN_LOW(port, pin) (port)->PCOR = (1<<(pin)) +//#define PIN_HIGH(port, pin) (port)->PSOR = (1<<(pin)) +#define PIN_LOW(port, pin) (port)->PDOR &= ~(1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PDOR |= (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PDDR |= (1<<(pin)) +#define PIN_INPUT(port, pin) (port)->PDDR &= ~(1u<<(pin)) +#define PIN_READ(port, pin) (port)->PDIR & (1u<<(pin)) + +#elif defined(MK20D5) || defined(TARGET_K20D50M) + #include + #define D0_PORT PTE + #define D0_PIN 1 + #define D1_PORT PTE + #define D1_PIN 0 + #define D2_PORT PTA + #define D2_PIN 5 + #define D3_PORT PTD + #define D3_PIN 4 + #define D4_PORT PTC + #define D4_PIN 8 + #define D5_PORT PTA + #define D5_PIN 1 + #define D6_PORT PTC + #define D6_PIN 3 + #define D7_PORT PTC + #define D7_PIN 4 + #define D8_PORT PTA + #define D8_PIN 12 + #define D9_PORT PTA + #define D9_PIN 2 + #define D10_PORT PTC + #define D10_PIN 2 + #define D11_PORT PTD + #define D11_PIN 2 + #define D12_PORT PTD + #define D12_PIN 3 + #define D13_PORT PTD + #define D13_PIN 1 + #define A0_PORT PTC + #define A0_PIN 0 + #define A1_PORT PTC + #define A1_PIN 1 + #define A2_PORT PTD + #define A2_PIN 6 + #define A3_PORT PTD + #define A3_PIN 5 + #define A4_PORT PTB + #define A4_PIN 1 + #define A5_PORT PTB + #define A5_PIN 0 +// Shield Control macros. Deliberately avoid the IOSET registers +#define PIN_LOW(port, pin) (port)->PCOR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PSOR = (1<<(pin)) +//#define PIN_LOW(port, pin) (port)->PDOR &= ~(1<<(pin)) +//#define PIN_HIGH(port, pin) (port)->PDOR |= (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PDDR |= (1<<(pin)) +#define PIN_INPUT(port, pin) (port)->PDDR &= ~(1u<<(pin)) +#define PIN_READ(port, pin) (port)->PDIR & (1u<<(pin)) + + +#elif defined(ZERO) + #include +// configure macros for the data pins +#if defined(D21_XPRO) + #define D0_PORT PORT->Group[1] + #define D0_PIN 9 + #define D1_PORT PORT->Group[1] + #define D1_PIN 8 + #define D2_PORT PORT->Group[1] + #define D2_PIN 14 + #define D3_PORT PORT->Group[1] + #define D3_PIN 2 + #define D4_PORT PORT->Group[1] + #define D4_PIN 5 + #define D5_PORT PORT->Group[0] + #define D5_PIN 21 + #define D6_PORT PORT->Group[1] + #define D6_PIN 15 + #define D7_PORT PORT->Group[0] + #define D7_PIN 17 + #define D8_PORT PORT->Group[1] + #define D8_PIN 6 + #define D9_PORT PORT->Group[1] + #define D9_PIN 7 + #define D10_PORT PORT->Group[0] + #define D10_PIN 5 + #define D11_PORT PORT->Group[0] + #define D11_PIN 6 + #define D12_PORT PORT->Group[0] + #define D12_PIN 4 + #define D13_PORT PORT->Group[0] + #define D13_PIN 7 + #define A0_PORT PORT->Group[1] + #define A0_PIN 0 + #define A1_PORT PORT->Group[1] + #define A1_PIN 1 + #define A2_PORT PORT->Group[0] + #define A2_PIN 10 + #define A3_PORT PORT->Group[0] + #define A3_PIN 11 + #define A4_PORT PORT->Group[0] + #define A4_PIN 8 + #define A5_PORT PORT->Group[0] + #define A5_PIN 9 +#elif defined(M0_PRO) + #define D0_PORT PORT->Group[0] + #define D0_PIN 11 + #define D1_PORT PORT->Group[0] + #define D1_PIN 10 + //M0 and Zero physical PA08 and PA14 are swapped + #define D2_PORT PORT->Group[0] //PA08 (Zero-D4) + #define D2_PIN 8 + #define D3_PORT PORT->Group[0] + #define D3_PIN 9 + #define D4_PORT PORT->Group[0] //PA14 (Zero-D2) + #define D4_PIN 14 + #define D5_PORT PORT->Group[0] + #define D5_PIN 15 + #define D6_PORT PORT->Group[0] + #define D6_PIN 20 + #define D7_PORT PORT->Group[0] + #define D7_PIN 21 + #define D8_PORT PORT->Group[0] + #define D8_PIN 6 + #define D9_PORT PORT->Group[0] + #define D9_PIN 7 + #define D10_PORT PORT->Group[0] + #define D10_PIN 18 + #define D11_PORT PORT->Group[0] + #define D11_PIN 16 + #define D12_PORT PORT->Group[0] + #define D12_PIN 19 + #define D13_PORT PORT->Group[0] + #define D13_PIN 17 + //M0 and Zero Arduino digital pin numbering is DIFFERENT + #define D16_PORT PORT->Group[0] //PA22 (SDA) (Zero-D20) + #define D16_PIN 22 + #define D17_PORT PORT->Group[0] //PA23 (SCL) (Zero-D21) + #define D17_PIN 23 + #define D18_PORT PORT->Group[0] //PA12 (MISO) (Zero-D22) + #define D18_PIN 12 + #define D20_PORT PORT->Group[1] //PB11 (SCK) (Zero-D24) + #define D20_PIN 11 + #define D21_PORT PORT->Group[1] //PB10 (MOSI) (Zero-D23) + #define D21_PIN 10 + #define A0_PORT PORT->Group[0] //PA02(M0-D24) (Zero-D14) + #define A0_PIN 2 + #define A1_PORT PORT->Group[1] //PB08 + #define A1_PIN 8 + #define A2_PORT PORT->Group[1] //PB09 + #define A2_PIN 9 + #define A3_PORT PORT->Group[0] //PA04 + #define A3_PIN 4 + #define A4_PORT PORT->Group[0] //PA05 + #define A4_PIN 5 + #define A5_PORT PORT->Group[1] //PB02 + #define A5_PIN 2 + +#endif +// Shield Control macros. +#define PIN_LOW(port, pin) (port).OUTCLR.reg = (1<<(pin)) +#define PIN_HIGH(port, pin) (port).OUTSET.reg = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port).DIR.reg |= (1<<(pin)) +#define PIN_INPUT(port, pin) (port).DIR.reg &= ~(1u<<(pin)) +#define PIN_READ(port, pin) (port).IN.reg & (1u<<(pin)) + + +//####################################### DUE ############################ +#elif defined(__SAM3X8E__) + #include + #define D0_PORT PIOA + #define D0_PIN 8 + #define D1_PORT PIOA + #define D1_PIN 9 + #define D2_PORT PIOB + #define D2_PIN 25 + #define D3_PORT PIOC + #define D3_PIN 28 + #define D4_PORT PIOC //also PA29 + #define D4_PIN 26 + #define D5_PORT PIOC + #define D5_PIN 25 + #define D6_PORT PIOC + #define D6_PIN 24 + #define D7_PORT PIOC + #define D7_PIN 23 + #define D8_PORT PIOC + #define D8_PIN 22 + #define D9_PORT PIOC + #define D9_PIN 21 + #define D10_PORT PIOC //also PA28 + #define D10_PIN 29 + #define D11_PORT PIOD + #define D11_PIN 7 + #define D12_PORT PIOD + #define D12_PIN 8 + #define D13_PORT PIOB + #define D13_PIN 27 + #define A0_PORT PIOA + #define A0_PIN 16 + #define A1_PORT PIOA + #define A1_PIN 24 + #define A2_PORT PIOA + #define A2_PIN 23 + #define A3_PORT PIOA + #define A3_PIN 22 + #define A4_PORT PIOA + #define A4_PIN 6 + #define A5_PORT PIOA + #define A5_PIN 4 +// Shield Control macros. +#define PIN_LOW(port, pin) (port)->PIO_CODR = (1<<(pin)) +#define PIN_HIGH(port, pin) (port)->PIO_SODR = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port)->PIO_OER = (1<<(pin)) +#define PIN_INPUT(port, pin) (port)->PIO_ODR &= ~(1u<<(pin)) +#define PIN_READ(port, pin) (port)->PIO_PDSR & (1u<<(pin)) + + +#elif defined(__AVR_ATxmegaA4U__) + #include + // PD6, PD7 is used for USB. I could have used PORTA for bus, PORTC for MSPI, SPI and remap + #define D0_PORT PORTE + #define D0_PIN 2 + #define D1_PORT PORTE + #define D1_PIN 3 + #define D2_PORT PORTC + #define D2_PIN 2 + #define D3_PORT PORTC + #define D3_PIN 3 + #define D4_PORT PORTC + #define D4_PIN 4 + #define D5_PORT PORTC + #define D5_PIN 5 + #define D6_PORT PORTC + #define D6_PIN 6 + #define D7_PORT PORTC + #define D7_PIN 7 + #define D8_PORT PORTC + #define D8_PIN 0 + #define D9_PORT PORTC + #define D9_PIN 1 + #define D10_PORT PORTD + #define D10_PIN 0 + #define D11_PORT PORTD + #define D11_PIN 3 + #define D12_PORT PORTD + #define D12_PIN 2 + #define D13_PORT PORTD + #define D13_PIN 1 + #define A0_PORT PORTB + #define A0_PIN 0 + #define A1_PORT PORTB + #define A1_PIN 1 + #define A2_PORT PORTB + #define A2_PIN 2 + #define A3_PORT PORTB + #define A3_PIN 3 + #define A4_PORT PORTE + #define A4_PIN 0 + #define A5_PORT PORTE + #define A5_PIN 1 +// Shield Control macros. +#define PIN_LOW(port, pin) (port).OUTCLR.reg = (1<<(pin)) +#define PIN_HIGH(port, pin) (port).OUTSET.reg = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port).DIR.reg |= (1<<(pin)) +#define PIN_INPUT(port, pin) (port).DIR.reg &= ~(1u<<(pin)) +#define PIN_READ(port, pin) (port).IN.reg & (1u<<(pin)) + + +#elif defined(__AVR_ATmega4809__) && defined(ARDUINO_AVR_NANO_EVERY) //NANO-EVERY +#warning using NANO-EVERY + #include + #define D0_PORT PORTC + #define D0_PIN 5 + #define D1_PORT PORTC + #define D1_PIN 4 + #define D2_PORT PORTA + #define D2_PIN 0 + #define D3_PORT PORTF + #define D3_PIN 5 + #define D4_PORT PORTC + #define D4_PIN 6 + #define D5_PORT PORTB + #define D5_PIN 2 + #define D6_PORT PORTF + #define D6_PIN 4 + #define D7_PORT PORTA + #define D7_PIN 1 + #define D8_PORT PORTE + #define D8_PIN 3 + #define D9_PORT PORTB + #define D9_PIN 0 + #define D10_PORT PORTB //PB1 + #define D10_PIN 1 + #define D11_PORT PORTE + #define D11_PIN 0 + #define D12_PORT PORTE + #define D12_PIN 1 + #define D13_PORT PORTE + #define D13_PIN 2 + #define A0_PORT PORTD + #define A0_PIN 3 + #define A1_PORT PORTD + #define A1_PIN 2 + #define A2_PORT PORTD + #define A2_PIN 1 + #define A3_PORT PORTD + #define A3_PIN 0 + #define A4_PORT PORTF + #define A4_PIN 2 + #define A5_PORT PORTF + #define A5_PIN 3 + #define A6_PORT PORTD + #define A6_PIN 5 + #define A7_PORT PORTD + #define A7_PIN 4 +// Shield Control macros. +#define PIN_LOW(port, pin) (port).OUTCLR.reg = (1<<(pin)) +#define PIN_HIGH(port, pin) (port).OUTSET.reg = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port).DIR.reg |= (1<<(pin)) +#define PIN_INPUT(port, pin) (port).DIR.reg &= ~(1u<<(pin)) +#define PIN_READ(port, pin) (port).IN.reg & (1u<<(pin)) + + +#elif defined(__AVR_ATmega4809__) //XPRO_4809 with XPRO_SHIELD_ADAPTER +#warning using XPRO_4809 with XPRO_SHIELD_ADAPTER + #include + #define D0_PORT PORTA + #define D0_PIN 1 + #define D1_PORT PORTA + #define D1_PIN 0 + #define D2_PORT PORTB + #define D2_PIN 2 + #define D3_PORT PORTC + #define D3_PIN 6 + #define D4_PORT PORTC + #define D4_PIN 7 + #define D5_PORT PORTF + #define D5_PIN 6 + #define D6_PORT PORTB + #define D6_PIN 3 + #define D7_PORT PORTE + #define D7_PIN 1 + #define D8_PORT PORTA + #define D8_PIN 2 + #define D9_PORT PORTA + #define D9_PIN 3 + #define D10_PORT PORTA + #define D10_PIN 7 + #define D11_PORT PORTA //PC5 + #define D11_PIN 4 + #define D12_PORT PORTA + #define D12_PIN 5 + #define D13_PORT PORTA + #define D13_PIN 6 + #define A0_PORT PORTD + #define A0_PIN 2 + #define A1_PORT PORTD + #define A1_PIN 3 + #define A2_PORT PORTD + #define A2_PIN 4 + #define A3_PORT PORTD + #define A3_PIN 5 + #define A4_PORT PORTC + #define A4_PIN 2 + #define A5_PORT PORTC + #define A5_PIN 3 +// Shield Control macros. +#define PIN_LOW(port, pin) (port).OUTCLR.reg = (1<<(pin)) +#define PIN_HIGH(port, pin) (port).OUTSET.reg = (1<<(pin)) +#define PIN_OUTPUT(port, pin) (port).DIR.reg |= (1<<(pin)) +#define PIN_INPUT(port, pin) (port).DIR.reg &= ~(1u<<(pin)) +#define PIN_READ(port, pin) (port).IN.reg & (1u<<(pin)) + + +#elif defined(__AVR_ATtiny1634__) + #include + // + #define D0_PORT PORTA //PA7 + #define D0_PIN 7 + #define D1_PORT PORTB //PB0 + #define D1_PIN 0 + #define D2_PORT PORTC //PC2 + #define D2_PIN 2 + #define D3_PORT PORTA //PA3 + #define D3_PIN 3 + #define D4_PORT PORTA //PA4 + #define D4_PIN 4 + #define D5_PORT PORTC //PC4 + #define D5_PIN 4 + #define D6_PORT PORTA //PA1 + #define D6_PIN 1 + #define D7_PORT PORTA //PA0 + #define D7_PIN 0 + #define D8_PORT PORTA //PA2 + #define D8_PIN 2 + #define D9_PORT PORTC //PC5 + #define D9_PIN 5 + #define D10_PORT PORTA //PA6 + #define D10_PIN 6 + #define D11_PORT PORTB //PB2 + #define D11_PIN 2 + #define D12_PORT PORTB //PB1 + #define D12_PIN 1 + #define D13_PORT PORTC //PC1 + #define D13_PIN 1 + #define A0_PORT PORTB //PB3 + #define A0_PIN 3 + #define A1_PORT PORTC //PC0 + #define A1_PIN 0 + #define A2_PORT PORTA //PA5 + #define A2_PIN 5 + #define A3_PORT PORTB //PB2 + #define A3_PIN 2 + #define A4_PORT PORTB //PB1 + #define A4_PIN 1 + #define A5_PORT PORTC //PC1 + #define A5_PIN 1 +#else +#error MCU unselected +#endif // MCUs + +#endif //PIN_SHIELD_1_H +#if 0 +#if defined(M0_PRO) +#endif +#if defined(D21_XPRO) +#endif +#endif diff --git a/Arduino/Libraries/MCUFRIEND_kbv/utility/pin_shield_8.h b/Arduino/Libraries/MCUFRIEND_kbv/utility/pin_shield_8.h new file mode 100644 index 0000000..8680341 --- /dev/null +++ b/Arduino/Libraries/MCUFRIEND_kbv/utility/pin_shield_8.h @@ -0,0 +1,474 @@ +#ifndef PIN_SHIELD_8_H_ +#define PIN_SHIELD_8_H_ + +// just provide macros for the 8-bit data bus +// i.e. write_8(), read_8(), setWriteDir(), setReadDir() + + +#define LPC810 810 +#define LPC812 812 +#define LPC1343 1343 +#define LPC1768 1768 +#define LPC2103 2103 +#define LPC2148 2148 + +#define ISTARGET_NUCLEO64 (0 \ + || defined(TARGET_NUCLEO_F072RB) \ + || defined(TARGET_NUCLEO_F103RB) \ + || defined(TARGET_NUCLEO_F401RE) \ + || defined(TARGET_NUCLEO_F411RE) \ + || defined(TARGET_NUCLEO_F446RE) \ + || defined(TARGET_NUCLEO_L433RC_P) \ + || defined(TARGET_NUCLEO_L476RG) \ + ) + +#define ISTARGET_NUCLEO144 (0 \ + || defined(TARGET_NUCLEO_F767ZI) \ + ) + +//#warning Using pin_SHIELD_8.h + +#if 0 + +#elif defined(MY_BLUEPILL) // Uno Shield on BLUEPILL_ADAPTER +#warning Uno Shield on MY_BLUEPILL_ADAPTER + +// configure macros for the data pins +#define AMASK 0x060F +#define BMASK 0x00C0 +#define write_8(d) { GPIOA->BSRR = AMASK << 16; GPIOB->BSRR = BMASK << 16; \ + GPIOA->BSRR = (((d) & 3) << 9) | (((d) & 0xF0) >> 4); \ + GPIOB->BSRR = (((d) & 0x0C) << 4); \ + } +#define read_8() (((GPIOA->IDR & (3<<9)) >> 9) | ((GPIOA->IDR & (0x0F)) << 4) | ((GPIOB->IDR & (3<<6)) >> 4)) + +#define GROUP_MODE(port, reg, mask, val) {port->reg = (port->reg & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) +// PA10,PA9 PA3-PA0 PB7,PB6 +#define setWriteDir() {GP_OUT(GPIOA, CRH, 0xFF0); GP_OUT(GPIOA, CRL, 0xFFFF); GP_OUT(GPIOB, CRL, 0xFF000000); } +#define setReadDir() {GP_INP(GPIOA, CRH, 0xFF0); GP_INP(GPIOA, CRL, 0xFFFF); GP_INP(GPIOB, CRL, 0xFF000000); } + +#elif defined(BLUEPILL) // Uno Shield on BLUEPILL_ADAPTER +#warning Uno Shield on BLUEPILL_ADAPTER + +// configure macros for the data pins +#define write_8(d) { GPIOA->BSRR = 0x00FF << 16; GPIOA->BSRR = (d) & 0xFF; } +#define read_8() (GPIOA->IDR & 0xFF) + +#define GROUP_MODE(port, reg, mask, val) {port->reg = (port->reg & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) +// PA7 ..PA0 +#define setWriteDir() {GP_OUT(GPIOA, CRL, 0xFFFFFFFF); } +#define setReadDir() {GP_INP(GPIOA, CRL, 0xFFFFFFFF); } + +#elif defined(ITEADMAPLE) // Uno Shield on MAPLE_REV3 board +#warning Uno Shield on MAPLE_REV3 board + +#define REGS(x) x +#define GROUP_MODE(port, reg, mask, val) {port->REGS(reg) = (port->REGS(reg) & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) + + // configure macros for the data pins +#define write_8(d) { \ + GPIOA->REGS(BSRR) = 0x0703 << 16; \ + GPIOB->REGS(BSRR) = 0x00E0 << 16; \ + GPIOA->REGS(BSRR) = ( ((d) & (1<<0)) << 10) \ + | (((d) & (1<<2)) >> 2) \ + | (((d) & (1<<3)) >> 2) \ + | (((d) & (1<<6)) << 2) \ + | (((d) & (1<<7)) << 2); \ + GPIOB->REGS(BSRR) = ( ((d) & (1<<1)) << 6) \ + | (((d) & (1<<4)) << 1) \ + | (((d) & (1<<5)) << 1); \ + } + +#define read_8() ( ( ( (GPIOA->REGS(IDR) & (1<<10)) >> 10) \ + | ((GPIOB->REGS(IDR) & (1<<7)) >> 6) \ + | ((GPIOA->REGS(IDR) & (1<<0)) << 2) \ + | ((GPIOA->REGS(IDR) & (1<<1)) << 2) \ + | ((GPIOB->REGS(IDR) & (1<<5)) >> 1) \ + | ((GPIOB->REGS(IDR) & (1<<6)) >> 1) \ + | ((GPIOA->REGS(IDR) & (1<<8)) >> 2) \ + | ((GPIOA->REGS(IDR) & (1<<9)) >> 2))) + +// PA10,PA9,PA8 PA1,PA0 PB7,PB6,PB5 +#define setWriteDir() {GP_OUT(GPIOA, CRH, 0xFFF); GP_OUT(GPIOA, CRL, 0xFF); GP_OUT(GPIOB, CRL, 0xFFF00000); } +#define setReadDir() {GP_INP(GPIOA, CRH, 0xFFF); GP_INP(GPIOA, CRL, 0xFF); GP_INP(GPIOB, CRL, 0xFFF00000); } + +#elif defined(NUCLEO144) || ISTARGET_NUCLEO144 +#if __MBED__ +#warning MBED knows everything +#elif defined(STM32F767xx) + #include +#endif + +#define REGS(x) x +// configure macros for the data pins +#define DMASK ((1<<15)) //#1 +#define EMASK ((1<<13)|(1<<11)|(1<<9)) //#3, #5, #6 +#define FMASK ((1<<12)|(1<<15)|(1<<14)|(1<<13)) //#0, #2, #4, #7 + +#define write_8(d) { \ + GPIOD->REGS(BSRR) = DMASK << 16; \ + GPIOE->REGS(BSRR) = EMASK << 16; \ + GPIOF->REGS(BSRR) = FMASK << 16; \ + GPIOD->REGS(BSRR) = ( ((d) & (1<<1)) << 14); \ + GPIOE->REGS(BSRR) = ( ((d) & (1<<3)) << 10) \ + | (((d) & (1<<5)) << 6) \ + | (((d) & (1<<6)) << 3); \ + GPIOF->REGS(BSRR) = ( ((d) & (1<<0)) << 12) \ + | (((d) & (1<<2)) << 13) \ + | (((d) & (1<<4)) << 10) \ + | (((d) & (1<<7)) << 6); \ + } + +#define read_8() ( ( ( (GPIOF->REGS(IDR) & (1<<12)) >> 12) \ + | ((GPIOD->REGS(IDR) & (1<<15)) >> 14) \ + | ((GPIOF->REGS(IDR) & (1<<15)) >> 13) \ + | ((GPIOE->REGS(IDR) & (1<<13)) >> 10) \ + | ((GPIOF->REGS(IDR) & (1<<14)) >> 10) \ + | ((GPIOE->REGS(IDR) & (1<<11)) >> 6) \ + | ((GPIOE->REGS(IDR) & (1<<9)) >> 3) \ + | ((GPIOF->REGS(IDR) & (1<<13)) >> 6))) + + +// PD15 PE13,PE11,PE9 PF15,PF14,PF13,PF12 +#define setWriteDir() { setReadDir(); \ + GPIOD->MODER |= 0x40000000; GPIOE->MODER |= 0x04440000; GPIOF->MODER |= 0x55000000; } +#define setReadDir() { GPIOD->MODER &= ~0xC0000000; GPIOE->MODER &= ~0x0CCC0000; GPIOF->MODER &= ~0xFF000000; } + + +#elif defined(NUCLEO) || ISTARGET_NUCLEO64 +#if __MBED__ +#warning MBED knows everything +#elif defined(STM32F072xB) + #include +#elif defined(STM32F103xB) + #if defined(__CC_ARM) + #include + #else + #include + #endif +#elif defined(STM32L476xx) || defined(STM32L433xx) + #include +#elif defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) + #include +#endif +// configure macros for the data pins. -00=10.06, -O1=7.85, -O1t=7.21, -O2=7.87, -O3=7.45, -O3t=7.03 + #define write_8(d) { \ + GPIOA->BSRR = 0x0700 << 16; \ + GPIOB->BSRR = 0x0438 << 16; \ + GPIOC->BSRR = 0x0080 << 16; \ + GPIOA->BSRR = (((d) & (1<<0)) << 9) \ + | (((d) & (1<<2)) << 8) \ + | (((d) & (1<<7)) << 1); \ + GPIOB->BSRR = (((d) & (1<<3)) << 0) \ + | (((d) & (1<<4)) << 1) \ + | (((d) & (1<<5)) >> 1) \ + | (((d) & (1<<6)) << 4); \ + GPIOC->BSRR = (((d) & (1<<1)) << 6); \ + } + #define read_8() ( (((GPIOA->IDR & (1<<9)) >> 9) \ + | ((GPIOC->IDR & (1<<7)) >> 6) \ + | ((GPIOA->IDR & (1<<10)) >> 8) \ + | ((GPIOB->IDR & (1<<3)) >> 0) \ + | ((GPIOB->IDR & (1<<5)) >> 1) \ + | ((GPIOB->IDR & (1<<4)) << 1) \ + | ((GPIOB->IDR & (1<<10)) >> 4) \ + | ((GPIOA->IDR & (1<<8)) >> 1))) +// be wise to clear both MODER bits properly. +#if defined(STM32F103xB) +#define GROUP_MODE(port, reg, mask, val) {port->reg = (port->reg & ~(mask)) | ((mask)&(val)); } +#define GP_OUT(port, reg, mask) GROUP_MODE(port, reg, mask, 0x33333333) +#define GP_INP(port, reg, mask) GROUP_MODE(port, reg, mask, 0x44444444) +// PA10,PA9,PA8 PB10 PB5,PB4,PB3 PC7 +#define setWriteDir() {GP_OUT(GPIOA, CRH, 0xFFF); GP_OUT(GPIOB, CRH, 0xF00); GP_OUT(GPIOB, CRL, 0xFFF000); GP_OUT(GPIOC, CRL, 0xF0000000); } +#define setReadDir() {GP_INP(GPIOA, CRH, 0xFFF); GP_INP(GPIOB, CRH, 0xF00); GP_INP(GPIOB, CRL, 0xFFF000); GP_INP(GPIOC, CRL, 0xF0000000); } +#else + #define setWriteDir() { setReadDir(); \ + GPIOA->MODER |= 0x150000; GPIOB->MODER |= 0x100540; GPIOC->MODER |= 0x4000; } + #define setReadDir() { GPIOA->MODER &= ~0x3F0000; GPIOB->MODER &= ~0x300FC0; GPIOC->MODER &= ~0xC000; } +#endif + + +#elif __TARGET_PROCESSOR == LPC1768 + #include +// configure macros for the data pins + #define write_8(d) { \ + LPC_GPIO0->FIOPIN = (LPC_GPIO0->FIOPIN & ~0x01878003) \ + | (((d) & (1<<0)) << 1) \ + | (((d) & (1<<1)) >> 1) \ + | (((d) & (1<<2)) << 22) \ + | (((d) & (1<<3)) << 20) \ + | (((d) & (1<<4)) << 12) \ + | (((d) & (1<<5)) << 10) \ + | (((d) & (1<<6)) << 11) \ + | (((d) & (1<<7)) << 11); \ + } + #define read_8() ( (((LPC_GPIO0->FIOPIN & (1<<1)) >> 1) \ + | ((LPC_GPIO0->FIOPIN & (1<<0)) << 1) \ + | ((LPC_GPIO0->FIOPIN & (1<<24)) >> 22) \ + | ((LPC_GPIO0->FIOPIN & (1<<23)) >> 20) \ + | ((LPC_GPIO0->FIOPIN & (1<<16)) >> 12) \ + | ((LPC_GPIO0->FIOPIN & (1<<15)) >> 10) \ + | ((LPC_GPIO0->FIOPIN & (1<<17)) >> 11) \ + | ((LPC_GPIO0->FIOPIN & (1<<18)) >> 11))) + #define setWriteDir() {LPC_GPIO0->FIODIR |= 0x01878003; } + #define setReadDir() {LPC_GPIO0->FIODIR &= ~0x01878003; } + + +#elif defined(MKL25Z4) || defined(TARGET_KL25Z) + #include +// configure macros for the data pins +#if 1 +#define AMASK ((1<<13)|(1<<12)|(1<<5)|(1<<4)) +#define CMASK ((1<<9)|(1<<8)) +#define DMASK ((1<<5)|(1<<4)) + #define write_8(d) { \ + PTA->PCOR = AMASK; PTC->PCOR = CMASK; PTD->PCOR = DMASK; \ + PTA->PSOR = (((d) & (1<<0)) << 13) \ + | (((d) & (1<<3)) << 9) \ + | (((d) & (1<<4)) >> 0) \ + | (((d) & (1<<5)) >> 0); \ + PTC->PSOR = (((d) & (1<<6)) << 2) \ + | (((d) & (1<<7)) << 2); \ + PTD->PSOR = (((d) & (1<<1)) << 4) \ + | (((d) & (1<<2)) << 2); \ + } + #define read_8() ( (((PTA->PDIR & (1<<13)) >> 13) \ + | ((PTA->PDIR & (1<<12)) >> 9) \ + | ((PTA->PDIR & (3<<4)) >> 0) \ + | ((PTC->PDIR & (3<<8)) >> 2) \ + | ((PTD->PDIR & (1<<4)) >> 2) \ + | ((PTD->PDIR & (1<<5)) >> 4))) + #define setWriteDir() {PTA->PDDR |= AMASK;PTC->PDDR |= CMASK;PTD->PDDR |= DMASK; } + #define setReadDir() {PTA->PDDR &= ~AMASK;PTC->PDDR &= ~CMASK;PTD->PDDR &= ~DMASK; } +#else + #define write_8(d) { \ + PTA->PDOR = (PTA->PDOR & ~0x3030) \ + | (((d) & (1<<0)) << 13) \ + | (((d) & (1<<3)) << 9) \ + | (((d) & (3<<4)) << 0); \ + PTC->PDOR = (PTC->PDOR & ~0x0300) \ + | (((d) & (3<<6)) << 2); \ + PTD->PDOR = (PTD->PDOR & ~0x0030) \ + | (((d) & (1<<1)) << 4) \ + | (((d) & (1<<2)) << 2); \ + } + #define read_8() ( (((PTA->PDIR & (1<<13)) >> 13) \ + | ((PTA->PDIR & (1<<12)) >> 9) \ + | ((PTA->PDIR & (3<<4)) >> 0) \ + | ((PTC->PDIR & (3<<8)) >> 2) \ + | ((PTD->PDIR & (1<<4)) >> 2) \ + | ((PTD->PDIR & (1<<5)) >> 4))) + #define setWriteDir() {PTA->PDDR |= 0x3030;PTC->PDDR |= 0x0300;PTD->PDDR |= 0x0030; } + #define setReadDir() {PTA->PDDR &= ~0x3030;PTC->PDDR &= ~0x0300;PTD->PDDR &= ~0x0030; } +#endif + +#elif defined(MKL26Z4) + #include +// configure macros for the data pins +#define AMASK ((1<<13)|(1<<12)|(1<<5)|(1<<4)) +#define CMASK ((1<<9)|(1<<8)) +#define DMASK ((1<<3)|(1<<2)) //PTD5, PTD4 on KL25Z + #define write_8(d) { \ + PTA->PCOR = AMASK; PTC->PCOR = CMASK; PTD->PCOR = DMASK; \ + PTA->PSOR = (((d) & (1<<0)) << 13) \ + | (((d) & (1<<3)) << 9) \ + | (((d) & (1<<4)) >> 0) \ + | (((d) & (1<<5)) >> 0); \ + PTC->PSOR = (((d) & (1<<6)) << 2) \ + | (((d) & (1<<7)) << 2); \ + PTD->PSOR = (((d) & (1<<1)) << 1) \ + | (((d) & (1<<2)) << 1); \ + } + #define read_8() ( (((PTA->PDIR & (1<<13)) >> 13) \ + | ((PTA->PDIR & (1<<12)) >> 9) \ + | ((PTA->PDIR & (3<<4)) >> 0) \ + | ((PTC->PDIR & (3<<8)) >> 2) \ + | ((PTD->PDIR & (1<<3)) >> 1) \ + | ((PTD->PDIR & (1<<2)) >> 1))) + #define setWriteDir() {PTA->PDDR |= AMASK;PTC->PDDR |= CMASK;PTD->PDDR |= DMASK; } + #define setReadDir() {PTA->PDDR &= ~AMASK;PTC->PDDR &= ~CMASK;PTD->PDDR &= ~DMASK; } + +#elif defined(MKL05Z4) || defined(TARGET_KL05Z) + #include +// configure macros for the data pins + #define write_8(d) { \ + PTA->PDOR = (PTA->PDOR & ~0x1C00) \ + | (((d) & (1<<2)) << 9) \ + | (((d) & (1<<4)) << 6) \ + | (((d) & (1<<5)) << 7); \ + PTB->PDOR = (PTB->PDOR & ~0x0CE0) \ + | (((d) & (3<<0)) << 10) \ + | (((d) & (1<<3)) << 2) \ + | (((d) & (3<<6)) << 0); \ + } + #define read_8() ( (((PTA->PDIR & (1<<11)) >> 9) \ + | ((PTA->PDIR & (1<<10)) >> 6) \ + | ((PTA->PDIR & (1<<12)) >> 7) \ + | ((PTB->PDIR & (3<<10)) >> 10) \ + | ((PTB->PDIR & (1<<5)) >> 2) \ + | ((PTB->PDIR & (3<<6)) >> 0))) + #define setWriteDir() { PTA->PDDR |= 0x1C00; PTB->PDDR |= 0x0CE0; } + #define setReadDir() { PTA->PDDR &= ~0x1C00; PTB->PDDR &= ~0x0CE0; } + + +#elif (defined(MK20D7) && defined(TEENSY)) || defined(TARGET_TEENSY3_1) +#if __MBED__ +#warning MBED knows everything +#else + #include +#endif +// configure macros for the data pins +#define AMASK ((1<<12)|(1<<13)) +#define CMASK ((1<<3)) +#define DMASK ((1<<0)|(1<<2)|(1<<3)|(1<<4)|(1<<7)) + + #define write_8(d) { \ + PTA->PCOR = AMASK; PTC->PCOR = CMASK; PTD->PCOR = DMASK; \ + PTA->PSOR = (((d) & (1<<3)) << 9) \ + | (((d) & (1<<4)) << 9); \ + PTC->PSOR = (((d) & (1<<1)) << 2); \ + PTD->PSOR = (((d) & (1<<0)) << 3) \ + | (((d) & (1<<2)) >> 2) \ + | (((d) & (1<<5)) << 2) \ + | (((d) & (1<<6)) >> 2) \ + | (((d) & (1<<7)) >> 5); \ + } + #define read_8() ( (((PTD->PDIR & (1<<3)) >> 3) \ + | ((PTC->PDIR & (1<<3)) >> 2) \ + | ((PTD->PDIR & (1<<0)) << 2) \ + | ((PTA->PDIR & (1<<12)) >> 9) \ + | ((PTA->PDIR & (1<<13)) >> 9) \ + | ((PTD->PDIR & (1<<7)) >> 2) \ + | ((PTD->PDIR & (1<<4)) << 2) \ + | ((PTD->PDIR & (1<<2)) << 5))) + #define setWriteDir() {PTA->PDDR |= AMASK;PTC->PDDR |= CMASK;PTD->PDDR |= DMASK; } + #define setReadDir() {PTA->PDDR &= ~AMASK;PTC->PDDR &= ~CMASK;PTD->PDDR &= ~DMASK; } + +#elif defined(MK20D5) || defined(TARGET_K20D50M) + #include +// configure macros for the data pins +#define AMASK ((1<<12)|(1<<5)|(1<<2)|(1<<1)) +#define CMASK ((1<<8)|(1<<4)|(1<<3)) +#define DMASK ((1<<4)) + #define write_8(d) { \ + PTA->PCOR = AMASK; PTC->PCOR = CMASK; PTD->PCOR = DMASK; \ + PTA->PSOR = (((d) & (1<<0)) << 12) \ + | (((d) & (1<<1)) << 1) \ + | (((d) & (1<<2)) << 3) \ + | (((d) & (1<<5)) >> 4); \ + PTC->PSOR = (((d) & (1<<4)) << 4) \ + | (((d) & (3<<6)) >> 3); \ + PTD->PSOR = (((d) & (1<<3)) << 1); \ + } + #define read_8() ( (((PTA->PDIR & (1<<5)) >> 3) \ + | ((PTA->PDIR & (1<<1)) << 4) \ + | ((PTA->PDIR & (1<<12)) >> 12) \ + | ((PTA->PDIR & (1<<2)) >> 1) \ + | ((PTC->PDIR & (1<<8)) >> 4) \ + | ((PTC->PDIR & (3<<3)) << 3) \ + | ((PTD->PDIR & (1<<4)) >> 1))) + #define setWriteDir() {PTA->PDDR |= AMASK;PTC->PDDR |= CMASK;PTD->PDDR |= DMASK; } + #define setReadDir() {PTA->PDDR &= ~AMASK;PTC->PDDR &= ~CMASK;PTD->PDDR &= ~DMASK; } + +#elif defined(ZERO) + #include + + #ifndef PORTA + #define PORTA PORT->Group[0] + #define PORTB PORT->Group[1] + #endif +// configure macros for the data pins +#if defined(D21_XPRO) + #define AMASK 0x00220000 + #define BMASK 0x0000C0E4 + #define write_8(d) { \ + PORTA.OUT.reg = (PORTA.OUT.reg & ~AMASK) \ + | (((d) & (1<<5)) << 16) \ + | (((d) & (1<<7)) << 10); \ + PORTB.OUT.reg = (PORTB.OUT.reg & ~BMASK) \ + | (((d) & (3<<0)) << 6) \ + | (((d) & (1<<2)) << 12) \ + | (((d) & (1<<3)) >> 1) \ + | (((d) & (1<<4)) << 1) \ + | (((d) & (1<<6)) << 9); \ + } + #define read_8() ( (((PORTA.IN.reg & (1<<21)) >> 16) \ + | ((PORTA.IN.reg & (1<<17)) >> 10) \ + | ((PORTB.IN.reg & (3<<6)) >> 6) \ + | ((PORTB.IN.reg & (1<<14)) >> 12) \ + | ((PORTB.IN.reg & (1<<2)) << 1) \ + | ((PORTB.IN.reg & (1<<5)) >> 1) \ + | ((PORTB.IN.reg & (1<<15)) >> 9))) + #define setWriteDir() { \ + PORTA.DIRSET.reg = AMASK; \ + PORTB.DIRSET.reg = BMASK; \ + PORTA.WRCONFIG.reg = (AMASK>>16) | (0<<22) | (0<<28) | (1<<30) | (1<<31); \ + PORTB.WRCONFIG.reg = (BMASK & 0xFFFF) | (0<<22) | (0<<28) | (1<<30); \ + } + #define setReadDir() { \ + PORTA.DIRCLR.reg = AMASK; \ + PORTB.DIRCLR.reg = BMASK; \ + PORTA.WRCONFIG.reg = (AMASK>>16) | (1<<17) | (0<<28) | (1<<30) | (1<<31); \ + PORTB.WRCONFIG.reg = (BMASK & 0xFFFF) | (1<<17) | (0<<28) | (1<<30); \ + } +#else + #define DMASK 0x0030C3C0 + #define write_8(x) {PORTA.OUTCLR.reg = (DMASK); \ + PORTA.OUTSET.reg = (((x) & 0x0F) << 6) \ + | (((x) & 0x30) << 10) \ + | (((x) & 0xC0)<<14); } + #define read_8() (((PORTA.IN.reg >> 6) & 0x0F) \ + | ((PORTA.IN.reg >> 10) & 0x30) \ + | ((PORTA.IN.reg >> 14) & 0xC0)) + #define setWriteDir() { PORTA.DIRSET.reg = DMASK; \ + PORTA.WRCONFIG.reg = (DMASK & 0xFFFF) | (0<<22) | (1<<28) | (1<<30); \ + PORTA.WRCONFIG.reg = (DMASK>>16) | (0<<22) | (1<<28) | (1<<30) | (1<<31); \ + } + #define setReadDir() { PORTA.DIRCLR.reg = DMASK; \ + PORTA.WRCONFIG.reg = (DMASK & 0xFFFF) | (1<<17) | (1<<28) | (1<<30); \ + PORTA.WRCONFIG.reg = (DMASK>>16) | (1<<17) | (1<<28) | (1<<30) | (1<<31); \ + } +#endif + +//####################################### DUE ############################ +#elif defined(__SAM3X8E__) //regular UNO shield on DUE + // configure macros for data bus +#define BMASK (1<<25) +#define CMASK (0xBF << 21) +#define write_8(x) { PIOB->PIO_CODR = BMASK; PIOC->PIO_CODR = CMASK; \ + PIOB->PIO_SODR = (((x) & (1<<2)) << 23); \ + PIOC->PIO_SODR = (((x) & (1<<0)) << 22) \ + | (((x) & (1<<1)) << 20) \ + | (((x) & (1<<3)) << 25) \ + | (((x) & (1<<4)) << 22) \ + | (((x) & (1<<5)) << 20) \ + | (((x) & (1<<6)) << 18) \ + | (((x) & (1<<7)) << 16); \ + } + +#define read_8() ( ((PIOC->PIO_PDSR & (1<<22)) >> 22)\ + | ((PIOC->PIO_PDSR & (1<<21)) >> 20)\ + | ((PIOB->PIO_PDSR & (1<<25)) >> 23)\ + | ((PIOC->PIO_PDSR & (1<<28)) >> 25)\ + | ((PIOC->PIO_PDSR & (1<<26)) >> 22)\ + | ((PIOC->PIO_PDSR & (1<<25)) >> 20)\ + | ((PIOC->PIO_PDSR & (1<<24)) >> 18)\ + | ((PIOC->PIO_PDSR & (1<<23)) >> 16)\ + ) +#define setWriteDir() { PIOB->PIO_OER = BMASK; PIOC->PIO_OER = CMASK; } +#define setReadDir() { \ + PMC->PMC_PCER0 = (1 << ID_PIOB)|(1 << ID_PIOC);\ + PIOB->PIO_ODR = BMASK; PIOC->PIO_ODR = CMASK;\ + } + +#else +#error MCU unselected +#endif // MCUs + +#endif //PIN_SHIELD_8_H diff --git a/Readme.md b/Readme.md index f807834..c39a050 100644 --- a/Readme.md +++ b/Readme.md @@ -7,6 +7,7 @@ - With LCDKeypad (found on a chinese seller website) - With TFT 2.4" Shield (https://www.amazon.fr/gp/product/B0798N3JWD/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1) - With TM1638 display (https://www.amazon.fr/gp/product/B0797PLVTX/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1) + - With TFT 3.2" OpenSmart Shield (only on Assetto Corsa Competizione) 2 parts : @@ -20,6 +21,7 @@ - Clone this repo on your server or download release - Copy Keypad folder in Arduino/Libraries in your Arduino libraries folder in your computer (only for LCDKeypad dashboard) +- Copy MCUFRIEND_kbv folder in Arduino/Libraries in your Arduino libraries folder in your computer (only for TFT 3.2" dashboard) - Upload specific .ino file in your Arduino (tested with Uno R3) - Launch AC - Launch your server in Server\AC_Arduino\Bin (after compiling with vs2019 or vs2017 community edition)