-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathili934x.h
103 lines (96 loc) · 3.9 KB
/
ili934x.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* Author: Steve Gunn
* Licence: This work is licensed under the Creative Commons Attribution License.
* View this license at http://creativecommons.org/about/licenses/
*/
#define BLC 4
#define RESET 7
#define CMD_ADDR 0x4000
#define DATA_ADDR 0x4100
#define write_cmd(cmd) asm volatile("sts %0,%1" :: "i" (CMD_ADDR), "r" (cmd) : "memory");
#define write_data(data) asm volatile("sts %0,%1" :: "i" (DATA_ADDR), "r" (data) : "memory");
#define write_data16(data) asm volatile("sts %0,%B1 \n\t sts %0,%A1" :: "i" (DATA_ADDR), "r" (data) : "memory");
#define write_cmd_data(cmd, data) asm volatile("sts %0,%1 \n\t sts %2,%3" :: "i" (CMD_ADDR), "r" (cmd), "i" (DATA_ADDR), "r" (data) : "memory");
/* Basic Commands */
#define NO_OPERATION 0x00
#define SOFTWARE_RESET 0x01
#define READ_DISPLAY_IDENTIFICATION_INFORMATION 0x04
#define READ_DISPLAY_STATUS 0x09
#define READ_DISPLAY_POWER_MODE 0x0A
#define READ_DISPLAY_MADCTL 0x0B
#define READ_DISPLAY_PIXEL_FORMAT 0x0C
#define READ_DISPLAY_IMAGE_FORMAT 0x0D
#define READ_DISPLAY_SIGNAL_MODE 0x0E
#define READ_DISPLAY_SELF_DIAGNOSTIC_RESULT 0x0F
#define ENTER_SLEEP_MODE 0x10
#define SLEEP_OUT 0x11
#define PARTIAL_MODE_ON 0x12
#define NORMAL_DISPLAY_MODE_ON 0x13
#define DISPLAY_INVERSION_OFF 0x20
#define DISPLAY_INVERSION_ON 0x21
#define GAMMA_SET 0x26
#define DISPLAY_OFF 0x28
#define DISPLAY_ON 0x29
#define COLUMN_ADDRESS_SET 0x2A
#define PAGE_ADDRESS_SET 0x2B
#define MEMORY_WRITE 0x2C
#define COLOR_SET 0x2D
#define MEMORY_READ 0x2E
#define PARTIAL_AREA 0x30
#define VERTICAL_SCROLLING_DEFINITION 0x33
#define TEARING_EFFECT_LINE_OFF 0x34
#define TEARING_EFFECT_LINE_ON 0x35
#define MEMORY_ACCESS_CONTROL 0x36
#define VERTICAL_SCROLLING_START_ADDRESS 0x37
#define IDLE_MODE_OFF 0x38
#define IDLE_MODE_ON 0x39
#define PIXEL_FORMAT_SET 0x3A
#define WRITE_MEMORY_CONTINUE 0x3C
#define READ_MEMORY_CONTINUE 0x3E
#define SET_TEAR_SCANLINE 0x44
#define GET_SCANLINE 0x45
#define WRITE_DISPLAY_BRIGHTNESS 0x51
#define READ_DISPLAY_BRIGHTNESS 0x52
#define WRITE_CTRL_DISPLAY 0x53
#define READ_CTRL_DISPLAY 0x54
#define WRITE_CONTENT_ADAPTIVE_BRIGHTNESS_CONTROL 0x55
#define READ_CONTENT_ADAPTIVE_BRIGHTNESS_CONTROL 0x56
#define WRITE_CABC_MINIMUM_BRIGHTNESS 0x5E
#define READ_CABC_MINIMUM_BRIGHTNESS 0x5F
#define READ_ID1 0xDA
#define READ_ID2 0xDB
#define READ_ID3 0xDC
/* Extended Commands */
#define RGB_INTERFACE_SIGNAL_CONTROL 0xB0
#define FRAME_CONTROL_IN_NORMAL_MODE 0xB1
#define FRAME_CONTROL_IN_IDLE_MODE 0xB2
#define FRAME_CONTROL_IN_PARTIAL_MODE 0xB3
#define DISPLAY_INVERSION_CONTROL 0xB4
#define BLANKING_PORCH_CONTROL 0xB5
#define DISPLAY_FUNCTION_CONTROL 0xB6
#define ENTRY_MODE_SET 0xB7
#define BACKLIGHT_CONTROL_1 0xB8
#define BACKLIGHT_CONTROL_2 0xB9
#define BACKLIGHT_CONTROL_3 0xBA
#define BACKLIGHT_CONTROL_4 0xBB
#define BACKLIGHT_CONTROL_5 0xBC
#define BACKLIGHT_CONTROL_7 0xBE
#define BACKLIGHT_CONTROL_8 0xBF
#define POWER_CONTROL_1 0xC0
#define POWER_CONTROL_2 0xC1
#define POWER_CONTROL3_(FOR_NORMAL_MODE) 0xC2
#define POWER_CONTROL4_(FOR_IDLE_MODE) 0xC3
#define POWER_CONTROL5_(FOR_PARTIAL_MODE) 0xC4
#define VCOM_CONTROL_1 0xC5
#define VCOM_CONTROL_2 0xC7
#define NV_MEMORY_WRITE 0xD0
#define NV_MEMORY_PROTECTION_KEY 0xD1
#define NV_MEMORY_STATUS_READ 0xD2
#define READ_ID4 0xD3
#define POSITIVE_GAMM_CORRECTION 0xE0
#define NEGATIVE_GAMMA_CORRECTION 0xE1
#define DIGITAL_GAMMA_CONTROL 0xE2
#define DIGITAL_GAMMA_CONTROL2 0xE3
#define INTERFACE_CONTROL 0xF6
/* Undocumented commands */
#define INTERNAL_IC_SETTING 0xCB
#define GAMMA_DISABLE 0xF2