Additional font macro

Dependents:   EspSerial

Committer:
SomeRandomBloke
Date:
Fri Feb 05 09:20:30 2016 +0000
Revision:
1:a6fd0931a9e9
Parent:
0:e1d164542663
Added additional font macro

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:e1d164542663 1 /**
bcostm 0:e1d164542663 2 ******************************************************************************
bcostm 0:e1d164542663 3 * @file stm32f429i_discovery_lcd.h
bcostm 0:e1d164542663 4 * @author MCD Application Team
bcostm 0:e1d164542663 5 * @version V2.1.2
bcostm 0:e1d164542663 6 * @date 02-March-2015
bcostm 0:e1d164542663 7 * @brief This file contains all the functions prototypes for the
bcostm 0:e1d164542663 8 * stm32f429i_discovery_lcd.c driver.
bcostm 0:e1d164542663 9 ******************************************************************************
bcostm 0:e1d164542663 10 * @attention
bcostm 0:e1d164542663 11 *
bcostm 0:e1d164542663 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bcostm 0:e1d164542663 13 *
bcostm 0:e1d164542663 14 * Redistribution and use in source and binary forms, with or without modification,
bcostm 0:e1d164542663 15 * are permitted provided that the following conditions are met:
bcostm 0:e1d164542663 16 * 1. Redistributions of source code must retain the above copyright notice,
bcostm 0:e1d164542663 17 * this list of conditions and the following disclaimer.
bcostm 0:e1d164542663 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
bcostm 0:e1d164542663 19 * this list of conditions and the following disclaimer in the documentation
bcostm 0:e1d164542663 20 * and/or other materials provided with the distribution.
bcostm 0:e1d164542663 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bcostm 0:e1d164542663 22 * may be used to endorse or promote products derived from this software
bcostm 0:e1d164542663 23 * without specific prior written permission.
bcostm 0:e1d164542663 24 *
bcostm 0:e1d164542663 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bcostm 0:e1d164542663 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bcostm 0:e1d164542663 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bcostm 0:e1d164542663 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bcostm 0:e1d164542663 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bcostm 0:e1d164542663 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bcostm 0:e1d164542663 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bcostm 0:e1d164542663 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bcostm 0:e1d164542663 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bcostm 0:e1d164542663 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bcostm 0:e1d164542663 35 *
bcostm 0:e1d164542663 36 ******************************************************************************
bcostm 0:e1d164542663 37 */
bcostm 0:e1d164542663 38
bcostm 0:e1d164542663 39 /* Define to prevent recursive inclusion -------------------------------------*/
bcostm 0:e1d164542663 40 #ifndef __STM32F429I_DISCOVERY_LCD_H
bcostm 0:e1d164542663 41 #define __STM32F429I_DISCOVERY_LCD_H
bcostm 0:e1d164542663 42
bcostm 0:e1d164542663 43 #ifdef __cplusplus
bcostm 0:e1d164542663 44 extern "C" {
bcostm 0:e1d164542663 45 #endif
bcostm 0:e1d164542663 46
bcostm 0:e1d164542663 47 /* Includes ------------------------------------------------------------------*/
bcostm 0:e1d164542663 48 #include "stm32f429i_discovery.h"
bcostm 0:e1d164542663 49 /* Include SDRAM Driver */
bcostm 0:e1d164542663 50 #include "stm32f429i_discovery_sdram.h"
bcostm 0:e1d164542663 51 #include "../Fonts/fonts.h"
bcostm 0:e1d164542663 52 /* Include LCD component driver */
bcostm 0:e1d164542663 53 #include "../Components/ili9341/ili9341.h"
bcostm 0:e1d164542663 54
bcostm 0:e1d164542663 55 /** @addtogroup BSP
bcostm 0:e1d164542663 56 * @{
bcostm 0:e1d164542663 57 */
bcostm 0:e1d164542663 58
bcostm 0:e1d164542663 59 /** @addtogroup STM32F429I_DISCOVERY
bcostm 0:e1d164542663 60 * @{
bcostm 0:e1d164542663 61 */
bcostm 0:e1d164542663 62
bcostm 0:e1d164542663 63 /** @defgroup STM32F429I_DISCOVERY_LCD
bcostm 0:e1d164542663 64 * @{
bcostm 0:e1d164542663 65 */
bcostm 0:e1d164542663 66
bcostm 0:e1d164542663 67 /** @defgroup STM32F429I_DISCOVERY_LCD_Exported_Types
bcostm 0:e1d164542663 68 * @{
bcostm 0:e1d164542663 69 */
bcostm 0:e1d164542663 70 typedef enum
bcostm 0:e1d164542663 71 {
bcostm 0:e1d164542663 72 LCD_OK = 0,
bcostm 0:e1d164542663 73 LCD_ERROR = 1,
bcostm 0:e1d164542663 74 LCD_TIMEOUT = 2
bcostm 0:e1d164542663 75 }LCD_StatusTypeDef;
bcostm 0:e1d164542663 76
bcostm 0:e1d164542663 77 typedef struct
bcostm 0:e1d164542663 78 {
bcostm 0:e1d164542663 79 uint32_t TextColor;
bcostm 0:e1d164542663 80 uint32_t BackColor;
bcostm 0:e1d164542663 81 sFONT *pFont;
bcostm 0:e1d164542663 82 }LCD_DrawPropTypeDef;
bcostm 0:e1d164542663 83
bcostm 0:e1d164542663 84 typedef struct
bcostm 0:e1d164542663 85 {
bcostm 0:e1d164542663 86 int16_t X;
bcostm 0:e1d164542663 87 int16_t Y;
bcostm 0:e1d164542663 88 } Point, * pPoint;
bcostm 0:e1d164542663 89
bcostm 0:e1d164542663 90 /**
bcostm 0:e1d164542663 91 * @brief Line mode structures definition
bcostm 0:e1d164542663 92 */
bcostm 0:e1d164542663 93 typedef enum
bcostm 0:e1d164542663 94 {
bcostm 0:e1d164542663 95 CENTER_MODE = 0x01, /* center mode */
bcostm 0:e1d164542663 96 RIGHT_MODE = 0x02, /* right mode */
bcostm 0:e1d164542663 97 LEFT_MODE = 0x03, /* left mode */
bcostm 0:e1d164542663 98 }Text_AlignModeTypdef;
bcostm 0:e1d164542663 99 /**
bcostm 0:e1d164542663 100 * @}
bcostm 0:e1d164542663 101 */
bcostm 0:e1d164542663 102
bcostm 0:e1d164542663 103 /** @defgroup STM32F429I_DISCOVERY_LCD_Exported_Constants
bcostm 0:e1d164542663 104 * @{
bcostm 0:e1d164542663 105 */
bcostm 0:e1d164542663 106 #define LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef
bcostm 0:e1d164542663 107
bcostm 0:e1d164542663 108 /**
bcostm 0:e1d164542663 109 * @brief LCD status structure definition
bcostm 0:e1d164542663 110 */
bcostm 0:e1d164542663 111 #define MAX_LAYER_NUMBER 2
bcostm 0:e1d164542663 112 #define LCD_FRAME_BUFFER ((uint32_t)0xD0000000)
bcostm 0:e1d164542663 113 #define BUFFER_OFFSET ((uint32_t)0x50000)
bcostm 0:e1d164542663 114
bcostm 0:e1d164542663 115 /**
bcostm 0:e1d164542663 116 * @brief LCD color
bcostm 0:e1d164542663 117 */
bcostm 0:e1d164542663 118 #define LCD_COLOR_BLUE 0xFF0000FF
bcostm 0:e1d164542663 119 #define LCD_COLOR_GREEN 0xFF00FF00
bcostm 0:e1d164542663 120 #define LCD_COLOR_RED 0xFFFF0000
bcostm 0:e1d164542663 121 #define LCD_COLOR_CYAN 0xFF00FFFF
bcostm 0:e1d164542663 122 #define LCD_COLOR_MAGENTA 0xFFFF00FF
bcostm 0:e1d164542663 123 #define LCD_COLOR_YELLOW 0xFFFFFF00
bcostm 0:e1d164542663 124 #define LCD_COLOR_LIGHTBLUE 0xFF8080FF
bcostm 0:e1d164542663 125 #define LCD_COLOR_LIGHTGREEN 0xFF80FF80
bcostm 0:e1d164542663 126 #define LCD_COLOR_LIGHTRED 0xFFFF8080
bcostm 0:e1d164542663 127 #define LCD_COLOR_LIGHTCYAN 0xFF80FFFF
bcostm 0:e1d164542663 128 #define LCD_COLOR_LIGHTMAGENTA 0xFFFF80FF
bcostm 0:e1d164542663 129 #define LCD_COLOR_LIGHTYELLOW 0xFFFFFF80
bcostm 0:e1d164542663 130 #define LCD_COLOR_DARKBLUE 0xFF000080
bcostm 0:e1d164542663 131 #define LCD_COLOR_DARKGREEN 0xFF008000
bcostm 0:e1d164542663 132 #define LCD_COLOR_DARKRED 0xFF800000
bcostm 0:e1d164542663 133 #define LCD_COLOR_DARKCYAN 0xFF008080
bcostm 0:e1d164542663 134 #define LCD_COLOR_DARKMAGENTA 0xFF800080
bcostm 0:e1d164542663 135 #define LCD_COLOR_DARKYELLOW 0xFF808000
bcostm 0:e1d164542663 136 #define LCD_COLOR_WHITE 0xFFFFFFFF
bcostm 0:e1d164542663 137 #define LCD_COLOR_LIGHTGRAY 0xFFD3D3D3
bcostm 0:e1d164542663 138 #define LCD_COLOR_GRAY 0xFF808080
bcostm 0:e1d164542663 139 #define LCD_COLOR_DARKGRAY 0xFF404040
bcostm 0:e1d164542663 140 #define LCD_COLOR_BLACK 0xFF000000
bcostm 0:e1d164542663 141 #define LCD_COLOR_BROWN 0xFFA52A2A
bcostm 0:e1d164542663 142 #define LCD_COLOR_ORANGE 0xFFFFA500
bcostm 0:e1d164542663 143 #define LCD_COLOR_TRANSPARENT 0xFF000000
bcostm 0:e1d164542663 144 /**
bcostm 0:e1d164542663 145 * @brief LCD default font
bcostm 0:e1d164542663 146 */
bcostm 0:e1d164542663 147 #define LCD_DEFAULT_FONT Font24
bcostm 0:e1d164542663 148
bcostm 0:e1d164542663 149 /**
bcostm 0:e1d164542663 150 * @brief LCD Layer
bcostm 0:e1d164542663 151 */
bcostm 0:e1d164542663 152 #define LCD_BACKGROUND_LAYER 0x0000
bcostm 0:e1d164542663 153 #define LCD_FOREGROUND_LAYER 0x0001
bcostm 0:e1d164542663 154
bcostm 0:e1d164542663 155 /**
bcostm 0:e1d164542663 156 * @}
bcostm 0:e1d164542663 157 */
bcostm 0:e1d164542663 158
bcostm 0:e1d164542663 159 /** @defgroup STM32F429I_DISCOVERY_LCD_Exported_Macros
bcostm 0:e1d164542663 160 * @{
bcostm 0:e1d164542663 161 */
bcostm 0:e1d164542663 162 /**
bcostm 0:e1d164542663 163 * @brief LCD Pixel format
bcostm 0:e1d164542663 164 */
bcostm 0:e1d164542663 165 #define LCD_PIXEL_FORMAT_ARGB8888 LTDC_PIXEL_FORMAT_ARGB8888
bcostm 0:e1d164542663 166 #define LCD_PIXEL_FORMAT_RGB888 LTDC_PIXEL_FORMAT_RGB888
bcostm 0:e1d164542663 167 #define LCD_PIXEL_FORMAT_RGB565 LTDC_PIXEL_FORMAT_RGB565
bcostm 0:e1d164542663 168 #define LCD_PIXEL_FORMAT_ARGB1555 LTDC_PIXEL_FORMAT_ARGB1555
bcostm 0:e1d164542663 169 #define LCD_PIXEL_FORMAT_ARGB4444 LTDC_PIXEL_FORMAT_ARGB4444
bcostm 0:e1d164542663 170 #define LCD_PIXEL_FORMAT_L8 LTDC_PIXEL_FORMAT_L8
bcostm 0:e1d164542663 171 #define LCD_PIXEL_FORMAT_AL44 LTDC_PIXEL_FORMAT_AL44
bcostm 0:e1d164542663 172 #define LCD_PIXEL_FORMAT_AL88 LTDC_PIXEL_FORMAT_AL88
bcostm 0:e1d164542663 173 /**
bcostm 0:e1d164542663 174 * @}
bcostm 0:e1d164542663 175 */
bcostm 0:e1d164542663 176
bcostm 0:e1d164542663 177 /** @defgroup STM32F429I_DISCOVERY_LCD_Exported_Functions
bcostm 0:e1d164542663 178 * @{
bcostm 0:e1d164542663 179 */
bcostm 0:e1d164542663 180 uint8_t BSP_LCD_Init(void);
bcostm 0:e1d164542663 181 uint32_t BSP_LCD_GetXSize(void);
bcostm 0:e1d164542663 182 uint32_t BSP_LCD_GetYSize(void);
bcostm 0:e1d164542663 183
bcostm 0:e1d164542663 184 /* functions using the LTDC controller */
bcostm 0:e1d164542663 185 void BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FrameBuffer);
bcostm 0:e1d164542663 186 void BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency);
bcostm 0:e1d164542663 187 void BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address);
bcostm 0:e1d164542663 188 void BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue);
bcostm 0:e1d164542663 189 void BSP_LCD_ResetColorKeying(uint32_t LayerIndex);
bcostm 0:e1d164542663 190 void BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
bcostm 0:e1d164542663 191 void BSP_LCD_SelectLayer(uint32_t LayerIndex);
bcostm 0:e1d164542663 192 void BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState state);
bcostm 0:e1d164542663 193
bcostm 0:e1d164542663 194 void BSP_LCD_SetTextColor(uint32_t Color);
bcostm 0:e1d164542663 195 void BSP_LCD_SetBackColor(uint32_t Color);
bcostm 0:e1d164542663 196 uint32_t BSP_LCD_GetTextColor(void);
bcostm 0:e1d164542663 197 uint32_t BSP_LCD_GetBackColor(void);
bcostm 0:e1d164542663 198 void BSP_LCD_SetFont(sFONT *pFonts);
bcostm 0:e1d164542663 199 sFONT *BSP_LCD_GetFont(void);
bcostm 0:e1d164542663 200
bcostm 0:e1d164542663 201 uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos);
bcostm 0:e1d164542663 202 void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel);
bcostm 0:e1d164542663 203 void BSP_LCD_Clear(uint32_t Color);
bcostm 0:e1d164542663 204 void BSP_LCD_ClearStringLine(uint32_t Line);
bcostm 0:e1d164542663 205 void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr);
bcostm 0:e1d164542663 206 void BSP_LCD_DisplayStringAt(uint16_t X, uint16_t Y, uint8_t *pText, Text_AlignModeTypdef mode);
bcostm 0:e1d164542663 207 void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii);
bcostm 0:e1d164542663 208
bcostm 0:e1d164542663 209 void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
bcostm 0:e1d164542663 210 void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
bcostm 0:e1d164542663 211 void BSP_LCD_DrawLine(uint16_t X1, uint16_t Y1, uint16_t X2, uint16_t Y2);
bcostm 0:e1d164542663 212 void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
bcostm 0:e1d164542663 213 void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
bcostm 0:e1d164542663 214 void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount);
bcostm 0:e1d164542663 215 void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
bcostm 0:e1d164542663 216 void BSP_LCD_DrawBitmap(uint32_t X, uint32_t Y, uint8_t *pBmp);
bcostm 0:e1d164542663 217
bcostm 0:e1d164542663 218 void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
bcostm 0:e1d164542663 219 void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
bcostm 0:e1d164542663 220 void BSP_LCD_FillTriangle(uint16_t X1, uint16_t X2, uint16_t X3, uint16_t Y1, uint16_t Y2, uint16_t Y3);
bcostm 0:e1d164542663 221 void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount);
bcostm 0:e1d164542663 222 void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
bcostm 0:e1d164542663 223
bcostm 0:e1d164542663 224 void BSP_LCD_DisplayOff(void);
bcostm 0:e1d164542663 225 void BSP_LCD_DisplayOn(void);
bcostm 0:e1d164542663 226
bcostm 0:e1d164542663 227 /**
bcostm 0:e1d164542663 228 * @}
bcostm 0:e1d164542663 229 */
bcostm 0:e1d164542663 230
bcostm 0:e1d164542663 231 /**
bcostm 0:e1d164542663 232 * @}
bcostm 0:e1d164542663 233 */
bcostm 0:e1d164542663 234
bcostm 0:e1d164542663 235 /**
bcostm 0:e1d164542663 236 * @}
bcostm 0:e1d164542663 237 */
bcostm 0:e1d164542663 238
bcostm 0:e1d164542663 239 /**
bcostm 0:e1d164542663 240 * @}
bcostm 0:e1d164542663 241 */
bcostm 0:e1d164542663 242
bcostm 0:e1d164542663 243 #ifdef __cplusplus
bcostm 0:e1d164542663 244 }
bcostm 0:e1d164542663 245 #endif
bcostm 0:e1d164542663 246
bcostm 0:e1d164542663 247 #endif /* __STM32F429I_DISCOVERY_LCD_H */
bcostm 0:e1d164542663 248
bcostm 0:e1d164542663 249 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/