STM32F723E-Discovery BSP User Manual
|
stm32f723e_discovery_lcd.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f723e_discovery_lcd.h 00004 * @author MCD Application Team 00005 * @brief This file contains the common defines and functions prototypes for 00006 * the stm32f723e_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 __STM32F723E_DISCOVERY_LCD_H 00039 #define __STM32F723E_DISCOVERY_LCD_H 00040 00041 #ifdef __cplusplus 00042 extern "C" { 00043 #endif 00044 00045 /* Includes ------------------------------------------------------------------*/ 00046 #include "stm32f723e_discovery.h" 00047 #include "../Components/st7789h2/st7789h2.h" 00048 #include "../../../Utilities/Fonts/fonts.h" 00049 00050 /** @addtogroup BSP 00051 * @{ 00052 */ 00053 00054 /** @addtogroup STM32F723E_DISCOVERY 00055 * @{ 00056 */ 00057 00058 /** @defgroup STM32F723E_DISCOVERY_LCD STM32F723E-DISCOVERY LCD 00059 * @{ 00060 */ 00061 00062 /** @defgroup STM32F723E_DISCOVERY_LCD_Exported_Types STM32F723E DISCOVERY LCD Exported Types 00063 * @{ 00064 */ 00065 typedef struct 00066 { 00067 uint32_t TextColor; 00068 uint32_t BackColor; 00069 sFONT *pFont; 00070 }LCD_DrawPropTypeDef; 00071 /** 00072 * @} 00073 */ 00074 00075 /** @defgroup STM32F723E_DISCOVERY_LCD_Exported_Constants STM32F723E DISCOVERY LCD Exported Constants 00076 * @{ 00077 */ 00078 /** 00079 * @brief LCD status structure definition 00080 */ 00081 #define LCD_OK ((uint8_t)0x00) 00082 #define LCD_ERROR ((uint8_t)0x01) 00083 #define LCD_TIMEOUT ((uint8_t)0x02) 00084 00085 typedef struct 00086 { 00087 int16_t X; 00088 int16_t Y; 00089 }Point, * pPoint; 00090 00091 /** 00092 * @brief Line mode structures definition 00093 */ 00094 typedef enum 00095 { 00096 CENTER_MODE = 0x01, /* Center mode */ 00097 RIGHT_MODE = 0x02, /* Right mode */ 00098 LEFT_MODE = 0x03 /* Left mode */ 00099 }Line_ModeTypdef; 00100 00101 00102 #define LCD_ORIENTATION_PORTRAIT ((uint8_t)0x00) /*!< Portrait orientation choice of LCD screen */ 00103 #define LCD_ORIENTATION_LANDSCAPE ((uint8_t)0x01) /*!< Landscape orientation choice of LCD screen */ 00104 #define LCD_ORIENTATION_LANDSCAPE_ROT180 ((uint32_t)0x02) /*!< Landscape rotated 180� orientation choice of LCD screen */ 00105 00106 00107 /** 00108 * @brief LCD color 00109 */ 00110 #define LCD_COLOR_BLUE ((uint16_t)0x001F) 00111 #define LCD_COLOR_GREEN ((uint16_t)0x07E0) 00112 #define LCD_COLOR_RED ((uint16_t)0xF800) 00113 #define LCD_COLOR_CYAN ((uint16_t)0x07FF) 00114 #define LCD_COLOR_MAGENTA ((uint16_t)0xF81F) 00115 #define LCD_COLOR_YELLOW ((uint16_t)0xFFE0) 00116 #define LCD_COLOR_LIGHTBLUE ((uint16_t)0x841F) 00117 #define LCD_COLOR_LIGHTGREEN ((uint16_t)0x87F0) 00118 #define LCD_COLOR_LIGHTRED ((uint16_t)0xFC10) 00119 #define LCD_COLOR_LIGHTMAGENTA ((uint16_t)0xFC1F) 00120 #define LCD_COLOR_LIGHTYELLOW ((uint16_t)0xFFF0) 00121 #define LCD_COLOR_DARKBLUE ((uint16_t)0x0010) 00122 #define LCD_COLOR_DARKGREEN ((uint16_t)0x0400) 00123 #define LCD_COLOR_DARKRED ((uint16_t)0x8000) 00124 #define LCD_COLOR_DARKCYAN ((uint16_t)0x0410) 00125 #define LCD_COLOR_DARKMAGENTA ((uint16_t)0x8010) 00126 #define LCD_COLOR_DARKYELLOW ((uint16_t)0x8400) 00127 #define LCD_COLOR_WHITE ((uint16_t)0xFFFF) 00128 #define LCD_COLOR_LIGHTGRAY ((uint16_t)0xD69A) 00129 #define LCD_COLOR_GRAY ((uint16_t)0x8410) 00130 #define LCD_COLOR_DARKGRAY ((uint16_t)0x4208) 00131 #define LCD_COLOR_BLACK ((uint16_t)0x0000) 00132 #define LCD_COLOR_BROWN ((uint16_t)0xA145) 00133 #define LCD_COLOR_ORANGE ((uint16_t)0xFD20) 00134 00135 /** 00136 * @brief LCD default font 00137 */ 00138 #define LCD_DEFAULT_FONT Font12 00139 00140 /** 00141 * @brief LCD special pins 00142 */ 00143 /* LCD reset pin */ 00144 #define LCD_RESET_PIN GPIO_PIN_7 00145 #define LCD_RESET_GPIO_PORT GPIOH 00146 #define LCD_RESET_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE() 00147 #define LCD_RESET_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE() 00148 00149 /* LCD tearing effect pin */ 00150 #define LCD_TE_PIN GPIO_PIN_8 00151 #define LCD_TE_GPIO_PORT GPIOC 00152 #define LCD_TE_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() 00153 #define LCD_TE_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE() 00154 00155 /* Backlight control pin */ 00156 #define LCD_BL_CTRL_PIN GPIO_PIN_11 00157 #define LCD_BL_CTRL_GPIO_PORT GPIOH 00158 #define LCD_BL_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE() 00159 #define LCD_BL_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE() 00160 00161 /** 00162 * @} 00163 */ 00164 00165 /** @defgroup STM32F723E_DISCOVERY_LCD_Exported_Functions STM32F723E DISCOVERY LCD Exported Functions 00166 * @{ 00167 */ 00168 uint8_t BSP_LCD_Init(void); 00169 uint8_t BSP_LCD_InitEx(uint32_t orientation); 00170 uint8_t BSP_LCD_DeInit(void); 00171 uint32_t BSP_LCD_GetXSize(void); 00172 uint32_t BSP_LCD_GetYSize(void); 00173 00174 uint16_t BSP_LCD_GetTextColor(void); 00175 uint16_t BSP_LCD_GetBackColor(void); 00176 void BSP_LCD_SetTextColor(__IO uint16_t Color); 00177 void BSP_LCD_SetBackColor(__IO uint16_t Color); 00178 void BSP_LCD_SetFont(sFONT *fonts); 00179 sFONT *BSP_LCD_GetFont(void); 00180 00181 void BSP_LCD_Clear(uint16_t Color); 00182 void BSP_LCD_ClearStringLine(uint16_t Line); 00183 void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr); 00184 void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Line_ModeTypdef Mode); 00185 void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii); 00186 00187 uint16_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos); 00188 void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint16_t RGB_Code); 00189 void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length); 00190 void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length); 00191 void BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); 00192 void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); 00193 void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius); 00194 void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount); 00195 void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius); 00196 void BSP_LCD_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp); 00197 void BSP_LCD_DrawRGBImage(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pbmp); 00198 void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); 00199 void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius); 00200 void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount); 00201 void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius); 00202 00203 void BSP_LCD_DisplayOff(void); 00204 void BSP_LCD_DisplayOn(void); 00205 00206 /* These functions can be modified in case the current settings 00207 need to be changed for specific application needs */ 00208 __weak void BSP_LCD_MspInit(void); 00209 __weak void BSP_LCD_MspDeInit(void); 00210 00211 /** 00212 * @} 00213 */ 00214 00215 /** 00216 * @} 00217 */ 00218 00219 /** 00220 * @} 00221 */ 00222 00223 /** 00224 * @} 00225 */ 00226 00227 #ifdef __cplusplus 00228 } 00229 #endif 00230 00231 #endif /* __STM32F723E_DISCOVERY_LCD_H */ 00232 00233 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Tue May 30 2017 13:59:12 for STM32F723E-Discovery BSP User Manual by 1.7.6.1