Select one of the symbols to view example projects that use it.
 
Outline
Includes
#include "nt35510.h"
#include <stdio.h>
#include <stdarg.h>
Private constants
Private functions
Exported functions
NT35510_Init(uint32_t, uint32_t)
NT35510_DeInit()
Files
loading...
CodeScopeSTM32 Libraries and Samplesnt35510nt35510.c
 
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * @file nt35510.c * @author MCD Application Team * @brief This file provides the LCD Driver for Frida Techshine 3K138 (WVGA) * DSI LCD Display NT35510. ****************************************************************************** * @attention * * Copyright (c) 2020 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ /* Includes ------------------------------------------------------------------*/ #include "nt35510.h" #include <stdio.h> #include <stdarg.h> /** @addtogroup BSP * @{ *//* ... */ /** @addtogroup Components * @{ *//* ... */ /** @defgroup NT35510 NT35510 * @brief This file provides a set of functions needed to drive the * NT35510 IC display driver. * @{ *//* ... */ Includes /* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/ /** @defgroup NT35510_Private_Constants NT35510 Private Constants * @{ *//* ... */ /* * @brief Constant tables of register settings used to transmit DSI * command packets as power up initialization sequence of the Frida 3K138 *//* ... */ /** * @} *//* ... */ Private constants /* Private macros ------------------------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /** @defgroup NT35510_Exported_Variables * @{ *//* ... */ /** * @} *//* ... */ Private functions /* Exported functions ---------------------------------------------------------*/ /** @defgroup NT35510_Exported_Functions OTM8009A Exported Functions * @{ *//* ... */ /** * @brief Initializes the LCD Frida display part by communication in DSI mode in Video Mode * with IC Display Driver NT35510 (see IC Driver specification for more information). * @param hdsi_eval : pointer on DSI configuration structure * @param hdsivideo_handle : pointer on DSI video mode configuration structure * @retval Status *//* ... */ uint8_t NT35510_Init(uint32_t ColorCoding, uint32_t orientation) { NT35510_IO_Delay(120); /* ************************************************************************** */ /* Proprietary Initialization */ /* ************************************************************************** */ const uint8_t nt35510_reg[] = {0x55, 0xAA, 0x52, 0x08, 0x01, 0xF0}; const uint8_t nt35510_reg1[] = {0x03, 0x03, 0x03, 0xB0}; const uint8_t nt35510_reg2[] = {0x46, 0x46, 0x46, 0xB6}; const uint8_t nt35510_reg3[] = {0x03, 0x03, 0x03, 0xB1}; const uint8_t nt35510_reg4[] = {0x36, 0x36, 0x36, 0xB7}; const uint8_t nt35510_reg5[] = {0x00, 0x00, 0x02, 0xB2}; const uint8_t nt35510_reg6[] = {0x26, 0x26, 0x26, 0xB8}; const uint8_t nt35510_reg7[] = {0xBF, 0x01}; const uint8_t nt35510_reg8[] = {0x09, 0x09, 0x09, 0xB3}; const uint8_t nt35510_reg9[] = {0x36, 0x36, 0x36, 0xB9}; const uint8_t nt35510_reg10[] = {0x08, 0x08, 0x08, 0xB5}; const uint8_t nt35510_reg12[] = {0x26, 0x26, 0x26, 0xBA}; const uint8_t nt35510_reg13[] = {0x00, 0x80, 0x00, 0xBC}; const uint8_t nt35510_reg14[] = {0x00, 0x80, 0x00, 0xBD}; const uint8_t nt35510_reg15[] = {0x00, 0x50, 0xBE}; const uint8_t nt35510_reg16[] = {0x55, 0xAA, 0x52, 0x08, 0x00, 0xF0}; const uint8_t nt35510_reg17[] = {0xFC, 0x00, 0xB1}; const uint8_t nt35510_reg18[] = {0xB6, 0x03}; const uint8_t nt35510_reg19[] = {0xB5, 0x51}; const uint8_t nt35510_reg20[] = {0x00, 0x00, 0xB7}; const uint8_t nt35510_reg21[] = {0x01, 0x02, 0x02, 0x02, 0xB8}; const uint8_t nt35510_reg22[] = {0x00, 0x00, 0x00, 0xBC}; const uint8_t nt35510_reg23[] = {0x03, 0x00, 0x00, 0xCC}; const uint8_t nt35510_reg24[] = {0xBA, 0x01}; const uint8_t nt35510_madctl_portrait[] = {NT35510_CMD_MADCTL ,0x00}; const uint8_t nt35510_caset_portrait[] = {0x00, 0x00, 0x01, 0xDF ,NT35510_CMD_CASET}; const uint8_t nt35510_raset_portrait[] = {0x00, 0x00, 0x03, 0x1F ,NT35510_CMD_RASET}; const uint8_t nt35510_madctl_landscape[] = {NT35510_CMD_MADCTL, 0x60}; const uint8_t nt35510_caset_landscape[] = {0x00, 0x00, 0x03, 0x1F ,NT35510_CMD_CASET}; const uint8_t nt35510_raset_landscape[] = {0x00, 0x00, 0x01, 0xDF ,NT35510_CMD_RASET}; const uint8_t nt35510_reg26[] = {NT35510_CMD_TEEON, 0x00}; /* Tear on */ const uint8_t nt35510_reg27[] = {NT35510_CMD_SLPOUT, 0x00}; /* Sleep out */ const uint8_t nt35510_reg30[] = {NT35510_CMD_DISPON, 0x00}; const uint8_t nt35510_reg31[] = {NT35510_CMD_WRDISBV, 0x7F}; const uint8_t nt35510_reg32[] = {NT35510_CMD_WRCTRLD, 0x2C}; const uint8_t nt35510_reg33[] = {NT35510_CMD_WRCABC, 0x02}; const uint8_t nt35510_reg34[] = {NT35510_CMD_WRCABCMB, 0xFF}; const uint8_t nt35510_reg35[] = {NT35510_CMD_RAMWR, 0x00}; const uint8_t nt35510_reg36[] = {NT35510_CMD_COLMOD, NT35510_COLMOD_RGB565}; const uint8_t nt35510_reg37[] = {NT35510_CMD_COLMOD, NT35510_COLMOD_RGB888}; DSI_IO_WriteCmd(5, (uint8_t *)nt35510_reg); /* LV2: Page 1 enable */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg1);/* AVDD: 5.2V */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg2);/* AVDD: Ratio */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg3);/* AVEE: -5.2V */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg4);/* AVEE: Ratio */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg5);/* VCL: -2.5V */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg6);/* VCL: Ratio */ DSI_IO_WriteCmd(1, (uint8_t *)nt35510_reg7);/* VGH: 15V (Free Pump) */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg8); DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg9);/* VGH: Ratio */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg10);/* VGL_REG: -10V */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg12);/* VGLX: Ratio */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg13);/* VGMP/VGSP: 4.5V/0V */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg14);/* VGMN/VGSN:-4.5V/0V */ DSI_IO_WriteCmd(2, (uint8_t *)nt35510_reg15);/* VCOM: -1.325V */ /* ************************************************************************** */ /* Proprietary DCS Initialization */ /* ************************************************************************** */ DSI_IO_WriteCmd(5, (uint8_t *)nt35510_reg16);/* LV2: Page 0 enable */ DSI_IO_WriteCmd(2, (uint8_t *)nt35510_reg17);/* Display control */ DSI_IO_WriteCmd(1, (uint8_t *)nt35510_reg18);/* Src hold time */ DSI_IO_WriteCmd(1, (uint8_t *)nt35510_reg19); DSI_IO_WriteCmd(2, (uint8_t *)nt35510_reg20);/* Gate EQ control */ DSI_IO_WriteCmd(4, (uint8_t *)nt35510_reg21);/* Src EQ control(Mode2) */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg22);/* Inv. mode(2-dot) */ DSI_IO_WriteCmd(3, (uint8_t *)nt35510_reg23); DSI_IO_WriteCmd(1, (uint8_t *)nt35510_reg24); /* Tear on */ DSI_IO_WriteCmd(0, (uint8_t *)nt35510_reg26); /* Set Pixel color format to RGB888 */ DSI_IO_WriteCmd(0, (uint8_t *)nt35510_reg37); /* ************************************************************************** */ /* Standard DCS Initialization */ /* ************************************************************************** */ /* Add a delay, otherwise MADCTL not taken */ NT35510_IO_Delay(200); /* Configure orientation */ if(orientation == NT35510_ORIENTATION_PORTRAIT) { DSI_IO_WriteCmd(1, (uint8_t *)nt35510_madctl_portrait); DSI_IO_WriteCmd(4, (uint8_t *)nt35510_caset_portrait); DSI_IO_WriteCmd(4, (uint8_t *)nt35510_raset_portrait); }if (orientation == NT35510_ORIENTATION_PORTRAIT) { ... } else { DSI_IO_WriteCmd(1, (uint8_t *)nt35510_madctl_landscape); DSI_IO_WriteCmd(4, (uint8_t *)nt35510_caset_landscape); DSI_IO_WriteCmd(4, (uint8_t *)nt35510_raset_landscape); }else { ... } DSI_IO_WriteCmd(0, (uint8_t *)nt35510_reg27); /* Wait for sleep out exit */ NT35510_IO_Delay(120); switch(ColorCoding) { case NT35510_FORMAT_RBG565 : /* Set Pixel color format to RGB565 */ DSI_IO_WriteCmd(1, (uint8_t *)nt35510_reg36); break;case NT35510_FORMAT_RBG565 : case NT35510_FORMAT_RGB888 : /* Set Pixel color format to RGB888 */ DSI_IO_WriteCmd(1, (uint8_t *)nt35510_reg37); break;case NT35510_FORMAT_RGB888 : default : /* Set Pixel color format to RGB888 */ DSI_IO_WriteCmd(1, (uint8_t *)nt35510_reg37); break;default }switch (ColorCoding) { ... } /** CABC : Content Adaptive Backlight Control section start >> */ /* Note : defaut is 0 (lowest Brightness), 0xFF is highest Brightness, try 0x7F : intermediate value */ DSI_IO_WriteCmd(1, (uint8_t *)nt35510_reg31); /* defaut is 0, try 0x2C - Brightness Control Block, Display Dimming & BackLight on */ DSI_IO_WriteCmd(1, (uint8_t *)nt35510_reg32); /* defaut is 0, try 0x02 - image Content based Adaptive Brightness [Still Picture] */ DSI_IO_WriteCmd(1, (uint8_t *)nt35510_reg33); /* defaut is 0 (lowest Brightness), 0xFF is highest Brightness */ DSI_IO_WriteCmd(1, (uint8_t *)nt35510_reg34); /** CABC : Content Adaptive Backlight Control section end << */ /* Display on */ DSI_IO_WriteCmd(0, (uint8_t *)nt35510_reg30); /* Send Command GRAM memory write (no parameters) : this initiates frame write via other DSI commands sent by */ /* DSI host from LTDC incoming pixels in video mode */ DSI_IO_WriteCmd(0, (uint8_t *)nt35510_reg35); return 0; }{ ... } /** * @} *//* ... */ uint8_t NT35510_DeInit(void) { const uint8_t nt35510_reg30b[] = {NT35510_CMD_DISPOFF, 0x00}; const uint8_t nt35510_reg27b[] = {NT35510_CMD_SLPIN, 0x00}; /* Display off */ DSI_IO_WriteCmd(0, (uint8_t *)nt35510_reg30b); NT35510_IO_Delay(120); /* Sleep in */ DSI_IO_WriteCmd(0, (uint8_t *)nt35510_reg27b); return 0; }{ ... } /** * @} *//* ... */ /** * @} *//* ... */ /** * @} *//* ... */ Exported functions