-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstm32l152d_eval_glass_lcd.h
245 lines (208 loc) · 5.5 KB
/
stm32l152d_eval_glass_lcd.h
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
/**
******************************************************************************
* @file stm32l152d_eval_glass_lcd.h
* @author MCD Application Team
* @brief Header file for stm32l152d_eval_glass_lcd.c module.
******************************************************************************
* @attention
*
* Copyright (c) 2017 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/** @addtogroup BSP
* @{
*/
/** @addtogroup STM32L152D_EVAL
* @{
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32L152D_EVAL_GLASS_LCD_H
#define __STM32L152D_EVAL_GLASS_LCD_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32l152d_eval.h"
/** @addtogroup STM32L152D_EVAL_GLASS_LCD
* @{
*/
/** @defgroup STM32L152D_EVAL_GLASS_LCD_Exported_Types Exported Types
* @{
*/
/**
* @brief LCD Glass point
* Warning: element values correspond to LCD Glass point.
*/
typedef enum
{
POINT_OFF = 0,
POINT_ON = 1
}Point_Typedef;
/**
* @brief LCD Glass Double point
* Warning: element values correspond to LCD Glass Double point.
*/
typedef enum
{
DOUBLEPOINT_OFF = 0,
DOUBLEPOINT_ON = 1
}DoublePoint_Typedef;
/**
* @brief LCD Glass Battery Level
* Warning: element values correspond to LCD Glass Battery Level.
*/
typedef enum
{
BATTERYLEVEL_OFF = 0,
BATTERYLEVEL_1_4 = 1,
BATTERYLEVEL_1_2 = 2,
BATTERYLEVEL_3_4 = 3,
BATTERYLEVEL_FULL = 4
}BatteryLevel_TypeDef;
/**
* @brief LCD Glass Temperature Level
* Warning: element values correspond to LCD Glass Temperature Level.
*/
typedef enum
{
TEMPERATURELEVEL_OFF = 0,
TEMPERATURELEVEL_1 = 1,
TEMPERATURELEVEL_2 = 2,
TEMPERATURELEVEL_3 = 3,
TEMPERATURELEVEL_4 = 4,
TEMPERATURELEVEL_5 = 5,
TEMPERATURELEVEL_6 = 6
}TemperatureLevel_TypeDef;
/**
* @brief LCD Glass Arrow Direction
* Warning: element values correspond to LCD Glass Arrow Direction.
*/
typedef enum
{
ARROWDIRECTION_OFF = 0,
ARROWDIRECTION_UP = 1,
ARROWDIRECTION_DOWN = 2,
ARROWDIRECTION_LEFT = 3,
ARROWDIRECTION_RIGHT = 4
}ArrowDirection_TypeDef;
/**
* @brief LCD Glass Value Unit
* Warning: element values correspond to LCD Glass Value Unit.
*/
typedef enum
{
VALUEUNIT_OFF = 0,
VALUEUNIT_MILLIAMPERE = 1,
VALUEUNIT_MICROAMPERE = 2,
VALUEUNIT_NANOAMPERE = 3
}ValueUnit_TypeDef;
/**
* @brief LCD Glass Sign
* Warning: element values correspond to LCD Glass Sign.
*/
typedef enum
{
SIGN_POSITIVE = 0,
SIGN_NEGATIVE = 1
}Sign_TypeDef;
/**
* @brief LCD Glass Pixel Row
* Warning: element values correspond to LCD Glass Pixel Row.
*/
typedef enum
{
PIXELROW_1 = 1,
PIXELROW_2 = 2,
PIXELROW_3 = 3,
PIXELROW_4 = 4,
PIXELROW_5 = 5,
PIXELROW_6 = 6,
PIXELROW_7 = 7,
PIXELROW_8 = 8,
PIXELROW_9 = 9,
PIXELROW_10 = 10
}PixelRow_TypeDef;
/**
* @brief LCD Glass Pixel Column
* Warning: element values correspond to LCD Glass Pixel Column.
*/
typedef enum
{
PIXELCOLUMN_1 = 1,
PIXELCOLUMN_2 = 2,
PIXELCOLUMN_3 = 3,
PIXELCOLUMN_4 = 4,
PIXELCOLUMN_5 = 5,
PIXELCOLUMN_6 = 6,
PIXELCOLUMN_7 = 7,
PIXELCOLUMN_8 = 8,
PIXELCOLUMN_9 = 9,
PIXELCOLUMN_10 = 10,
PIXELCOLUMN_11 = 11,
PIXELCOLUMN_12 = 12,
PIXELCOLUMN_13 = 13,
PIXELCOLUMN_14 = 14,
PIXELCOLUMN_15 = 15,
PIXELCOLUMN_16 = 16,
PIXELCOLUMN_17 = 17,
PIXELCOLUMN_18 = 18,
PIXELCOLUMN_19 = 19
}PixelColumn_TypeDef;
/**
* @}
*/
/** @defgroup STM32L152D_EVAL_GLASS_LCD_Exported_Constants Exported Constants
* @{
*/
/* Define for scrolling sentences*/
#define SCROLL_SPEED 200
#define SCROLL_SPEED_L 400
#define SCROLL_NUM 1
#define DOT 0x8000 /* for add decimal point in string */
#define DOUBLE_DOT 0x4000 /* for add decimal point in string */
/**
* @}
*/
/** @addtogroup STM32L152D_EVAL_GLASS_LCD_Exported_Functions Exported Functions
* @{
*/
void BSP_LCD_GLASS_Init(void);
void BSP_LCD_GLASS_Contrast(uint32_t Contrast);
void BSP_LCD_GLASS_DisplayChar(uint8_t* Ch, Point_Typedef Point, DoublePoint_Typedef DoublePoint, uint8_t Position);
void BSP_LCD_GLASS_DisplayString(uint8_t* ptr);
void BSP_LCD_GLASS_WriteChar(uint8_t* ch, uint8_t Point, uint8_t Column, uint8_t Position);
void BSP_LCD_GLASS_ClearChar(uint8_t position);
void BSP_LCD_GLASS_DisplayStrDeci(uint16_t* ptr);
void BSP_LCD_GLASS_Clear(void);
void BSP_LCD_GLASS_ClearTextZone(void);
void BSP_LCD_GLASS_DisplayLogo(FunctionalState NewState);
void BSP_LCD_GLASS_ArrowConfig(ArrowDirection_TypeDef ArrowDirection);
void BSP_LCD_GLASS_TemperatureConfig(TemperatureLevel_TypeDef TemperatureLevel);
void BSP_LCD_GLASS_ValueUnitConfig(ValueUnit_TypeDef ValueUnit);
void BSP_LCD_GLASS_SignCmd(Sign_TypeDef Sign, FunctionalState NewState);
void BSP_LCD_GLASS_WriteMatrixPixel(PixelRow_TypeDef PixelRow, PixelColumn_TypeDef PixelColumn);
void BSP_LCD_GLASS_ClearMatrixPixel(PixelRow_TypeDef PixelRow, PixelColumn_TypeDef PixelColumn);
void BSP_LCD_GLASS_ScrollSentence(uint8_t* ptr, uint16_t nScroll, uint16_t ScrollSpeed);
void BSP_LCD_GLASS_BarLevelConfig(uint8_t BarLevel);
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32L152D_EVAL_GLASS_LCD_H */
/**
* @}
*/
/**
* @}
*/