COSA
An Object-Oriented Platform for Arduino Programming
ILI9341.cpp
Go to the documentation of this file.
1 
21 #include "ILI9341.hh"
22 
23 const uint8_t ILI9341::s_script[] __PROGMEM = {
24  // Software Reset
25  SWRESET, 0,
26  // Software Delay
27  SWDELAY, 250,
28  // Power Control A
29  // Vcore = 1.6 V, DDVDH = 5.6 V
30  PWCTRLA, 5, 0x39, 0x2C, 0x00, 0x34, 0x02,
31  // Power Control B
32  // PCEQ enable
33  PWCTRLB, 3, 0x00, 0xC1, 0x30,
34  // Driver Timing Control A
35  // Internal clock -1, EQ -1, CR -1, Pre-Charge -2
36  DTCTRLA, 3, 0x85, 0x00, 0x78,
37  // Driver Timing Control B
38  // External clock 0, EQE -1, CRE -1, Pre-Charge -2
39  DTCTRLB, 2, 0x00, 0x00,
40  // Power On Sequence Control
41  // Soft start keep 1 frame
42  // 1st frame enable
43  // DDVHDH enhanced mode enable
44  PWONCTRL, 4, 0x64, 0x03, 0X12, 0X81,
45  // Pump Ratio Control
46  // DDVDH = 2xVCI
47  PRCTRL, 1, 0x20,
48  // Power Control 1
49  // GVDD = 4.60 V
50  PWCTRL1, 1, 0x23,
51  // Power Control 2
52  PWCTRL2, 1, 0x10,
53  // VCOM Control 1
54  // VCOMH = 4.250 V
55  // VCOML = -1.5 V
56  VMCTRL1, 2, 0x3e, 0x28,
57  // VCOM Control 2
58  // VCOMH = VMH - 58
59  // VCOML = VMH - 58
60  VMCTRL2, 1, 0x86,
61  // Memory Data Access Control
62  // Column Address Order (MX), BGR Order
63  MADCTL, 1, 0x48,
64  // Pixel Format Set
65  // RGB 16-bits, MCU 16-bits
66  PIXSET, 1, 0x55,
67  // Frame Rate Control
68  // Division Ratio = fosc / 1
69  // Frame Rate = 79 Hz
70  FRMCTR1, 2, 0x00, 0x18,
71  // Display Function Control
72  // Interval scan, V63, V0, VCOML, VCOMH
73  DISCTRL, 3, 0x08, 0x82, 0x27,
74  // Disable 3-Gamma
75  EN3GAM, 1, 0x00,
76  // Gamma Set
77  // Gamma curve 1
78  GAMSET, 1, 0x01,
79  // Positive Gamma Correction
80  PGAMCTRL, 15,
81  0x0F, 0x31, 0x2B, 0x0C, 0x0E,
82  0x08, 0x4E, 0xF1, 0x37, 0x07,
83  0x10, 0x03, 0x0E, 0x09, 0x00,
84  // Negative Gamma Correction
85  NGAMCTRL, 15,
86  0x00, 0x0E, 0x14, 0x03, 0x11,
87  0x07, 0x31, 0xC1, 0x48, 0x08,
88  0x0F, 0x0C, 0x31, 0x36, 0x0F,
89  // Exit Sleep Mode
90  SLPOUT, 0,
91  // Software Delay
92  SWDELAY, 120,
93  // Display On
94  DISPON, 0,
95  // END OF SCRIPT
96  SCRIPTEND
97 };
98 
100  GDDRAM(SCREEN_WIDTH, SCREEN_HEIGHT, cs, dc)
101 {
102 }
ILI9341(Board::DigitalPin cs=Board::D10, Board::DigitalPin dc=Board::D9)
Definition: ILI9341.cpp:99
static const uint8_t s_script[]
Definition: ILI9341.hh:95
Definition: GDDRAM.hh:31
const uint8_t ILI9341::s_script[] __PROGMEM
Definition: ILI9341.cpp:23