1 /* SPDX-License-Identifier: MIT */
2 /*
3  * This is our library for the Adafruit  ILI9341 Breakout and Shield
4  * ----> http://www.adafruit.com/products/1651
5  *
6  * Check out the links above for our tutorials and wiring diagrams
7  * These displays use SPI to communicate, 4 or 5 pins are required to
8  * interface (RST is optional)
9  * Adafruit invests time and resources providing this open source code,
10  * please support Adafruit and open-source hardware by purchasing
11  * products from Adafruit!
12  *
13  * Written by Limor Fried/Ladyada for Adafruit Industries.
14  * MIT license, all text above must be included in any redistribution
15  */
16 
17 #ifndef __HX8357_H__
18 #define __HX8357_H__
19 
20 #define HX8357D 0xD
21 #define HX8357B 0xB
22 
23 #define HX8357_TFTWIDTH  320
24 #define HX8357_TFTHEIGHT 480
25 
26 #define HX8357_SETOSC 0xB0
27 #define HX8357_SETPWR1 0xB1
28 #define HX8357B_SETDISPLAY 0xB2
29 #define HX8357_SETRGB 0xB3
30 #define HX8357D_SETCOM  0xB6
31 
32 #define HX8357B_SETDISPMODE  0xB4
33 #define HX8357D_SETCYC  0xB4
34 #define HX8357B_SETOTP 0xB7
35 #define HX8357D_SETC 0xB9
36 
37 #define HX8357B_SET_PANEL_DRIVING 0xC0
38 #define HX8357D_SETSTBA 0xC0
39 #define HX8357B_SETDGC  0xC1
40 #define HX8357B_SETID  0xC3
41 #define HX8357B_SETDDB  0xC4
42 #define HX8357B_SETDISPLAYFRAME 0xC5
43 #define HX8357B_GAMMASET 0xC8
44 #define HX8357B_SETCABC  0xC9
45 #define HX8357_SETPANEL  0xCC
46 
47 #define HX8357B_SETPOWER 0xD0
48 #define HX8357B_SETVCOM 0xD1
49 #define HX8357B_SETPWRNORMAL 0xD2
50 
51 #define HX8357B_RDID1   0xDA
52 #define HX8357B_RDID2   0xDB
53 #define HX8357B_RDID3   0xDC
54 #define HX8357B_RDID4   0xDD
55 
56 #define HX8357D_SETGAMMA 0xE0
57 
58 #define HX8357B_SETGAMMA 0xC8
59 #define HX8357B_SETPANELRELATED  0xE9
60 
61 /* Color definitions */
62 #define	HX8357_BLACK   0x0000
63 #define	HX8357_BLUE    0x001F
64 #define	HX8357_RED     0xF800
65 #define	HX8357_GREEN   0x07E0
66 #define HX8357_CYAN    0x07FF
67 #define HX8357_MAGENTA 0xF81F
68 #define HX8357_YELLOW  0xFFE0
69 #define HX8357_WHITE   0xFFFF
70 
71 #endif /* __HX8357_H__ */
72