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