STM32Cube BSP FW for STM32F769I-Discovery
Dependents: mbed-os-example-blinky-5 DISCO-F769NI_TOUCHSCREEN_demo_custom_1 Datarecorder2 DISCO-F769NI_TOUCHSCREEN_demo ... more
Drivers/BSP/Components/otm8009a/otm8009a.c@4:72a949940ad6, 2019-11-15 (annotated)
- Committer:
- Jerome Coutant
- Date:
- Fri Nov 15 11:20:11 2019 +0100
- Revision:
- 4:72a949940ad6
- Parent:
- 0:c0f3bbab73d2
STM32Cube_FW_F7_V1.15.0 Update
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jerome Coutant
0:c0f3bbab73d2
|
1
|
/**
|
|
Jerome Coutant
0:c0f3bbab73d2
|
2
|
******************************************************************************
|
|
Jerome Coutant
0:c0f3bbab73d2
|
3
|
* @file otm8009a.c
|
|
Jerome Coutant
0:c0f3bbab73d2
|
4
|
* @author MCD Application Team
|
|
Jerome Coutant
0:c0f3bbab73d2
|
5
|
* @brief This file provides the LCD Driver for KoD KM-040TMP-02-0621 (WVGA)
|
|
Jerome Coutant
0:c0f3bbab73d2
|
6
|
* DSI LCD Display OTM8009A.
|
|
Jerome Coutant
0:c0f3bbab73d2
|
7
|
******************************************************************************
|
|
Jerome Coutant
0:c0f3bbab73d2
|
8
|
* @attention
|
|
Jerome Coutant
0:c0f3bbab73d2
|
9
|
*
|
|
Jerome Coutant
4:72a949940ad6
|
10
|
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
|
|
Jerome Coutant
0:c0f3bbab73d2
|
11
|
*
|
|
Jerome Coutant
0:c0f3bbab73d2
|
12
|
* Redistribution and use in source and binary forms, with or without modification,
|
|
Jerome Coutant
0:c0f3bbab73d2
|
13
|
* are permitted provided that the following conditions are met:
|
|
Jerome Coutant
0:c0f3bbab73d2
|
14
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
Jerome Coutant
0:c0f3bbab73d2
|
15
|
* this list of conditions and the following disclaimer.
|
|
Jerome Coutant
0:c0f3bbab73d2
|
16
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
Jerome Coutant
0:c0f3bbab73d2
|
17
|
* this list of conditions and the following disclaimer in the documentation
|
|
Jerome Coutant
0:c0f3bbab73d2
|
18
|
* and/or other materials provided with the distribution.
|
|
Jerome Coutant
0:c0f3bbab73d2
|
19
|
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
Jerome Coutant
0:c0f3bbab73d2
|
20
|
* may be used to endorse or promote products derived from this software
|
|
Jerome Coutant
0:c0f3bbab73d2
|
21
|
* without specific prior written permission.
|
|
Jerome Coutant
0:c0f3bbab73d2
|
22
|
*
|
|
Jerome Coutant
0:c0f3bbab73d2
|
23
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
Jerome Coutant
0:c0f3bbab73d2
|
24
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Jerome Coutant
0:c0f3bbab73d2
|
25
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
Jerome Coutant
0:c0f3bbab73d2
|
26
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
Jerome Coutant
0:c0f3bbab73d2
|
27
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Jerome Coutant
0:c0f3bbab73d2
|
28
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
Jerome Coutant
0:c0f3bbab73d2
|
29
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
Jerome Coutant
0:c0f3bbab73d2
|
30
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
Jerome Coutant
0:c0f3bbab73d2
|
31
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Jerome Coutant
0:c0f3bbab73d2
|
32
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Jerome Coutant
0:c0f3bbab73d2
|
33
|
*
|
|
Jerome Coutant
0:c0f3bbab73d2
|
34
|
******************************************************************************
|
|
Jerome Coutant
0:c0f3bbab73d2
|
35
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
36
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
37
|
/* Includes ------------------------------------------------------------------*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
38
|
#include "otm8009a.h"
|
|
Jerome Coutant
0:c0f3bbab73d2
|
39
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
40
|
/** @addtogroup BSP
|
|
Jerome Coutant
0:c0f3bbab73d2
|
41
|
* @{
|
|
Jerome Coutant
0:c0f3bbab73d2
|
42
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
43
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
44
|
/** @addtogroup Components
|
|
Jerome Coutant
0:c0f3bbab73d2
|
45
|
* @{
|
|
Jerome Coutant
0:c0f3bbab73d2
|
46
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
47
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
48
|
/** @defgroup OTM8009A OTM8009A
|
|
Jerome Coutant
0:c0f3bbab73d2
|
49
|
* @brief This file provides a set of functions needed to drive the
|
|
Jerome Coutant
0:c0f3bbab73d2
|
50
|
* otm8009a IC display driver.
|
|
Jerome Coutant
0:c0f3bbab73d2
|
51
|
* @{
|
|
Jerome Coutant
0:c0f3bbab73d2
|
52
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
53
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
54
|
/* Private types -------------------------------------------------------------*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
55
|
/* Private variables ---------------------------------------------------------*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
56
|
/* Private constants ---------------------------------------------------------*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
57
|
/** @defgroup OTM8009A_Private_Constants OTM8009A Private Constants
|
|
Jerome Coutant
0:c0f3bbab73d2
|
58
|
* @{
|
|
Jerome Coutant
0:c0f3bbab73d2
|
59
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
60
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
61
|
/*
|
|
Jerome Coutant
0:c0f3bbab73d2
|
62
|
* @brief Constant tables of register settings used to transmit DSI
|
|
Jerome Coutant
0:c0f3bbab73d2
|
63
|
* command packets as power up initialization sequence of the KoD LCD (OTM8009A LCD Driver)
|
|
Jerome Coutant
0:c0f3bbab73d2
|
64
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
65
|
const uint8_t lcdRegData1[] = {0x80,0x09,0x01,0xFF};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
66
|
const uint8_t lcdRegData2[] = {0x80,0x09,0xFF};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
67
|
const uint8_t lcdRegData3[] = {0x00,0x09,0x0F,0x0E,0x07,0x10,0x0B,0x0A,0x04,0x07,0x0B,0x08,0x0F,0x10,0x0A,0x01,0xE1};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
68
|
const uint8_t lcdRegData4[] = {0x00,0x09,0x0F,0x0E,0x07,0x10,0x0B,0x0A,0x04,0x07,0x0B,0x08,0x0F,0x10,0x0A,0x01,0xE2};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
69
|
const uint8_t lcdRegData5[] = {0x79,0x79,0xD8};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
70
|
const uint8_t lcdRegData6[] = {0x00,0x01,0xB3};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
71
|
const uint8_t lcdRegData7[] = {0x85,0x01,0x00,0x84,0x01,0x00,0xCE};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
72
|
const uint8_t lcdRegData8[] = {0x18,0x04,0x03,0x39,0x00,0x00,0x00,0x18,0x03,0x03,0x3A,0x00,0x00,0x00,0xCE};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
73
|
const uint8_t lcdRegData9[] = {0x18,0x02,0x03,0x3B,0x00,0x00,0x00,0x18,0x01,0x03,0x3C,0x00,0x00,0x00,0xCE};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
74
|
const uint8_t lcdRegData10[] = {0x01,0x01,0x20,0x20,0x00,0x00,0x01,0x02,0x00,0x00,0xCF};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
75
|
const uint8_t lcdRegData11[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
76
|
const uint8_t lcdRegData12[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
77
|
const uint8_t lcdRegData13[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
78
|
const uint8_t lcdRegData14[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
79
|
const uint8_t lcdRegData15[] = {0x00,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
80
|
const uint8_t lcdRegData16[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00,0xCB};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
81
|
const uint8_t lcdRegData17[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
82
|
const uint8_t lcdRegData18[] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCB};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
83
|
const uint8_t lcdRegData19[] = {0x00,0x26,0x09,0x0B,0x01,0x25,0x00,0x00,0x00,0x00,0xCC};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
84
|
const uint8_t lcdRegData20[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x0A,0x0C,0x02,0xCC};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
85
|
const uint8_t lcdRegData21[] = {0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
86
|
const uint8_t lcdRegData22[] = {0x00,0x25,0x0C,0x0A,0x02,0x26,0x00,0x00,0x00,0x00,0xCC};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
87
|
const uint8_t lcdRegData23[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x0B,0x09,0x01,0xCC};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
88
|
const uint8_t lcdRegData24[] = {0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
89
|
const uint8_t lcdRegData25[] = {0xFF,0xFF,0xFF,0xFF};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
90
|
/*
|
|
Jerome Coutant
0:c0f3bbab73d2
|
91
|
* CASET value (Column Address Set) : X direction LCD GRAM boundaries
|
|
Jerome Coutant
0:c0f3bbab73d2
|
92
|
* depending on LCD orientation mode and PASET value (Page Address Set) : Y direction
|
|
Jerome Coutant
0:c0f3bbab73d2
|
93
|
* LCD GRAM boundaries depending on LCD orientation mode
|
|
Jerome Coutant
0:c0f3bbab73d2
|
94
|
* XS[15:0] = 0x000 = 0, XE[15:0] = 0x31F = 799 for landscape mode : apply to CASET
|
|
Jerome Coutant
0:c0f3bbab73d2
|
95
|
* YS[15:0] = 0x000 = 0, YE[15:0] = 0x31F = 799 for portrait mode : : apply to PASET
|
|
Jerome Coutant
0:c0f3bbab73d2
|
96
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
97
|
const uint8_t lcdRegData27[] = {0x00, 0x00, 0x03, 0x1F, OTM8009A_CMD_CASET};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
98
|
/*
|
|
Jerome Coutant
0:c0f3bbab73d2
|
99
|
* XS[15:0] = 0x000 = 0, XE[15:0] = 0x1DF = 479 for portrait mode : apply to CASET
|
|
Jerome Coutant
0:c0f3bbab73d2
|
100
|
* YS[15:0] = 0x000 = 0, YE[15:0] = 0x1DF = 479 for landscape mode : apply to PASET
|
|
Jerome Coutant
0:c0f3bbab73d2
|
101
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
102
|
const uint8_t lcdRegData28[] = {0x00, 0x00, 0x01, 0xDF, OTM8009A_CMD_PASET};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
103
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
104
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
105
|
const uint8_t ShortRegData1[] = {OTM8009A_CMD_NOP, 0x00};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
106
|
const uint8_t ShortRegData2[] = {OTM8009A_CMD_NOP, 0x80};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
107
|
const uint8_t ShortRegData3[] = {0xC4, 0x30};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
108
|
const uint8_t ShortRegData4[] = {OTM8009A_CMD_NOP, 0x8A};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
109
|
const uint8_t ShortRegData5[] = {0xC4, 0x40};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
110
|
const uint8_t ShortRegData6[] = {OTM8009A_CMD_NOP, 0xB1};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
111
|
const uint8_t ShortRegData7[] = {0xC5, 0xA9};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
112
|
const uint8_t ShortRegData8[] = {OTM8009A_CMD_NOP, 0x91};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
113
|
const uint8_t ShortRegData9[] = {0xC5, 0x34};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
114
|
const uint8_t ShortRegData10[] = {OTM8009A_CMD_NOP, 0xB4};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
115
|
const uint8_t ShortRegData11[] = {0xC0, 0x50};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
116
|
const uint8_t ShortRegData12[] = {0xD9, 0x4E};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
117
|
const uint8_t ShortRegData13[] = {OTM8009A_CMD_NOP, 0x81};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
118
|
const uint8_t ShortRegData14[] = {0xC1, 0x66};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
119
|
const uint8_t ShortRegData15[] = {OTM8009A_CMD_NOP, 0xA1};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
120
|
const uint8_t ShortRegData16[] = {0xC1, 0x08};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
121
|
const uint8_t ShortRegData17[] = {OTM8009A_CMD_NOP, 0x92};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
122
|
const uint8_t ShortRegData18[] = {0xC5, 0x01};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
123
|
const uint8_t ShortRegData19[] = {OTM8009A_CMD_NOP, 0x95};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
124
|
const uint8_t ShortRegData20[] = {OTM8009A_CMD_NOP, 0x94};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
125
|
const uint8_t ShortRegData21[] = {0xC5, 0x33};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
126
|
const uint8_t ShortRegData22[] = {OTM8009A_CMD_NOP, 0xA3};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
127
|
const uint8_t ShortRegData23[] = {0xC0, 0x1B};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
128
|
const uint8_t ShortRegData24[] = {OTM8009A_CMD_NOP, 0x82};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
129
|
const uint8_t ShortRegData25[] = {0xC5, 0x83};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
130
|
const uint8_t ShortRegData26[] = {0xC4, 0x83};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
131
|
const uint8_t ShortRegData27[] = {0xC1, 0x0E};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
132
|
const uint8_t ShortRegData28[] = {OTM8009A_CMD_NOP, 0xA6};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
133
|
const uint8_t ShortRegData29[] = {OTM8009A_CMD_NOP, 0xA0};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
134
|
const uint8_t ShortRegData30[] = {OTM8009A_CMD_NOP, 0xB0};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
135
|
const uint8_t ShortRegData31[] = {OTM8009A_CMD_NOP, 0xC0};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
136
|
const uint8_t ShortRegData32[] = {OTM8009A_CMD_NOP, 0xD0};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
137
|
const uint8_t ShortRegData33[] = {OTM8009A_CMD_NOP, 0x90};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
138
|
const uint8_t ShortRegData34[] = {OTM8009A_CMD_NOP, 0xE0};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
139
|
const uint8_t ShortRegData35[] = {OTM8009A_CMD_NOP, 0xF0};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
140
|
const uint8_t ShortRegData36[] = {OTM8009A_CMD_SLPOUT, 0x00};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
141
|
const uint8_t ShortRegData37[] = {OTM8009A_CMD_COLMOD, OTM8009A_COLMOD_RGB565};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
142
|
const uint8_t ShortRegData38[] = {OTM8009A_CMD_COLMOD, OTM8009A_COLMOD_RGB888};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
143
|
const uint8_t ShortRegData39[] = {OTM8009A_CMD_MADCTR, OTM8009A_MADCTR_MODE_LANDSCAPE};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
144
|
const uint8_t ShortRegData40[] = {OTM8009A_CMD_WRDISBV, 0x7F};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
145
|
const uint8_t ShortRegData41[] = {OTM8009A_CMD_WRCTRLD, 0x2C};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
146
|
const uint8_t ShortRegData42[] = {OTM8009A_CMD_WRCABC, 0x02};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
147
|
const uint8_t ShortRegData43[] = {OTM8009A_CMD_WRCABCMB, 0xFF};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
148
|
const uint8_t ShortRegData44[] = {OTM8009A_CMD_DISPON, 0x00};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
149
|
const uint8_t ShortRegData45[] = {OTM8009A_CMD_RAMWR, 0x00};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
150
|
const uint8_t ShortRegData46[] = {0xCF, 0x00};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
151
|
const uint8_t ShortRegData47[] = {0xC5, 0x66};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
152
|
const uint8_t ShortRegData48[] = {OTM8009A_CMD_NOP, 0xB6};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
153
|
const uint8_t ShortRegData49[] = {0xF5, 0x06};
|
|
Jerome Coutant
4:72a949940ad6
|
154
|
const uint8_t ShortRegData50[] = {OTM8009A_CMD_NOP, 0xB1};
|
|
Jerome Coutant
4:72a949940ad6
|
155
|
const uint8_t ShortRegData51[] = {0xC6, 0x06};
|
|
Jerome Coutant
0:c0f3bbab73d2
|
156
|
/**
|
|
Jerome Coutant
0:c0f3bbab73d2
|
157
|
* @}
|
|
Jerome Coutant
0:c0f3bbab73d2
|
158
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
159
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
160
|
/* Private macros ------------------------------------------------------------*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
161
|
/* Private functions ---------------------------------------------------------*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
162
|
/** @defgroup OTM8009A_Exported_Variables
|
|
Jerome Coutant
0:c0f3bbab73d2
|
163
|
* @{
|
|
Jerome Coutant
0:c0f3bbab73d2
|
164
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
165
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
166
|
/**
|
|
Jerome Coutant
0:c0f3bbab73d2
|
167
|
* @}
|
|
Jerome Coutant
0:c0f3bbab73d2
|
168
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
169
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
170
|
/* Exported functions ---------------------------------------------------------*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
171
|
/** @defgroup OTM8009A_Exported_Functions OTM8009A Exported Functions
|
|
Jerome Coutant
0:c0f3bbab73d2
|
172
|
* @{
|
|
Jerome Coutant
0:c0f3bbab73d2
|
173
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
174
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
175
|
/**
|
|
Jerome Coutant
0:c0f3bbab73d2
|
176
|
* @brief DSI IO write short/long command.
|
|
Jerome Coutant
0:c0f3bbab73d2
|
177
|
* @note : Can be surcharged by application code implementation of the function.
|
|
Jerome Coutant
0:c0f3bbab73d2
|
178
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
179
|
__weak void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t *pParams)
|
|
Jerome Coutant
0:c0f3bbab73d2
|
180
|
{
|
|
Jerome Coutant
0:c0f3bbab73d2
|
181
|
/* NOTE : This function Should not be modified, when it is needed,
|
|
Jerome Coutant
0:c0f3bbab73d2
|
182
|
the DSI_IO_WriteCmd could be implemented in the user file
|
|
Jerome Coutant
0:c0f3bbab73d2
|
183
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
184
|
}
|
|
Jerome Coutant
0:c0f3bbab73d2
|
185
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
186
|
/**
|
|
Jerome Coutant
0:c0f3bbab73d2
|
187
|
* @brief Initializes the LCD KoD display part by communication in DSI mode in Video Mode
|
|
Jerome Coutant
0:c0f3bbab73d2
|
188
|
* with IC Display Driver OTM8009A (see IC Driver specification for more information).
|
|
Jerome Coutant
0:c0f3bbab73d2
|
189
|
* @param hdsi_eval : pointer on DSI configuration structure
|
|
Jerome Coutant
0:c0f3bbab73d2
|
190
|
* @param hdsivideo_handle : pointer on DSI video mode configuration structure
|
|
Jerome Coutant
0:c0f3bbab73d2
|
191
|
* @retval Status
|
|
Jerome Coutant
0:c0f3bbab73d2
|
192
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
193
|
uint8_t OTM8009A_Init(uint32_t ColorCoding, uint32_t orientation)
|
|
Jerome Coutant
0:c0f3bbab73d2
|
194
|
{
|
|
Jerome Coutant
0:c0f3bbab73d2
|
195
|
/* Enable CMD2 to access vendor specific commands */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
196
|
/* Enter in command 2 mode and set EXTC to enable address shift function (0x00) */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
197
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
198
|
DSI_IO_WriteCmd( 3, (uint8_t *)lcdRegData1);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
199
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
200
|
/* Enter ORISE Command 2 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
201
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2); /* Shift address to 0x80 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
202
|
DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData2);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
203
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
204
|
/////////////////////////////////////////////////////////////////////
|
|
Jerome Coutant
0:c0f3bbab73d2
|
205
|
/* SD_PCH_CTRL - 0xC480h - 129th parameter - Default 0x00 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
206
|
/* Set SD_PT */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
207
|
/* -> Source output level during porch and non-display area to GND */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
208
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
209
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData3);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
210
|
OTM8009A_IO_Delay(10);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
211
|
/* Not documented */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
212
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData4);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
213
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData5);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
214
|
OTM8009A_IO_Delay(10);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
215
|
/////////////////////////////////////////////////////////////////////
|
|
Jerome Coutant
0:c0f3bbab73d2
|
216
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
217
|
/* PWR_CTRL4 - 0xC4B0h - 178th parameter - Default 0xA8 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
218
|
/* Set gvdd_en_test */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
219
|
/* -> enable GVDD test mode !!! */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
220
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData6);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
221
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData7);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
222
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
223
|
/* PWR_CTRL2 - 0xC590h - 146th parameter - Default 0x79 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
224
|
/* Set pump 4 vgh voltage */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
225
|
/* -> from 15.0v down to 13.0v */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
226
|
/* Set pump 5 vgh voltage */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
227
|
/* -> from -12.0v downto -9.0v */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
228
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData8);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
229
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData9);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
230
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
231
|
/* P_DRV_M - 0xC0B4h - 181th parameter - Default 0x00 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
232
|
/* -> Column inversion */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
233
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData10);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
234
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData11);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
235
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
236
|
/* VCOMDC - 0xD900h - 1st parameter - Default 0x39h */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
237
|
/* VCOM Voltage settings */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
238
|
/* -> from -1.0000v downto -1.2625v */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
239
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
240
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData12);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
241
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
242
|
/* Oscillator adjustment for Idle/Normal mode (LPDT only) set to 65Hz (default is 60Hz) */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
243
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
244
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData14);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
245
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
246
|
/* Video mode internal */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
247
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData15);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
248
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData16);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
249
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
250
|
/* PWR_CTRL2 - 0xC590h - 147h parameter - Default 0x00 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
251
|
/* Set pump 4&5 x6 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
252
|
/* -> ONLY VALID when PUMP4_EN_ASDM_HV = "0" */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
253
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData17);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
254
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData18);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
255
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
256
|
/* PWR_CTRL2 - 0xC590h - 150th parameter - Default 0x33h */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
257
|
/* Change pump4 clock ratio */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
258
|
/* -> from 1 line to 1/2 line */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
259
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData19);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
260
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData9);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
261
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
262
|
/* GVDD/NGVDD settings */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
263
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
264
|
DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData5);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
265
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
266
|
/* PWR_CTRL2 - 0xC590h - 149th parameter - Default 0x33h */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
267
|
/* Rewrite the default value ! */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
268
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData20);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
269
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData21);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
270
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
271
|
/* Panel display timing Setting 3 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
272
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData22);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
273
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData23);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
274
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
275
|
/* Power control 1 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
276
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData24);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
277
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData25);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
278
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
279
|
/* Source driver precharge */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
280
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
281
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData26);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
282
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
283
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData15);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
284
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData27);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
285
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
286
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData28);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
287
|
DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData6);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
288
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
289
|
/* GOAVST */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
290
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
291
|
DSI_IO_WriteCmd( 6, (uint8_t *)lcdRegData7);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
292
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
293
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
294
|
DSI_IO_WriteCmd( 14, (uint8_t *)lcdRegData8);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
295
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
296
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
297
|
DSI_IO_WriteCmd( 14, (uint8_t *)lcdRegData9);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
298
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
299
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
300
|
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData10);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
301
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
302
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
303
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData46);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
304
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
305
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
306
|
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData11);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
307
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
308
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData33);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
309
|
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData12);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
310
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
311
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
312
|
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData13);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
313
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
314
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
315
|
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData14);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
316
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
317
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
318
|
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData15);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
319
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
320
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
321
|
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData16);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
322
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
323
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData34);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
324
|
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData17);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
325
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
326
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData35);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
327
|
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData18);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
328
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
329
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
330
|
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData19);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
331
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
332
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData33);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
333
|
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData20);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
334
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
335
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
336
|
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData21);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
337
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
338
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
339
|
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData22);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
340
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
341
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
342
|
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData23);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
343
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
344
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
345
|
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData24);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
346
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
347
|
/////////////////////////////////////////////////////////////////////////////
|
|
Jerome Coutant
0:c0f3bbab73d2
|
348
|
/* PWR_CTRL1 - 0xc580h - 130th parameter - default 0x00 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
349
|
/* Pump 1 min and max DM */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
350
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
351
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData47);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
352
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData48);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
353
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData49);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
354
|
/////////////////////////////////////////////////////////////////////////////
|
|
Jerome Coutant
0:c0f3bbab73d2
|
355
|
|
|
Jerome Coutant
4:72a949940ad6
|
356
|
/* CABC LEDPWM frequency adjusted to 19,5kHz */
|
|
Jerome Coutant
4:72a949940ad6
|
357
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData50);
|
|
Jerome Coutant
4:72a949940ad6
|
358
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData51);
|
|
Jerome Coutant
4:72a949940ad6
|
359
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
360
|
/* Exit CMD2 mode */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
361
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
362
|
DSI_IO_WriteCmd( 3, (uint8_t *)lcdRegData25);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
363
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
364
|
/*************************************************************************** */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
365
|
/* Standard DCS Initialization TO KEEP CAN BE DONE IN HSDT */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
366
|
/*************************************************************************** */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
367
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
368
|
/* NOP - goes back to DCS std command ? */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
369
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
370
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
371
|
/* Gamma correction 2.2+ table (HSDT possible) */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
372
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
373
|
DSI_IO_WriteCmd( 16, (uint8_t *)lcdRegData3);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
374
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
375
|
/* Gamma correction 2.2- table (HSDT possible) */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
376
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
377
|
DSI_IO_WriteCmd( 16, (uint8_t *)lcdRegData4);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
378
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
379
|
/* Send Sleep Out command to display : no parameter */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
380
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData36);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
381
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
382
|
/* Wait for sleep out exit */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
383
|
OTM8009A_IO_Delay(120);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
384
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
385
|
switch(ColorCoding)
|
|
Jerome Coutant
0:c0f3bbab73d2
|
386
|
{
|
|
Jerome Coutant
0:c0f3bbab73d2
|
387
|
case OTM8009A_FORMAT_RBG565 :
|
|
Jerome Coutant
0:c0f3bbab73d2
|
388
|
/* Set Pixel color format to RGB565 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
389
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData37);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
390
|
break;
|
|
Jerome Coutant
0:c0f3bbab73d2
|
391
|
case OTM8009A_FORMAT_RGB888 :
|
|
Jerome Coutant
0:c0f3bbab73d2
|
392
|
/* Set Pixel color format to RGB888 */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
393
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData38);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
394
|
break;
|
|
Jerome Coutant
0:c0f3bbab73d2
|
395
|
default :
|
|
Jerome Coutant
0:c0f3bbab73d2
|
396
|
break;
|
|
Jerome Coutant
0:c0f3bbab73d2
|
397
|
}
|
|
Jerome Coutant
0:c0f3bbab73d2
|
398
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
399
|
/* Send command to configure display in landscape orientation mode. By default
|
|
Jerome Coutant
0:c0f3bbab73d2
|
400
|
the orientation mode is portrait */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
401
|
if(orientation == OTM8009A_ORIENTATION_LANDSCAPE)
|
|
Jerome Coutant
0:c0f3bbab73d2
|
402
|
{
|
|
Jerome Coutant
0:c0f3bbab73d2
|
403
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData39);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
404
|
DSI_IO_WriteCmd( 4, (uint8_t *)lcdRegData27);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
405
|
DSI_IO_WriteCmd( 4, (uint8_t *)lcdRegData28);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
406
|
}
|
|
Jerome Coutant
0:c0f3bbab73d2
|
407
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
408
|
/** CABC : Content Adaptive Backlight Control section start >> */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
409
|
/* Note : defaut is 0 (lowest Brightness), 0xFF is highest Brightness, try 0x7F : intermediate value */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
410
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData40);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
411
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
412
|
/* defaut is 0, try 0x2C - Brightness Control Block, Display Dimming & BackLight on */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
413
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData41);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
414
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
415
|
/* defaut is 0, try 0x02 - image Content based Adaptive Brightness [Still Picture] */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
416
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData42);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
417
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
418
|
/* defaut is 0 (lowest Brightness), 0xFF is highest Brightness */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
419
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData43);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
420
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
421
|
/** CABC : Content Adaptive Backlight Control section end << */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
422
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
423
|
/* Send Command Display On */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
424
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData44);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
425
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
426
|
/* NOP command */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
427
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
428
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
429
|
/* Send Command GRAM memory write (no parameters) : this initiates frame write via other DSI commands sent by */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
430
|
/* DSI host from LTDC incoming pixels in video mode */
|
|
Jerome Coutant
0:c0f3bbab73d2
|
431
|
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData45);
|
|
Jerome Coutant
0:c0f3bbab73d2
|
432
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
433
|
return 0;
|
|
Jerome Coutant
0:c0f3bbab73d2
|
434
|
}
|
|
Jerome Coutant
0:c0f3bbab73d2
|
435
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
436
|
/**
|
|
Jerome Coutant
0:c0f3bbab73d2
|
437
|
* @}
|
|
Jerome Coutant
0:c0f3bbab73d2
|
438
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
439
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
440
|
/**
|
|
Jerome Coutant
0:c0f3bbab73d2
|
441
|
* @}
|
|
Jerome Coutant
0:c0f3bbab73d2
|
442
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
443
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
444
|
/**
|
|
Jerome Coutant
0:c0f3bbab73d2
|
445
|
* @}
|
|
Jerome Coutant
0:c0f3bbab73d2
|
446
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
447
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
448
|
/**
|
|
Jerome Coutant
0:c0f3bbab73d2
|
449
|
* @}
|
|
Jerome Coutant
0:c0f3bbab73d2
|
450
|
*/
|
|
Jerome Coutant
0:c0f3bbab73d2
|
451
|
|
|
Jerome Coutant
0:c0f3bbab73d2
|
452
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|