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