Nenad Djalovic / BSP_DISCO_F469NIa

Fork of BSP_DISCO_F469NI by ST

Committer:
Jerome Coutant
Date:
Wed Feb 28 13:17:15 2018 +0100
Revision:
4:3cdfcc4f7c9d
Parent:
2:123b894b49dd
STM32Cube_FW_F4_V1.19.0 BSP_DISCO_F469NI

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jerome Coutant 2:123b894b49dd 1 /**
Jerome Coutant 2:123b894b49dd 2 ******************************************************************************
Jerome Coutant 2:123b894b49dd 3 * @file otm8009a.h
Jerome Coutant 2:123b894b49dd 4 * @author MCD Application Team
Jerome Coutant 2:123b894b49dd 5 * @version V1.0.2
Jerome Coutant 2:123b894b49dd 6 * @date 27-January-2017
Jerome Coutant 2:123b894b49dd 7 * @brief This file contains all the constants parameters for the OTM8009A
Jerome Coutant 2:123b894b49dd 8 * which is the LCD Driver for KoD KM-040TMP-02-0621 (WVGA)
Jerome Coutant 2:123b894b49dd 9 * DSI LCD Display.
Jerome Coutant 2:123b894b49dd 10 ******************************************************************************
Jerome Coutant 2:123b894b49dd 11 * @attention
Jerome Coutant 2:123b894b49dd 12 *
Jerome Coutant 2:123b894b49dd 13 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
Jerome Coutant 2:123b894b49dd 14 *
Jerome Coutant 2:123b894b49dd 15 * Redistribution and use in source and binary forms, with or without modification,
Jerome Coutant 2:123b894b49dd 16 * are permitted provided that the following conditions are met:
Jerome Coutant 2:123b894b49dd 17 * 1. Redistributions of source code must retain the above copyright notice,
Jerome Coutant 2:123b894b49dd 18 * this list of conditions and the following disclaimer.
Jerome Coutant 2:123b894b49dd 19 * 2. Redistributions in binary form must reproduce the above copyright notice,
Jerome Coutant 2:123b894b49dd 20 * this list of conditions and the following disclaimer in the documentation
Jerome Coutant 2:123b894b49dd 21 * and/or other materials provided with the distribution.
Jerome Coutant 2:123b894b49dd 22 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Jerome Coutant 2:123b894b49dd 23 * may be used to endorse or promote products derived from this software
Jerome Coutant 2:123b894b49dd 24 * without specific prior written permission.
Jerome Coutant 2:123b894b49dd 25 *
Jerome Coutant 2:123b894b49dd 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Jerome Coutant 2:123b894b49dd 27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Jerome Coutant 2:123b894b49dd 28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Jerome Coutant 2:123b894b49dd 29 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Jerome Coutant 2:123b894b49dd 30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Jerome Coutant 2:123b894b49dd 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Jerome Coutant 2:123b894b49dd 32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Jerome Coutant 2:123b894b49dd 33 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Jerome Coutant 2:123b894b49dd 34 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Jerome Coutant 2:123b894b49dd 35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Jerome Coutant 2:123b894b49dd 36 *
Jerome Coutant 2:123b894b49dd 37 ******************************************************************************
Jerome Coutant 2:123b894b49dd 38 */
Jerome Coutant 2:123b894b49dd 39
Jerome Coutant 2:123b894b49dd 40 /* Define to prevent recursive inclusion -------------------------------------*/
Jerome Coutant 2:123b894b49dd 41 #ifndef __OTM8009A_H
Jerome Coutant 2:123b894b49dd 42 #define __OTM8009A_H
Jerome Coutant 2:123b894b49dd 43
Jerome Coutant 2:123b894b49dd 44 #ifdef __cplusplus
Jerome Coutant 2:123b894b49dd 45 extern "C" {
Jerome Coutant 2:123b894b49dd 46 #endif
Jerome Coutant 2:123b894b49dd 47
Jerome Coutant 2:123b894b49dd 48 /* Includes ------------------------------------------------------------------*/
Jerome Coutant 2:123b894b49dd 49 #include <stdint.h>
Jerome Coutant 2:123b894b49dd 50 /** @addtogroup BSP
Jerome Coutant 2:123b894b49dd 51 * @{
Jerome Coutant 2:123b894b49dd 52 */
Jerome Coutant 2:123b894b49dd 53
Jerome Coutant 2:123b894b49dd 54 /** @addtogroup Components
Jerome Coutant 2:123b894b49dd 55 * @{
Jerome Coutant 2:123b894b49dd 56 */
Jerome Coutant 2:123b894b49dd 57
Jerome Coutant 2:123b894b49dd 58 /** @addtogroup otm8009a
Jerome Coutant 2:123b894b49dd 59 * @{
Jerome Coutant 2:123b894b49dd 60 */
Jerome Coutant 2:123b894b49dd 61
Jerome Coutant 2:123b894b49dd 62 /** @addtogroup OTM8009A_Exported_Variables
Jerome Coutant 2:123b894b49dd 63 * @{
Jerome Coutant 2:123b894b49dd 64 */
Jerome Coutant 2:123b894b49dd 65
Jerome Coutant 2:123b894b49dd 66 #if defined ( __GNUC__ )
Jerome Coutant 2:123b894b49dd 67 #ifndef __weak
Jerome Coutant 2:123b894b49dd 68 #define __weak __attribute__((weak))
Jerome Coutant 2:123b894b49dd 69 #endif /* __weak */
Jerome Coutant 2:123b894b49dd 70 #endif /* __GNUC__ */
Jerome Coutant 2:123b894b49dd 71
Jerome Coutant 2:123b894b49dd 72 /**
Jerome Coutant 2:123b894b49dd 73 * @brief LCD_OrientationTypeDef
Jerome Coutant 2:123b894b49dd 74 * Possible values of Display Orientation
Jerome Coutant 2:123b894b49dd 75 */
Jerome Coutant 2:123b894b49dd 76 #define OTM8009A_ORIENTATION_PORTRAIT ((uint32_t)0x00) /* Portrait orientation choice of LCD screen */
Jerome Coutant 2:123b894b49dd 77 #define OTM8009A_ORIENTATION_LANDSCAPE ((uint32_t)0x01) /* Landscape orientation choice of LCD screen */
Jerome Coutant 2:123b894b49dd 78
Jerome Coutant 2:123b894b49dd 79 /**
Jerome Coutant 2:123b894b49dd 80 * @brief Possible values of
Jerome Coutant 2:123b894b49dd 81 * pixel data format (ie color coding) transmitted on DSI Data lane in DSI packets
Jerome Coutant 2:123b894b49dd 82 */
Jerome Coutant 2:123b894b49dd 83 #define OTM8009A_FORMAT_RGB888 ((uint32_t)0x00) /* Pixel format chosen is RGB888 : 24 bpp */
Jerome Coutant 2:123b894b49dd 84 #define OTM8009A_FORMAT_RBG565 ((uint32_t)0x02) /* Pixel format chosen is RGB565 : 16 bpp */
Jerome Coutant 2:123b894b49dd 85
Jerome Coutant 2:123b894b49dd 86 /**
Jerome Coutant 2:123b894b49dd 87 * @brief otm8009a_480x800 Size
Jerome Coutant 2:123b894b49dd 88 */
Jerome Coutant 2:123b894b49dd 89
Jerome Coutant 2:123b894b49dd 90 /* Width and Height in Portrait mode */
Jerome Coutant 2:123b894b49dd 91 #define OTM8009A_480X800_WIDTH ((uint16_t)480) /* LCD PIXEL WIDTH */
Jerome Coutant 2:123b894b49dd 92 #define OTM8009A_480X800_HEIGHT ((uint16_t)800) /* LCD PIXEL HEIGHT */
Jerome Coutant 2:123b894b49dd 93
Jerome Coutant 2:123b894b49dd 94 /* Width and Height in Landscape mode */
Jerome Coutant 2:123b894b49dd 95 #define OTM8009A_800X480_WIDTH ((uint16_t)800) /* LCD PIXEL WIDTH */
Jerome Coutant 2:123b894b49dd 96 #define OTM8009A_800X480_HEIGHT ((uint16_t)480) /* LCD PIXEL HEIGHT */
Jerome Coutant 2:123b894b49dd 97
Jerome Coutant 2:123b894b49dd 98 /**
Jerome Coutant 2:123b894b49dd 99 * @brief OTM8009A_480X800 Timing parameters for Portrait orientation mode
Jerome Coutant 2:123b894b49dd 100 */
Jerome Coutant 2:123b894b49dd 101 #define OTM8009A_480X800_HSYNC ((uint16_t)2) /* Horizontal synchronization */
Jerome Coutant 2:123b894b49dd 102 #define OTM8009A_480X800_HBP ((uint16_t)34) /* Horizontal back porch */
Jerome Coutant 2:123b894b49dd 103 #define OTM8009A_480X800_HFP ((uint16_t)34) /* Horizontal front porch */
Jerome Coutant 2:123b894b49dd 104 #define OTM8009A_480X800_VSYNC ((uint16_t)1) /* Vertical synchronization */
Jerome Coutant 2:123b894b49dd 105 #define OTM8009A_480X800_VBP ((uint16_t)15) /* Vertical back porch */
Jerome Coutant 2:123b894b49dd 106 #define OTM8009A_480X800_VFP ((uint16_t)16) /* Vertical front porch */
Jerome Coutant 2:123b894b49dd 107
Jerome Coutant 2:123b894b49dd 108 /**
Jerome Coutant 2:123b894b49dd 109 * @brief OTM8009A_800X480 Timing parameters for Landscape orientation mode
Jerome Coutant 2:123b894b49dd 110 * Same values as for Portrait mode in fact.
Jerome Coutant 2:123b894b49dd 111 */
Jerome Coutant 2:123b894b49dd 112 #define OTM8009A_800X480_HSYNC OTM8009A_480X800_VSYNC /* Horizontal synchronization */
Jerome Coutant 2:123b894b49dd 113 #define OTM8009A_800X480_HBP OTM8009A_480X800_VBP /* Horizontal back porch */
Jerome Coutant 2:123b894b49dd 114 #define OTM8009A_800X480_HFP OTM8009A_480X800_VFP /* Horizontal front porch */
Jerome Coutant 2:123b894b49dd 115 #define OTM8009A_800X480_VSYNC OTM8009A_480X800_HSYNC /* Vertical synchronization */
Jerome Coutant 2:123b894b49dd 116 #define OTM8009A_800X480_VBP OTM8009A_480X800_HBP /* Vertical back porch */
Jerome Coutant 2:123b894b49dd 117 #define OTM8009A_800X480_VFP OTM8009A_480X800_HFP /* Vertical front porch */
Jerome Coutant 2:123b894b49dd 118
Jerome Coutant 2:123b894b49dd 119
Jerome Coutant 2:123b894b49dd 120 /* List of OTM8009A used commands */
Jerome Coutant 2:123b894b49dd 121 /* Detailed in OTM8009A Data Sheet 'DATA_SHEET_OTM8009A_V0 92.pdf' */
Jerome Coutant 2:123b894b49dd 122 /* Version of 14 June 2012 */
Jerome Coutant 2:123b894b49dd 123 #define OTM8009A_CMD_NOP 0x00 /* NOP command */
Jerome Coutant 2:123b894b49dd 124 #define OTM8009A_CMD_SWRESET 0x01 /* Sw reset command */
Jerome Coutant 2:123b894b49dd 125 #define OTM8009A_CMD_RDDMADCTL 0x0B /* Read Display MADCTR command : read memory display access ctrl */
Jerome Coutant 2:123b894b49dd 126 #define OTM8009A_CMD_RDDCOLMOD 0x0C /* Read Display pixel format */
Jerome Coutant 2:123b894b49dd 127 #define OTM8009A_CMD_SLPIN 0x10 /* Sleep In command */
Jerome Coutant 2:123b894b49dd 128 #define OTM8009A_CMD_SLPOUT 0x11 /* Sleep Out command */
Jerome Coutant 2:123b894b49dd 129 #define OTM8009A_CMD_PTLON 0x12 /* Partial mode On command */
Jerome Coutant 2:123b894b49dd 130
Jerome Coutant 2:123b894b49dd 131 #define OTM8009A_CMD_DISPOFF 0x28 /* Display Off command */
Jerome Coutant 2:123b894b49dd 132 #define OTM8009A_CMD_DISPON 0x29 /* Display On command */
Jerome Coutant 2:123b894b49dd 133
Jerome Coutant 2:123b894b49dd 134 #define OTM8009A_CMD_CASET 0x2A /* Column address set command */
Jerome Coutant 2:123b894b49dd 135 #define OTM8009A_CMD_PASET 0x2B /* Page address set command */
Jerome Coutant 2:123b894b49dd 136
Jerome Coutant 2:123b894b49dd 137 #define OTM8009A_CMD_RAMWR 0x2C /* Memory (GRAM) write command */
Jerome Coutant 2:123b894b49dd 138 #define OTM8009A_CMD_RAMRD 0x2E /* Memory (GRAM) read command */
Jerome Coutant 2:123b894b49dd 139
Jerome Coutant 2:123b894b49dd 140 #define OTM8009A_CMD_PLTAR 0x30 /* Partial area command (4 parameters) */
Jerome Coutant 2:123b894b49dd 141
Jerome Coutant 2:123b894b49dd 142 #define OTM8009A_CMD_TEOFF 0x34 /* Tearing Effect Line Off command : command with no parameter */
Jerome Coutant 2:123b894b49dd 143
Jerome Coutant 2:123b894b49dd 144 #define OTM8009A_CMD_TEEON 0x35 /* Tearing Effect Line On command : command with 1 parameter 'TELOM' */
Jerome Coutant 2:123b894b49dd 145
Jerome Coutant 2:123b894b49dd 146 /* Parameter TELOM : Tearing Effect Line Output Mode : possible values */
Jerome Coutant 2:123b894b49dd 147 #define OTM8009A_TEEON_TELOM_VBLANKING_INFO_ONLY 0x00
Jerome Coutant 2:123b894b49dd 148 #define OTM8009A_TEEON_TELOM_VBLANKING_AND_HBLANKING_INFO 0x01
Jerome Coutant 2:123b894b49dd 149
Jerome Coutant 2:123b894b49dd 150 #define OTM8009A_CMD_MADCTR 0x36 /* Memory Access write control command */
Jerome Coutant 2:123b894b49dd 151
Jerome Coutant 2:123b894b49dd 152 /* Possible used values of MADCTR */
Jerome Coutant 2:123b894b49dd 153 #define OTM8009A_MADCTR_MODE_PORTRAIT 0x00
Jerome Coutant 2:123b894b49dd 154 #define OTM8009A_MADCTR_MODE_LANDSCAPE 0x60 /* MY = 0, MX = 1, MV = 1, ML = 0, RGB = 0 */
Jerome Coutant 2:123b894b49dd 155
Jerome Coutant 2:123b894b49dd 156 #define OTM8009A_CMD_IDMOFF 0x38 /* Idle mode Off command */
Jerome Coutant 2:123b894b49dd 157 #define OTM8009A_CMD_IDMON 0x39 /* Idle mode On command */
Jerome Coutant 2:123b894b49dd 158
Jerome Coutant 2:123b894b49dd 159 #define OTM8009A_CMD_COLMOD 0x3A /* Interface Pixel format command */
Jerome Coutant 2:123b894b49dd 160
Jerome Coutant 2:123b894b49dd 161 /* Possible values of COLMOD parameter corresponding to used pixel formats */
Jerome Coutant 2:123b894b49dd 162 #define OTM8009A_COLMOD_RGB565 0x55
Jerome Coutant 2:123b894b49dd 163 #define OTM8009A_COLMOD_RGB888 0x77
Jerome Coutant 2:123b894b49dd 164
Jerome Coutant 2:123b894b49dd 165 #define OTM8009A_CMD_RAMWRC 0x3C /* Memory write continue command */
Jerome Coutant 2:123b894b49dd 166 #define OTM8009A_CMD_RAMRDC 0x3E /* Memory read continue command */
Jerome Coutant 2:123b894b49dd 167
Jerome Coutant 2:123b894b49dd 168 #define OTM8009A_CMD_WRTESCN 0x44 /* Write Tearing Effect Scan line command */
Jerome Coutant 2:123b894b49dd 169 #define OTM8009A_CMD_RDSCNL 0x45 /* Read Tearing Effect Scan line command */
Jerome Coutant 2:123b894b49dd 170
Jerome Coutant 2:123b894b49dd 171 /* CABC Management : ie : Content Adaptive Back light Control in IC OTM8009a */
Jerome Coutant 2:123b894b49dd 172 #define OTM8009A_CMD_WRDISBV 0x51 /* Write Display Brightness command */
Jerome Coutant 2:123b894b49dd 173 #define OTM8009A_CMD_WRCTRLD 0x53 /* Write CTRL Display command */
Jerome Coutant 2:123b894b49dd 174 #define OTM8009A_CMD_WRCABC 0x55 /* Write Content Adaptive Brightness command */
Jerome Coutant 2:123b894b49dd 175 #define OTM8009A_CMD_WRCABCMB 0x5E /* Write CABC Minimum Brightness command */
Jerome Coutant 2:123b894b49dd 176
Jerome Coutant 2:123b894b49dd 177 /**
Jerome Coutant 2:123b894b49dd 178 * @brief OTM8009A_480X800 frequency divider
Jerome Coutant 2:123b894b49dd 179 */
Jerome Coutant 2:123b894b49dd 180 #define OTM8009A_480X800_FREQUENCY_DIVIDER 2 /* LCD Frequency divider */
Jerome Coutant 2:123b894b49dd 181
Jerome Coutant 2:123b894b49dd 182 /**
Jerome Coutant 2:123b894b49dd 183 * @}
Jerome Coutant 2:123b894b49dd 184 */
Jerome Coutant 2:123b894b49dd 185
Jerome Coutant 2:123b894b49dd 186 /* Exported macro ------------------------------------------------------------*/
Jerome Coutant 2:123b894b49dd 187
Jerome Coutant 2:123b894b49dd 188 /** @defgroup OTM8009A_Exported_Macros OTM8009A Exported Macros
Jerome Coutant 2:123b894b49dd 189 * @{
Jerome Coutant 2:123b894b49dd 190 */
Jerome Coutant 2:123b894b49dd 191
Jerome Coutant 2:123b894b49dd 192 /**
Jerome Coutant 2:123b894b49dd 193 * @}
Jerome Coutant 2:123b894b49dd 194 */
Jerome Coutant 2:123b894b49dd 195
Jerome Coutant 2:123b894b49dd 196 /* Exported functions --------------------------------------------------------*/
Jerome Coutant 2:123b894b49dd 197
Jerome Coutant 2:123b894b49dd 198 /** @addtogroup OTM8009A_Exported_Functions
Jerome Coutant 2:123b894b49dd 199 * @{
Jerome Coutant 2:123b894b49dd 200 */
Jerome Coutant 2:123b894b49dd 201 void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t *pParams);
Jerome Coutant 2:123b894b49dd 202 uint8_t OTM8009A_Init(uint32_t ColorCoding, uint32_t orientation);
Jerome Coutant 2:123b894b49dd 203 void OTM8009A_IO_Delay(uint32_t Delay);
Jerome Coutant 2:123b894b49dd 204 /**
Jerome Coutant 2:123b894b49dd 205 * @}
Jerome Coutant 2:123b894b49dd 206 */
Jerome Coutant 2:123b894b49dd 207 #ifdef __cplusplus
Jerome Coutant 2:123b894b49dd 208 }
Jerome Coutant 2:123b894b49dd 209 #endif
Jerome Coutant 2:123b894b49dd 210
Jerome Coutant 2:123b894b49dd 211 #endif /* __OTM8009A_480X800_H */
Jerome Coutant 2:123b894b49dd 212 /**
Jerome Coutant 2:123b894b49dd 213 * @}
Jerome Coutant 2:123b894b49dd 214 */
Jerome Coutant 2:123b894b49dd 215
Jerome Coutant 2:123b894b49dd 216 /**
Jerome Coutant 2:123b894b49dd 217 * @}
Jerome Coutant 2:123b894b49dd 218 */
Jerome Coutant 2:123b894b49dd 219
Jerome Coutant 2:123b894b49dd 220 /**
Jerome Coutant 2:123b894b49dd 221 * @}
Jerome Coutant 2:123b894b49dd 222 */
Jerome Coutant 2:123b894b49dd 223
Jerome Coutant 2:123b894b49dd 224 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/