hal_gdc_intern.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file hal_gdc_intern.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of Graphics library.
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 ****************************************************************************************
36 */
37
38 /** @addtogroup GRAPHICS_SDK Graphics
39 * @{
40 */
41
42 /** @addtogroup HAL_DC HAL DC
43 * @{
44 */
45
46 /** @defgroup HAL_GDC_INTERN GDC Intern
47 * @brief DC-related MIPI command definition.
48 * @{
49 */
50
51 #ifndef HAL_GDC_INTERN_H__
52 #define HAL_GDC_INTERN_H__
53
54 /**
55 * @addtogroup HAL_GDC_INTERN_MACRO Defines
56 * @{
57 */
58 /** @defgroup HAL_GDC_INTERN_RW_CMD The DC RW CMD
59 * @{
60 */
61 #define HAL_GDC_MAGIC (0x87452365) /**< DC ID */
62 #define HAL_GDC_DBIB_STALL (1U << 31) /**< Specify MIPI DBI */
63 #define SPI_WRITE (2U) /**< Set to SPI Write CMD */
64 #define SPI_READ (3U) /**< Set to SPI Read CMD */
65 #define SPICMD (1U<<5U) /**< Special as SPI CMD */
66 #define QSPICMD (0U<<5U) /**< Special as QSPI CMD */
67 #define QSPIDATA (1U<<4U) /**< Special as QSPI DATA */
68 #define CMD_OFFSET (8U) /**< offset for command */
69 #define CMD1_DATA1 (SPI_WRITE) /**< Send cmd in 1-wire and data in 1-wire */
70 #define CMD1_DATA4 (SPICMD|QSPIDATA|SPI_WRITE) /**< Send cmd in 1-wire and data in 4-wire */
71 #define CMD4_DATA4 (QSPICMD|QSPIDATA|SPI_WRITE) /**< Send cmd in 4-wire and data in 4-wire */
72 #define CMD1_RDAT1 (SPI_READ) /**< Read cmd in 1-wire and data in 1-wire */
73 /** @} */
74
75 /** @} */
76
77 /** @addtogroup HAL_GDC_INTERN_ENUM Enumerations
78 * @{
79 */
80 /**
81 * @brief DC's color mode check definition
82 */
83 typedef enum {
84 HAL_GDC_DBIB_STALL_CHK = 1 << 31, /**< DBIB stall check */
85 HAL_GDC_OPENLDI_CHK = 1U << 30, /**< Openldi check */
86 HAL_GDC_JDIMIP_CHK = 1U << 29, /**< JDIMIP check */
87 HAL_GDC_ARGB4444_CHK = 1U << 22, /**< ARGB444 check */
88 HAL_GDC_RGBA4444_CHK = 1U << 21, /**< RGBA444 check */
89 HAL_GDC_GPI_CHK = 1U << 20, /**< GPI check */
90 HAL_GDC_EXTRCTRL_CHK = 1U << 19, /**< EXTRCTRL check */
91 HAL_GDC_TSC6_CHK = 1U << 18, /**< TSC6 check */
92 HAL_GDC_TSC_CHK = 1U << 17, /**< TSC check */
93 HAL_GDC_LUT8_CHK = 1U << 16, /**< LUT8 check */
94 HAL_GDC_RGBA5551_CHK = 1U << 15, /**< RGBA5551 check */
95 HAL_GDC_ABGR8888_CHK = 1U << 14, /**< ARGB8888 check */
96 HAL_GDC_RGB332_CHK = 1U << 13, /**< RGB332 check */
97 HAL_GDC_RGB565_CHK = 1U << 12, /**< RGB565 check */
98 HAL_GDC_BGRA8888_CHK = 1U << 11, /**< BGRA8888 check */
99 HAL_GDC_L8_CHK = 1U << 10, /**< L8 check */
100 HAL_GDC_L1_CHK = 1U << 9, /**< L1 check */
101 HAL_GDC_L4_CHK = 1U << 8, /**< L4 check */
102 HAL_GDC_YUVV_CHK = 1U << 7, /**< YUVV check */
103 HAL_GDC_RGB24_CHK = 1U << 6, /**< RGB24 check */
104 HAL_GDC_YUY2_CHK = 1U << 5, /**< YUV2 check */
105 HAL_GDC_RGBA8888_CHK = 1U << 4, /**< RGBA8888 check */
106 HAL_GDC_ARGB8888_CHK = 1U << 3, /**< ARGB8888 check */
107 HAL_GDC_V_YUV420_CHK = 1U << 2, /**< V_YUV420 check */
108 HAL_GDC_TLYUV420_CHK = 1U << 1, /**< TLYUV420 check */
109 HAL_GDC_BLOCK4X4_CHK = 1U << 0 /**< BLOCK4X4 check */
110 } hal_gdc_colormode_check_t;
111
112 /**
113 * @brief AXI control definition
114 */
115 typedef enum {
116 HAL_GDC_AXI_16BEAT = 0x0, /**< 16 beat */
117 HAL_GDC_AXI_2BEAT = 0x1, /**< 2beat */
118 HAL_GDC_AXI_4BEAT = 0x2, /**< 4 beat */
119 HAL_GDC_AXI_8BEAT = 0x3, /**< 8 beat */
120 HAL_GDC_AXI_32BEAT = 0x5, /**< 32 beat */
121 HAL_GDC_AXI_64BEAT = 0x6, /**< 64 beat */
122 HAL_GDC_AXI_128BEAT = 0x7, /**< 128 beat */
123 HAL_GDC_AXI_FT_HF = 0x0U << 3, /**< Ignore */
124 HAL_GDC_AXI_FT_2B = 0x1U << 3, /**< Ignore */
125 HAL_GDC_AXI_FT_4B = 0x2U << 3, /**< Ignore */
126 HAL_GDC_AXI_FT_8B = 0x3U << 3 /**< Ignore */
127 } hal_gdc_AXI_cfg_t;
128
129 /**
130 * @brief MIPI CMD definition
131 */
132 typedef enum {
133 hal_gdc_snapshot = 0xff, /**< Snapshot */
134 hal_gdc_store_base_addr = (1 <<31), /**< Store base addr */
135 hal_gdc_DBI_cmd = (1U<<30), /**< DBI CMD */
136 hal_gdc_wcmd16 = (1U<<28), /**< Write CMD 16bits */
137 hal_gdc_wcmd24 = (1U<<29), /**< Write CMD 24bits */
138 hal_gdc_wcmd32 = (1U<<29)|(1U<<28), /**< Write CMD 32bits */
139 hal_gdc_rcmd16 = (1U<<28), /**< Read CMD 16bits */
140 hal_gdc_rcmd24 = (1U<<29), /**< Read CMD 24its */
141 hal_gdc_rcmd32 = (1U<<29)|(1U<<28), /**< Read CMD 32bits */
142 hal_gdc_mask_qspi = (1U<<27), /**< Force QSPI to be single wire */
143 hal_gdc_DBI_ge = (1U<<27), /**< DBI ge */
144 hal_gdc_DBI_read = (1U<<26), /**< DBI read */
145 hal_gdc_ext_ctrl = (1U<<25), /**< Ext control */
146 hal_gdc_sline_cmd = (1U<<24), /**< Sline CMD */
147 hal_gdc_read_byte = (0U<<30), /**< Read 1Byte */
148 hal_gdc_read_2byte = (1U<<30), /**< Read 2Byte */
149 hal_gdc_read_3byte = (2 <<30), /**< Read 3Byte */
150 hal_gdc_read_4byte = (3 <<30) /**< Read 4Byte */
151 } dc_mipi_cmd_t;
152
153 /** @} */
154
155 #endif
156
157 /** @} */
158 /** @} */
159 /** @} */
HAL_GDC_RGBA5551_CHK
@ HAL_GDC_RGBA5551_CHK
RGBA5551 check.
Definition: hal_gdc_intern.h:94
HAL_GDC_TSC6_CHK
@ HAL_GDC_TSC6_CHK
TSC6 check.
Definition: hal_gdc_intern.h:91
HAL_GDC_TSC_CHK
@ HAL_GDC_TSC_CHK
TSC check.
Definition: hal_gdc_intern.h:92
HAL_GDC_GPI_CHK
@ HAL_GDC_GPI_CHK
GPI check.
Definition: hal_gdc_intern.h:89
dc_mipi_cmd_t
dc_mipi_cmd_t
MIPI CMD definition.
Definition: hal_gdc_intern.h:132
HAL_GDC_AXI_FT_4B
@ HAL_GDC_AXI_FT_4B
Ignore.
Definition: hal_gdc_intern.h:125
HAL_GDC_BGRA8888_CHK
@ HAL_GDC_BGRA8888_CHK
BGRA8888 check.
Definition: hal_gdc_intern.h:98
HAL_GDC_JDIMIP_CHK
@ HAL_GDC_JDIMIP_CHK
JDIMIP check.
Definition: hal_gdc_intern.h:86
HAL_GDC_AXI_2BEAT
@ HAL_GDC_AXI_2BEAT
2beat
Definition: hal_gdc_intern.h:117
hal_gdc_DBI_ge
@ hal_gdc_DBI_ge
DBI ge.
Definition: hal_gdc_intern.h:143
HAL_GDC_AXI_4BEAT
@ HAL_GDC_AXI_4BEAT
4 beat
Definition: hal_gdc_intern.h:118
hal_gdc_read_4byte
@ hal_gdc_read_4byte
Read 4Byte.
Definition: hal_gdc_intern.h:150
HAL_GDC_RGB24_CHK
@ HAL_GDC_RGB24_CHK
RGB24 check.
Definition: hal_gdc_intern.h:103
hal_gdc_DBI_read
@ hal_gdc_DBI_read
DBI read.
Definition: hal_gdc_intern.h:144
hal_gdc_read_2byte
@ hal_gdc_read_2byte
Read 2Byte.
Definition: hal_gdc_intern.h:148
HAL_GDC_YUY2_CHK
@ HAL_GDC_YUY2_CHK
YUV2 check.
Definition: hal_gdc_intern.h:104
HAL_GDC_YUVV_CHK
@ HAL_GDC_YUVV_CHK
YUVV check.
Definition: hal_gdc_intern.h:102
hal_gdc_wcmd32
@ hal_gdc_wcmd32
Write CMD 32bits.
Definition: hal_gdc_intern.h:138
HAL_GDC_L1_CHK
@ HAL_GDC_L1_CHK
L1 check.
Definition: hal_gdc_intern.h:100
hal_gdc_rcmd24
@ hal_gdc_rcmd24
Read CMD 24its.
Definition: hal_gdc_intern.h:140
HAL_GDC_RGB565_CHK
@ HAL_GDC_RGB565_CHK
RGB565 check.
Definition: hal_gdc_intern.h:97
hal_gdc_sline_cmd
@ hal_gdc_sline_cmd
Sline CMD.
Definition: hal_gdc_intern.h:146
HAL_GDC_RGBA8888_CHK
@ HAL_GDC_RGBA8888_CHK
RGBA8888 check.
Definition: hal_gdc_intern.h:105
HAL_GDC_ARGB4444_CHK
@ HAL_GDC_ARGB4444_CHK
ARGB444 check.
Definition: hal_gdc_intern.h:87
HAL_GDC_DBIB_STALL_CHK
@ HAL_GDC_DBIB_STALL_CHK
DBIB stall check.
Definition: hal_gdc_intern.h:84
HAL_GDC_EXTRCTRL_CHK
@ HAL_GDC_EXTRCTRL_CHK
EXTRCTRL check.
Definition: hal_gdc_intern.h:90
HAL_GDC_AXI_32BEAT
@ HAL_GDC_AXI_32BEAT
32 beat
Definition: hal_gdc_intern.h:120
HAL_GDC_L4_CHK
@ HAL_GDC_L4_CHK
L4 check.
Definition: hal_gdc_intern.h:101
hal_gdc_wcmd16
@ hal_gdc_wcmd16
Write CMD 16bits.
Definition: hal_gdc_intern.h:136
HAL_GDC_AXI_8BEAT
@ HAL_GDC_AXI_8BEAT
8 beat
Definition: hal_gdc_intern.h:119
HAL_GDC_AXI_FT_8B
@ HAL_GDC_AXI_FT_8B
Ignore.
Definition: hal_gdc_intern.h:126
HAL_GDC_BLOCK4X4_CHK
@ HAL_GDC_BLOCK4X4_CHK
BLOCK4X4 check.
Definition: hal_gdc_intern.h:109
HAL_GDC_LUT8_CHK
@ HAL_GDC_LUT8_CHK
LUT8 check.
Definition: hal_gdc_intern.h:93
HAL_GDC_AXI_FT_HF
@ HAL_GDC_AXI_FT_HF
Ignore.
Definition: hal_gdc_intern.h:123
HAL_GDC_OPENLDI_CHK
@ HAL_GDC_OPENLDI_CHK
Openldi check.
Definition: hal_gdc_intern.h:85
hal_gdc_read_byte
@ hal_gdc_read_byte
Read 1Byte.
Definition: hal_gdc_intern.h:147
HAL_GDC_ABGR8888_CHK
@ HAL_GDC_ABGR8888_CHK
ARGB8888 check.
Definition: hal_gdc_intern.h:95
HAL_GDC_AXI_FT_2B
@ HAL_GDC_AXI_FT_2B
Ignore.
Definition: hal_gdc_intern.h:124
hal_gdc_snapshot
@ hal_gdc_snapshot
Snapshot.
Definition: hal_gdc_intern.h:133
hal_gdc_AXI_cfg_t
hal_gdc_AXI_cfg_t
AXI control definition.
Definition: hal_gdc_intern.h:115
hal_gdc_DBI_cmd
@ hal_gdc_DBI_cmd
DBI CMD.
Definition: hal_gdc_intern.h:135
HAL_GDC_V_YUV420_CHK
@ HAL_GDC_V_YUV420_CHK
V_YUV420 check.
Definition: hal_gdc_intern.h:107
HAL_GDC_TLYUV420_CHK
@ HAL_GDC_TLYUV420_CHK
TLYUV420 check.
Definition: hal_gdc_intern.h:108
HAL_GDC_RGBA4444_CHK
@ HAL_GDC_RGBA4444_CHK
RGBA444 check.
Definition: hal_gdc_intern.h:88
hal_gdc_wcmd24
@ hal_gdc_wcmd24
Write CMD 24bits.
Definition: hal_gdc_intern.h:137
hal_gdc_rcmd32
@ hal_gdc_rcmd32
Read CMD 32bits.
Definition: hal_gdc_intern.h:141
hal_gdc_rcmd16
@ hal_gdc_rcmd16
Read CMD 16bits.
Definition: hal_gdc_intern.h:139
HAL_GDC_L8_CHK
@ HAL_GDC_L8_CHK
L8 check.
Definition: hal_gdc_intern.h:99
HAL_GDC_AXI_64BEAT
@ HAL_GDC_AXI_64BEAT
64 beat
Definition: hal_gdc_intern.h:121
hal_gdc_read_3byte
@ hal_gdc_read_3byte
Read 3Byte.
Definition: hal_gdc_intern.h:149
HAL_GDC_AXI_128BEAT
@ HAL_GDC_AXI_128BEAT
128 beat
Definition: hal_gdc_intern.h:122
HAL_GDC_ARGB8888_CHK
@ HAL_GDC_ARGB8888_CHK
ARGB8888 check.
Definition: hal_gdc_intern.h:106
hal_gdc_store_base_addr
@ hal_gdc_store_base_addr
Store base addr.
Definition: hal_gdc_intern.h:134
hal_gdc_mask_qspi
@ hal_gdc_mask_qspi
Force QSPI to be single wire.
Definition: hal_gdc_intern.h:142
HAL_GDC_RGB332_CHK
@ HAL_GDC_RGB332_CHK
RGB332 check.
Definition: hal_gdc_intern.h:96
hal_gdc_colormode_check_t
hal_gdc_colormode_check_t
DC's color mode check definition.
Definition: hal_gdc_intern.h:83
hal_gdc_ext_ctrl
@ hal_gdc_ext_ctrl
Ext control.
Definition: hal_gdc_intern.h:145
HAL_GDC_AXI_16BEAT
@ HAL_GDC_AXI_16BEAT
16 beat
Definition: hal_gdc_intern.h:116