STM32L152D_EVAL BSP User Manual: stm32l152d_eval_lcd.h Source File

STM32L152D_EVAL BSP

stm32l152d_eval_lcd.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l152d_eval_lcd.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32l152d_eval_lcd.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2017 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 /** @addtogroup BSP
00038   * @{
00039   */
00040 
00041 /** @addtogroup STM32L152D_EVAL
00042   * @{
00043   */
00044 
00045 /* Define to prevent recursive inclusion -------------------------------------*/
00046 #ifndef __STM32L152D_EVAL_LCD_H
00047 #define __STM32L152D_EVAL_LCD_H
00048 
00049 #ifdef __cplusplus
00050  extern "C" {
00051 #endif 
00052 
00053 /* Includes ------------------------------------------------------------------*/
00054 #include "stm32l152d_eval.h" 
00055 #include "../Components/hx8347d/hx8347d.h"
00056 #include "../Components/spfd5408/spfd5408.h"
00057 #include "../Components/ili9320/ili9320.h"
00058 #include "../Components/ili9325/ili9325.h"
00059 #include "../../../Utilities/Fonts/fonts.h"
00060 
00061 /** @addtogroup STM32L152D_EVAL_LCD
00062   * @{
00063   */ 
00064 
00065 
00066 /** @defgroup STM32L152D_EVAL_LCD_Exported_Types Exported Types
00067   * @{
00068   */
00069 typedef struct 
00070 { 
00071   uint32_t TextColor;
00072   uint32_t BackColor;
00073   sFONT    *pFont; 
00074 
00075 }LCD_DrawPropTypeDef;
00076 /**
00077   * @}
00078   */ 
00079 
00080 /** @defgroup STM32L152D_EVAL_LCD_Exported_Constants Exported Constants
00081   * @{
00082   */
00083 /** 
00084   * @brief  LCD status structure definition  
00085   */     
00086 #define LCD_OK         0x00
00087 #define LCD_ERROR      0x01
00088 #define LCD_TIMEOUT    0x02
00089     
00090 typedef struct 
00091 {
00092   int16_t X;
00093   int16_t Y;
00094 
00095 }Point, * pPoint; 
00096 
00097 /** 
00098   * @brief  Line mode structures definition
00099   */ 
00100 typedef enum
00101 {
00102   CENTER_MODE             = 0x01,    /*!< Center mode */
00103   RIGHT_MODE              = 0x02,    /*!< Right mode  */
00104   LEFT_MODE               = 0x03     /*!< Left mode   */
00105 
00106 }Line_ModeTypdef;
00107 
00108 /** 
00109   * @brief  LCD color  
00110   */ 
00111 #define LCD_COLOR_BLUE          (uint16_t)0x001F
00112 #define LCD_COLOR_GREEN         (uint16_t)0x07E0
00113 #define LCD_COLOR_RED           (uint16_t)0xF800
00114 #define LCD_COLOR_CYAN          (uint16_t)0x07FF
00115 #define LCD_COLOR_MAGENTA       (uint16_t)0xF81F
00116 #define LCD_COLOR_YELLOW        (uint16_t)0xFFE0
00117 #define LCD_COLOR_LIGHTBLUE     (uint16_t)0x841F
00118 #define LCD_COLOR_LIGHTGREEN    (uint16_t)0x87F0
00119 #define LCD_COLOR_LIGHTRED      (uint16_t)0xFC10
00120 #define LCD_COLOR_LIGHTCYAN     (uint16_t)0x87FF
00121 #define LCD_COLOR_LIGHTMAGENTA  (uint16_t)0xFC1F
00122 #define LCD_COLOR_LIGHTYELLOW   (uint16_t)0xFFF0
00123 #define LCD_COLOR_DARKBLUE      (uint16_t)0x0010
00124 #define LCD_COLOR_DARKGREEN     (uint16_t)0x0400
00125 #define LCD_COLOR_DARKRED       (uint16_t)0x8000
00126 #define LCD_COLOR_DARKCYAN      (uint16_t)0x0410
00127 #define LCD_COLOR_DARKMAGENTA   (uint16_t)0x8010
00128 #define LCD_COLOR_DARKYELLOW    (uint16_t)0x8400
00129 #define LCD_COLOR_WHITE         (uint16_t)0xFFFF
00130 #define LCD_COLOR_LIGHTGRAY     (uint16_t)0xD69A
00131 #define LCD_COLOR_GRAY          (uint16_t)0x8410
00132 #define LCD_COLOR_DARKGRAY      (uint16_t)0x4208
00133 #define LCD_COLOR_BLACK         (uint16_t)0x0000
00134 #define LCD_COLOR_BROWN         (uint16_t)0xA145
00135 #define LCD_COLOR_ORANGE        (uint16_t)0xFD20
00136 
00137 /** 
00138   * @brief LCD default font 
00139   */ 
00140 #define LCD_DEFAULT_FONT         Font24
00141 
00142 /**
00143   * @}
00144   */
00145 
00146 /** @addtogroup STM32L152D_EVAL_LCD_Exported_Functions
00147   * @{
00148   */
00149 
00150 uint8_t  BSP_LCD_Init(void);
00151 uint32_t BSP_LCD_GetXSize(void);
00152 uint32_t BSP_LCD_GetYSize(void);
00153  
00154 uint16_t BSP_LCD_GetTextColor(void);
00155 uint16_t BSP_LCD_GetBackColor(void);
00156 void     BSP_LCD_SetTextColor(__IO uint16_t Color);
00157 void     BSP_LCD_SetBackColor(__IO uint16_t Color);
00158 void     BSP_LCD_SetFont(sFONT *fonts);
00159 sFONT    *BSP_LCD_GetFont(void);
00160 
00161 void     BSP_LCD_Clear(uint16_t Color);
00162 void     BSP_LCD_ClearStringLine(uint16_t Line);
00163 void     BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr);
00164 void     BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Line_ModeTypdef Mode);
00165 void     BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii);
00166 
00167 uint16_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos);
00168 void     BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint16_t RGB_Code);
00169 void     BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00170 void     BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
00171 void     BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
00172 void     BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00173 void     BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00174 void     BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount);
00175 void     BSP_LCD_FillTriangle(uint16_t X1, uint16_t X2, uint16_t X3, uint16_t Y1, uint16_t Y2, uint16_t Y3);
00176 void     BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount);
00177 void     BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00178 void     BSP_LCD_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp);
00179 void     BSP_LCD_DrawRGBImage(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pbmp);
00180 void     BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00181 void     BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00182 void     BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
00183 
00184 void     BSP_LCD_DisplayOff(void);
00185 void     BSP_LCD_DisplayOn(void);
00186 
00187 /**
00188   * @}
00189   */
00190 
00191 /**
00192   * @}
00193   */ 
00194 
00195 #ifdef __cplusplus
00196 }
00197 #endif
00198 
00199 #endif /* __STM32L152D_EVAL_LCD_H */
00200 
00201 /**
00202   * @}
00203   */ 
00204 
00205 /**
00206   * @}
00207   */ 
00208 
00209 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Thu Aug 24 2017 17:57:47 for STM32L152D_EVAL BSP User Manual by   doxygen 1.7.6.1