1 /**************************************************************************//**
2  * @file     lcd.h
3  * @version  V3.00
4  * @brief    Liquid-Crystal Display(LCD) driver header file
5  *
6  * @copyright SPDX-License-Identifier: Apache-2.0
7  * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved.
8  *****************************************************************************/
9 #ifndef __LCD_H__
10 #define __LCD_H__
11 
12 #ifdef __cplusplus
13 extern "C"
14 {
15 #endif
16 
17 
18 /** @addtogroup Standard_Driver Standard Driver
19   @{
20 */
21 
22 /** @addtogroup LCD_Driver LCD Driver
23   @{
24 */
25 
26 /** @addtogroup LCD_EXPORTED_CONSTANTS LCD Exported Constants
27   @{
28 */
29 /*---------------------------------------------------------------------------------------------------------*/
30 /*  LCD Bias Voltage Level Selection Constant Definitions                                                  */
31 /*---------------------------------------------------------------------------------------------------------*/
32 #define LCD_BIAS_LV_1_2                 (1ul << LCD_PCTL_BIAS_Pos) /*!< LCD bias voltage level selection - 1/2 Bias \hideinitializer */
33 #define LCD_BIAS_LV_1_3                 (2ul << LCD_PCTL_BIAS_Pos) /*!< LCD bias voltage level selection - 1/3 Bias \hideinitializer */
34 #define LCD_BIAS_LV_1_4                 (3ul << LCD_PCTL_BIAS_Pos) /*!< LCD bias voltage level selection - 1/4 Bias \hideinitializer */
35 
36 /*---------------------------------------------------------------------------------------------------------*/
37 /*  LCD COM Duty Ratio Selection Constant Definitions                                                      */
38 /*---------------------------------------------------------------------------------------------------------*/
39 #define LCD_COM_DUTY_1_1                (0ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/1 Duty \hideinitializer */
40 #define LCD_COM_DUTY_1_2                (1ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/2 Duty \hideinitializer */
41 #define LCD_COM_DUTY_1_3                (2ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/3 Duty \hideinitializer */
42 #define LCD_COM_DUTY_1_4                (3ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/4 Duty \hideinitializer */
43 #define LCD_COM_DUTY_1_5                (4ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/5 Duty \hideinitializer */
44 #define LCD_COM_DUTY_1_6                (5ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/6 Duty \hideinitializer */
45 #define LCD_COM_DUTY_1_7                (6ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/7 Duty \hideinitializer */
46 #define LCD_COM_DUTY_1_8                (7ul << LCD_PCTL_DUTY_Pos) /*!< LCD com duty ratio selection - 1/8 Duty \hideinitializer */
47 
48 /*---------------------------------------------------------------------------------------------------------*/
49 /*  LCD Waveform Attribute Selection Constant Definitions                                                  */
50 /*---------------------------------------------------------------------------------------------------------*/
51 #define LCD_WAVEFORM_TYPE_A_NORMAL      (0ul << LCD_PCTL_TYPE_Pos) /*!< LCD waveform Type-A, no inverse \hideinitializer */
52 #define LCD_WAVEFORM_TYPE_B_NORMAL      (1ul << LCD_PCTL_TYPE_Pos) /*!< LCD waveform Type-B, no inverse \hideinitializer */
53 #define LCD_WAVEFORM_TYPE_A_INVERSE     (2ul << LCD_PCTL_TYPE_Pos) /*!< LCD waveform Type-A and inverse \hideinitializer */
54 #define LCD_WAVEFORM_TYPE_B_INVERSE     (3ul << LCD_PCTL_TYPE_Pos) /*!< LCD waveform Type-B and inverse \hideinitializer */
55 
56 /*---------------------------------------------------------------------------------------------------------*/
57 /*  LCD Charge Pump Voltage Selection Constant Definitions                                                 */
58 /*---------------------------------------------------------------------------------------------------------*/
59 #define LCD_CP_VOLTAGE_LV_0             (0ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 2.6 V \hideinitializer */
60 #define LCD_CP_VOLTAGE_LV_1             (1ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 2.8 V \hideinitializer */
61 #define LCD_CP_VOLTAGE_LV_2             (2ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 3.0 V \hideinitializer */
62 #define LCD_CP_VOLTAGE_LV_3             (3ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 3.2 V \hideinitializer */
63 #define LCD_CP_VOLTAGE_LV_4             (4ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 3.4 V \hideinitializer */
64 #define LCD_CP_VOLTAGE_LV_5             (5ul << LCD_PCTL_CPVSEL_Pos) /*!< Select LCD charge pump voltage 3.6 V \hideinitializer */
65 
66 /*---------------------------------------------------------------------------------------------------------*/
67 /*  LCD Interrupt Source Constant Definitions                                                              */
68 /*---------------------------------------------------------------------------------------------------------*/
69 #define LCD_DISABLE_ALL_INT             (0ul << LCD_INTEN_FCEIEN_Pos)   /*!< Disable all LCD interrupt sources \hideinitializer */
70 #define LCD_FRAME_COUNTING_END_INT      (1ul << LCD_INTEN_FCEIEN_Pos)   /*!< Indicate frame count end interrupt \hideinitializer */
71 #define LCD_FRAME_END_INT               (1ul << LCD_INTEN_FEIEN_Pos)    /*!< Indicate frame end interrupt \hideinitializer */
72 #define LCD_CPTOUT_INT                  (1ul << LCD_INTEN_CTOIEN_Pos)   /*!< Indicate charge pump charging timeout interrupt \hideinitializer */
73 #define LCD_ENABLE_ALL_INT              (7ul << LCD_INTEN_FCEIEN_Pos)   /*!< Enable all LCD interrupt sources \hideinitializer */
74 
75 /*---------------------------------------------------------------------------------------------------------*/
76 /*  LCD Operation Voltage Source Constant Definitions                                                      */
77 /*---------------------------------------------------------------------------------------------------------*/
78 #define LCD_VOLTAGE_SOURCE_VLCD         (0ul << LCD_DCTL_VSRC_Pos) /*!< LCD voltage source from external VLCD power \hideinitializer */
79 #define LCD_VOLTAGE_SOURCE_AVDD         (1ul << LCD_DCTL_VSRC_Pos) /*!< LCD voltage source from internal VDD \hideinitializer */
80 #define LCD_VOLTAGE_SOURCE_CP           (2ul << LCD_DCTL_VSRC_Pos) /*!< LCD voltage source from built-in charge pump \hideinitializer */
81 
82 /*---------------------------------------------------------------------------------------------------------*/
83 /*  LCD Driving Mode Selection Constant Definitions                                                        */
84 /*---------------------------------------------------------------------------------------------------------*/
85 #define LCD_LOW_DRIVING_AND_BUF_OFF                     (0ul << LCD_DCTL_RESMODE_Pos) /*!< LCD operates with low-drive and voltage buffer disabled \hideinitializer */
86 #define LCD_HIGH_DRIVING_AND_BUF_OFF                    (1ul << LCD_DCTL_RESMODE_Pos) /*!< LCD operates with high-drive and voltage buffer disabled \hideinitializer */
87 #define LCD_LOW_DRIVING_AND_BUF_ON                      (2ul << LCD_DCTL_RESMODE_Pos) /*!< LCD operates with low-drive and voltage buffer enabled \hideinitializer */
88 #define LCD_HIGH_DRIVING_AND_BUF_OFF_AND_PWR_SAVING     (5ul << LCD_DCTL_RESMODE_Pos) /*!< LCD operates with high-drive, voltage buffer disabled and power saving \hideinitializer */
89 #define LCD_LOW_DRIVING_AND_BUF_ON_AND_PWR_SAVING       (6ul << LCD_DCTL_RESMODE_Pos) /*!< LCD operates with low-drive, voltage buffer enabled and power saving \hideinitializer */
90 
91 /*---------------------------------------------------------------------------------------------------------*/
92 /*  LCD Power Saving Mode Constant Definitions                                                             */
93 /*---------------------------------------------------------------------------------------------------------*/
94 #define LCD_PWR_SAVING_NORMAL_MODE              (0ul << LCD_DCTL_PSVREV_Pos) /*!< The timing of LCD power saving is normal \hideinitializer */
95 #define LCD_PWR_SAVING_REVERSE_MODE             (1ul << LCD_DCTL_PSVREV_Pos) /*!< The timing of LCD power saving is reverse \hideinitializer */
96 
97 /**@}*/ /* end of group LCD_EXPORTED_CONSTANTS */
98 
99 
100 /** @addtogroup LCD_EXPORTED_STRUCTS LCD Exported Structs
101   @{
102 */
103 /**
104   * @details    LCD Configuration Data Struct
105   */
106 typedef struct
107 {
108     uint32_t u32SrcFreq;        /*!< LCD clock source frequency */
109     uint32_t u32ComDuty;        /*!< COM duty */
110     uint32_t u32BiasLevel;      /*!< Bias level */
111     uint32_t u32Framerate;      /*!< Operation frame rate */
112     uint32_t u32WaveformType;   /*!< Waveform type */
113     uint32_t u32IntSrc;         /*!< Interrupt source */
114     uint32_t u32DrivingMode;    /*!< Driving mode */
115     uint32_t u32VSrc;           /*!< Voltage source */
116 } S_LCD_CFG_T;
117 
118 /**@}*/ /* end of group LCD_EXPORTED_STRUCTS */
119 
120 
121 /** @addtogroup LCD_EXPORTED_FUNCTIONS LCD Exported Functions
122   @{
123 */
124 
125 /**
126   * @brief      Enable LCD Display
127   *
128   * @param      None
129   *
130   * @return     None
131   *
132   * @details    This macro is used to enable LCD display.
133   */
134 #define LCD_ENABLE_DISPLAY()        do{ LCD->CTL |= LCD_CTL_EN_Msk; while(LCD->CTL & LCD_CTL_SYNC_Msk) {} }while(0)
135 
136 /**
137   * @brief      Disable LCD Display
138   *
139   * @param      None
140   *
141   * @return     None
142   *
143   * @details    This macro is used to disable LCD display.
144   */
145 #define LCD_DISABLE_DISPLAY()       do{ LCD->CTL &= ~LCD_CTL_EN_Msk; while(LCD->CTL & LCD_CTL_SYNC_Msk) {} }while(0)
146 
147 /**
148   * @brief      Set LCD Waveform Type
149   *
150   * @param[in]  type       The LCD waveform type. It could be one of the following type
151   *                             - \ref LCD_WAVEFORM_TYPE_A_NORMAL
152   *                             - \ref LCD_WAVEFORM_TYPE_B_NORMAL
153   *                             - \ref LCD_WAVEFORM_TYPE_A_INVERSE
154   *                             - \ref LCD_WAVEFORM_TYPE_B_INVERSE
155   *
156   * @return     None
157   *
158   * @details    This macro is used to set the attribute of LCD output waveform.
159   */
160 #define LCD_WAVEFORM_TYPE(type)     (LCD->PCTL = (LCD->PCTL & ~LCD_PCTL_TYPE_Msk) | (type))
161 
162 /**
163   * @brief      Set LCD Source Clock Divider
164   *
165   * @param[in]  div         The frequency divider, valid value is between 1 to 1024.
166   *
167   * @return     None
168   *
169   * @details    This macro is used to set the LCD operarion frequency is (LCD source frequency / div).
170   */
171 #define LCD_SET_FREQDIV(div)        (LCD->PCTL = (LCD->PCTL & ~LCD_PCTL_FREQDIV_Msk) | (((div)-1) << LCD_PCTL_FREQDIV_Pos))
172 
173 /**
174   * @brief      Set Charge Pump Voltage
175   *
176   * @param[in]  voltage     The target charge pump voltage. It could be one of the following voltage level
177   *                             - \ref LCD_CP_VOLTAGE_LV_0, 2.6 V
178   *                             - \ref LCD_CP_VOLTAGE_LV_1, 2.8 V
179   *                             - \ref LCD_CP_VOLTAGE_LV_2, 3.0 V
180   *                             - \ref LCD_CP_VOLTAGE_LV_3, 3.2 V
181   *                             - \ref LCD_CP_VOLTAGE_LV_4, 3.4 V
182   *                             - \ref LCD_CP_VOLTAGE_LV_5, 3.6 V
183   *
184   * @return     None
185   *
186   * @details    This macro is used to set charge pump voltage for VLCD.
187   */
188 #define LCD_SET_CP_VOLTAGE(voltage) (LCD->PCTL = (LCD->PCTL & ~LCD_PCTL_CPVSEL_Msk) | (voltage))
189 
190 /**
191   * @brief      Decrease Charge Pump Voltage
192   *
193   * @param[in]  unit        The tuning units, valid value is between 0 to 7.
194   *                         One unit of voltage is about 0.03V, and the charge pump voltage is decreased (unit * 0.03)V.
195   *
196   * @return     None
197   *
198   * @details    This macro is used to decrease charge pump voltage by specific units.
199   */
200 #define LCD_CP_VOLTAGE_DECREASE(unit)   (LCD->PCTL = (LCD->PCTL & ~LCD_PCTL_CPVTUNE_Msk) | ((unit) << LCD_PCTL_CPVTUNE_Pos))
201 
202 /**
203   * @brief      Increase Charge Pump Voltage
204   *
205   * @param[in]  unit        The tuning units, valid value is between 1 to 8.
206   *                         One unit of voltage is about 0.03V, and the charge pump voltage is increased (unit * 0.03)V.
207   *
208   * @return     None
209   *
210   * @details    This macro is used to increase charge pump voltage by specific units.
211   */
212 #define LCD_CP_VOLTAGE_INCREASE(unit)   (LCD->PCTL = (LCD->PCTL & ~LCD_PCTL_CPVTUNE_Msk) | ((16-(unit)) << LCD_PCTL_CPVTUNE_Pos))
213 
214 /**
215   * @brief      Set LCD Blinking ON
216   *
217   * @param      None
218   *
219   * @return     None
220   *
221   * @details    This macro is used to enable LCD blinking.
222   */
223 #define LCD_BLINKING_ON()       (LCD->FCTL |= LCD_FCTL_BLINK_Msk)
224 
225 /**
226   * @brief      Set LCD Blinking OFF
227   *
228   * @param      None
229   *
230   * @return     None
231   *
232   * @details    This macro is used to disable LCD blinking.
233   */
234 #define LCD_BLINKING_OFF()      (LCD->FCTL &= ~LCD_FCTL_BLINK_Msk)
235 
236 /**
237   * @brief      Set LCD Frame Counting Value
238   *
239   * @param[in]  value       Frame counting value. Valid value is between 1 to 1024.
240   *
241   * @return     None
242   *
243   * @details    This macro is used to set the LCD frame counting value to configure the blink interval.
244   * @note       For type-B waveform, the frame counter increases at the end of odd frames, not even frames.
245   */
246 #define LCD_SET_FRAME_COUNTING_VALUE(value)     (LCD->FCTL = (LCD->FCTL & ~LCD_FCTL_FCV_Msk) | (((value)-1) << LCD_FCTL_FCV_Pos))
247 
248 /**
249   * @brief      Set Null Frame Time
250   *
251   * @param[in]  unit        The unit parameter is used to determine the null frame time, valid value is between 0 to 15.
252   *                         And one unit time is one LCD operation clock period.
253   *
254   * @return     None
255   *
256   * @details    This macro is used to set the one null frame time.
257   * @note       All COM and SEG output voltages will keep at 0V during a null frame.
258   */
259 #define LCD_SET_NULL_FRAME_TIME(unit)       (LCD->FCTL = (LCD->FCTL & ~LCD_FCTL_NFTIME_Msk) | ((unit) << LCD_FCTL_NFTIME_Pos))
260 
261 /**
262   * @brief      Set Continuous Frames
263   *
264   * @param[in]  frame       The continuous frames, valid setting is between 1 to 16 frames.
265   *
266   * @return     None
267   *
268   * @details    This macro is used to specify the number of continuous frames reached to insert one null frame.
269   */
270 #define LCD_SET_CONTINUOUS_FRAME(frame)     (LCD->FCTL = (LCD->FCTL & ~LCD_FCTL_NFNUM_Msk) | (((frame)-1) << LCD_FCTL_NFNUM_Pos))
271 
272 /**
273   * @brief      Select LCD Voltage Source
274   *
275   * @param[in]  mode        The LCD operation voltage source. It could be one of the following source
276   *                             - \ref LCD_VOLTAGE_SOURCE_VLCD
277   *                             - \ref LCD_VOLTAGE_SOURCE_AVDD
278   *                             - \ref LCD_VOLTAGE_SOURCE_CP
279   *
280   * @return     None
281   *
282   * @details    This macro is used to select LCD operation voltage source.
283   */
284 #define LCD_VOLTAGE_SOURCE(source)  (LCD->DCTL = (LCD->DCTL & ~LCD_DCTL_VSRC_Msk) | (source))
285 
286 /**
287   * @brief      Set LCD Driving Mode
288   *
289   * @param[in]  mode        The LCD operation driving mode. It could be one of the following mode
290   *                             - \ref LCD_LOW_DRIVING_AND_BUF_OFF
291   *                             - \ref LCD_HIGH_DRIVING_AND_BUF_OFF
292   *                             - \ref LCD_LOW_DRIVING_AND_BUF_ON
293   *                             - \ref LCD_HIGH_DRIVING_AND_BUF_OFF_AND_PWR_SAVING
294   *                             - \ref LCD_LOW_DRIVING_AND_BUF_ON_AND_PWR_SAVING
295   *
296   * @return     None
297   *
298   * @details    This macro is used to set LCD operation drivig mode.
299   */
300 #define LCD_DRIVING_MODE(mode)      (LCD->DCTL = (LCD->DCTL & ~(LCD_DCTL_RESMODE_Msk | LCD_DCTL_BUFEN_Msk | LCD_DCTL_PSVEN_Msk)) | (mode))
301 
302 /**
303   * @brief      Select Power Saving Mode
304   *
305   * @param[in]  mode        The LCD power saving mode selection. It could be one of the following constant definition
306   *                             - \ref LCD_PWR_SAVING_NORMAL_MODE
307   *                             - \ref LCD_PWR_SAVING_REVERSE_MODE
308   *
309   * @return     None
310   *
311   * @details    This macro is used to set the LCD power saving mode.
312   *             When the timing of power saving mode is reversed, the original power saving period becomes no power saving,
313   *             and the original no power saving period becomes power saving.
314   */
315 #define LCD_PWR_SAVING_MODE(mode)   (LCD->DCTL = (LCD->DCTL & ~LCD_DCTL_PSVREV_Msk) | (mode))
316 
317 /**
318   * @brief      Set Power Saving T1 Period
319   *
320   * @param[in]  t1      The number of t1 to determine T1 period, valid value is between 1 to 16.
321   *                     And one unit of t1 period is half of LCD operation clock period.
322   *
323   * @return     None
324   *
325   * @details    This macro is used to configure the T1 (Enable Time) period of power saving.
326   */
327 #define LCD_PWR_SAVING_T1_PERIOD(t1)    (LCD->DCTL = (LCD->DCTL & ~LCD_DCTL_PSVT1_Msk) | (((t1)-1) << LCD_DCTL_PSVT1_Pos))
328 
329 /**
330   * @brief      Set Power Saving T2 Period
331   *
332   * @param[in]  t2      The number of t2 to determine T2 period, valid value is between 1 to 16.
333   *                     And one unit of t1 period is half of LCD operation clock period.
334   *
335   * @return     None
336   *
337   * @details    This macro is used to configure the T2 (On Time) period of power saving.
338   */
339 #define LCD_PWR_SAVING_T2_PERIOD(t2)    (LCD->DCTL = (LCD->DCTL & ~LCD_DCTL_PSVT2_Msk) | (((t2)-1) << LCD_DCTL_PSVT2_Pos))
340 
341 /**
342   * @brief      Set Charging Timeout Time
343   *
344   * @param[in]  value   The maximum timeout value, valid value is between 1 to 8192.
345   *                     And one unit of timeout value is one LCD operation clock period.
346   *
347   * @return     None
348   *
349   * @details    This macro is used to set maximum timeout time of charge pump charging timer.
350   */
351 #define LCD_SET_CHARGE_TIMEOUT_TIME(value)  (LCD->DCTL = (LCD->DCTL & ~LCD_DCTL_CTOTIME_Msk) | (((value)-1) << LCD_DCTL_CTOTIME_Pos))
352 
353 /**
354   * @brief      Select Device Package Type
355   *
356   * @param[in]  pak     Select device package type.
357   *                     0 for 128-pin package, and 1 for 64-pin package.
358   *
359   * @return     None
360   *
361   * @details    This macro is used to select device output pins for LCD controller with different package type.
362   */
363 #define LCD_SELECT_PACKAGE_TYPE(pkg)    (LCD->PKGSEL = (LCD->PKGSEL & ~LCD_PKGSEL_PKG_Msk) | ((pkg) << LCD_PKGSEL_PKG_Pos))
364 
365 /**
366   * @brief      Enable LCD Frame Counting End Interrupt
367   *
368   * @param      None
369   *
370   * @return     None
371   *
372   * @details    This macro is used to enable frame count end interrupt function.
373   */
374 #define LCD_ENABLE_FRAME_COUNTING_END_INT()     (LCD->INTEN |= LCD_INTEN_FCEIEN_Msk)
375 
376 /**
377   * @brief      Disable LCD Frame Counting End Interrupt
378   *
379   * @param      None
380   *
381   * @return     None
382   *
383   * @details    This macro is used to disable frame count end interrupt function.
384   */
385 #define LCD_DISABLE_FRAME_COUNTING_END_INT()    (LCD->INTEN &= ~LCD_INTEN_FCEIEN_Msk)
386 
387 /**
388   * @brief      Enable LCD Frame End Interrupt
389   *
390   * @param      None
391   *
392   * @return     None
393   *
394   * @details    This macro is used to enable frame end interrupt function.
395   */
396 #define LCD_ENABLE_FRAME_END_INT()      (LCD->INTEN |= LCD_INTEN_FEIEN_Msk)
397 
398 /**
399   * @brief      Disable LCD Frame End Interrupt
400   *
401   * @param      None
402   *
403   * @return     None
404   *
405   * @details    This macro is used to disable frame end interrupt function.
406   */
407 #define LCD_DISABLE_FRAME_END_INT()     (LCD->INTEN &= ~LCD_INTEN_FEIEN_Msk)
408 
409 /**
410   * @brief      Enable Charging Timeout Interrupt
411   *
412   * @param      None
413   *
414   * @return     None
415   *
416   * @details    This macro is used to enable charge pump charging timeout interrupt function.
417   */
418 #define LCD_ENABLE_CHARGE_TIMEOUT_INT()     (LCD->INTEN |= LCD_INTEN_CTOIEN_Msk)
419 
420 /**
421   * @brief      Disable Charging Timeout Interrupt
422   *
423   * @param      None
424   *
425   * @return     None
426   *
427   * @details    This macro is used to disable charge pump charging timeout interrupt function.
428   */
429 #define LCD_DISABLE_CHARGE_TIMEOUT_INT()    (LCD->INTEN &= ~LCD_INTEN_CTOIEN_Msk)
430 
431 /**
432   * @brief      Get LCD Frame Counting End Flag
433   *
434   * @param      None
435   *
436   * @retval     0   Frame count end flag did not occur
437   * @retval     1   Frame count end flag occurred
438   *
439   * @details    This macro gets frame count end flag.
440   */
441 #define LCD_GET_FRAME_COUNTING_END_FLAG()   ((LCD->STS & LCD_STS_FCEF_Msk)? 1UL : 0UL)
442 
443 /**
444   * @brief      Clear LCD Frame Counting End Flag
445   *
446   * @param      None
447   *
448   * @return     None
449   *
450   * @details    This macro clears frame count end flag.
451   */
452 #define LCD_CLEAR_FRAME_COUNTING_END_FLAG() (LCD->STS = LCD_STS_FCEF_Msk)
453 
454 /**
455   * @brief      Get LCD Frame End Flag
456   *
457   * @param      None
458   *
459   * @retval     0   Frame end flag did not occur
460   * @retval     1   Frame end flag occurred
461   *
462   * @details    This macro gets frame end flag.
463   */
464 #define LCD_GET_FRAME_END_FLAG()            ((LCD->STS & LCD_STS_FEF_Msk)? 1UL : 0UL)
465 
466 /**
467   * @brief      Clear LCD Frame End Flag
468   *
469   * @param      None
470   *
471   * @return     None
472   *
473   * @details    This macro clears frame end flag.
474   */
475 #define LCD_CLEAR_FRAME_END_FLAG()          (LCD->STS = LCD_STS_FEF_Msk)
476 
477 /**
478   * @brief      Get Charging Timeout Flag
479   *
480   * @param      None
481   *
482   * @retval     0   Charge pump timer timeout flag did not occur
483   * @retval     1   Charge pump timer timeout flag occurred
484   *
485   * @details    This macro gets charge pump charging timeout flag.
486   */
487 #define LCD_GET_CHARGE_TIMEOUT_FLAG()       ((LCD->STS & LCD_STS_CTOF_Msk)? 1UL : 0UL)
488 
489 /**
490   * @brief      Clear Charging Timeout Flag
491   *
492   * @param      None
493   *
494   * @return     None
495   *
496   * @details    This macro clears charge pump charging timeout flag.
497   */
498 #define LCD_CLEAR_CHARGE_TIMEOUT_FLAG()     (LCD->STS = LCD_STS_CTOF_Msk)
499 
500 /**
501   * @brief      Get Charging Time
502   *
503   * @param      None
504   *
505   * @return     Current 13-bit charging timer value
506   *
507   * @details    This macro gets charging timer value while stops charge pump charging.
508   */
509 #define LCD_GET_CHARGE_TIME()              ((LCD->STS & LCD_STS_CTIME_Msk) >> 16)
510 
511 
512 uint32_t LCD_Open(S_LCD_CFG_T *pLCDCfg);
513 void LCD_Close(void);
514 void LCD_SetPixel(uint32_t u32Com, uint32_t u32Seg, uint32_t u32OnFlag);
515 void LCD_SetAllPixels(uint32_t u32OnOff);
516 uint32_t LCD_EnableBlink(uint32_t u32ms);
517 void LCD_DisableBlink(void);
518 void LCD_EnableInt(uint32_t u32IntSrc);
519 void LCD_DisableInt(uint32_t u32IntSrc);
520 
521 /**@}*/ /* end of group LCD_EXPORTED_FUNCTIONS */
522 
523 /**@}*/ /* end of group LCD_Driver */
524 
525 /**@}*/ /* end of group Standard_Driver */
526 
527 #ifdef __cplusplus
528 }
529 #endif
530 
531 #endif /* __LCD_H__ */
532