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