Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: DISCO_L4R9I-LCD-demo
stm32l4r9i_discovery_lcd.h
00001 /** 00002 ****************************************************************************** 00003 * @file stm32l4r9i_discovery_lcd.h 00004 * @author MCD Application Team 00005 * @brief This file contains the common defines and functions prototypes for 00006 * the stm32l4r9i_discovery_lcd.c driver. 00007 ****************************************************************************** 00008 * @attention 00009 * 00010 * <h2><center>© Copyright (c) 2017 STMicroelectronics. 00011 * All rights reserved.</center></h2> 00012 * 00013 * This software component is licensed by ST under BSD 3-Clause license, 00014 * the "License"; You may not use this file except in compliance with the 00015 * License. You may obtain a copy of the License at: 00016 * opensource.org/licenses/BSD-3-Clause 00017 * 00018 ****************************************************************************** 00019 */ 00020 00021 /* Define to prevent recursive inclusion -------------------------------------*/ 00022 #ifndef __STM32L4R9I_DISCOVERY_LCD_H 00023 #define __STM32L4R9I_DISCOVERY_LCD_H 00024 00025 #ifdef __cplusplus 00026 extern "C" { 00027 #endif 00028 00029 #include "stm32l4r9i_discovery.h" 00030 #include "../../../Utilities/Fonts/fonts.h" 00031 00032 /** @addtogroup BSP 00033 * @{ 00034 */ 00035 00036 /** @addtogroup STM32L4R9I_DISCOVERY 00037 * @{ 00038 */ 00039 00040 /** @addtogroup STM32L4R9I_DISCOVERY_LCD STM32L4R9I_DISCOVERY LCD 00041 * @{ 00042 */ 00043 00044 /** @defgroup STM32L4R9I_DISCOVERY_LCD_Exported_Constants LCD Exported Constants 00045 * @{ 00046 */ 00047 00048 /* LTDC layer configuration structure */ 00049 #define LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef 00050 00051 /* Maximum number of LTDC layers */ 00052 #define LTDC_MAX_LAYER_NUMBER ((uint32_t) 2) 00053 00054 /* LTDC Background layer index */ 00055 #define LTDC_ACTIVE_LAYER_BACKGROUND LTDC_LAYER_1 00056 00057 /* LTDC Foreground layer index : Not used on STM32L4R9I_DISCOVERY, only one layer used */ 00058 #define LTDC_ACTIVE_LAYER_FOREGROUND LTDC_LAYER_2 00059 00060 /* Number of LTDC layers */ 00061 #define LTDC_NB_OF_LAYERS ((uint32_t) 2) 00062 00063 /* LTDC Default used layer index */ 00064 #define LTDC_DEFAULT_ACTIVE_LAYER LTDC_ACTIVE_LAYER_BACKGROUND 00065 00066 /* LCD status */ 00067 #define LCD_OK 0x00 00068 #define LCD_ERROR 0x01 00069 #define LCD_TIMEOUT 0x02 00070 00071 /* LCD color definitions values in ARGB8888 format */ 00072 /* Blue value in ARGB8888 format */ 00073 #define LCD_COLOR_BLUE ((uint32_t) 0xFF0000FF) 00074 /* Green value in ARGB8888 format */ 00075 #define LCD_COLOR_GREEN ((uint32_t) 0xFF00FF00) 00076 /* Red value in ARGB8888 format */ 00077 #define LCD_COLOR_RED ((uint32_t) 0xFFFF0000) 00078 /* Cyan value in ARGB8888 format */ 00079 #define LCD_COLOR_CYAN ((uint32_t) 0xFF00FFFF) 00080 /* Magenta value in ARGB8888 format */ 00081 #define LCD_COLOR_MAGENTA ((uint32_t) 0xFFFF00FF) 00082 /* Yellow value in ARGB8888 format */ 00083 #define LCD_COLOR_YELLOW ((uint32_t) 0xFFFFFF00) 00084 /* Light Blue value in ARGB8888 format */ 00085 #define LCD_COLOR_LIGHTBLUE ((uint32_t) 0xFF8080FF) 00086 /* Light Green value in ARGB8888 format */ 00087 #define LCD_COLOR_LIGHTGREEN ((uint32_t) 0xFF80FF80) 00088 /* Light Red value in ARGB8888 format */ 00089 #define LCD_COLOR_LIGHTRED ((uint32_t) 0xFFFF8080) 00090 /* Light Cyan value in ARGB8888 format */ 00091 #define LCD_COLOR_LIGHTCYAN ((uint32_t) 0xFF80FFFF) 00092 /* Light Magenta value in ARGB8888 format */ 00093 #define LCD_COLOR_LIGHTMAGENTA ((uint32_t) 0xFFFF80FF) 00094 /* Light Yellow value in ARGB8888 format */ 00095 #define LCD_COLOR_LIGHTYELLOW ((uint32_t) 0xFFFFFF80) 00096 /* Dark Blue value in ARGB8888 format */ 00097 #define LCD_COLOR_DARKBLUE ((uint32_t) 0xFF000080) 00098 /* Light Dark Green value in ARGB8888 format */ 00099 #define LCD_COLOR_DARKGREEN ((uint32_t) 0xFF008000) 00100 /* Light Dark Red value in ARGB8888 format */ 00101 #define LCD_COLOR_DARKRED ((uint32_t) 0xFF800000) 00102 /* Dark Cyan value in ARGB8888 format */ 00103 #define LCD_COLOR_DARKCYAN ((uint32_t) 0xFF008080) 00104 /* Dark Magenta value in ARGB8888 format */ 00105 #define LCD_COLOR_DARKMAGENTA ((uint32_t) 0xFF800080) 00106 /* Dark Yellow value in ARGB8888 format */ 00107 #define LCD_COLOR_DARKYELLOW ((uint32_t) 0xFF808000) 00108 /* White value in ARGB8888 format */ 00109 #define LCD_COLOR_WHITE ((uint32_t) 0xFFFFFFFF) 00110 /* Light Gray value in ARGB8888 format */ 00111 #define LCD_COLOR_LIGHTGRAY ((uint32_t) 0xFFD3D3D3) 00112 /* Gray value in ARGB8888 format */ 00113 #define LCD_COLOR_GRAY ((uint32_t) 0xFF808080) 00114 /* Dark Gray value in ARGB8888 format */ 00115 #define LCD_COLOR_DARKGRAY ((uint32_t) 0xFF404040) 00116 /* Black value in ARGB8888 format */ 00117 #define LCD_COLOR_BLACK ((uint32_t) 0xFF000000) 00118 /* Brown value in ARGB8888 format */ 00119 #define LCD_COLOR_BROWN ((uint32_t) 0xFFA52A2A) 00120 /* Orange value in ARGB8888 format */ 00121 #define LCD_COLOR_ORANGE ((uint32_t) 0xFFFFA500) 00122 /* Transparent value in ARGB8888 format */ 00123 #define LCD_COLOR_TRANSPARENT ((uint32_t) 0xFF000000) 00124 00125 /* LCD default font */ 00126 #define LCD_DEFAULT_FONT Font24 00127 00128 /** 00129 * @} 00130 */ 00131 00132 /** @defgroup STM32L4R9I_DISCOVERY_LCD_Exported_Types LCD Exported Types 00133 * @{ 00134 */ 00135 00136 /* LCD Drawing main properties */ 00137 typedef struct 00138 { 00139 uint32_t TextColor; /*!< Specifies the color of text */ 00140 uint32_t BackColor; /*!< Specifies the background color below the text */ 00141 sFONT *pFont; /*!< Specifies the font used for the text */ 00142 } LCD_DrawPropTypeDef; 00143 00144 /* LCD Drawing point (pixel) geometric definition */ 00145 typedef struct 00146 { 00147 int16_t X; /*!< geometric X position of drawing */ 00148 int16_t Y; /*!< geometric Y position of drawing */ 00149 } Point; 00150 00151 /* Pointer on LCD Drawing point (pixel) geometric definition */ 00152 typedef Point * pPoint; 00153 00154 /* LCD drawing Line alignment mode definitions */ 00155 typedef enum 00156 { 00157 CENTER_MODE = 0x01, /*!< Center mode */ 00158 RIGHT_MODE = 0x02, /*!< Right mode */ 00159 LEFT_MODE = 0x03 /*!< Left mode */ 00160 } Text_AlignModeTypdef; 00161 00162 /* LCD_OrientationTypeDef : Possible values of Display Orientation */ 00163 typedef enum 00164 { 00165 LCD_ORIENTATION_PORTRAIT = 0x00, /*!< Portrait orientation choice of LCD screen */ 00166 LCD_ORIENTATION_LANDSCAPE = 0x01, /*!< Landscape orientation choice of LCD screen */ 00167 LCD_ORIENTATION_INVALID = 0x02 /*!< Invalid orientation choice of LCD screen */ 00168 } LCD_OrientationTypeDef; 00169 00170 /** 00171 * @} 00172 */ 00173 00174 /** @addtogroup STM32L4R9I_DISCOVERY_LCD_Exported_Functions 00175 * @{ 00176 */ 00177 00178 uint8_t BSP_LCD_Init(void); 00179 uint8_t BSP_LCD_DeInit(void); 00180 00181 uint32_t BSP_LCD_GetXSize(void); 00182 uint32_t BSP_LCD_GetYSize(void); 00183 00184 uint8_t BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency); 00185 uint8_t BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue); 00186 uint8_t BSP_LCD_ResetColorKeying(uint32_t LayerIndex); 00187 00188 uint8_t BSP_LCD_SelectLayer(uint32_t LayerIndex); 00189 uint8_t BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State); 00190 00191 void BSP_LCD_SetTextColor(uint32_t Color); 00192 uint32_t BSP_LCD_GetTextColor(void); 00193 void BSP_LCD_SetBackColor(uint32_t Color); 00194 uint32_t BSP_LCD_GetBackColor(void); 00195 void BSP_LCD_SetFont(sFONT *fonts); 00196 sFONT *BSP_LCD_GetFont(void); 00197 00198 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos); 00199 void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel); 00200 void BSP_LCD_Clear(uint32_t Color); 00201 void BSP_LCD_ClearStringLine(uint32_t Line); 00202 void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr); 00203 void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode); 00204 void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii); 00205 00206 void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length); 00207 void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length); 00208 void BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); 00209 void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); 00210 void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius); 00211 void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount); 00212 void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius); 00213 void BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp); 00214 00215 void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); 00216 void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius); 00217 void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount); 00218 void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius); 00219 00220 void BSP_LCD_DisplayOff(void); 00221 void BSP_LCD_DisplayOn(void); 00222 00223 void BSP_LCD_Refresh(void); 00224 uint8_t BSP_LCD_IsFrameBufferAvailable(void); 00225 00226 void BSP_LCD_SetBrightness(uint8_t BrightnessValue); 00227 00228 /* These __weak functions can be surcharged by application code for specific application needs */ 00229 void BSP_LCD_MspInit(void); 00230 void BSP_LCD_MspDeInit(void); 00231 00232 void BSP_LCD_DMA2D_IRQHandler(void); 00233 void BSP_LCD_DSI_IRQHandler(void); 00234 void BSP_LCD_LTDC_IRQHandler(void); 00235 void BSP_LCD_LTDC_ER_IRQHandler(void); 00236 00237 /** 00238 * @} 00239 */ 00240 00241 /** 00242 * @} 00243 */ 00244 00245 /** 00246 * @} 00247 */ 00248 00249 /** 00250 * @} 00251 */ 00252 00253 #ifdef __cplusplus 00254 } 00255 #endif 00256 00257 #endif /* __STM32L4R9I_DISCOVERY_LCD_H */ 00258 00259 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Wed Jul 13 2022 19:15:17 by
