A31G11x F/W Packages  2.5.0
ABOV Cortex-M0+ Core based MCUs Integrated Driver
A31G11x_hal_lcd.h
Go to the documentation of this file.
1 /***************************************************************************//****************************************************************************/
34 
35 #ifndef _LCD_H_
36 #define _LCD_H_
37 
38 #include "A31G11x.h"
39 #include "A31G11x_hal_aa_types.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 //******************************************************************************
46 // Constant
47 //******************************************************************************
48 
49 //========== LCD_CR ========================================
50 
51 //---------- Internal LCD Bias Dividing Resistor Selection ----------
52 #define LCD_RLCD3 (0x0uL << 6)
53 #define LCD_RLCD1 (0x1uL << 6)
54 #define LCD_RLCD2 (0x2uL << 6)
55 #define LCD_RLCD4 (0x3uL << 6)
56 
57 //---------- LCD Duty and Bias Selection ----------
58 #define LCD_8D4B (0x0uL << 3)
59 #define LCD_6D4B (0x1uL << 3)
60 #define LCD_5D3B (0x2uL << 3)
61 #define LCD_4D3B (0x3uL << 3)
62 #define LCD_3D3B (0x4uL << 3)
63 #define LCD_3D2B (0x5uL << 3)
64 
65 //---------- LCD Clock Selection ----------
66 #define LCD_CLK128 (0x0uL << 1)
67 #define LCD_CLK256 (0x1uL << 1)
68 #define LCD_CLK512 (0x2uL << 1)
69 #define LCD_CLK1024 (0x3uL << 1)
70 
71 //========== LCD_BCCR ========================================
72 
73 //---------- LCD Automatic Bias Control En/Disable ----------
74 #define LCD_ABCDIS (0x0uL << 12)
75 #define LCD_ABCEN (0x1uL << 12)
76 
77 //---------- "Bias Mode A" time Selection ----------
78 #define LCD_BIA1CLK (0x0uL << 8)
79 #define LCD_BIA2CLK (0x1uL << 8)
80 #define LCD_BIA3CLK (0x2uL << 8)
81 #define LCD_BIA4CLK (0x3uL << 8)
82 #define LCD_BIA5CLK (0x4uL << 8)
83 #define LCD_BIA6CLK (0x5uL << 8)
84 #define LCD_BIA7CLK (0x6uL << 8)
85 #define LCD_BIA8CLK (0x7uL << 8)
86 
87 //---------- LCD Contrast Control En/Disable ----------
88 #define LCD_CONTDIS (0x0uL << 5)
89 #define LCD_CONTEN (0x1uL << 5)
90 
91 //---------- VLC0 Voltage Control ----------
92 #define LCD_VLC31 (0x0uL << 0)
93 #define LCD_VLC30 (0x1uL << 0)
94 #define LCD_VLC29 (0x2uL << 0)
95 #define LCD_VLC28 (0x3uL << 0)
96 #define LCD_VLC27 (0x4uL << 0)
97 #define LCD_VLC26 (0x5uL << 0)
98 #define LCD_VLC25 (0x6uL << 0)
99 #define LCD_VLC24 (0x7uL << 0)
100 #define LCD_VLC23 (0x8uL << 0)
101 #define LCD_VLC22 (0x9uL << 0)
102 #define LCD_VLC21 (0xAuL << 0)
103 #define LCD_VLC20 (0xBuL << 0)
104 #define LCD_VLC19 (0xCuL << 0)
105 #define LCD_VLC18 (0xDuL << 0)
106 #define LCD_VLC17 (0xEuL << 0)
107 #define LCD_VLC16 (0xFuL << 0)
108 
109 //---------- Constant ----------
110 #define LCDBufSize 28
111 
112 //******************************************************************************
113 // Type
114 //******************************************************************************
115 
116 //==============================================================================
117 // Structure
118 //==============================================================================
119 
120 typedef struct
121 {
122  /* LCD_CR */
123  uint32_t Bias;
124  uint32_t Duty;
125  uint32_t Clk;
126 
127  /* LCD_BCCR */
128  uint32_t AutoBiasEn;
129  uint32_t BiasTime;
130  uint32_t Contrast;
131  uint32_t ContrastStep;
132 } LCD_CFG_Type;
133 
134 //******************************************************************************
135 // Macro
136 //******************************************************************************
137 
138 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
142 #define LCDON() (LCD->CR_b.DISP = 1)
143 
144 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
148 #define LCDOFF() (LCD->CR_b.DISP = 0)
149 
150 //******************************************************************************
151 // Function
152 //******************************************************************************
153 
155 
156 HAL_Status_Type HAL_LCD_SetRegister( uint32_t u32LCD_CR, uint32_t u32LCD_BCCR );
158 HAL_Status_Type HAL_LCD_WriteDspRam( uint8_t* write_buf, uint32_t u32Index, uint32_t size );
159 
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 #endif /* _LCD_H_ */
165 
uint32_t ContrastStep
HAL_Status_Type
uint32_t Contrast
Contains the ABOV typedefs for C standard types. It is intended to be used in ISO C conforming develo...
HAL_Status_Type HAL_LCD_Init(LCD_CFG_Type *LCD_Config)
Initialize the LCD peripheral with the specified parameters.
uint32_t AutoBiasEn
uint32_t BiasTime
HAL_Status_Type HAL_LCD_SetRegister(uint32_t u32LCD_CR, uint32_t u32LCD_BCCR)
Set LCD LCD_CR/LCD_BCCR Registers.
HAL_Status_Type HAL_LCD_WriteDspRam(uint8_t *write_buf, uint32_t u32Index, uint32_t size)
Write LCD Buffer.
HAL_Status_Type HAL_LCD_ClearDspRam(void)
Clear LCD Buffer.