1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
/**
******************************************************************************
* @file stm32_lcd.h
* @author MCD Application Team
* @brief This file contains the common defines and functions prototypes for
* the stm32_lcd.c driver.
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef STM32_LCD_H
#define STM32_LCD_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "../Fonts/fonts.h"
#include "lcd.h"
#include <stddef.h>
/** @addtogroup Utilities
* @{
*/
/** @addtogroup STM32_EVAL
* @{
*/
/** @addtogroup Common
* @{
*/
/** @addtogroup STM32 LCD Utility
* @{
*/
/** @defgroup UTIL_LCD_Exported_Constants STM32 LCD Utility Exported Constants
* @{
*/
/**
* @brief LCD Utility color definitions values
*/
#define UTIL_LCD_COLOR_BLUE 0xFF0000FFUL
#define UTIL_LCD_COLOR_GREEN 0xFF00FF00UL
#define UTIL_LCD_COLOR_RED 0xFFFF0000UL
#define UTIL_LCD_COLOR_CYAN 0xFF00FFFFUL
#define UTIL_LCD_COLOR_MAGENTA 0xFFFF00FFUL
#define UTIL_LCD_COLOR_YELLOW 0xFFFFFF00UL
#define UTIL_LCD_COLOR_LIGHTBLUE 0xFF8080FFUL
#define UTIL_LCD_COLOR_LIGHTGREEN 0xFF80FF80UL
#define UTIL_LCD_COLOR_LIGHTRED 0xFFFF8080UL
#define UTIL_LCD_COLOR_LIGHTCYAN 0xFF80FFFFUL
#define UTIL_LCD_COLOR_LIGHTMAGENTA 0xFFFF80FFUL
#define UTIL_LCD_COLOR_LIGHTYELLOW 0xFFFFFF80UL
#define UTIL_LCD_COLOR_DARKBLUE 0xFF000080UL
#define UTIL_LCD_COLOR_DARKGREEN 0xFF008000UL
#define UTIL_LCD_COLOR_DARKRED 0xFF800000UL
#define UTIL_LCD_COLOR_DARKCYAN 0xFF008080UL
#define UTIL_LCD_COLOR_DARKMAGENTA 0xFF800080UL
#define UTIL_LCD_COLOR_DARKYELLOW 0xFF808000UL
#define UTIL_LCD_COLOR_WHITE 0xFFFFFFFFUL
#define UTIL_LCD_COLOR_LIGHTGRAY 0xFFD3D3D3UL
#define UTIL_LCD_COLOR_GRAY 0xFF808080UL
#define UTIL_LCD_COLOR_DARKGRAY 0xFF404040UL
#define UTIL_LCD_COLOR_BLACK 0xFF000000UL
#define UTIL_LCD_COLOR_BROWN 0xFFA52A2AUL
#define UTIL_LCD_COLOR_ORANGE 0xFFFFA500UL
/* Defintion of Official ST Colors */
#define UTIL_LCD_COLOR_ST_BLUE_DARK 0xFF002052UL
#define UTIL_LCD_COLOR_ST_BLUE 0xFF39A9DCUL
#define UTIL_LCD_COLOR_ST_BLUE_LIGHT 0xFFD1E4F3UL
#define UTIL_LCD_COLOR_ST_GREEN_LIGHT 0xFFBBCC01UL
#define UTIL_LCD_COLOR_ST_GREEN_DARK 0xFF003D14UL
#define UTIL_LCD_COLOR_ST_YELLOW 0xFFFFD300UL
#define UTIL_LCD_COLOR_ST_BROWN 0xFF5C0915UL
#define UTIL_LCD_COLOR_ST_PINK 0xFFD4007AUL
#define UTIL_LCD_COLOR_ST_PURPLE 0xFF590D58UL
#define UTIL_LCD_COLOR_ST_GRAY_DARK 0xFF4F5251UL
#define UTIL_LCD_COLOR_ST_GRAY 0xFF90989EUL
#define UTIL_LCD_COLOR_ST_GRAY_LIGHT 0xFFB9C4CAUL
/**
* @brief LCD Utility default font
*/
#define UTIL_LCD_DEFAULT_FONT Font24
/**
* @}
*/
/** @defgroup UTIL_LCD_Exported_Types STM32 LCD Utility Exported Types
* @{
*/
#define LINE(x) ((x) * (((sFONT *)UTIL_LCD_GetFont())->Height))
/**
* @}
*/
/** @defgroup UTIL_LCD_Exported_Types STM32 LCD Utility Exported Types
* @{
*/
/**
* @brief LCD Utility Drawing main properties
*/
typedef struct
{
uint32_t TextColor; /*!< Specifies the color of text */
uint32_t BackColor; /*!< Specifies the background color below the text */
sFONT *pFont; /*!< Specifies the font used for the text */
uint32_t LcdLayer;
uint32_t LcdDevice;
uint32_t LcdXsize;
uint32_t LcdYsize;
uint32_t LcdPixelFormat;
} UTIL_LCD_Ctx_t;
/**
* @brief LCD Utility Drawing point (pixel) geometric definition
*/
typedef struct
{
int16_t X; /*!< geometric X position of drawing */
int16_t Y; /*!< geometric Y position of drawing */
} Point;
/**
* @brief Pointer on LCD Utility Drawing point (pixel) geometric definition
*/
typedef Point * pPoint;
/**
* @brief LCD Utility drawing Line alignment mode definitions
*/
typedef enum
{
CENTER_MODE = 0x01, /*!< Center mode */
RIGHT_MODE = 0x02, /*!< Right mode */
LEFT_MODE = 0x03 /*!< Left mode */
} Text_AlignModeTypdef;
/**
* @}
*/
/** @addtogroup UTIL_LCD_Exported_Functions
* @{
*/
void UTIL_LCD_SetFuncDriver(const LCD_UTILS_Drv_t *pDrv);
void UTIL_LCD_SetLayer(uint32_t Layer);
void UTIL_LCD_SetDevice(uint32_t Device);
void UTIL_LCD_SetTextColor(uint32_t Color);
uint32_t UTIL_LCD_GetTextColor(void);
void UTIL_LCD_SetBackColor(uint32_t Color);
uint32_t UTIL_LCD_GetBackColor(void);
void UTIL_LCD_SetFont(sFONT *fonts);
sFONT *UTIL_LCD_GetFont(void);
void UTIL_LCD_Clear(uint32_t Color);
void UTIL_LCD_ClearStringLine(uint32_t Line);
void UTIL_LCD_DisplayStringAtLine(uint32_t Line, uint8_t *ptr);
void UTIL_LCD_DisplayStringAt(uint32_t Xpos, uint32_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode);
void UTIL_LCD_DisplayChar(uint32_t Xpos, uint32_t Ypos, uint8_t Ascii);
void UTIL_LCD_GetPixel(uint16_t Xpos, uint16_t Ypos, uint32_t *Color);
void UTIL_LCD_SetPixel(uint16_t Xpos, uint16_t Ypos, uint32_t Color);
void UTIL_LCD_FillRGBRect(uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height);
void UTIL_LCD_DrawHLine(uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
void UTIL_LCD_DrawVLine(uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
void UTIL_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pData);
void UTIL_LCD_FillRect(uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color);
void UTIL_LCD_DrawLine(uint32_t Xpos1, uint32_t Ypos1, uint32_t Xpos2, uint32_t Ypos2, uint32_t Color);
void UTIL_LCD_DrawRect(uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color);
void UTIL_LCD_DrawCircle(uint32_t Xpos, uint32_t Ypos, uint32_t Radius, uint32_t Color);
void UTIL_LCD_DrawPolygon(pPoint Points, uint32_t PointCount, uint32_t Color);
void UTIL_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius, uint32_t Color);
void UTIL_LCD_FillCircle(uint32_t Xpos, uint32_t Ypos, uint32_t Radius, uint32_t Color);
void UTIL_LCD_FillPolygon(pPoint Points, uint32_t PointCount, uint32_t Color);
void UTIL_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius, uint32_t Color);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* STM32_LCD_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|