Developer World
Spresense SDK Library v3.2.0-ebc0364
mipi_display.h
1/****************************************************************************
2 * include/nuttx/video/mipi_display.h
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership. The
7 * ASF licenses this file to you under the Apache License Version 2.0 (the
8 * "License"); you may not use this file except in compliance with the
9 * License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing software
14 * distributed under the License is distributed on an "AS IS" BASIS WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND either express or implied. See the
16 * License for the specific language governing permissions and limitations
17 * under the License.
18 *
19 ****************************************************************************/
20
21#ifndef __INCLUDE_NUTTX_VIDEO_MIPI_DISPLAY_H
22#define __INCLUDE_NUTTX_VIDEO_MIPI_DISPLAY_H
23
24/****************************************************************************
25 * Pre-processor Definitions
26 ****************************************************************************/
27
28/* DSI Processor-to-Peripheral transaction types */
29
30#define MIPI_DSI_VSYNC_START 0x01
31#define MIPI_DSI_VSYNC_END 0x11
32#define MIPI_DSI_HSYNC_START 0x21
33#define MIPI_DSI_HSYNC_END 0x31
34#define MIPI_DSI_COMPRESSION_MODE 0x07
35#define MIPI_DSI_END_OF_TRANSMISSION 0x08
36#define MIPI_DSI_COLOR_MODE_OFF 0x02
37#define MIPI_DSI_COLOR_MODE_ON 0x12
38#define MIPI_DSI_SHUTDOWN_PERIPHERAL 0x22
39#define MIPI_DSI_TURN_ON_PERIPHERAL 0x32
40#define MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM 0x03
41#define MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM 0x13
42#define MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM 0x23
43#define MIPI_DSI_GENERIC_READ_0_PARAM 0x04
44#define MIPI_DSI_GENERIC_READ_1_PARAM 0x14
45#define MIPI_DSI_GENERIC_READ_2_PARAM 0x24
46#define MIPI_DSI_DCS_SHORT_WRITE_0_PARAM 0x05
47#define MIPI_DSI_DCS_SHORT_WRITE_1_PARAM 0x15
48#define MIPI_DSI_DCS_READ_0_PARAM 0x06
49#define MIPI_DSI_EXECUTE_QUEUE 0x16
50#define MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE 0x37
51#define MIPI_DSI_NULL_PACKET 0x09
52#define MIPI_DSI_BLANKING_PACKET 0x19
53#define MIPI_DSI_LONG_GENERIC_WRITE 0x29
54#define MIPI_DSI_DCS_LONG_WRITE 0x39
55#define MIPI_DSI_PICTURE_PARAMETER_SET 0x0a
56#define MIPI_DSI_COMPRESSED_PIXEL_STREAM 0x0b
57#define MIPI_DSI_LOOSELY_PACKED_PIXEL_STREAM_YCBCR20 0x0c
58#define MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR24 0x1c
59#define MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16 0x2c
60#define MIPI_DSI_PACKED_PIXEL_STREAM_RGB30 0x0d
61#define MIPI_DSI_PACKED_PIXEL_STREAM_RGB36 0x1d
62#define MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12 0x3d
63#define MIPI_DSI_PACKED_PIXEL_STREAM_RGB16 0x0e
64#define MIPI_DSI_PACKED_PIXEL_STREAM_RGB18 0x1e
65#define MIPI_DSI_PIXEL_STREAM_3BYTE_RGB18 0x2e
66#define MIPI_DSI_PACKED_PIXEL_STREAM_RGB24 0x3e
67
68/* DSI Peripheral-to-Processor transaction data type */
69
70#define MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT 0x02
71#define MIPI_DSI_RX_END_OF_TRANSMISSION 0x08
72#define MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_1BYTE 0x11
73#define MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_2BYTE 0x12
74#define MIPI_DSI_RX_GENERIC_LONG_READ_RESPONSE 0x1a
75#define MIPI_DSI_RX_DCS_LONG_READ_RESPONSE 0x1c
76#define MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_1BYTE 0x21
77#define MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_2BYTE 0x22
78
79/* DCS commands */
80
81#define MIPI_DCS_NOP 0x00
82#define MIPI_DCS_SOFT_RESET 0x01
83#define MIPI_DCS_GET_COMPRESSION_MODE 0x03
84#define MIPI_DCS_GET_DISPLAY_ID 0x04
85#define MIPI_DCS_GET_ERROR_COUNT_ON_DSI 0x05
86#define MIPI_DCS_GET_RED_CHANNEL 0x06
87#define MIPI_DCS_GET_GREEN_CHANNEL 0x07
88#define MIPI_DCS_GET_BLUE_CHANNEL 0x08
89#define MIPI_DCS_GET_DISPLAY_STATUS 0x09
90#define MIPI_DCS_GET_POWER_MODE 0x0a
91#define MIPI_DCS_GET_ADDRESS_MODE 0x0b
92#define MIPI_DCS_GET_PIXEL_FORMAT 0x0c
93#define MIPI_DCS_GET_DISPLAY_MODE 0x0d
94#define MIPI_DCS_GET_SIGNAL_MODE 0x0e
95#define MIPI_DCS_GET_DIAGNOSTIC_RESULT 0x0f
96#define MIPI_DCS_ENTER_SLEEP_MODE 0x10
97#define MIPI_DCS_EXIT_SLEEP_MODE 0x11
98#define MIPI_DCS_ENTER_PARTIAL_MODE 0x12
99#define MIPI_DCS_ENTER_NORMAL_MODE 0x13
100#define MIPI_DCS_GET_IMAGE_CHECKSUM_RGB 0x14
101#define MIPI_DCS_GET_IMAGE_CHECKSUM_CT 0x15
102#define MIPI_DCS_EXIT_INVERT_MODE 0x20
103#define MIPI_DCS_ENTER_INVERT_MODE 0x21
104#define MIPI_DCS_SET_GAMMA_CURVE 0x26
105#define MIPI_DCS_SET_DISPLAY_OFF 0x28
106#define MIPI_DCS_SET_DISPLAY_ON 0x29
107#define MIPI_DCS_SET_COLUMN_ADDRESS 0x2a
108#define MIPI_DCS_SET_PAGE_ADDRESS 0x2b
109#define MIPI_DCS_WRITE_MEMORY_START 0x2c
110#define MIPI_DCS_WRITE_LUT 0x2d
111#define MIPI_DCS_READ_MEMORY_START 0x2e
112#define MIPI_DCS_SET_PARTIAL_ROWS 0x30 /* MIPI DCS 1.02 -
113 * MIPI_DCS_SET_PARTIAL_AREA
114 * before that */
115#define MIPI_DCS_SET_PARTIAL_COLUMNS 0x31
116#define MIPI_DCS_SET_SCROLL_AREA 0x33
117#define MIPI_DCS_SET_TEAR_OFF 0x34
118#define MIPI_DCS_SET_TEAR_ON 0x35
119#define MIPI_DCS_SET_ADDRESS_MODE 0x36
120#define MIPI_DCS_SET_SCROLL_START 0x37
121#define MIPI_DCS_EXIT_IDLE_MODE 0x38
122#define MIPI_DCS_ENTER_IDLE_MODE 0x39
123#define MIPI_DCS_SET_PIXEL_FORMAT 0x3a
124#define MIPI_DCS_WRITE_MEMORY_CONTINUE 0x3c
125#define MIPI_DCS_SET_3D_CONTROL 0x3d
126#define MIPI_DCS_READ_MEMORY_CONTINUE 0x3e
127#define MIPI_DCS_GET_3D_CONTROL 0x3f
128#define MIPI_DCS_SET_VSYNC_TIMING 0x40
129#define MIPI_DCS_SET_TEAR_SCANLINE 0x44
130#define MIPI_DCS_GET_SCANLINE 0x45
131#define MIPI_DCS_SET_DISPLAY_BRIGHTNESS 0x51 /* MIPI DCS 1.3 */
132#define MIPI_DCS_GET_DISPLAY_BRIGHTNESS 0x52 /* MIPI DCS 1.3 */
133#define MIPI_DCS_WRITE_CONTROL_DISPLAY 0x53 /* MIPI DCS 1.3 */
134#define MIPI_DCS_GET_CONTROL_DISPLAY 0x54 /* MIPI DCS 1.3 */
135#define MIPI_DCS_WRITE_POWER_SAVE 0x55 /* MIPI DCS 1.3 */
136#define MIPI_DCS_GET_POWER_SAVE 0x56 /* MIPI DCS 1.3 */
137#define MIPI_DCS_SET_CABC_MIN_BRIGHTNESS 0x5e /* MIPI DCS 1.3 */
138#define MIPI_DCS_GET_CABC_MIN_BRIGHTNESS 0x5f /* MIPI DCS 1.3 */
139#define MIPI_DCS_READ_DDB_START 0xa1
140#define MIPI_DCS_READ_PPS_START 0xa2
141#define MIPI_DCS_READ_DDB_CONTINUE 0xa8
142#define MIPI_DCS_READ_PPS_CONTINUE 0xa9
143
144/* DCS pixel formats */
145
146#define MIPI_DCS_PIXEL_FMT_24BIT 7
147#define MIPI_DCS_PIXEL_FMT_18BIT 6
148#define MIPI_DCS_PIXEL_FMT_16BIT 5
149#define MIPI_DCS_PIXEL_FMT_12BIT 3
150#define MIPI_DCS_PIXEL_FMT_8BIT 2
151#define MIPI_DCS_PIXEL_FMT_3BIT 1
152
153#endif /* __INCLUDE_NUTTX_VIDEO_MIPI_DISPLAY_H */