STM32Cube BSP FW for STM32F769I-Discovery
Dependents: mbed-os-example-blinky-5 DISCO-F769NI_TOUCHSCREEN_demo_custom_1 Datarecorder2 DISCO-F769NI_TOUCHSCREEN_demo ... more
stm32f769i_discovery_lcd.h
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f769i_discovery_lcd.h 00004 * @author MCD Application Team 00005 * @brief This file contains the common defines and functions prototypes for 00006 * the stm32469i_discovery_lcd.c driver. 00007 ****************************************************************************** 00008 * @attention 00009 * 00010 * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> 00011 * 00012 * Redistribution and use in source and binary forms, with or without modification, 00013 * are permitted provided that the following conditions are met: 00014 * 1. Redistributions of source code must retain the above copyright notice, 00015 * this list of conditions and the following disclaimer. 00016 * 2. Redistributions in binary form must reproduce the above copyright notice, 00017 * this list of conditions and the following disclaimer in the documentation 00018 * and/or other materials provided with the distribution. 00019 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00020 * may be used to endorse or promote products derived from this software 00021 * without specific prior written permission. 00022 * 00023 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00024 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00025 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00026 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00027 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00028 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00029 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00030 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00031 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00032 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00033 * 00034 ****************************************************************************** 00035 */ 00036 00037 /* Define to prevent recursive inclusion -------------------------------------*/ 00038 #ifndef __STM32F769I_DISCOVERY_LCD_H 00039 #define __STM32F769I_DISCOVERY_LCD_H 00040 00041 #ifdef __cplusplus 00042 extern "C" { 00043 #endif 00044 00045 /* Includes ------------------------------------------------------------------*/ 00046 /* Include LCD component Driver */ 00047 00048 /* Include OTM8009A LCD Driver IC driver code */ 00049 #include "../Components/otm8009a/otm8009a.h" 00050 /* Include ADV7533 HDMI Driver IC driver code */ 00051 #include "../Components/adv7533/adv7533.h" 00052 00053 /* Include SDRAM Driver */ 00054 #include "stm32f769i_discovery_sdram.h" 00055 #include "stm32f769i_discovery.h" 00056 00057 #include "../../../Utilities/Fonts/fonts.h" 00058 00059 #include <string.h> /* use of memset() */ 00060 00061 /** @addtogroup BSP 00062 * @{ 00063 */ 00064 00065 /** @addtogroup STM32F769I_DISCOVERY 00066 * @{ 00067 */ 00068 00069 /** @addtogroup STM32F769I_DISCOVERY_LCD 00070 * @{ 00071 */ 00072 00073 /** @defgroup STM32F769I_DISCOVERY_LCD_Exported_Constants STM32F769I DISCOVERY LCD Exported Constants 00074 * @{ 00075 */ 00076 #define BSP_LCD_DMA2D_IRQHandler DMA2D_IRQHandler 00077 #define BSP_LCD_DSI_IRQHandler DSI_IRQHandler 00078 #define BSP_LCD_LTDC_IRQHandler LTDC_IRQHandler 00079 #define BSP_LCD_LTDC_ER_IRQHandler LTDC_ER_IRQHandler 00080 00081 00082 #define LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef 00083 /** 00084 * @brief LCD FB_StartAddress 00085 */ 00086 #define LCD_FB_START_ADDRESS ((uint32_t)0xC0000000) 00087 00088 /** @brief Maximum number of LTDC layers 00089 */ 00090 #define LTDC_MAX_LAYER_NUMBER ((uint32_t) 2) 00091 00092 /** @brief LTDC Background layer index 00093 */ 00094 #define LTDC_ACTIVE_LAYER_BACKGROUND ((uint32_t) 0) 00095 00096 /** @brief LTDC Foreground layer index 00097 */ 00098 #define LTDC_ACTIVE_LAYER_FOREGROUND ((uint32_t) 1) 00099 00100 /** @brief Number of LTDC layers 00101 */ 00102 #define LTDC_NB_OF_LAYERS ((uint32_t) 2) 00103 00104 /** @brief LTDC Default used layer index 00105 */ 00106 #define LTDC_DEFAULT_ACTIVE_LAYER LTDC_ACTIVE_LAYER_FOREGROUND 00107 00108 /** 00109 * @brief LCD status structure definition 00110 */ 00111 #define LCD_OK 0x00 00112 #define LCD_ERROR 0x01 00113 #define LCD_TIMEOUT 0x02 00114 00115 /** 00116 * @brief LCD Display OTM8009A DSI Virtual Channel ID 00117 */ 00118 #define LCD_OTM8009A_ID ((uint32_t) 0) 00119 00120 /** 00121 * @brief HDMI ADV7533 DSI Virtual Channel ID 00122 */ 00123 #define HDMI_ADV7533_ID ((uint32_t) 0) 00124 00125 /** 00126 * @brief HDMI Foramt 00127 */ 00128 #define HDMI_FORMAT_720_480 ((uint8_t) 0x00) /*720_480 format choice of HDMI display */ 00129 #define HDMI_FORMAT_720_576 ((uint8_t) 0x01) /*720_576 format choice of HDMI display*/ 00130 00131 /** 00132 * @brief LCD color definitions values 00133 * in ARGB8888 format. 00134 */ 00135 00136 /** @brief Blue value in ARGB8888 format 00137 */ 00138 #define LCD_COLOR_BLUE ((uint32_t) 0xFF0000FF) 00139 00140 /** @brief Green value in ARGB8888 format 00141 */ 00142 #define LCD_COLOR_GREEN ((uint32_t) 0xFF00FF00) 00143 00144 /** @brief Red value in ARGB8888 format 00145 */ 00146 #define LCD_COLOR_RED ((uint32_t) 0xFFFF0000) 00147 00148 /** @brief Cyan value in ARGB8888 format 00149 */ 00150 #define LCD_COLOR_CYAN ((uint32_t) 0xFF00FFFF) 00151 00152 /** @brief Magenta value in ARGB8888 format 00153 */ 00154 #define LCD_COLOR_MAGENTA ((uint32_t) 0xFFFF00FF) 00155 00156 /** @brief Yellow value in ARGB8888 format 00157 */ 00158 #define LCD_COLOR_YELLOW ((uint32_t) 0xFFFFFF00) 00159 00160 /** @brief Light Blue value in ARGB8888 format 00161 */ 00162 #define LCD_COLOR_LIGHTBLUE ((uint32_t) 0xFF8080FF) 00163 00164 /** @brief Light Green value in ARGB8888 format 00165 */ 00166 #define LCD_COLOR_LIGHTGREEN ((uint32_t) 0xFF80FF80) 00167 00168 /** @brief Light Red value in ARGB8888 format 00169 */ 00170 #define LCD_COLOR_LIGHTRED ((uint32_t) 0xFFFF8080) 00171 00172 /** @brief Light Cyan value in ARGB8888 format 00173 */ 00174 #define LCD_COLOR_LIGHTCYAN ((uint32_t) 0xFF80FFFF) 00175 00176 /** @brief Light Magenta value in ARGB8888 format 00177 */ 00178 #define LCD_COLOR_LIGHTMAGENTA ((uint32_t) 0xFFFF80FF) 00179 00180 /** @brief Light Yellow value in ARGB8888 format 00181 */ 00182 #define LCD_COLOR_LIGHTYELLOW ((uint32_t) 0xFFFFFF80) 00183 00184 /** @brief Dark Blue value in ARGB8888 format 00185 */ 00186 #define LCD_COLOR_DARKBLUE ((uint32_t) 0xFF000080) 00187 00188 /** @brief Light Dark Green value in ARGB8888 format 00189 */ 00190 #define LCD_COLOR_DARKGREEN ((uint32_t) 0xFF008000) 00191 00192 /** @brief Light Dark Red value in ARGB8888 format 00193 */ 00194 #define LCD_COLOR_DARKRED ((uint32_t) 0xFF800000) 00195 00196 /** @brief Dark Cyan value in ARGB8888 format 00197 */ 00198 #define LCD_COLOR_DARKCYAN ((uint32_t) 0xFF008080) 00199 00200 /** @brief Dark Magenta value in ARGB8888 format 00201 */ 00202 #define LCD_COLOR_DARKMAGENTA ((uint32_t) 0xFF800080) 00203 00204 /** @brief Dark Yellow value in ARGB8888 format 00205 */ 00206 #define LCD_COLOR_DARKYELLOW ((uint32_t) 0xFF808000) 00207 00208 /** @brief White value in ARGB8888 format 00209 */ 00210 #define LCD_COLOR_WHITE ((uint32_t) 0xFFFFFFFF) 00211 00212 /** @brief Light Gray value in ARGB8888 format 00213 */ 00214 #define LCD_COLOR_LIGHTGRAY ((uint32_t) 0xFFD3D3D3) 00215 00216 /** @brief Gray value in ARGB8888 format 00217 */ 00218 #define LCD_COLOR_GRAY ((uint32_t) 0xFF808080) 00219 00220 /** @brief Dark Gray value in ARGB8888 format 00221 */ 00222 #define LCD_COLOR_DARKGRAY ((uint32_t) 0xFF404040) 00223 00224 /** @brief Black value in ARGB8888 format 00225 */ 00226 #define LCD_COLOR_BLACK ((uint32_t) 0xFF000000) 00227 00228 /** @brief Brown value in ARGB8888 format 00229 */ 00230 #define LCD_COLOR_BROWN ((uint32_t) 0xFFA52A2A) 00231 00232 /** @brief Orange value in ARGB8888 format 00233 */ 00234 #define LCD_COLOR_ORANGE ((uint32_t) 0xFFFFA500) 00235 00236 /** @brief Transparent value in ARGB8888 format 00237 */ 00238 #define LCD_COLOR_TRANSPARENT ((uint32_t) 0xFF000000) 00239 00240 /** 00241 * @brief LCD default font 00242 */ 00243 #define LCD_DEFAULT_FONT Font24 00244 00245 /** 00246 * @brief Possible values of 00247 * pixel data format (ie color coding) transmitted on DSI Data lane in DSI packets 00248 */ 00249 00250 #define LCD_DSI_PIXEL_DATA_FMT_RBG888 DSI_RGB888 /*!< DSI packet pixel format chosen is RGB888 : 24 bpp */ 00251 #define LCD_DSI_PIXEL_DATA_FMT_RBG565 DSI_RGB565 /*!< DSI packet pixel format chosen is RGB565 : 16 bpp */ 00252 00253 /** 00254 * @} 00255 */ 00256 00257 /** @defgroup STM32F769I_DISCOVERY_LCD_Exported_Types STM32F769I DISCOVERY LCD Exported Types 00258 * @{ 00259 */ 00260 00261 /** 00262 * @brief LCD Drawing main properties 00263 */ 00264 typedef struct 00265 { 00266 uint32_t TextColor; /*!< Specifies the color of text */ 00267 uint32_t BackColor; /*!< Specifies the background color below the text */ 00268 sFONT *pFont; /*!< Specifies the font used for the text */ 00269 00270 } LCD_DrawPropTypeDef; 00271 00272 /** 00273 * @brief LCD Drawing point (pixel) geometric definition 00274 */ 00275 typedef struct 00276 { 00277 int16_t X; /*!< geometric X position of drawing */ 00278 int16_t Y; /*!< geometric Y position of drawing */ 00279 00280 } Point; 00281 00282 /** 00283 * @brief Pointer on LCD Drawing point (pixel) geometric definition 00284 */ 00285 typedef Point * pPoint; 00286 00287 /** 00288 * @brief LCD drawing Line alignment mode definitions 00289 */ 00290 typedef enum 00291 { 00292 CENTER_MODE = 0x01, /*!< Center mode */ 00293 RIGHT_MODE = 0x02, /*!< Right mode */ 00294 LEFT_MODE = 0x03 /*!< Left mode */ 00295 00296 } Text_AlignModeTypdef; 00297 00298 00299 /** 00300 * @brief LCD_OrientationTypeDef 00301 * Possible values of Display Orientation 00302 */ 00303 typedef enum 00304 { 00305 LCD_ORIENTATION_PORTRAIT = 0x00, /*!< Portrait orientation choice of LCD screen */ 00306 LCD_ORIENTATION_LANDSCAPE = 0x01, /*!< Landscape orientation choice of LCD screen */ 00307 LCD_ORIENTATION_INVALID = 0x02 /*!< Invalid orientation choice of LCD screen */ 00308 } LCD_OrientationTypeDef; 00309 00310 /** 00311 * @} 00312 */ 00313 00314 /** @defgroup STM32F769I_DISCOVERY_LCD_Exported_Macro STM32F769I DISCOVERY LCD Exported Macro 00315 * @{ 00316 */ 00317 00318 /** @addtogroup STM32F769I_DISCOVERY_LCD_Exported_Functions 00319 * @{ 00320 */ 00321 uint8_t BSP_LCD_Init(void); 00322 uint8_t BSP_LCD_InitEx(LCD_OrientationTypeDef orientation); 00323 uint8_t BSP_LCD_HDMIInitEx(uint8_t format); 00324 00325 void BSP_LCD_MspDeInit(void); 00326 void BSP_LCD_MspInit(void); 00327 void BSP_LCD_Reset(void); 00328 00329 uint32_t BSP_LCD_GetXSize(void); 00330 uint32_t BSP_LCD_GetYSize(void); 00331 void BSP_LCD_SetXSize(uint32_t imageWidthPixels); 00332 void BSP_LCD_SetYSize(uint32_t imageHeightPixels); 00333 00334 void BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address); 00335 void BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency); 00336 void BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address); 00337 void BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue); 00338 void BSP_LCD_ResetColorKeying(uint32_t LayerIndex); 00339 void BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); 00340 00341 void BSP_LCD_SelectLayer(uint32_t LayerIndex); 00342 void BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State); 00343 00344 void BSP_LCD_SetTextColor(uint32_t Color); 00345 uint32_t BSP_LCD_GetTextColor(void); 00346 void BSP_LCD_SetBackColor(uint32_t Color); 00347 uint32_t BSP_LCD_GetBackColor(void); 00348 void BSP_LCD_SetFont(sFONT *fonts); 00349 sFONT *BSP_LCD_GetFont(void); 00350 00351 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos); 00352 void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel); 00353 void BSP_LCD_Clear(uint32_t Color); 00354 void BSP_LCD_ClearStringLine(uint32_t Line); 00355 void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr); 00356 void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode); 00357 void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii); 00358 00359 void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length); 00360 void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length); 00361 void BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); 00362 void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); 00363 void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius); 00364 void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount); 00365 void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius); 00366 void BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp); 00367 00368 void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); 00369 void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius); 00370 void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount); 00371 void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius); 00372 00373 void BSP_LCD_DisplayOn(void); 00374 void BSP_LCD_DisplayOff(void); 00375 void BSP_LCD_SetBrightness(uint8_t BrightnessValue); 00376 00377 /** 00378 * @} 00379 */ 00380 00381 /** @defgroup STM32F769I_DISCOVERY_LCD_Exported_Variables STM32F769I DISCOVERY LCD Exported Variables 00382 * @{ 00383 */ 00384 00385 /* @brief DMA2D handle variable */ 00386 extern DMA2D_HandleTypeDef hdma2d_discovery; 00387 00388 /** 00389 * @} 00390 */ 00391 00392 /** 00393 * @} 00394 */ 00395 00396 /** 00397 * @} 00398 */ 00399 00400 /** 00401 * @} 00402 */ 00403 00404 /** 00405 * @} 00406 */ 00407 00408 #ifdef __cplusplus 00409 } 00410 #endif 00411 00412 #endif /* __STM32F769I_DISCOVERY_LCD_H */ 00413 00414 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Tue Jul 12 2022 17:55:04 by 1.7.2