mbed library sources

Dependents:   bare

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Wed Feb 26 09:45:12 2014 +0000
Revision:
106:ced8cbb51063
Parent:
80:66393a7b209d
Synchronized with git revision 4222735eff5868389433f0e9271976b39c8115cd

Full URL: https://github.com/mbedmicro/mbed/commit/4222735eff5868389433f0e9271976b39c8115cd/

[NUCLEO_xxx] Update STM32CubeF4 driver V1.0.0 + update license

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 76:aeb1df146756 1 /**
mbed_official 76:aeb1df146756 2 ******************************************************************************
mbed_official 76:aeb1df146756 3 * @file stm32l1xx_lcd.h
mbed_official 76:aeb1df146756 4 * @author MCD Application Team
mbed_official 80:66393a7b209d 5 * @version V1.3.0
mbed_official 80:66393a7b209d 6 * @date 31-January-2014
mbed_official 76:aeb1df146756 7 * @brief This file contains all the functions prototypes for the LCD firmware
mbed_official 76:aeb1df146756 8 * library.
mbed_official 76:aeb1df146756 9 ******************************************************************************
mbed_official 76:aeb1df146756 10 * @attention
mbed_official 76:aeb1df146756 11 *
mbed_official 106:ced8cbb51063 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 76:aeb1df146756 13 *
mbed_official 106:ced8cbb51063 14 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 106:ced8cbb51063 15 * are permitted provided that the following conditions are met:
mbed_official 106:ced8cbb51063 16 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 106:ced8cbb51063 17 * this list of conditions and the following disclaimer.
mbed_official 106:ced8cbb51063 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 106:ced8cbb51063 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 106:ced8cbb51063 20 * and/or other materials provided with the distribution.
mbed_official 106:ced8cbb51063 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 106:ced8cbb51063 22 * may be used to endorse or promote products derived from this software
mbed_official 106:ced8cbb51063 23 * without specific prior written permission.
mbed_official 76:aeb1df146756 24 *
mbed_official 106:ced8cbb51063 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 106:ced8cbb51063 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 106:ced8cbb51063 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 106:ced8cbb51063 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 106:ced8cbb51063 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 106:ced8cbb51063 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 106:ced8cbb51063 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 106:ced8cbb51063 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 106:ced8cbb51063 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 106:ced8cbb51063 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 76:aeb1df146756 35 *
mbed_official 76:aeb1df146756 36 ******************************************************************************
mbed_official 76:aeb1df146756 37 */
mbed_official 76:aeb1df146756 38
mbed_official 76:aeb1df146756 39 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 76:aeb1df146756 40 #ifndef __STM32L1xx_LCD_H
mbed_official 76:aeb1df146756 41 #define __STM32L1xx_LCD_H
mbed_official 76:aeb1df146756 42
mbed_official 76:aeb1df146756 43 #ifdef __cplusplus
mbed_official 76:aeb1df146756 44 extern "C" {
mbed_official 76:aeb1df146756 45 #endif
mbed_official 76:aeb1df146756 46
mbed_official 76:aeb1df146756 47 /* Includes ------------------------------------------------------------------*/
mbed_official 76:aeb1df146756 48 #include "stm32l1xx.h"
mbed_official 76:aeb1df146756 49
mbed_official 76:aeb1df146756 50 /** @addtogroup STM32L1xx_StdPeriph_Driver
mbed_official 76:aeb1df146756 51 * @{
mbed_official 76:aeb1df146756 52 */
mbed_official 76:aeb1df146756 53
mbed_official 76:aeb1df146756 54 /** @addtogroup LCD
mbed_official 76:aeb1df146756 55 * @{
mbed_official 76:aeb1df146756 56 */
mbed_official 76:aeb1df146756 57
mbed_official 76:aeb1df146756 58 /* Exported types ------------------------------------------------------------*/
mbed_official 76:aeb1df146756 59
mbed_official 76:aeb1df146756 60 /**
mbed_official 76:aeb1df146756 61 * @brief LCD Init structure definition
mbed_official 76:aeb1df146756 62 */
mbed_official 76:aeb1df146756 63
mbed_official 76:aeb1df146756 64 typedef struct
mbed_official 76:aeb1df146756 65 {
mbed_official 76:aeb1df146756 66 uint32_t LCD_Prescaler; /*!< Configures the LCD Prescaler.
mbed_official 76:aeb1df146756 67 This parameter can be one value of @ref LCD_Prescaler */
mbed_official 76:aeb1df146756 68 uint32_t LCD_Divider; /*!< Configures the LCD Divider.
mbed_official 76:aeb1df146756 69 This parameter can be one value of @ref LCD_Divider */
mbed_official 76:aeb1df146756 70 uint32_t LCD_Duty; /*!< Configures the LCD Duty.
mbed_official 76:aeb1df146756 71 This parameter can be one value of @ref LCD_Duty */
mbed_official 76:aeb1df146756 72 uint32_t LCD_Bias; /*!< Configures the LCD Bias.
mbed_official 76:aeb1df146756 73 This parameter can be one value of @ref LCD_Bias */
mbed_official 76:aeb1df146756 74 uint32_t LCD_VoltageSource; /*!< Selects the LCD Voltage source.
mbed_official 76:aeb1df146756 75 This parameter can be one value of @ref LCD_Voltage_Source */
mbed_official 76:aeb1df146756 76 }LCD_InitTypeDef;
mbed_official 76:aeb1df146756 77
mbed_official 76:aeb1df146756 78
mbed_official 76:aeb1df146756 79 /* Exported constants --------------------------------------------------------*/
mbed_official 76:aeb1df146756 80
mbed_official 76:aeb1df146756 81 /** @defgroup LCD_Exported_Constants
mbed_official 76:aeb1df146756 82 * @{
mbed_official 76:aeb1df146756 83 */
mbed_official 76:aeb1df146756 84
mbed_official 76:aeb1df146756 85 /** @defgroup LCD_Prescaler
mbed_official 76:aeb1df146756 86 * @{
mbed_official 76:aeb1df146756 87 */
mbed_official 76:aeb1df146756 88
mbed_official 76:aeb1df146756 89 #define LCD_Prescaler_1 ((uint32_t)0x00000000) /*!< CLKPS = LCDCLK */
mbed_official 76:aeb1df146756 90 #define LCD_Prescaler_2 ((uint32_t)0x00400000) /*!< CLKPS = LCDCLK/2 */
mbed_official 76:aeb1df146756 91 #define LCD_Prescaler_4 ((uint32_t)0x00800000) /*!< CLKPS = LCDCLK/4 */
mbed_official 76:aeb1df146756 92 #define LCD_Prescaler_8 ((uint32_t)0x00C00000) /*!< CLKPS = LCDCLK/8 */
mbed_official 76:aeb1df146756 93 #define LCD_Prescaler_16 ((uint32_t)0x01000000) /*!< CLKPS = LCDCLK/16 */
mbed_official 76:aeb1df146756 94 #define LCD_Prescaler_32 ((uint32_t)0x01400000) /*!< CLKPS = LCDCLK/32 */
mbed_official 76:aeb1df146756 95 #define LCD_Prescaler_64 ((uint32_t)0x01800000) /*!< CLKPS = LCDCLK/64 */
mbed_official 76:aeb1df146756 96 #define LCD_Prescaler_128 ((uint32_t)0x01C00000) /*!< CLKPS = LCDCLK/128 */
mbed_official 76:aeb1df146756 97 #define LCD_Prescaler_256 ((uint32_t)0x02000000) /*!< CLKPS = LCDCLK/256 */
mbed_official 76:aeb1df146756 98 #define LCD_Prescaler_512 ((uint32_t)0x02400000) /*!< CLKPS = LCDCLK/512 */
mbed_official 76:aeb1df146756 99 #define LCD_Prescaler_1024 ((uint32_t)0x02800000) /*!< CLKPS = LCDCLK/1024 */
mbed_official 76:aeb1df146756 100 #define LCD_Prescaler_2048 ((uint32_t)0x02C00000) /*!< CLKPS = LCDCLK/2048 */
mbed_official 76:aeb1df146756 101 #define LCD_Prescaler_4096 ((uint32_t)0x03000000) /*!< CLKPS = LCDCLK/4096 */
mbed_official 76:aeb1df146756 102 #define LCD_Prescaler_8192 ((uint32_t)0x03400000) /*!< CLKPS = LCDCLK/8192 */
mbed_official 76:aeb1df146756 103 #define LCD_Prescaler_16384 ((uint32_t)0x03800000) /*!< CLKPS = LCDCLK/16384 */
mbed_official 76:aeb1df146756 104 #define LCD_Prescaler_32768 ((uint32_t)0x03C00000) /*!< CLKPS = LCDCLK/32768 */
mbed_official 76:aeb1df146756 105
mbed_official 76:aeb1df146756 106 #define IS_LCD_PRESCALER(PRESCALER) (((PRESCALER) == LCD_Prescaler_1) || \
mbed_official 76:aeb1df146756 107 ((PRESCALER) == LCD_Prescaler_2) || \
mbed_official 76:aeb1df146756 108 ((PRESCALER) == LCD_Prescaler_4) || \
mbed_official 76:aeb1df146756 109 ((PRESCALER) == LCD_Prescaler_8) || \
mbed_official 76:aeb1df146756 110 ((PRESCALER) == LCD_Prescaler_16) || \
mbed_official 76:aeb1df146756 111 ((PRESCALER) == LCD_Prescaler_32) || \
mbed_official 76:aeb1df146756 112 ((PRESCALER) == LCD_Prescaler_64) || \
mbed_official 76:aeb1df146756 113 ((PRESCALER) == LCD_Prescaler_128) || \
mbed_official 76:aeb1df146756 114 ((PRESCALER) == LCD_Prescaler_256) || \
mbed_official 76:aeb1df146756 115 ((PRESCALER) == LCD_Prescaler_512) || \
mbed_official 76:aeb1df146756 116 ((PRESCALER) == LCD_Prescaler_1024) || \
mbed_official 76:aeb1df146756 117 ((PRESCALER) == LCD_Prescaler_2048) || \
mbed_official 76:aeb1df146756 118 ((PRESCALER) == LCD_Prescaler_4096) || \
mbed_official 76:aeb1df146756 119 ((PRESCALER) == LCD_Prescaler_8192) || \
mbed_official 76:aeb1df146756 120 ((PRESCALER) == LCD_Prescaler_16384) || \
mbed_official 76:aeb1df146756 121 ((PRESCALER) == LCD_Prescaler_32768))
mbed_official 76:aeb1df146756 122
mbed_official 76:aeb1df146756 123 /**
mbed_official 76:aeb1df146756 124 * @}
mbed_official 76:aeb1df146756 125 */
mbed_official 76:aeb1df146756 126
mbed_official 76:aeb1df146756 127 /** @defgroup LCD_Divider
mbed_official 76:aeb1df146756 128 * @{
mbed_official 76:aeb1df146756 129 */
mbed_official 76:aeb1df146756 130
mbed_official 76:aeb1df146756 131 #define LCD_Divider_16 ((uint32_t)0x00000000) /*!< LCD frequency = CLKPS/16 */
mbed_official 76:aeb1df146756 132 #define LCD_Divider_17 ((uint32_t)0x00040000) /*!< LCD frequency = CLKPS/17 */
mbed_official 76:aeb1df146756 133 #define LCD_Divider_18 ((uint32_t)0x00080000) /*!< LCD frequency = CLKPS/18 */
mbed_official 76:aeb1df146756 134 #define LCD_Divider_19 ((uint32_t)0x000C0000) /*!< LCD frequency = CLKPS/19 */
mbed_official 76:aeb1df146756 135 #define LCD_Divider_20 ((uint32_t)0x00100000) /*!< LCD frequency = CLKPS/20 */
mbed_official 76:aeb1df146756 136 #define LCD_Divider_21 ((uint32_t)0x00140000) /*!< LCD frequency = CLKPS/21 */
mbed_official 76:aeb1df146756 137 #define LCD_Divider_22 ((uint32_t)0x00180000) /*!< LCD frequency = CLKPS/22 */
mbed_official 76:aeb1df146756 138 #define LCD_Divider_23 ((uint32_t)0x001C0000) /*!< LCD frequency = CLKPS/23 */
mbed_official 76:aeb1df146756 139 #define LCD_Divider_24 ((uint32_t)0x00200000) /*!< LCD frequency = CLKPS/24 */
mbed_official 76:aeb1df146756 140 #define LCD_Divider_25 ((uint32_t)0x00240000) /*!< LCD frequency = CLKPS/25 */
mbed_official 76:aeb1df146756 141 #define LCD_Divider_26 ((uint32_t)0x00280000) /*!< LCD frequency = CLKPS/26 */
mbed_official 76:aeb1df146756 142 #define LCD_Divider_27 ((uint32_t)0x002C0000) /*!< LCD frequency = CLKPS/27 */
mbed_official 76:aeb1df146756 143 #define LCD_Divider_28 ((uint32_t)0x00300000) /*!< LCD frequency = CLKPS/28 */
mbed_official 76:aeb1df146756 144 #define LCD_Divider_29 ((uint32_t)0x00340000) /*!< LCD frequency = CLKPS/29 */
mbed_official 76:aeb1df146756 145 #define LCD_Divider_30 ((uint32_t)0x00380000) /*!< LCD frequency = CLKPS/30 */
mbed_official 76:aeb1df146756 146 #define LCD_Divider_31 ((uint32_t)0x003C0000) /*!< LCD frequency = CLKPS/31 */
mbed_official 76:aeb1df146756 147
mbed_official 76:aeb1df146756 148 #define IS_LCD_DIVIDER(DIVIDER) (((DIVIDER) == LCD_Divider_16) || \
mbed_official 76:aeb1df146756 149 ((DIVIDER) == LCD_Divider_17) || \
mbed_official 76:aeb1df146756 150 ((DIVIDER) == LCD_Divider_18) || \
mbed_official 76:aeb1df146756 151 ((DIVIDER) == LCD_Divider_19) || \
mbed_official 76:aeb1df146756 152 ((DIVIDER) == LCD_Divider_20) || \
mbed_official 76:aeb1df146756 153 ((DIVIDER) == LCD_Divider_21) || \
mbed_official 76:aeb1df146756 154 ((DIVIDER) == LCD_Divider_22) || \
mbed_official 76:aeb1df146756 155 ((DIVIDER) == LCD_Divider_23) || \
mbed_official 76:aeb1df146756 156 ((DIVIDER) == LCD_Divider_24) || \
mbed_official 76:aeb1df146756 157 ((DIVIDER) == LCD_Divider_25) || \
mbed_official 76:aeb1df146756 158 ((DIVIDER) == LCD_Divider_26) || \
mbed_official 76:aeb1df146756 159 ((DIVIDER) == LCD_Divider_27) || \
mbed_official 76:aeb1df146756 160 ((DIVIDER) == LCD_Divider_28) || \
mbed_official 76:aeb1df146756 161 ((DIVIDER) == LCD_Divider_29) || \
mbed_official 76:aeb1df146756 162 ((DIVIDER) == LCD_Divider_30) || \
mbed_official 76:aeb1df146756 163 ((DIVIDER) == LCD_Divider_31))
mbed_official 76:aeb1df146756 164
mbed_official 76:aeb1df146756 165 /**
mbed_official 76:aeb1df146756 166 * @}
mbed_official 76:aeb1df146756 167 */
mbed_official 76:aeb1df146756 168
mbed_official 76:aeb1df146756 169
mbed_official 76:aeb1df146756 170 /** @defgroup LCD_Duty
mbed_official 76:aeb1df146756 171 * @{
mbed_official 76:aeb1df146756 172 */
mbed_official 76:aeb1df146756 173
mbed_official 76:aeb1df146756 174 #define LCD_Duty_Static ((uint32_t)0x00000000) /*!< Static duty */
mbed_official 76:aeb1df146756 175 #define LCD_Duty_1_2 ((uint32_t)0x00000004) /*!< 1/2 duty */
mbed_official 76:aeb1df146756 176 #define LCD_Duty_1_3 ((uint32_t)0x00000008) /*!< 1/3 duty */
mbed_official 76:aeb1df146756 177 #define LCD_Duty_1_4 ((uint32_t)0x0000000C) /*!< 1/4 duty */
mbed_official 76:aeb1df146756 178 #define LCD_Duty_1_8 ((uint32_t)0x00000010) /*!< 1/4 duty */
mbed_official 76:aeb1df146756 179
mbed_official 76:aeb1df146756 180 #define IS_LCD_DUTY(DUTY) (((DUTY) == LCD_Duty_Static) || \
mbed_official 76:aeb1df146756 181 ((DUTY) == LCD_Duty_1_2) || \
mbed_official 76:aeb1df146756 182 ((DUTY) == LCD_Duty_1_3) || \
mbed_official 76:aeb1df146756 183 ((DUTY) == LCD_Duty_1_4) || \
mbed_official 76:aeb1df146756 184 ((DUTY) == LCD_Duty_1_8))
mbed_official 76:aeb1df146756 185
mbed_official 76:aeb1df146756 186 /**
mbed_official 76:aeb1df146756 187 * @}
mbed_official 76:aeb1df146756 188 */
mbed_official 76:aeb1df146756 189
mbed_official 76:aeb1df146756 190
mbed_official 76:aeb1df146756 191 /** @defgroup LCD_Bias
mbed_official 76:aeb1df146756 192 * @{
mbed_official 76:aeb1df146756 193 */
mbed_official 76:aeb1df146756 194
mbed_official 76:aeb1df146756 195 #define LCD_Bias_1_4 ((uint32_t)0x00000000) /*!< 1/4 Bias */
mbed_official 76:aeb1df146756 196 #define LCD_Bias_1_2 LCD_CR_BIAS_0 /*!< 1/2 Bias */
mbed_official 76:aeb1df146756 197 #define LCD_Bias_1_3 LCD_CR_BIAS_1 /*!< 1/3 Bias */
mbed_official 76:aeb1df146756 198
mbed_official 76:aeb1df146756 199 #define IS_LCD_BIAS(BIAS) (((BIAS) == LCD_Bias_1_4) || \
mbed_official 76:aeb1df146756 200 ((BIAS) == LCD_Bias_1_2) || \
mbed_official 76:aeb1df146756 201 ((BIAS) == LCD_Bias_1_3))
mbed_official 76:aeb1df146756 202 /**
mbed_official 76:aeb1df146756 203 * @}
mbed_official 76:aeb1df146756 204 */
mbed_official 76:aeb1df146756 205
mbed_official 76:aeb1df146756 206 /** @defgroup LCD_Voltage_Source
mbed_official 76:aeb1df146756 207 * @{
mbed_official 76:aeb1df146756 208 */
mbed_official 76:aeb1df146756 209
mbed_official 76:aeb1df146756 210 #define LCD_VoltageSource_Internal ((uint32_t)0x00000000) /*!< Internal voltage source for the LCD */
mbed_official 76:aeb1df146756 211 #define LCD_VoltageSource_External LCD_CR_VSEL /*!< External voltage source for the LCD */
mbed_official 76:aeb1df146756 212
mbed_official 76:aeb1df146756 213 #define IS_LCD_VOLTAGE_SOURCE(SOURCE) (((SOURCE) == LCD_VoltageSource_Internal) || \
mbed_official 76:aeb1df146756 214 ((SOURCE) == LCD_VoltageSource_External))
mbed_official 76:aeb1df146756 215
mbed_official 76:aeb1df146756 216 /**
mbed_official 76:aeb1df146756 217 * @}
mbed_official 76:aeb1df146756 218 */
mbed_official 76:aeb1df146756 219
mbed_official 76:aeb1df146756 220 /** @defgroup LCD_Interrupts
mbed_official 76:aeb1df146756 221 * @{
mbed_official 76:aeb1df146756 222 */
mbed_official 76:aeb1df146756 223 #define LCD_IT_SOF LCD_FCR_SOFIE
mbed_official 76:aeb1df146756 224 #define LCD_IT_UDD LCD_FCR_UDDIE
mbed_official 76:aeb1df146756 225
mbed_official 76:aeb1df146756 226 #define IS_LCD_IT(IT) ((((IT) & (uint32_t)0xFFFFFFF5) == 0x00) && ((IT) != 0x00))
mbed_official 76:aeb1df146756 227
mbed_official 76:aeb1df146756 228 #define IS_LCD_GET_IT(IT) (((IT) == LCD_IT_SOF) || ((IT) == LCD_IT_UDD))
mbed_official 76:aeb1df146756 229
mbed_official 76:aeb1df146756 230 /**
mbed_official 76:aeb1df146756 231 * @}
mbed_official 76:aeb1df146756 232 */
mbed_official 76:aeb1df146756 233
mbed_official 76:aeb1df146756 234 /** @defgroup LCD_PulseOnDuration
mbed_official 76:aeb1df146756 235 * @{
mbed_official 76:aeb1df146756 236 */
mbed_official 76:aeb1df146756 237
mbed_official 76:aeb1df146756 238 #define LCD_PulseOnDuration_0 ((uint32_t)0x00000000) /*!< Pulse ON duration = 0 pulse */
mbed_official 76:aeb1df146756 239 #define LCD_PulseOnDuration_1 ((uint32_t)0x00000010) /*!< Pulse ON duration = 1/CK_PS */
mbed_official 76:aeb1df146756 240 #define LCD_PulseOnDuration_2 ((uint32_t)0x00000020) /*!< Pulse ON duration = 2/CK_PS */
mbed_official 76:aeb1df146756 241 #define LCD_PulseOnDuration_3 ((uint32_t)0x00000030) /*!< Pulse ON duration = 3/CK_PS */
mbed_official 76:aeb1df146756 242 #define LCD_PulseOnDuration_4 ((uint32_t)0x00000040) /*!< Pulse ON duration = 4/CK_PS */
mbed_official 76:aeb1df146756 243 #define LCD_PulseOnDuration_5 ((uint32_t)0x00000050) /*!< Pulse ON duration = 5/CK_PS */
mbed_official 76:aeb1df146756 244 #define LCD_PulseOnDuration_6 ((uint32_t)0x00000060) /*!< Pulse ON duration = 6/CK_PS */
mbed_official 76:aeb1df146756 245 #define LCD_PulseOnDuration_7 ((uint32_t)0x00000070) /*!< Pulse ON duration = 7/CK_PS */
mbed_official 76:aeb1df146756 246
mbed_official 76:aeb1df146756 247 #define IS_LCD_PULSE_ON_DURATION(DURATION) (((DURATION) == LCD_PulseOnDuration_0) || \
mbed_official 76:aeb1df146756 248 ((DURATION) == LCD_PulseOnDuration_1) || \
mbed_official 76:aeb1df146756 249 ((DURATION) == LCD_PulseOnDuration_2) || \
mbed_official 76:aeb1df146756 250 ((DURATION) == LCD_PulseOnDuration_3) || \
mbed_official 76:aeb1df146756 251 ((DURATION) == LCD_PulseOnDuration_4) || \
mbed_official 76:aeb1df146756 252 ((DURATION) == LCD_PulseOnDuration_5) || \
mbed_official 76:aeb1df146756 253 ((DURATION) == LCD_PulseOnDuration_6) || \
mbed_official 76:aeb1df146756 254 ((DURATION) == LCD_PulseOnDuration_7))
mbed_official 76:aeb1df146756 255 /**
mbed_official 76:aeb1df146756 256 * @}
mbed_official 76:aeb1df146756 257 */
mbed_official 76:aeb1df146756 258
mbed_official 76:aeb1df146756 259
mbed_official 76:aeb1df146756 260 /** @defgroup LCD_DeadTime
mbed_official 76:aeb1df146756 261 * @{
mbed_official 76:aeb1df146756 262 */
mbed_official 76:aeb1df146756 263
mbed_official 76:aeb1df146756 264 #define LCD_DeadTime_0 ((uint32_t)0x00000000) /*!< No dead Time */
mbed_official 76:aeb1df146756 265 #define LCD_DeadTime_1 ((uint32_t)0x00000080) /*!< One Phase between different couple of Frame */
mbed_official 76:aeb1df146756 266 #define LCD_DeadTime_2 ((uint32_t)0x00000100) /*!< Two Phase between different couple of Frame */
mbed_official 76:aeb1df146756 267 #define LCD_DeadTime_3 ((uint32_t)0x00000180) /*!< Three Phase between different couple of Frame */
mbed_official 76:aeb1df146756 268 #define LCD_DeadTime_4 ((uint32_t)0x00000200) /*!< Four Phase between different couple of Frame */
mbed_official 76:aeb1df146756 269 #define LCD_DeadTime_5 ((uint32_t)0x00000280) /*!< Five Phase between different couple of Frame */
mbed_official 76:aeb1df146756 270 #define LCD_DeadTime_6 ((uint32_t)0x00000300) /*!< Six Phase between different couple of Frame */
mbed_official 76:aeb1df146756 271 #define LCD_DeadTime_7 ((uint32_t)0x00000380) /*!< Seven Phase between different couple of Frame */
mbed_official 76:aeb1df146756 272
mbed_official 76:aeb1df146756 273 #define IS_LCD_DEAD_TIME(TIME) (((TIME) == LCD_DeadTime_0) || \
mbed_official 76:aeb1df146756 274 ((TIME) == LCD_DeadTime_1) || \
mbed_official 76:aeb1df146756 275 ((TIME) == LCD_DeadTime_2) || \
mbed_official 76:aeb1df146756 276 ((TIME) == LCD_DeadTime_3) || \
mbed_official 76:aeb1df146756 277 ((TIME) == LCD_DeadTime_4) || \
mbed_official 76:aeb1df146756 278 ((TIME) == LCD_DeadTime_5) || \
mbed_official 76:aeb1df146756 279 ((TIME) == LCD_DeadTime_6) || \
mbed_official 76:aeb1df146756 280 ((TIME) == LCD_DeadTime_7))
mbed_official 76:aeb1df146756 281 /**
mbed_official 76:aeb1df146756 282 * @}
mbed_official 76:aeb1df146756 283 */
mbed_official 76:aeb1df146756 284
mbed_official 76:aeb1df146756 285 /** @defgroup LCD_BlinkMode
mbed_official 76:aeb1df146756 286 * @{
mbed_official 76:aeb1df146756 287 */
mbed_official 76:aeb1df146756 288
mbed_official 76:aeb1df146756 289 #define LCD_BlinkMode_Off ((uint32_t)0x00000000) /*!< Blink disabled */
mbed_official 76:aeb1df146756 290 #define LCD_BlinkMode_SEG0_COM0 ((uint32_t)0x00010000) /*!< Blink enabled on SEG[0], COM[0] (1 pixel) */
mbed_official 76:aeb1df146756 291 #define LCD_BlinkMode_SEG0_AllCOM ((uint32_t)0x00020000) /*!< Blink enabled on SEG[0], all COM (up to
mbed_official 76:aeb1df146756 292 8 pixels according to the programmed duty) */
mbed_official 76:aeb1df146756 293 #define LCD_BlinkMode_AllSEG_AllCOM ((uint32_t)0x00030000) /*!< Blink enabled on all SEG and all COM (all pixels) */
mbed_official 76:aeb1df146756 294
mbed_official 76:aeb1df146756 295 #define IS_LCD_BLINK_MODE(MODE) (((MODE) == LCD_BlinkMode_Off) || \
mbed_official 76:aeb1df146756 296 ((MODE) == LCD_BlinkMode_SEG0_COM0) || \
mbed_official 76:aeb1df146756 297 ((MODE) == LCD_BlinkMode_SEG0_AllCOM) || \
mbed_official 76:aeb1df146756 298 ((MODE) == LCD_BlinkMode_AllSEG_AllCOM))
mbed_official 76:aeb1df146756 299 /**
mbed_official 76:aeb1df146756 300 * @}
mbed_official 76:aeb1df146756 301 */
mbed_official 76:aeb1df146756 302
mbed_official 76:aeb1df146756 303 /** @defgroup LCD_BlinkFrequency
mbed_official 76:aeb1df146756 304 * @{
mbed_official 76:aeb1df146756 305 */
mbed_official 76:aeb1df146756 306
mbed_official 76:aeb1df146756 307 #define LCD_BlinkFrequency_Div8 ((uint32_t)0x00000000) /*!< The Blink frequency = fLCD/8 */
mbed_official 76:aeb1df146756 308 #define LCD_BlinkFrequency_Div16 ((uint32_t)0x00002000) /*!< The Blink frequency = fLCD/16 */
mbed_official 76:aeb1df146756 309 #define LCD_BlinkFrequency_Div32 ((uint32_t)0x00004000) /*!< The Blink frequency = fLCD/32 */
mbed_official 76:aeb1df146756 310 #define LCD_BlinkFrequency_Div64 ((uint32_t)0x00006000) /*!< The Blink frequency = fLCD/64 */
mbed_official 76:aeb1df146756 311 #define LCD_BlinkFrequency_Div128 ((uint32_t)0x00008000) /*!< The Blink frequency = fLCD/128 */
mbed_official 76:aeb1df146756 312 #define LCD_BlinkFrequency_Div256 ((uint32_t)0x0000A000) /*!< The Blink frequency = fLCD/256 */
mbed_official 76:aeb1df146756 313 #define LCD_BlinkFrequency_Div512 ((uint32_t)0x0000C000) /*!< The Blink frequency = fLCD/512 */
mbed_official 76:aeb1df146756 314 #define LCD_BlinkFrequency_Div1024 ((uint32_t)0x0000E000) /*!< The Blink frequency = fLCD/1024 */
mbed_official 76:aeb1df146756 315
mbed_official 76:aeb1df146756 316 #define IS_LCD_BLINK_FREQUENCY(FREQUENCY) (((FREQUENCY) == LCD_BlinkFrequency_Div8) || \
mbed_official 76:aeb1df146756 317 ((FREQUENCY) == LCD_BlinkFrequency_Div16) || \
mbed_official 76:aeb1df146756 318 ((FREQUENCY) == LCD_BlinkFrequency_Div32) || \
mbed_official 76:aeb1df146756 319 ((FREQUENCY) == LCD_BlinkFrequency_Div64) || \
mbed_official 76:aeb1df146756 320 ((FREQUENCY) == LCD_BlinkFrequency_Div128) || \
mbed_official 76:aeb1df146756 321 ((FREQUENCY) == LCD_BlinkFrequency_Div256) || \
mbed_official 76:aeb1df146756 322 ((FREQUENCY) == LCD_BlinkFrequency_Div512) || \
mbed_official 76:aeb1df146756 323 ((FREQUENCY) == LCD_BlinkFrequency_Div1024))
mbed_official 76:aeb1df146756 324 /**
mbed_official 76:aeb1df146756 325 * @}
mbed_official 76:aeb1df146756 326 */
mbed_official 76:aeb1df146756 327
mbed_official 76:aeb1df146756 328 /** @defgroup LCD_Contrast
mbed_official 76:aeb1df146756 329 * @{
mbed_official 76:aeb1df146756 330 */
mbed_official 76:aeb1df146756 331
mbed_official 76:aeb1df146756 332 #define LCD_Contrast_Level_0 ((uint32_t)0x00000000) /*!< Maximum Voltage = 2.60V */
mbed_official 76:aeb1df146756 333 #define LCD_Contrast_Level_1 ((uint32_t)0x00000400) /*!< Maximum Voltage = 2.73V */
mbed_official 76:aeb1df146756 334 #define LCD_Contrast_Level_2 ((uint32_t)0x00000800) /*!< Maximum Voltage = 2.86V */
mbed_official 76:aeb1df146756 335 #define LCD_Contrast_Level_3 ((uint32_t)0x00000C00) /*!< Maximum Voltage = 2.99V */
mbed_official 76:aeb1df146756 336 #define LCD_Contrast_Level_4 ((uint32_t)0x00001000) /*!< Maximum Voltage = 3.12V */
mbed_official 76:aeb1df146756 337 #define LCD_Contrast_Level_5 ((uint32_t)0x00001400) /*!< Maximum Voltage = 3.25V */
mbed_official 76:aeb1df146756 338 #define LCD_Contrast_Level_6 ((uint32_t)0x00001800) /*!< Maximum Voltage = 3.38V */
mbed_official 76:aeb1df146756 339 #define LCD_Contrast_Level_7 ((uint32_t)0x00001C00) /*!< Maximum Voltage = 3.51V */
mbed_official 76:aeb1df146756 340
mbed_official 76:aeb1df146756 341 #define IS_LCD_CONTRAST(CONTRAST) (((CONTRAST) == LCD_Contrast_Level_0) || \
mbed_official 76:aeb1df146756 342 ((CONTRAST) == LCD_Contrast_Level_1) || \
mbed_official 76:aeb1df146756 343 ((CONTRAST) == LCD_Contrast_Level_2) || \
mbed_official 76:aeb1df146756 344 ((CONTRAST) == LCD_Contrast_Level_3) || \
mbed_official 76:aeb1df146756 345 ((CONTRAST) == LCD_Contrast_Level_4) || \
mbed_official 76:aeb1df146756 346 ((CONTRAST) == LCD_Contrast_Level_5) || \
mbed_official 76:aeb1df146756 347 ((CONTRAST) == LCD_Contrast_Level_6) || \
mbed_official 76:aeb1df146756 348 ((CONTRAST) == LCD_Contrast_Level_7))
mbed_official 76:aeb1df146756 349 /**
mbed_official 76:aeb1df146756 350 * @}
mbed_official 76:aeb1df146756 351 */
mbed_official 76:aeb1df146756 352
mbed_official 76:aeb1df146756 353 /** @defgroup LCD_Flag
mbed_official 76:aeb1df146756 354 * @{
mbed_official 76:aeb1df146756 355 */
mbed_official 76:aeb1df146756 356
mbed_official 76:aeb1df146756 357 #define LCD_FLAG_ENS LCD_SR_ENS
mbed_official 76:aeb1df146756 358 #define LCD_FLAG_SOF LCD_SR_SOF
mbed_official 76:aeb1df146756 359 #define LCD_FLAG_UDR LCD_SR_UDR
mbed_official 76:aeb1df146756 360 #define LCD_FLAG_UDD LCD_SR_UDD
mbed_official 76:aeb1df146756 361 #define LCD_FLAG_RDY LCD_SR_RDY
mbed_official 76:aeb1df146756 362 #define LCD_FLAG_FCRSF LCD_SR_FCRSR
mbed_official 76:aeb1df146756 363
mbed_official 76:aeb1df146756 364 #define IS_LCD_GET_FLAG(FLAG) (((FLAG) == LCD_FLAG_ENS) || ((FLAG) == LCD_FLAG_SOF) || \
mbed_official 76:aeb1df146756 365 ((FLAG) == LCD_FLAG_UDR) || ((FLAG) == LCD_FLAG_UDD) || \
mbed_official 76:aeb1df146756 366 ((FLAG) == LCD_FLAG_RDY) || ((FLAG) == LCD_FLAG_FCRSF))
mbed_official 76:aeb1df146756 367
mbed_official 76:aeb1df146756 368 #define IS_LCD_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFF5) == 0x00) && ((FLAG) != 0x00))
mbed_official 76:aeb1df146756 369 /**
mbed_official 76:aeb1df146756 370 * @}
mbed_official 76:aeb1df146756 371 */
mbed_official 76:aeb1df146756 372
mbed_official 76:aeb1df146756 373 /** @defgroup LCD_RAMRegister
mbed_official 76:aeb1df146756 374 * @{
mbed_official 76:aeb1df146756 375 */
mbed_official 76:aeb1df146756 376
mbed_official 76:aeb1df146756 377 #define LCD_RAMRegister_0 ((uint32_t)0x00000000) /*!< LCD RAM Register 0 */
mbed_official 76:aeb1df146756 378 #define LCD_RAMRegister_1 ((uint32_t)0x00000001) /*!< LCD RAM Register 1 */
mbed_official 76:aeb1df146756 379 #define LCD_RAMRegister_2 ((uint32_t)0x00000002) /*!< LCD RAM Register 2 */
mbed_official 76:aeb1df146756 380 #define LCD_RAMRegister_3 ((uint32_t)0x00000003) /*!< LCD RAM Register 3 */
mbed_official 76:aeb1df146756 381 #define LCD_RAMRegister_4 ((uint32_t)0x00000004) /*!< LCD RAM Register 4 */
mbed_official 76:aeb1df146756 382 #define LCD_RAMRegister_5 ((uint32_t)0x00000005) /*!< LCD RAM Register 5 */
mbed_official 76:aeb1df146756 383 #define LCD_RAMRegister_6 ((uint32_t)0x00000006) /*!< LCD RAM Register 6 */
mbed_official 76:aeb1df146756 384 #define LCD_RAMRegister_7 ((uint32_t)0x00000007) /*!< LCD RAM Register 7 */
mbed_official 76:aeb1df146756 385 #define LCD_RAMRegister_8 ((uint32_t)0x00000008) /*!< LCD RAM Register 8 */
mbed_official 76:aeb1df146756 386 #define LCD_RAMRegister_9 ((uint32_t)0x00000009) /*!< LCD RAM Register 9 */
mbed_official 76:aeb1df146756 387 #define LCD_RAMRegister_10 ((uint32_t)0x0000000A) /*!< LCD RAM Register 10 */
mbed_official 76:aeb1df146756 388 #define LCD_RAMRegister_11 ((uint32_t)0x0000000B) /*!< LCD RAM Register 11 */
mbed_official 76:aeb1df146756 389 #define LCD_RAMRegister_12 ((uint32_t)0x0000000C) /*!< LCD RAM Register 12 */
mbed_official 76:aeb1df146756 390 #define LCD_RAMRegister_13 ((uint32_t)0x0000000D) /*!< LCD RAM Register 13 */
mbed_official 76:aeb1df146756 391 #define LCD_RAMRegister_14 ((uint32_t)0x0000000E) /*!< LCD RAM Register 14 */
mbed_official 76:aeb1df146756 392 #define LCD_RAMRegister_15 ((uint32_t)0x0000000F) /*!< LCD RAM Register 15 */
mbed_official 76:aeb1df146756 393
mbed_official 76:aeb1df146756 394 #define IS_LCD_RAM_REGISTER(REGISTER) (((REGISTER) == LCD_RAMRegister_0) || \
mbed_official 76:aeb1df146756 395 ((REGISTER) == LCD_RAMRegister_1) || \
mbed_official 76:aeb1df146756 396 ((REGISTER) == LCD_RAMRegister_2) || \
mbed_official 76:aeb1df146756 397 ((REGISTER) == LCD_RAMRegister_3) || \
mbed_official 76:aeb1df146756 398 ((REGISTER) == LCD_RAMRegister_4) || \
mbed_official 76:aeb1df146756 399 ((REGISTER) == LCD_RAMRegister_5) || \
mbed_official 76:aeb1df146756 400 ((REGISTER) == LCD_RAMRegister_6) || \
mbed_official 76:aeb1df146756 401 ((REGISTER) == LCD_RAMRegister_7) || \
mbed_official 76:aeb1df146756 402 ((REGISTER) == LCD_RAMRegister_8) || \
mbed_official 76:aeb1df146756 403 ((REGISTER) == LCD_RAMRegister_9) || \
mbed_official 76:aeb1df146756 404 ((REGISTER) == LCD_RAMRegister_10) || \
mbed_official 76:aeb1df146756 405 ((REGISTER) == LCD_RAMRegister_11) || \
mbed_official 76:aeb1df146756 406 ((REGISTER) == LCD_RAMRegister_12) || \
mbed_official 76:aeb1df146756 407 ((REGISTER) == LCD_RAMRegister_13) || \
mbed_official 76:aeb1df146756 408 ((REGISTER) == LCD_RAMRegister_14) || \
mbed_official 76:aeb1df146756 409 ((REGISTER) == LCD_RAMRegister_15))
mbed_official 76:aeb1df146756 410
mbed_official 76:aeb1df146756 411 /**
mbed_official 76:aeb1df146756 412 * @}
mbed_official 76:aeb1df146756 413 */
mbed_official 76:aeb1df146756 414
mbed_official 76:aeb1df146756 415 /**
mbed_official 76:aeb1df146756 416 * @}
mbed_official 76:aeb1df146756 417 */
mbed_official 76:aeb1df146756 418
mbed_official 76:aeb1df146756 419 /* Exported macro ------------------------------------------------------------*/
mbed_official 76:aeb1df146756 420 /* Exported functions ------------------------------------------------------- */
mbed_official 76:aeb1df146756 421
mbed_official 76:aeb1df146756 422 /* Function used to set the LCD configuration to the default reset state *****/
mbed_official 76:aeb1df146756 423 void LCD_DeInit(void);
mbed_official 76:aeb1df146756 424
mbed_official 76:aeb1df146756 425 /* Initialization and Configuration functions *********************************/
mbed_official 76:aeb1df146756 426 void LCD_Init(LCD_InitTypeDef* LCD_InitStruct);
mbed_official 76:aeb1df146756 427 void LCD_StructInit(LCD_InitTypeDef* LCD_InitStruct);
mbed_official 76:aeb1df146756 428 void LCD_Cmd(FunctionalState NewState);
mbed_official 76:aeb1df146756 429 void LCD_WaitForSynchro(void);
mbed_official 76:aeb1df146756 430 void LCD_HighDriveCmd(FunctionalState NewState);
mbed_official 76:aeb1df146756 431 void LCD_MuxSegmentCmd(FunctionalState NewState);
mbed_official 76:aeb1df146756 432 void LCD_PulseOnDurationConfig(uint32_t LCD_PulseOnDuration);
mbed_official 76:aeb1df146756 433 void LCD_DeadTimeConfig(uint32_t LCD_DeadTime);
mbed_official 76:aeb1df146756 434 void LCD_BlinkConfig(uint32_t LCD_BlinkMode, uint32_t LCD_BlinkFrequency);
mbed_official 76:aeb1df146756 435 void LCD_ContrastConfig(uint32_t LCD_Contrast);
mbed_official 76:aeb1df146756 436
mbed_official 76:aeb1df146756 437 /* LCD RAM memory write functions *********************************************/
mbed_official 76:aeb1df146756 438 void LCD_Write(uint32_t LCD_RAMRegister, uint32_t LCD_Data);
mbed_official 76:aeb1df146756 439 void LCD_UpdateDisplayRequest(void);
mbed_official 76:aeb1df146756 440
mbed_official 76:aeb1df146756 441 /* Interrupts and flags management functions **********************************/
mbed_official 76:aeb1df146756 442 void LCD_ITConfig(uint32_t LCD_IT, FunctionalState NewState);
mbed_official 76:aeb1df146756 443 FlagStatus LCD_GetFlagStatus(uint32_t LCD_FLAG);
mbed_official 76:aeb1df146756 444 void LCD_ClearFlag(uint32_t LCD_FLAG);
mbed_official 76:aeb1df146756 445 ITStatus LCD_GetITStatus(uint32_t LCD_IT);
mbed_official 76:aeb1df146756 446 void LCD_ClearITPendingBit(uint32_t LCD_IT);
mbed_official 76:aeb1df146756 447
mbed_official 76:aeb1df146756 448 #ifdef __cplusplus
mbed_official 76:aeb1df146756 449 }
mbed_official 76:aeb1df146756 450 #endif
mbed_official 76:aeb1df146756 451
mbed_official 76:aeb1df146756 452 #endif /* __STM32L1xx_LCD_H */
mbed_official 76:aeb1df146756 453
mbed_official 76:aeb1df146756 454 /**
mbed_official 76:aeb1df146756 455 * @}
mbed_official 76:aeb1df146756 456 */
mbed_official 76:aeb1df146756 457
mbed_official 76:aeb1df146756 458 /**
mbed_official 76:aeb1df146756 459 * @}
mbed_official 76:aeb1df146756 460 */
mbed_official 76:aeb1df146756 461
mbed_official 76:aeb1df146756 462 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/