Nano102_112 Series BSP  V3.03.002
The Board Support Package for Nano102_112 Series
lcd.h
Go to the documentation of this file.
1 /**************************************************************************/
12 #ifndef __LCD_H__
13 #define __LCD_H__
14 
15 #ifdef __cplusplus
16 extern "C"
17 {
18 #endif
19 
20 #include <stdint.h>
21 //#include <stdbool.h>
22 
23 
37 /*---------------------------------------------------------------------------------------------------------*/
39 /* Macro, type and constant definitions */
40 /*---------------------------------------------------------------------------------------------------------*/
41 
43 
44 #define LCD_FREQ_DIV32 ((uint32_t) 0x00000000)
45 #define LCD_FREQ_DIV64 ((uint32_t) 0x00000010)
46 #define LCD_FREQ_DIV96 ((uint32_t) 0x00000020)
47 #define LCD_FREQ_DIV128 ((uint32_t) 0x00000030)
48 #define LCD_FREQ_DIV192 ((uint32_t) 0x00000040)
49 #define LCD_FREQ_DIV256 ((uint32_t) 0x00000050)
50 #define LCD_FREQ_DIV384 ((uint32_t) 0x00000060)
51 #define LCD_FREQ_DIV512 ((uint32_t) 0x00000070)
53 #define LCD_MUX_STATIC ((uint32_t) 0x00000000)
54 #define LCD_MUX_ONE_SECOND ((uint32_t) 0x00000002)
55 #define LCD_MUX_ONE_THIRD ((uint32_t) 0x00000004)
56 #define LCD_MUX_ONE_FOURTH ((uint32_t) 0x00000006)
57 #define LCD_MUX_ONE_FIFTH ((uint32_t) 0x00000008)
58 #define LCD_MUX_ONE_SIXTH ((uint32_t) 0x0000000A)
60 #define LCD_BIAS_STATIC ((uint32_t) 0x00000000)
61 #define LCD_BIAS_HALF ((uint32_t) 0x00000002)
62 #define LCD_BIAS_THIRD ((uint32_t) 0x00000004)
64 #define LCD_CPUMP_DIV1 ((uint32_t) 0x00000000)
65 #define LCD_CPUMP_DIV2 ((uint32_t) 0x00000800)
66 #define LCD_CPUMP_DIV4 ((uint32_t) 0x00001000)
67 #define LCD_CPUMP_DIV8 ((uint32_t) 0x00001800)
68 #define LCD_CPUMP_DIV16 ((uint32_t) 0x00002000)
69 #define LCD_CPUMP_DIV32 ((uint32_t) 0x00002800)
70 #define LCD_CPUMP_DIV64 ((uint32_t) 0x00003000)
71 #define LCD_CPUMP_DIV128 ((uint32_t) 0x00003800)
73 #define LCD_CPVOl_2_7V ((uint32_t) 0x00000000)
74 #define LCD_CPVOl_2_8V ((uint32_t) 0x00000100)
75 #define LCD_CPVOl_2_9V ((uint32_t) 0x00000200)
76 #define LCD_CPVOl_3V ((uint32_t) 0x00000300)
77 #define LCD_CPVOl_3_1V ((uint32_t) 0x00000400)
78 #define LCD_CPVOl_3_2V ((uint32_t) 0x00000500)
79 #define LCD_CPVOl_3_3V ((uint32_t) 0x00000600)
80 #define LCD_CPVOl_3_4V ((uint32_t) 0x00000700)
82 #define LCD_FCPRESC_DIV1 ((uint32_t) 0x00000000)
83 #define LCD_FCPRESC_DIV2 ((uint32_t) 0x00000004)
84 #define LCD_FCPRESC_DIV4 ((uint32_t) 0x00000008)
85 #define LCD_FCPRESC_DIV8 ((uint32_t) 0x0000000C)
87 #define LCD_FRAMECOUNT_INT ((uint32_t) 0x00000001)
88 #define LCD_POWERDOWN_INT ((uint32_t) 0x00000002)
89 #define LCD_ALL_INT ((uint32_t) 0x00000003)
91  /* end of group NANO1X2_LCD_EXPORTED_CONSTANTS */
92 
93 
97 typedef enum {
98  LCD_C_TYPE = 0,
102 } LCD_PanelType;
103  /* end of group NANO1X2_LCD_EXPORTED_STRUCTS */
105 
106 
118 #define LCD_GET_PD_INT_FLAG() ((LCD->FCSTS & LCD_FCSTS_PDSTS_Msk) >> LCD_FCSTS_PDSTS_Pos)
119 
127 #define LCD_CLR_PD_INT_FLAG() (LCD->FCSTS = LCD_FCSTS_PDSTS_Msk)
128 
136 #define LCD_GET_FRAME_CNT_INT_FLAG() ((LCD->FCSTS & LCD_FCSTS_FCSTS_Msk) >> LCD_FCSTS_FCSTS_Pos)
137 
145 #define LCD_CLR_FRAME_CNT_INT_FLAG() (LCD->FCSTS = LCD_FCSTS_FCSTS_Msk)
146 
154 #define LCD_ENABLE_PD_DISPLAY() (LCD->CTL |= LCD_CTL_PDDISP_EN_Msk)
155 
163 #define LCD_DISABLE_PD_DISPLAY() (LCD->CTL &= ~LCD_CTL_PDDISP_EN_Msk)
164 
165 uint32_t LCD_EnableFrameCounter(uint32_t u32Count);
166 void LCD_DisableFrameCounter(void);
167 uint32_t LCD_EnableBlink(uint32_t u32ms);
168 void LCD_DisableBlink(void);
169 void LCD_EnableInt(uint32_t IntSrc);
170 void LCD_DisableInt(uint32_t IntSrc);
171 uint32_t LCD_Open(uint32_t u32DrivingType, uint32_t u32ComNum, uint32_t u32BiasLevel, uint32_t u32FramerateDiv, uint32_t u32DrivingVol);
172 void LCD_SetPixel(uint32_t u32Com, uint32_t u32Seg, uint32_t u32OnFlag);
173 void LCD_SetAllPixels(uint32_t u32OnOff);
174 void LCD_Close(void);
175 
184 static __INLINE void LCD_EnableDisplay(void)
185 {
186  /* Enable LCD */
187  LCD->CTL |= LCD_CTL_EN_Msk;
188 }
189 
198 static __INLINE void LCD_DisableDisplay(void)
199 {
200  /* Enable LCD */
201  LCD->CTL &= ~LCD_CTL_EN_Msk;
202 }
203 
204 
205  /* end of group NANO1X2_LCD_EXPORTED_FUNCTIONS */
207 
208  /* end of group NANO1X2_LCD_Driver */
210  /* end of group NANO1X2_Device_Driver */
212 
213 
214 #ifdef __cplusplus
215 }
216 #endif
217 
218 #endif /* __LCD_H__ */
219 
220 
221 
222 /*** (C) COPYRIGHT 2014 Nuvoton Technology Corp. ***/
223 
224 
static __INLINE void LCD_DisableDisplay(void)
Disable LCD controller.
Definition: lcd.h:198
uint32_t LCD_EnableBlink(uint32_t u32ms)
Enable Blink function in LCD controller.
Definition: lcd.c:376
void LCD_DisableInt(uint32_t IntSrc)
This function is used to disable LCD specified interrupt.
Definition: lcd.c:466
void LCD_DisableBlink(void)
Disable Blink function in LCD controller.
Definition: lcd.c:423
Definition: lcd.h:98
uint32_t LCD_EnableFrameCounter(uint32_t u32Count)
Set Frame Count and Enable frame count.
Definition: lcd.c:210
#define LCD_CTL_EN_Msk
void LCD_SetPixel(uint32_t u32Com, uint32_t u32Seg, uint32_t u32OnFlag)
Enables a segment on the LCD display.
Definition: lcd.c:62
#define LCD
Pointer to LCD register structure.
uint32_t LCD_Open(uint32_t u32DrivingType, uint32_t u32ComNum, uint32_t u32BiasLevel, uint32_t u32FramerateDiv, uint32_t u32DrivingVol)
LCD Initialization routine.
Definition: lcd.c:287
void LCD_DisableFrameCounter(void)
Disable frame count function.
Definition: lcd.c:264
LCD_PanelType
Definition: lcd.h:97
void LCD_Close(void)
The function is used to disable LCD controller.
Definition: lcd.c:362
static __INLINE void LCD_EnableDisplay(void)
Enable LCD controller.
Definition: lcd.h:184
void LCD_EnableInt(uint32_t IntSrc)
This function is used to enable LCD interrupt.
Definition: lcd.c:444
void LCD_SetAllPixels(uint32_t u32OnOff)
LCD Enable/Disable all segments.
Definition: lcd.c:166