NANO100_BSP V3.04.002
The Board Support Package for Nano100BN Series
lcd.h
Go to the documentation of this file.
1/****************************************************************************/
12#ifndef __LCD_H__
13#define __LCD_H__
14
15#ifdef __cplusplus
16extern "C"
17{
18#endif
19
20#include <stdint.h>
21//#include <stdbool.h>
22
23
38/*---------------------------------------------------------------------------------------------------------*/
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#define ERR_LCD_CAL_BLINK_FAIL 0xFFFF0000 /* end of group NANO100_LCD_EXPORTED_CONSTANTS */
94
95
99typedef enum
100{
106 /* end of group NANO100_LCD_EXPORTED_STRUCTS */
108
109
121#define LCD_GET_PD_INT_FLAG() ((LCD->FCSTS & LCD_FCSTS_PDSTS_Msk) >> LCD_FCSTS_PDSTS_Pos)
122
130#define LCD_CLR_PD_INT_FLAG() (LCD->FCSTS = LCD_FCSTS_PDSTS_Msk)
131
139#define LCD_GET_FRAME_CNT_INT_FLAG() ((LCD->FCSTS & LCD_FCSTS_FCSTS_Msk) >> LCD_FCSTS_FCSTS_Pos)
140
148#define LCD_CLR_FRAME_CNT_INT_FLAG() (LCD->FCSTS = LCD_FCSTS_FCSTS_Msk)
149
157#define LCD_ENABLE_PD_DISPLAY() (LCD->CTL |= LCD_CTL_PDDISP_EN_Msk)
158
166#define LCD_DISABLE_PD_DISPLAY() (LCD->CTL &= ~LCD_CTL_PDDISP_EN_Msk)
167
168uint32_t LCD_EnableFrameCounter(uint32_t u32Count);
169void LCD_DisableFrameCounter(void);
170uint32_t LCD_EnableBlink(uint32_t u32ms);
171void LCD_DisableBlink(void);
172void LCD_EnableInt(uint32_t IntSrc);
173void LCD_DisableInt(uint32_t IntSrc);
174uint32_t LCD_Open(uint32_t u32DrivingType, uint32_t u32ComNum, uint32_t u32BiasLevel, uint32_t u32FramerateDiv, uint32_t u32DrivingVol);
175void LCD_SetPixel(uint32_t u32Com, uint32_t u32Seg, uint32_t u32OnFlag);
176void LCD_SetAllPixels(uint32_t u32OnOff);
177void LCD_Close(void);
178
187static __INLINE void LCD_EnableDisplay(void)
188{
189 /* Enable LCD */
190 LCD->CTL |= LCD_CTL_EN_Msk;
191}
192
201static __INLINE void LCD_DisableDisplay(void)
202{
203 /* Enable LCD */
204 LCD->CTL &= ~LCD_CTL_EN_Msk;
205}
206
207
208 /* end of group NANO100_LCD_EXPORTED_FUNCTIONS */
210
211 /* end of group NANO100_LCD_Driver */
213 /* end of group NANO100_Device_Driver */
215
216
217#ifdef __cplusplus
218}
219#endif
220
221#endif /* __LCD_H__ */
222
223
224
225/*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
226
227
#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:64
void LCD_SetAllPixels(uint32_t u32OnOff)
LCD Enable/Disable all segments.
Definition: lcd.c:177
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:298
static __INLINE void LCD_EnableDisplay(void)
Enable LCD controller.
Definition: lcd.h:187
void LCD_EnableInt(uint32_t IntSrc)
This function is used to enable LCD interrupt.
Definition: lcd.c:451
uint32_t LCD_EnableBlink(uint32_t u32ms)
Enable Blink function in LCD controller.
Definition: lcd.c:383
void LCD_Close(void)
The function is used to disable LCD controller.
Definition: lcd.c:369
void LCD_DisableInt(uint32_t IntSrc)
This function is used to disable LCD specified interrupt.
Definition: lcd.c:473
void LCD_DisableFrameCounter(void)
Disable frame count function.
Definition: lcd.c:275
void LCD_DisableBlink(void)
Disable Blink function in LCD controller.
Definition: lcd.c:430
uint32_t LCD_EnableFrameCounter(uint32_t u32Count)
Set Frame Count and Enable frame count.
Definition: lcd.c:221
static __INLINE void LCD_DisableDisplay(void)
Disable LCD controller.
Definition: lcd.h:201
LCD_PanelType
Definition: lcd.h:100
@ LCD_EXTERNAL_C_TYPE
Definition: lcd.h:104
@ LCD_INTERNAL_R_TYPE
Definition: lcd.h:103
@ LCD_C_TYPE
Definition: lcd.h:101
@ LCD_EXTERNAL_R_TYPE
Definition: lcd.h:102
#define LCD
Pointer to LCD register structure.