STM8L15x Standard Peripherals Drivers
|
stm8l15x_lcd.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file stm8l15x_lcd.h 00004 * @author MCD Application Team 00005 * @version V1.5.0 00006 * @date 13-May-2011 00007 * @brief This file contains all the functions prototypes for the LCD firmware 00008 * library. 00009 ****************************************************************************** 00010 * @attention 00011 * 00012 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 00013 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 00014 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 00015 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 00016 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 00017 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 00018 * 00019 * <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2> 00020 ****************************************************************************** 00021 */ 00022 00023 /* Define to prevent recursive inclusion -------------------------------------*/ 00024 #ifndef __STM8L15x_LCD_H 00025 #define __STM8L15x_LCD_H 00026 00027 /* Includes ------------------------------------------------------------------*/ 00028 #include "stm8l15x.h" 00029 00030 /** @addtogroup STM8L15x_StdPeriph_Driver 00031 * @{ 00032 */ 00033 00034 /** @addtogroup LCD 00035 * @{ 00036 */ 00037 00038 /* Exported types ------------------------------------------------------------*/ 00039 00040 /** @defgroup LCD_Exported_Types 00041 * @{ 00042 */ 00043 00044 /** @defgroup LCD_Duty 00045 * @brief element values correspond to the bits position 00046 * @{ 00047 */ 00048 00049 typedef enum { 00050 LCD_Duty_Static = (uint8_t)0x00, /*!< Static duty */ 00051 LCD_Duty_1_2 = (uint8_t)0x02, /*!< 1/2 duty */ 00052 LCD_Duty_1_3 = (uint8_t)0x04, /*!< 1/3 duty */ 00053 LCD_Duty_1_4 = (uint8_t)0x06, /*!< 1/4 duty */ 00054 LCD_Duty_1_8 = (uint8_t)0x20 /*!< 1/8 duty */ 00055 } LCD_Duty_TypeDef; 00056 00057 #define IS_LCD_DUTY(DUTY) (((DUTY) == LCD_Duty_Static) || ((DUTY) == LCD_Duty_1_2) || \ 00058 ((DUTY) == LCD_Duty_1_3) || ((DUTY) == LCD_Duty_1_4) || \ 00059 ((DUTY) == LCD_Duty_1_8)) 00060 /** 00061 * @} 00062 */ 00063 00064 /** @defgroup LCD_Bias 00065 * @brief element values correspond to the bits position 00066 * @{ 00067 */ 00068 typedef enum { 00069 LCD_Bias_1_4 = (uint8_t)0x10, /*!< 1/4 bias */ 00070 LCD_Bias_1_3 = (uint8_t)0x00, /*!< 1/3 bias */ 00071 LCD_Bias_1_2 = (uint8_t)0x01 /*!< 1/2 bias */ 00072 } LCD_Bias_TypeDef; 00073 00074 #define IS_LCD_BIAS(BIAS) (((BIAS) == LCD_Bias_1_4) || \ 00075 ((BIAS) == LCD_Bias_1_3) || \ 00076 ((BIAS) == LCD_Bias_1_2)) 00077 00078 /** 00079 * @} 00080 */ 00081 00082 /** @defgroup LCD_Clock_Prescaler 00083 * @brief element values correspond to the bits position 00084 * @{ 00085 */ 00086 typedef enum { 00087 LCD_Prescaler_1 = (uint8_t)0x00, /*!< CLKprescaler = ClKinput */ 00088 LCD_Prescaler_2 = (uint8_t)0x10, /*!< CLKprescaler = ClKinput/2 */ 00089 LCD_Prescaler_4 = (uint8_t)0x20, /*!< CLKprescaler = ClKinput/4 */ 00090 LCD_Prescaler_8 = (uint8_t)0x30, /*!< CLKprescaler = ClKinput/8 */ 00091 LCD_Prescaler_16 = (uint8_t)0x40, /*!< CLKprescaler = ClKinput/16 */ 00092 LCD_Prescaler_32 = (uint8_t)0x50, /*!< CLKprescaler = ClKinput/32 */ 00093 LCD_Prescaler_64 = (uint8_t)0x60, /*!< CLKprescaler = ClKinput/64 */ 00094 LCD_Prescaler_128 = (uint8_t)0x70, /*!< CLKprescaler = ClKinput/128 */ 00095 LCD_Prescaler_256 = (uint8_t)0x80, /*!< CLKprescaler = ClKinput/256 */ 00096 LCD_Prescaler_512 = (uint8_t)0x90, /*!< CLKprescaler = ClKinput/512 */ 00097 LCD_Prescaler_1024 = (uint8_t)0xA0, /*!< CLKprescaler = ClKinput/1024 */ 00098 LCD_Prescaler_2048 = (uint8_t)0xB0, /*!< CLKprescaler = ClKinput/2048 */ 00099 LCD_Prescaler_4096 = (uint8_t)0xC0, /*!< CLKprescaler = ClKinput/4096 */ 00100 LCD_Prescaler_8192 = (uint8_t)0xD0, /*!< CLKprescaler = ClKinput/8192 */ 00101 LCD_Prescaler_16384 = (uint8_t)0xE0, /*!< CLKprescaler = ClKinput/16384 */ 00102 LCD_Prescaler_32768 = (uint8_t)0xF0 /*!< CLKprescaler = ClKinput/32768 */ 00103 } LCD_Prescaler_TypeDef; 00104 00105 #define IS_LCD_CLOCK_PRESCALER(PRESCALER) (((PRESCALER) == LCD_Prescaler_1) || \ 00106 ((PRESCALER) == LCD_Prescaler_2) || \ 00107 ((PRESCALER) == LCD_Prescaler_4) || \ 00108 ((PRESCALER) == LCD_Prescaler_8) || \ 00109 ((PRESCALER) == LCD_Prescaler_16) || \ 00110 ((PRESCALER) == LCD_Prescaler_32) || \ 00111 ((PRESCALER) == LCD_Prescaler_64) || \ 00112 ((PRESCALER) == LCD_Prescaler_128) || \ 00113 ((PRESCALER) == LCD_Prescaler_256) || \ 00114 ((PRESCALER) == LCD_Prescaler_512) || \ 00115 ((PRESCALER) == LCD_Prescaler_1024) || \ 00116 ((PRESCALER) == LCD_Prescaler_2048) || \ 00117 ((PRESCALER) == LCD_Prescaler_4096) || \ 00118 ((PRESCALER) == LCD_Prescaler_8192) || \ 00119 ((PRESCALER) == LCD_Prescaler_16384) || \ 00120 ((PRESCALER) == LCD_Prescaler_32768)) 00121 00122 /** 00123 * @} 00124 */ 00125 00126 /** @defgroup LCD_Clock_Divider 00127 * @brief element values correspond to the bits position 00128 * @{ 00129 */ 00130 typedef enum { 00131 LCD_Divider_16 = (uint8_t)0x00, /*!< LCD frequency = CLKprescaler/16 */ 00132 LCD_Divider_17 = (uint8_t)0x01, /*!< LCD frequency = CLKprescaler/17 */ 00133 LCD_Divider_18 = (uint8_t)0x02, /*!< LCD frequency = CLKprescaler/18 */ 00134 LCD_Divider_19 = (uint8_t)0x03, /*!< LCD frequency = CLKprescaler/19 */ 00135 LCD_Divider_20 = (uint8_t)0x04, /*!< LCD frequency = CLKprescaler/20 */ 00136 LCD_Divider_21 = (uint8_t)0x05, /*!< LCD frequency = CLKprescaler/21 */ 00137 LCD_Divider_22 = (uint8_t)0x06, /*!< LCD frequency = CLKprescaler/22 */ 00138 LCD_Divider_23 = (uint8_t)0x07, /*!< LCD frequency = CLKprescaler/23 */ 00139 LCD_Divider_24 = (uint8_t)0x08, /*!< LCD frequency = CLKprescaler/24 */ 00140 LCD_Divider_25 = (uint8_t)0x09, /*!< LCD frequency = CLKprescaler/25 */ 00141 LCD_Divider_26 = (uint8_t)0x0A, /*!< LCD frequency = CLKprescaler/26 */ 00142 LCD_Divider_27 = (uint8_t)0x0B, /*!< LCD frequency = CLKprescaler/27 */ 00143 LCD_Divider_28 = (uint8_t)0x0C, /*!< LCD frequency = CLKprescaler/28 */ 00144 LCD_Divider_29 = (uint8_t)0x0D, /*!< LCD frequency = CLKprescaler/29 */ 00145 LCD_Divider_30 = (uint8_t)0x0E, /*!< LCD frequency = CLKprescaler/30 */ 00146 LCD_Divider_31 = (uint8_t)0x0F /*!< LCD frequency = CLKprescaler/31 */ 00147 } LCD_Divider_TypeDef; 00148 00149 #define IS_LCD_CLOCK_DIVIDER(DIVIDER) (((DIVIDER) == LCD_Divider_16) || \ 00150 ((DIVIDER) == LCD_Divider_17) || \ 00151 ((DIVIDER) == LCD_Divider_18) || \ 00152 ((DIVIDER) == LCD_Divider_19) || \ 00153 ((DIVIDER) == LCD_Divider_20) || \ 00154 ((DIVIDER) == LCD_Divider_21) || \ 00155 ((DIVIDER) == LCD_Divider_22) || \ 00156 ((DIVIDER) == LCD_Divider_23) || \ 00157 ((DIVIDER) == LCD_Divider_24) || \ 00158 ((DIVIDER) == LCD_Divider_25) || \ 00159 ((DIVIDER) == LCD_Divider_26) || \ 00160 ((DIVIDER) == LCD_Divider_27) || \ 00161 ((DIVIDER) == LCD_Divider_28) || \ 00162 ((DIVIDER) == LCD_Divider_29) || \ 00163 ((DIVIDER) == LCD_Divider_30) || \ 00164 ((DIVIDER) == LCD_Divider_31)) 00165 00166 /** 00167 * @} 00168 */ 00169 00170 /** @defgroup LCD_Contrast 00171 * @brief element values correspond to the bits position 00172 * @{ 00173 */ 00174 typedef enum { 00175 LCD_Contrast_Level_0 = (uint8_t)0x00, /*!< Medium Density / High Density Maximum Voltage = 2.60V / 2.60V */ 00176 LCD_Contrast_Level_1 = (uint8_t)0x02, /*!< Medium Density / High Density Maximum Voltage = 2.70V / 2.73V */ 00177 LCD_Contrast_Level_2 = (uint8_t)0x04, /*!< Medium Density / High Density Maximum Voltage = 2.80V / 2.86V */ 00178 LCD_Contrast_Level_3 = (uint8_t)0x06, /*!< Medium Density / High Density Maximum Voltage = 2.90V / 2.99V */ 00179 LCD_Contrast_Level_4 = (uint8_t)0x08, /*!< Medium Density / High Density Maximum Voltage = 3.00V / 3.12V */ 00180 LCD_Contrast_Level_5 = (uint8_t)0x0A, /*!< Medium Density / High Density Maximum Voltage = 3.10V / 3.25V */ 00181 LCD_Contrast_Level_6 = (uint8_t)0x0C, /*!< Medium Density / High Density Maximum Voltage = 3.20V / 3.38V */ 00182 LCD_Contrast_Level_7 = (uint8_t)0x0E /*!< Medium Density / High Density Maximum Voltage = 3.30V / 3.51V */ 00183 } LCD_Contrast_TypeDef; 00184 00185 #define IS_LCD_CONTRAST(CONTRAST) (((CONTRAST) == LCD_Contrast_Level_0) || \ 00186 ((CONTRAST) == LCD_Contrast_Level_1) || \ 00187 ((CONTRAST) == LCD_Contrast_Level_2) || \ 00188 ((CONTRAST) == LCD_Contrast_Level_3) || \ 00189 ((CONTRAST) == LCD_Contrast_Level_4) || \ 00190 ((CONTRAST) == LCD_Contrast_Level_5) || \ 00191 ((CONTRAST) == LCD_Contrast_Level_6) || \ 00192 ((CONTRAST) == LCD_Contrast_Level_7)) 00193 00194 /** 00195 * @} 00196 */ 00197 00198 /** @defgroup LCD_Voltage_Source 00199 * @brief element values correspond to the bits position 00200 * @{ 00201 */ 00202 typedef enum { 00203 LCD_VoltageSource_Internal = (uint8_t)0x00, /*!< Internal voltage source for the LCD */ 00204 LCD_VoltageSource_External = (uint8_t)0x01 /*!< External voltage source for the LCD */ 00205 } LCD_VoltageSource_TypeDef; 00206 00207 #define IS_LCD_VOLTAGE_SOURCE(SOURCE) (((SOURCE) == LCD_VoltageSource_Internal) || \ 00208 ((SOURCE) == LCD_VoltageSource_External)) 00209 00210 /** 00211 * @} 00212 */ 00213 00214 /** @defgroup LCD_Pulse_On_Duration 00215 * @brief element values correspond to the bits position 00216 * @{ 00217 */ 00218 typedef enum { 00219 LCD_PulseOnDuration_0 = (uint8_t)0x00, /*!< Pulse on duration = 0/CLKprescaler */ 00220 LCD_PulseOnDuration_1 = (uint8_t)0x20, /*!< Pulse on duration = 1/CLKprescaler */ 00221 LCD_PulseOnDuration_2 = (uint8_t)0x40, /*!< Pulse on duration = 2/CLKprescaler */ 00222 LCD_PulseOnDuration_3 = (uint8_t)0x60, /*!< Pulse on duration = 3/CLKprescaler */ 00223 LCD_PulseOnDuration_4 = (uint8_t)0x80, /*!< Pulse on duration = 4/CLKprescaler */ 00224 LCD_PulseOnDuration_5 = (uint8_t)0xA0, /*!< Pulse on duration = 5/CLKprescaler */ 00225 LCD_PulseOnDuration_6 = (uint8_t)0xC0, /*!< Pulse on duration = 6/CLKprescaler */ 00226 LCD_PulseOnDuration_7 = (uint8_t)0xE0 /*!< Pulse on duration = 7/CLKprescaler */ 00227 } LCD_PulseOnDuration_TypeDef; 00228 00229 #define IS_LCD_PULSE_DURATION(DURATION) (((DURATION) == LCD_PulseOnDuration_0) || \ 00230 ((DURATION) == LCD_PulseOnDuration_1) || \ 00231 ((DURATION) == LCD_PulseOnDuration_2) || \ 00232 ((DURATION) == LCD_PulseOnDuration_3) || \ 00233 ((DURATION) == LCD_PulseOnDuration_4) || \ 00234 ((DURATION) == LCD_PulseOnDuration_5) || \ 00235 ((DURATION) == LCD_PulseOnDuration_6) || \ 00236 ((DURATION) == LCD_PulseOnDuration_7)) 00237 00238 /** 00239 * @} 00240 */ 00241 00242 /** @defgroup LCD_Dead_Time 00243 * @brief element values correspond to the bits position 00244 * @{ 00245 */ 00246 typedef enum { 00247 LCD_DeadTime_0 = (uint8_t)0x00, /*!< No dead Time */ 00248 LCD_DeadTime_1 = (uint8_t)0x01, /*!< One Phase between different couple of Frame */ 00249 LCD_DeadTime_2 = (uint8_t)0x02, /*!< Two Phase between different couple of Frame */ 00250 LCD_DeadTime_3 = (uint8_t)0x03, /*!< Tree Phase between different couple of Frame */ 00251 LCD_DeadTime_4 = (uint8_t)0x04, /*!< Four Phase between different couple of Frame */ 00252 LCD_DeadTime_5 = (uint8_t)0x05, /*!< Five Phase between different couple of Frame */ 00253 LCD_DeadTime_6 = (uint8_t)0x06, /*!< Six Phase between different couple of Frame */ 00254 LCD_DeadTime_7 = (uint8_t)0x07 /*!< Seven Phase between different couple of Frame */ 00255 } LCD_DeadTime_TypeDef; 00256 00257 #define IS_LCD_DEAD_TIME(TIME) (((TIME) == LCD_DeadTime_0) || \ 00258 ((TIME) == LCD_DeadTime_1) || \ 00259 ((TIME) == LCD_DeadTime_2) || \ 00260 ((TIME) == LCD_DeadTime_3) || \ 00261 ((TIME) == LCD_DeadTime_4) || \ 00262 ((TIME) == LCD_DeadTime_5) || \ 00263 ((TIME) == LCD_DeadTime_6) || \ 00264 ((TIME) == LCD_DeadTime_7)) 00265 00266 /** 00267 * @} 00268 */ 00269 00270 /** @defgroup LCD_BlinkMode 00271 * @{ 00272 */ 00273 typedef enum { 00274 LCD_BlinkMode_Off = (uint8_t)0x00, /*!< Blink inactive */ 00275 LCD_BlinkMode_SEG0_COM0 = (uint8_t)0x40, /*!< SEG0 on COM0 blink */ 00276 LCD_BlinkMode_SEG0_AllCOM = (uint8_t)0x80, /*!< SEG0 on All COM blink */ 00277 LCD_BlinkMode_AllSEG_AllCOM = (uint8_t)0xC0 /*!< All SEG on All COm Blink */ 00278 } LCD_BlinkMode_TypeDef; 00279 00280 #define IS_LCD_BLINK_MODE(BLINK) (((BLINK) == LCD_BlinkMode_Off) || \ 00281 ((BLINK) == LCD_BlinkMode_SEG0_COM0) || \ 00282 ((BLINK) == LCD_BlinkMode_SEG0_AllCOM) || \ 00283 ((BLINK) == LCD_BlinkMode_AllSEG_AllCOM)) 00284 00285 /** 00286 * @} 00287 */ 00288 00289 /** @defgroup LCD_Blink_Frequency 00290 * @brief element values correspond to the bits position 00291 * @{ 00292 */ 00293 typedef enum { 00294 LCD_BlinkFrequency_Div8 = (uint8_t)0x00, /*!< The Blink frequency = fLcd/8 */ 00295 LCD_BlinkFrequency_Div16 = (uint8_t)0x08, /*!< The Blink frequency = fLcd/16 */ 00296 LCD_BlinkFrequency_Div32 = (uint8_t)0x10, /*!< The Blink frequency = fLcd/32 */ 00297 LCD_BlinkFrequency_Div64 = (uint8_t)0x18, /*!< The Blink frequency = fLcd/64 */ 00298 LCD_BlinkFrequency_Div128 = (uint8_t)0x20, /*!< The Blink frequency = fLcd/128 */ 00299 LCD_BlinkFrequency_Div256 = (uint8_t)0x28, /*!< The Blink frequency = fLcd/256 */ 00300 LCD_BlinkFrequency_Div512 = (uint8_t)0x30, /*!< The Blink frequency = fLcd/512 */ 00301 LCD_BlinkFrequency_Div1024 = (uint8_t)0x38 /*!< The Blink frequency = fLcd/1024 */ 00302 } LCD_BlinkFrequency_TypeDef; 00303 00304 #define IS_LCD_BLINK_FREQUENCY(BLINKF) (((BLINKF) == LCD_BlinkFrequency_Div8) || \ 00305 ((BLINKF) == LCD_BlinkFrequency_Div16) || \ 00306 ((BLINKF) == LCD_BlinkFrequency_Div32) || \ 00307 ((BLINKF) == LCD_BlinkFrequency_Div64) || \ 00308 ((BLINKF) == LCD_BlinkFrequency_Div128) || \ 00309 ((BLINKF) == LCD_BlinkFrequency_Div256) || \ 00310 ((BLINKF) == LCD_BlinkFrequency_Div512) || \ 00311 ((BLINKF) == LCD_BlinkFrequency_Div1024)) 00312 /** 00313 * @} 00314 */ 00315 00316 /** @defgroup LCD_RAMRegister 00317 * @{ 00318 */ 00319 typedef enum { 00320 LCD_RAMRegister_0 = (uint8_t)0x00, /*!< RAM Register 0 */ 00321 LCD_RAMRegister_1 = (uint8_t)0x01, /*!< RAM Register 1 */ 00322 LCD_RAMRegister_2 = (uint8_t)0x02, /*!< RAM Register 2 */ 00323 LCD_RAMRegister_3 = (uint8_t)0x03, /*!< RAM Register 3 */ 00324 LCD_RAMRegister_4 = (uint8_t)0x04, /*!< RAM Register 4 */ 00325 LCD_RAMRegister_5 = (uint8_t)0x05, /*!< RAM Register 5 */ 00326 LCD_RAMRegister_6 = (uint8_t)0x06, /*!< RAM Register 6 */ 00327 LCD_RAMRegister_7 = (uint8_t)0x07, /*!< RAM Register 7 */ 00328 LCD_RAMRegister_8 = (uint8_t)0x08, /*!< RAM Register 8 */ 00329 LCD_RAMRegister_9 = (uint8_t)0x09, /*!< RAM Register 9 */ 00330 LCD_RAMRegister_10 = (uint8_t)0x0A, /*!< RAM Register 10 */ 00331 LCD_RAMRegister_11 = (uint8_t)0x0B, /*!< RAM Register 11 */ 00332 LCD_RAMRegister_12 = (uint8_t)0x0C, /*!< RAM Register 12 */ 00333 LCD_RAMRegister_13 = (uint8_t)0x0D, /*!< RAM Register 13 */ 00334 LCD_RAMRegister_14 = (uint8_t)0x0E, /*!< RAM Register 14 */ 00335 LCD_RAMRegister_15 = (uint8_t)0x0F, /*!< RAM Register 15 */ 00336 LCD_RAMRegister_16 = (uint8_t)0x10, /*!< RAM Register 16 */ 00337 LCD_RAMRegister_17 = (uint8_t)0x11, /*!< RAM Register 17 */ 00338 LCD_RAMRegister_18 = (uint8_t)0x12, /*!< RAM Register 18 */ 00339 LCD_RAMRegister_19 = (uint8_t)0x13, /*!< RAM Register 19 */ 00340 LCD_RAMRegister_20 = (uint8_t)0x14, /*!< RAM Register 20 */ 00341 LCD_RAMRegister_21 = (uint8_t)0x15 /*!< RAM Register 21 */ 00342 } LCD_RAMRegister_TypeDef; 00343 00344 #define IS_LCD_RAM_REGISTER(REGISTER) (((REGISTER) == LCD_RAMRegister_0) || \ 00345 ((REGISTER) == LCD_RAMRegister_1) || \ 00346 ((REGISTER) == LCD_RAMRegister_2) || \ 00347 ((REGISTER) == LCD_RAMRegister_3) || \ 00348 ((REGISTER) == LCD_RAMRegister_4) || \ 00349 ((REGISTER) == LCD_RAMRegister_5) || \ 00350 ((REGISTER) == LCD_RAMRegister_6) || \ 00351 ((REGISTER) == LCD_RAMRegister_7) || \ 00352 ((REGISTER) == LCD_RAMRegister_8) || \ 00353 ((REGISTER) == LCD_RAMRegister_9) || \ 00354 ((REGISTER) == LCD_RAMRegister_10) || \ 00355 ((REGISTER) == LCD_RAMRegister_11) || \ 00356 ((REGISTER) == LCD_RAMRegister_12) || \ 00357 ((REGISTER) == LCD_RAMRegister_13) || \ 00358 ((REGISTER) == LCD_RAMRegister_14) || \ 00359 ((REGISTER) == LCD_RAMRegister_15) || \ 00360 ((REGISTER) == LCD_RAMRegister_16) || \ 00361 ((REGISTER) == LCD_RAMRegister_17) || \ 00362 ((REGISTER) == LCD_RAMRegister_18) || \ 00363 ((REGISTER) == LCD_RAMRegister_19) || \ 00364 ((REGISTER) == LCD_RAMRegister_20) || \ 00365 ((REGISTER) == LCD_RAMRegister_21)) 00366 00367 /** 00368 * @} 00369 */ 00370 00371 /** @defgroup LCD_Port_Mask_Register 00372 * @{ 00373 */ 00374 typedef enum { 00375 LCD_PortMaskRegister_0 = (uint8_t)0x00, /*!< PortMask Register 0 */ 00376 LCD_PortMaskRegister_1 = (uint8_t)0x01, /*!< PortMask Register 1 */ 00377 LCD_PortMaskRegister_2 = (uint8_t)0x02, /*!< PortMask Register 2 */ 00378 LCD_PortMaskRegister_3 = (uint8_t)0x03, /*!< PortMask Register 3 */ 00379 LCD_PortMaskRegister_4 = (uint8_t)0x04, /*!< PortMask Register 4 */ 00380 LCD_PortMaskRegister_5 = (uint8_t)0x05 /*!< PortMask Register 5 */ 00381 } LCD_PortMaskRegister_TypeDef; 00382 00383 #define IS_LCD_PORT_MASK(MASK) (((MASK) == LCD_PortMaskRegister_0) || \ 00384 ((MASK) == LCD_PortMaskRegister_1) || \ 00385 ((MASK) == LCD_PortMaskRegister_2) || \ 00386 ((MASK) == LCD_PortMaskRegister_3) || \ 00387 ((MASK) == LCD_PortMaskRegister_4) || \ 00388 ((MASK) == LCD_PortMaskRegister_5)) 00389 00390 /** 00391 * @} 00392 */ 00393 00394 /** @defgroup LCD_Page_Selection 00395 * @{ 00396 */ 00397 typedef enum { 00398 LCD_PageSelection_FirstPage = (uint8_t)0x00, /*!< The LCD RAM is selected as the first page */ 00399 LCD_PageSelection_SecondPage = (uint8_t)0x04 /*!< The LCD RAM is selected as the second page */ 00400 } LCD_PageSelection_TypeDef; 00401 00402 #define IS_LCD_PAGE_SELECT(PAGE) (((PAGE) == LCD_PageSelection_FirstPage) || \ 00403 ((PAGE) == LCD_PageSelection_SecondPage)) 00404 /** 00405 * @} 00406 */ 00407 00408 /** 00409 * @} 00410 */ 00411 00412 /* Private define ------------------------------------------------------------*/ 00413 /* LCD Legacy defines */ 00414 /** @defgroup LCD_Private_Define 00415 * @ brief LCD Legacy defines 00416 * @{ 00417 */ 00418 #define LCD_Contrast_2V6 ((uint8_t)LCD_Contrast_Level_0) 00419 #define LCD_Contrast_2V7 ((uint8_t)LCD_Contrast_Level_1) 00420 #define LCD_Contrast_2V8 ((uint8_t)LCD_Contrast_Level_2) 00421 #define LCD_Contrast_2V9 ((uint8_t)LCD_Contrast_Level_3) 00422 #define LCD_Contrast_3V0 ((uint8_t)LCD_Contrast_Level_4) 00423 #define LCD_Contrast_3V1 ((uint8_t)LCD_Contrast_Level_5) 00424 #define LCD_Contrast_3V2 ((uint8_t)LCD_Contrast_Level_6) 00425 #define LCD_Contrast_3V3 ((uint8_t)LCD_Contrast_Level_7) 00426 /** 00427 * @} 00428 */ 00429 /* Private macros ------------------------------------------------------------*/ 00430 /* Exported functions ------------------------------------------------------- */ 00431 00432 /* Function used to set the LCD configuration to the default reset state *****/ 00433 void LCD_DeInit(void); 00434 00435 /* Initialization and Configuration functions *********************************/ 00436 void LCD_Init(LCD_Prescaler_TypeDef LCD_Prescaler, LCD_Divider_TypeDef LCD_Divider, 00437 LCD_Duty_TypeDef LCD_Duty, LCD_Bias_TypeDef LCD_Bias, LCD_VoltageSource_TypeDef LCD_VoltageSource); 00438 void LCD_PortMaskConfig(LCD_PortMaskRegister_TypeDef LCD_PortMaskRegister, uint8_t LCD_Mask); 00439 void LCD_Cmd(FunctionalState NewState); 00440 void LCD_HighDriveCmd(FunctionalState NewState); 00441 void LCD_PulseOnDurationConfig(LCD_PulseOnDuration_TypeDef LCD_PulseOnDuration); 00442 void LCD_DeadTimeConfig(LCD_DeadTime_TypeDef LCD_DeadTime); 00443 void LCD_BlinkConfig(LCD_BlinkMode_TypeDef LCD_BlinkMode, LCD_BlinkFrequency_TypeDef LCD_BlinkFrequency); 00444 void LCD_ContrastConfig(LCD_Contrast_TypeDef LCD_Contrast); 00445 00446 /* LCD RAM memory write functions *********************************************/ 00447 void LCD_WriteRAM(LCD_RAMRegister_TypeDef LCD_RAMRegister, uint8_t LCD_Data); 00448 void LCD_PageSelect(LCD_PageSelection_TypeDef LCD_PageSelection); 00449 00450 /* Interrupts and flags management functions **********************************/ 00451 void LCD_ITConfig(FunctionalState NewState); 00452 FlagStatus LCD_GetFlagStatus(void); 00453 void LCD_ClearFlag(void); 00454 ITStatus LCD_GetITStatus(void); 00455 void LCD_ClearITPendingBit(void); 00456 00457 #endif /* __STM8L15x_LCD_H */ 00458 00459 /** 00460 * @} 00461 */ 00462 00463 /** 00464 * @} 00465 */ 00466 00467 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/