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 HX8357B_NOP     0x00
26#define HX8357B_SWRESET 0x01
27#define HX8357B_RDDID   0x04
28#define HX8357B_RDDST   0x09
29
30#define HX8357B_RDPOWMODE  0x0A
31#define HX8357B_RDMADCTL  0x0B
32#define HX8357B_RDCOLMOD  0x0C
33#define HX8357B_RDDIM  0x0D
34#define HX8357B_RDDSDR  0x0F
35
36#define HX8357_SLPIN   0x10
37#define HX8357_SLPOUT  0x11
38#define HX8357B_PTLON   0x12
39#define HX8357B_NORON   0x13
40
41#define HX8357_INVOFF  0x20
42#define HX8357_INVON   0x21
43#define HX8357_DISPOFF 0x28
44#define HX8357_DISPON  0x29
45
46#define HX8357_CASET   0x2A
47#define HX8357_PASET   0x2B
48#define HX8357_RAMWR   0x2C
49#define HX8357_RAMRD   0x2E
50
51#define HX8357B_PTLAR   0x30
52#define HX8357_TEON  0x35
53#define HX8357_TEARLINE  0x44
54#define HX8357_MADCTL  0x36
55#define HX8357_COLMOD  0x3A
56
57#define HX8357_SETOSC 0xB0
58#define HX8357_SETPWR1 0xB1
59#define HX8357B_SETDISPLAY 0xB2
60#define HX8357_SETRGB 0xB3
61#define HX8357D_SETCOM  0xB6
62
63#define HX8357B_SETDISPMODE  0xB4
64#define HX8357D_SETCYC  0xB4
65#define HX8357B_SETOTP 0xB7
66#define HX8357D_SETC 0xB9
67
68#define HX8357B_SET_PANEL_DRIVING 0xC0
69#define HX8357D_SETSTBA 0xC0
70#define HX8357B_SETDGC  0xC1
71#define HX8357B_SETID  0xC3
72#define HX8357B_SETDDB  0xC4
73#define HX8357B_SETDISPLAYFRAME 0xC5
74#define HX8357B_GAMMASET 0xC8
75#define HX8357B_SETCABC  0xC9
76#define HX8357_SETPANEL  0xCC
77
78#define HX8357B_SETPOWER 0xD0
79#define HX8357B_SETVCOM 0xD1
80#define HX8357B_SETPWRNORMAL 0xD2
81
82#define HX8357B_RDID1   0xDA
83#define HX8357B_RDID2   0xDB
84#define HX8357B_RDID3   0xDC
85#define HX8357B_RDID4   0xDD
86
87#define HX8357D_SETGAMMA 0xE0
88
89#define HX8357B_SETGAMMA 0xC8
90#define HX8357B_SETPANELRELATED  0xE9
91
92/* Color definitions */
93#define	HX8357_BLACK   0x0000
94#define	HX8357_BLUE    0x001F
95#define	HX8357_RED     0xF800
96#define	HX8357_GREEN   0x07E0
97#define HX8357_CYAN    0x07FF
98#define HX8357_MAGENTA 0xF81F
99#define HX8357_YELLOW  0xFFE0
100#define HX8357_WHITE   0xFFFF
101
102#endif /* __HX8357_H__ */
103