mbed SDK library sources

Fork of mbed-src by mbed official

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Jan 30 12:15:05 2014 +0000
Revision:
80:66393a7b209d
Parent:
76:aeb1df146756
Synchronized with git revision dba523f83fe09b7fce11fc1299dd1216e9776359

Full URL: https://github.com/mbedmicro/mbed/commit/dba523f83fe09b7fce11fc1299dd1216e9776359/

Update of I2C, SPI, SLEEP for NUCLEO_F103RB and L152RE

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