Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
112:6f327212ef96
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 112:6f327212ef96 1 /**
Kojto 112:6f327212ef96 2 ******************************************************************************
Kojto 112:6f327212ef96 3 * @file stm32l1xx_hal_lcd.h
Kojto 112:6f327212ef96 4 * @author MCD Application Team
Kojto 112:6f327212ef96 5 * @version V1.0.0
Kojto 112:6f327212ef96 6 * @date 5-September-2014
Kojto 112:6f327212ef96 7 * @brief Header file of LCD Controller HAL module.
Kojto 112:6f327212ef96 8 ******************************************************************************
Kojto 112:6f327212ef96 9 * @attention
Kojto 112:6f327212ef96 10 *
Kojto 112:6f327212ef96 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 112:6f327212ef96 12 *
Kojto 112:6f327212ef96 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 112:6f327212ef96 14 * are permitted provided that the following conditions are met:
Kojto 112:6f327212ef96 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 112:6f327212ef96 16 * this list of conditions and the following disclaimer.
Kojto 112:6f327212ef96 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 112:6f327212ef96 18 * this list of conditions and the following disclaimer in the documentation
Kojto 112:6f327212ef96 19 * and/or other materials provided with the distribution.
Kojto 112:6f327212ef96 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 112:6f327212ef96 21 * may be used to endorse or promote products derived from this software
Kojto 112:6f327212ef96 22 * without specific prior written permission.
Kojto 112:6f327212ef96 23 *
Kojto 112:6f327212ef96 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 112:6f327212ef96 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 112:6f327212ef96 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 112:6f327212ef96 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 112:6f327212ef96 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 112:6f327212ef96 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 112:6f327212ef96 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 112:6f327212ef96 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 112:6f327212ef96 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 112:6f327212ef96 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 112:6f327212ef96 34 *
Kojto 112:6f327212ef96 35 ******************************************************************************
Kojto 112:6f327212ef96 36 */
Kojto 112:6f327212ef96 37
Kojto 112:6f327212ef96 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 112:6f327212ef96 39 #ifndef __STM32L1xx_HAL_LCD_H
Kojto 112:6f327212ef96 40 #define __STM32L1xx_HAL_LCD_H
Kojto 112:6f327212ef96 41
Kojto 112:6f327212ef96 42 #ifdef __cplusplus
Kojto 112:6f327212ef96 43 extern "C" {
Kojto 112:6f327212ef96 44 #endif
Kojto 112:6f327212ef96 45
Kojto 112:6f327212ef96 46 /** @addtogroup STM32L1xx_HAL_Driver
Kojto 112:6f327212ef96 47 * @{
Kojto 112:6f327212ef96 48 */
Kojto 112:6f327212ef96 49
Kojto 112:6f327212ef96 50 #if defined (STM32L100xB) || defined (STM32L100xBA) || defined (STM32L100xC) ||\
Kojto 112:6f327212ef96 51 defined (STM32L152xB) || defined (STM32L152xBA) || defined (STM32L152xC) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L152xE) ||\
Kojto 112:6f327212ef96 52 defined (STM32L162xC) || defined (STM32L162xCA) || defined (STM32L162xD) || defined (STM32L162xE)
Kojto 112:6f327212ef96 53
Kojto 112:6f327212ef96 54 /* Includes ------------------------------------------------------------------*/
Kojto 112:6f327212ef96 55 #include "stm32l1xx_hal_def.h"
Kojto 112:6f327212ef96 56
Kojto 112:6f327212ef96 57 /** @addtogroup LCD
Kojto 112:6f327212ef96 58 * @{
Kojto 112:6f327212ef96 59 */
Kojto 112:6f327212ef96 60
Kojto 112:6f327212ef96 61 /* Exported types ------------------------------------------------------------*/
Kojto 112:6f327212ef96 62
Kojto 112:6f327212ef96 63 /** @defgroup LCD_Exported_Types LCD Exported Types
Kojto 112:6f327212ef96 64 * @{
Kojto 112:6f327212ef96 65 */
Kojto 112:6f327212ef96 66
Kojto 112:6f327212ef96 67 /**
Kojto 112:6f327212ef96 68 * @brief LCD Init structure definition
Kojto 112:6f327212ef96 69 */
Kojto 112:6f327212ef96 70
Kojto 112:6f327212ef96 71 typedef struct
Kojto 112:6f327212ef96 72 {
Kojto 112:6f327212ef96 73 uint32_t Prescaler; /*!< Configures the LCD Prescaler.
Kojto 112:6f327212ef96 74 This parameter can be one value of @ref LCD_Prescaler */
Kojto 112:6f327212ef96 75 uint32_t Divider; /*!< Configures the LCD Divider.
Kojto 112:6f327212ef96 76 This parameter can be one value of @ref LCD_Divider */
Kojto 112:6f327212ef96 77 uint32_t Duty; /*!< Configures the LCD Duty.
Kojto 112:6f327212ef96 78 This parameter can be one value of @ref LCD_Duty */
Kojto 112:6f327212ef96 79 uint32_t Bias; /*!< Configures the LCD Bias.
Kojto 112:6f327212ef96 80 This parameter can be one value of @ref LCD_Bias */
Kojto 112:6f327212ef96 81 uint32_t VoltageSource; /*!< Selects the LCD Voltage source.
Kojto 112:6f327212ef96 82 This parameter can be one value of @ref LCD_Voltage_Source */
Kojto 112:6f327212ef96 83 uint32_t Contrast; /*!< Configures the LCD Contrast.
Kojto 112:6f327212ef96 84 This parameter can be one value of @ref LCD_Contrast */
Kojto 112:6f327212ef96 85 uint32_t DeadTime; /*!< Configures the LCD Dead Time.
Kojto 112:6f327212ef96 86 This parameter can be one value of @ref LCD_DeadTime */
Kojto 112:6f327212ef96 87 uint32_t PulseOnDuration; /*!< Configures the LCD Pulse On Duration.
Kojto 112:6f327212ef96 88 This parameter can be one value of @ref LCD_PulseOnDuration */
Kojto 112:6f327212ef96 89 uint32_t BlinkMode; /*!< Configures the LCD Blink Mode.
Kojto 112:6f327212ef96 90 This parameter can be one value of @ref LCD_BlinkMode */
Kojto 112:6f327212ef96 91 uint32_t BlinkFrequency; /*!< Configures the LCD Blink frequency.
Kojto 112:6f327212ef96 92 This parameter can be one value of @ref LCD_BlinkFrequency */
Kojto 112:6f327212ef96 93 uint32_t MuxSegment; /*!< Enable or disable mux segment.
Kojto 112:6f327212ef96 94 This parameter can be set to ENABLE or DISABLE. */
Kojto 112:6f327212ef96 95 }LCD_InitTypeDef;
Kojto 112:6f327212ef96 96
Kojto 112:6f327212ef96 97 /**
Kojto 112:6f327212ef96 98 * @brief HAL LCD State structures definition
Kojto 112:6f327212ef96 99 */
Kojto 112:6f327212ef96 100 typedef enum
Kojto 112:6f327212ef96 101 {
Kojto 112:6f327212ef96 102 HAL_LCD_STATE_RESET = 0x00, /*!< Peripheral is not yet Initialized */
Kojto 112:6f327212ef96 103 HAL_LCD_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */
Kojto 112:6f327212ef96 104 HAL_LCD_STATE_BUSY = 0x02, /*!< an internal process is ongoing */
Kojto 112:6f327212ef96 105 HAL_LCD_STATE_TIMEOUT = 0x03, /*!< Timeout state */
Kojto 112:6f327212ef96 106 HAL_LCD_STATE_ERROR = 0x04 /*!< Error */
Kojto 112:6f327212ef96 107 }HAL_LCD_StateTypeDef;
Kojto 112:6f327212ef96 108
Kojto 112:6f327212ef96 109 /**
Kojto 112:6f327212ef96 110 * @brief HAL LCD Error Code structure definition
Kojto 112:6f327212ef96 111 */
Kojto 112:6f327212ef96 112 typedef enum
Kojto 112:6f327212ef96 113 {
Kojto 112:6f327212ef96 114 HAL_LCD_ERROR_NONE = 0x00, /*!< No error */
Kojto 112:6f327212ef96 115 HAL_LCD_ERROR_FCRSF = 0x01, /*!< Synchro flag timeout error */
Kojto 112:6f327212ef96 116 HAL_LCD_ERROR_UDR = 0x02, /*!< Update display request flag timeout error */
Kojto 112:6f327212ef96 117 HAL_LCD_ERROR_UDD = 0x04, /*!< Update display done flag timeout error */
Kojto 112:6f327212ef96 118 HAL_LCD_ERROR_ENS = 0x08, /*!< LCD enabled status flag timeout error */
Kojto 112:6f327212ef96 119 HAL_LCD_ERROR_RDY = 0x10 /*!< LCD Booster ready timeout error */
Kojto 112:6f327212ef96 120 }HAL_LCD_ErrorTypeDef;
Kojto 112:6f327212ef96 121
Kojto 112:6f327212ef96 122 /**
Kojto 112:6f327212ef96 123 * @brief UART handle Structure definition
Kojto 112:6f327212ef96 124 */
Kojto 112:6f327212ef96 125 typedef struct
Kojto 112:6f327212ef96 126 {
Kojto 112:6f327212ef96 127 LCD_TypeDef *Instance; /* LCD registers base address */
Kojto 112:6f327212ef96 128
Kojto 112:6f327212ef96 129 LCD_InitTypeDef Init; /* LCD communication parameters */
Kojto 112:6f327212ef96 130
Kojto 112:6f327212ef96 131 HAL_LockTypeDef Lock; /* Locking object */
Kojto 112:6f327212ef96 132
Kojto 112:6f327212ef96 133 __IO HAL_LCD_StateTypeDef State; /* LCD communication state */
Kojto 112:6f327212ef96 134
Kojto 112:6f327212ef96 135 __IO HAL_LCD_ErrorTypeDef ErrorCode; /* LCD Error code */
Kojto 112:6f327212ef96 136
Kojto 112:6f327212ef96 137 }LCD_HandleTypeDef;
Kojto 112:6f327212ef96 138
Kojto 112:6f327212ef96 139 /**
Kojto 112:6f327212ef96 140 * @}
Kojto 112:6f327212ef96 141 */
Kojto 112:6f327212ef96 142
Kojto 112:6f327212ef96 143 /* Exported constants --------------------------------------------------------*/
Kojto 112:6f327212ef96 144
Kojto 112:6f327212ef96 145 /** @defgroup LCD_Exported_Constants LCD Exported Constants
Kojto 112:6f327212ef96 146 * @{
Kojto 112:6f327212ef96 147 */
Kojto 112:6f327212ef96 148
Kojto 112:6f327212ef96 149 /** @defgroup LCD_Prescaler LCD Prescaler
Kojto 112:6f327212ef96 150 * @{
Kojto 112:6f327212ef96 151 */
Kojto 112:6f327212ef96 152
Kojto 112:6f327212ef96 153 #define LCD_PRESCALER_1 ((uint32_t)0x00000000) /*!< CLKPS = LCDCLK */
Kojto 112:6f327212ef96 154 #define LCD_PRESCALER_2 ((uint32_t)0x00400000) /*!< CLKPS = LCDCLK/2 */
Kojto 112:6f327212ef96 155 #define LCD_PRESCALER_4 ((uint32_t)0x00800000) /*!< CLKPS = LCDCLK/4 */
Kojto 112:6f327212ef96 156 #define LCD_PRESCALER_8 ((uint32_t)0x00C00000) /*!< CLKPS = LCDCLK/8 */
Kojto 112:6f327212ef96 157 #define LCD_PRESCALER_16 ((uint32_t)0x01000000) /*!< CLKPS = LCDCLK/16 */
Kojto 112:6f327212ef96 158 #define LCD_PRESCALER_32 ((uint32_t)0x01400000) /*!< CLKPS = LCDCLK/32 */
Kojto 112:6f327212ef96 159 #define LCD_PRESCALER_64 ((uint32_t)0x01800000) /*!< CLKPS = LCDCLK/64 */
Kojto 112:6f327212ef96 160 #define LCD_PRESCALER_128 ((uint32_t)0x01C00000) /*!< CLKPS = LCDCLK/128 */
Kojto 112:6f327212ef96 161 #define LCD_PRESCALER_256 ((uint32_t)0x02000000) /*!< CLKPS = LCDCLK/256 */
Kojto 112:6f327212ef96 162 #define LCD_PRESCALER_512 ((uint32_t)0x02400000) /*!< CLKPS = LCDCLK/512 */
Kojto 112:6f327212ef96 163 #define LCD_PRESCALER_1024 ((uint32_t)0x02800000) /*!< CLKPS = LCDCLK/1024 */
Kojto 112:6f327212ef96 164 #define LCD_PRESCALER_2048 ((uint32_t)0x02C00000) /*!< CLKPS = LCDCLK/2048 */
Kojto 112:6f327212ef96 165 #define LCD_PRESCALER_4096 ((uint32_t)0x03000000) /*!< CLKPS = LCDCLK/4096 */
Kojto 112:6f327212ef96 166 #define LCD_PRESCALER_8192 ((uint32_t)0x03400000) /*!< CLKPS = LCDCLK/8192 */
Kojto 112:6f327212ef96 167 #define LCD_PRESCALER_16384 ((uint32_t)0x03800000) /*!< CLKPS = LCDCLK/16384 */
Kojto 112:6f327212ef96 168 #define LCD_PRESCALER_32768 ((uint32_t)LCD_FCR_PS) /*!< CLKPS = LCDCLK/32768 */
Kojto 112:6f327212ef96 169
Kojto 112:6f327212ef96 170 #define IS_LCD_PRESCALER(__PRESCALER__) (((__PRESCALER__) == LCD_PRESCALER_1) || \
Kojto 112:6f327212ef96 171 ((__PRESCALER__) == LCD_PRESCALER_2) || \
Kojto 112:6f327212ef96 172 ((__PRESCALER__) == LCD_PRESCALER_4) || \
Kojto 112:6f327212ef96 173 ((__PRESCALER__) == LCD_PRESCALER_8) || \
Kojto 112:6f327212ef96 174 ((__PRESCALER__) == LCD_PRESCALER_16) || \
Kojto 112:6f327212ef96 175 ((__PRESCALER__) == LCD_PRESCALER_32) || \
Kojto 112:6f327212ef96 176 ((__PRESCALER__) == LCD_PRESCALER_64) || \
Kojto 112:6f327212ef96 177 ((__PRESCALER__) == LCD_PRESCALER_128) || \
Kojto 112:6f327212ef96 178 ((__PRESCALER__) == LCD_PRESCALER_256) || \
Kojto 112:6f327212ef96 179 ((__PRESCALER__) == LCD_PRESCALER_512) || \
Kojto 112:6f327212ef96 180 ((__PRESCALER__) == LCD_PRESCALER_1024) || \
Kojto 112:6f327212ef96 181 ((__PRESCALER__) == LCD_PRESCALER_2048) || \
Kojto 112:6f327212ef96 182 ((__PRESCALER__) == LCD_PRESCALER_4096) || \
Kojto 112:6f327212ef96 183 ((__PRESCALER__) == LCD_PRESCALER_8192) || \
Kojto 112:6f327212ef96 184 ((__PRESCALER__) == LCD_PRESCALER_16384) || \
Kojto 112:6f327212ef96 185 ((__PRESCALER__) == LCD_PRESCALER_32768))
Kojto 112:6f327212ef96 186
Kojto 112:6f327212ef96 187 /**
Kojto 112:6f327212ef96 188 * @}
Kojto 112:6f327212ef96 189 */
Kojto 112:6f327212ef96 190
Kojto 112:6f327212ef96 191 /** @defgroup LCD_Divider LCD Divider
Kojto 112:6f327212ef96 192 * @{
Kojto 112:6f327212ef96 193 */
Kojto 112:6f327212ef96 194
Kojto 112:6f327212ef96 195 #define LCD_DIVIDER_16 ((uint32_t)0x00000000) /*!< LCD frequency = CLKPS/16 */
Kojto 112:6f327212ef96 196 #define LCD_DIVIDER_17 ((uint32_t)0x00040000) /*!< LCD frequency = CLKPS/17 */
Kojto 112:6f327212ef96 197 #define LCD_DIVIDER_18 ((uint32_t)0x00080000) /*!< LCD frequency = CLKPS/18 */
Kojto 112:6f327212ef96 198 #define LCD_DIVIDER_19 ((uint32_t)0x000C0000) /*!< LCD frequency = CLKPS/19 */
Kojto 112:6f327212ef96 199 #define LCD_DIVIDER_20 ((uint32_t)0x00100000) /*!< LCD frequency = CLKPS/20 */
Kojto 112:6f327212ef96 200 #define LCD_DIVIDER_21 ((uint32_t)0x00140000) /*!< LCD frequency = CLKPS/21 */
Kojto 112:6f327212ef96 201 #define LCD_DIVIDER_22 ((uint32_t)0x00180000) /*!< LCD frequency = CLKPS/22 */
Kojto 112:6f327212ef96 202 #define LCD_DIVIDER_23 ((uint32_t)0x001C0000) /*!< LCD frequency = CLKPS/23 */
Kojto 112:6f327212ef96 203 #define LCD_DIVIDER_24 ((uint32_t)0x00200000) /*!< LCD frequency = CLKPS/24 */
Kojto 112:6f327212ef96 204 #define LCD_DIVIDER_25 ((uint32_t)0x00240000) /*!< LCD frequency = CLKPS/25 */
Kojto 112:6f327212ef96 205 #define LCD_DIVIDER_26 ((uint32_t)0x00280000) /*!< LCD frequency = CLKPS/26 */
Kojto 112:6f327212ef96 206 #define LCD_DIVIDER_27 ((uint32_t)0x002C0000) /*!< LCD frequency = CLKPS/27 */
Kojto 112:6f327212ef96 207 #define LCD_DIVIDER_28 ((uint32_t)0x00300000) /*!< LCD frequency = CLKPS/28 */
Kojto 112:6f327212ef96 208 #define LCD_DIVIDER_29 ((uint32_t)0x00340000) /*!< LCD frequency = CLKPS/29 */
Kojto 112:6f327212ef96 209 #define LCD_DIVIDER_30 ((uint32_t)0x00380000) /*!< LCD frequency = CLKPS/30 */
Kojto 112:6f327212ef96 210 #define LCD_DIVIDER_31 ((uint32_t)LCD_FCR_DIV) /*!< LCD frequency = CLKPS/31 */
Kojto 112:6f327212ef96 211
Kojto 112:6f327212ef96 212 #define IS_LCD_DIVIDER(__DIVIDER__) (((__DIVIDER__) == LCD_DIVIDER_16) || \
Kojto 112:6f327212ef96 213 ((__DIVIDER__) == LCD_DIVIDER_17) || \
Kojto 112:6f327212ef96 214 ((__DIVIDER__) == LCD_DIVIDER_18) || \
Kojto 112:6f327212ef96 215 ((__DIVIDER__) == LCD_DIVIDER_19) || \
Kojto 112:6f327212ef96 216 ((__DIVIDER__) == LCD_DIVIDER_20) || \
Kojto 112:6f327212ef96 217 ((__DIVIDER__) == LCD_DIVIDER_21) || \
Kojto 112:6f327212ef96 218 ((__DIVIDER__) == LCD_DIVIDER_22) || \
Kojto 112:6f327212ef96 219 ((__DIVIDER__) == LCD_DIVIDER_23) || \
Kojto 112:6f327212ef96 220 ((__DIVIDER__) == LCD_DIVIDER_24) || \
Kojto 112:6f327212ef96 221 ((__DIVIDER__) == LCD_DIVIDER_25) || \
Kojto 112:6f327212ef96 222 ((__DIVIDER__) == LCD_DIVIDER_26) || \
Kojto 112:6f327212ef96 223 ((__DIVIDER__) == LCD_DIVIDER_27) || \
Kojto 112:6f327212ef96 224 ((__DIVIDER__) == LCD_DIVIDER_28) || \
Kojto 112:6f327212ef96 225 ((__DIVIDER__) == LCD_DIVIDER_29) || \
Kojto 112:6f327212ef96 226 ((__DIVIDER__) == LCD_DIVIDER_30) || \
Kojto 112:6f327212ef96 227 ((__DIVIDER__) == LCD_DIVIDER_31))
Kojto 112:6f327212ef96 228
Kojto 112:6f327212ef96 229 /**
Kojto 112:6f327212ef96 230 * @}
Kojto 112:6f327212ef96 231 */
Kojto 112:6f327212ef96 232
Kojto 112:6f327212ef96 233
Kojto 112:6f327212ef96 234 /** @defgroup LCD_Duty LCD Duty
Kojto 112:6f327212ef96 235 * @{
Kojto 112:6f327212ef96 236 */
Kojto 112:6f327212ef96 237
Kojto 112:6f327212ef96 238 #define LCD_DUTY_STATIC ((uint32_t)0x00000000) /*!< Static duty */
Kojto 112:6f327212ef96 239 #define LCD_DUTY_1_2 (LCD_CR_DUTY_0) /*!< 1/2 duty */
Kojto 112:6f327212ef96 240 #define LCD_DUTY_1_3 (LCD_CR_DUTY_1) /*!< 1/3 duty */
Kojto 112:6f327212ef96 241 #define LCD_DUTY_1_4 ((LCD_CR_DUTY_1 | LCD_CR_DUTY_0)) /*!< 1/4 duty */
Kojto 112:6f327212ef96 242 #define LCD_DUTY_1_8 (LCD_CR_DUTY_2) /*!< 1/8 duty */
Kojto 112:6f327212ef96 243
Kojto 112:6f327212ef96 244 #define IS_LCD_DUTY(__DUTY__) (((__DUTY__) == LCD_DUTY_STATIC) || \
Kojto 112:6f327212ef96 245 ((__DUTY__) == LCD_DUTY_1_2) || \
Kojto 112:6f327212ef96 246 ((__DUTY__) == LCD_DUTY_1_3) || \
Kojto 112:6f327212ef96 247 ((__DUTY__) == LCD_DUTY_1_4) || \
Kojto 112:6f327212ef96 248 ((__DUTY__) == LCD_DUTY_1_8))
Kojto 112:6f327212ef96 249
Kojto 112:6f327212ef96 250 /**
Kojto 112:6f327212ef96 251 * @}
Kojto 112:6f327212ef96 252 */
Kojto 112:6f327212ef96 253
Kojto 112:6f327212ef96 254
Kojto 112:6f327212ef96 255 /** @defgroup LCD_Bias LCD Bias
Kojto 112:6f327212ef96 256 * @{
Kojto 112:6f327212ef96 257 */
Kojto 112:6f327212ef96 258
Kojto 112:6f327212ef96 259 #define LCD_BIAS_1_4 ((uint32_t)0x00000000) /*!< 1/4 Bias */
Kojto 112:6f327212ef96 260 #define LCD_BIAS_1_2 LCD_CR_BIAS_0 /*!< 1/2 Bias */
Kojto 112:6f327212ef96 261 #define LCD_BIAS_1_3 LCD_CR_BIAS_1 /*!< 1/3 Bias */
Kojto 112:6f327212ef96 262
Kojto 112:6f327212ef96 263 #define IS_LCD_BIAS(__BIAS__) (((__BIAS__) == LCD_BIAS_1_4) || \
Kojto 112:6f327212ef96 264 ((__BIAS__) == LCD_BIAS_1_2) || \
Kojto 112:6f327212ef96 265 ((__BIAS__) == LCD_BIAS_1_3))
Kojto 112:6f327212ef96 266 /**
Kojto 112:6f327212ef96 267 * @}
Kojto 112:6f327212ef96 268 */
Kojto 112:6f327212ef96 269
Kojto 112:6f327212ef96 270 /** @defgroup LCD_Voltage_Source LCD Voltage Source
Kojto 112:6f327212ef96 271 * @{
Kojto 112:6f327212ef96 272 */
Kojto 112:6f327212ef96 273
Kojto 112:6f327212ef96 274 #define LCD_VOLTAGESOURCE_INTERNAL ((uint32_t)0x00000000) /*!< Internal voltage source for the LCD */
Kojto 112:6f327212ef96 275 #define LCD_VOLTAGESOURCE_EXTERNAL LCD_CR_VSEL /*!< External voltage source for the LCD */
Kojto 112:6f327212ef96 276
Kojto 112:6f327212ef96 277 #define IS_LCD_VOLTAGE_SOURCE(SOURCE) (((SOURCE) == LCD_VOLTAGESOURCE_INTERNAL) || \
Kojto 112:6f327212ef96 278 ((SOURCE) == LCD_VOLTAGESOURCE_EXTERNAL))
Kojto 112:6f327212ef96 279
Kojto 112:6f327212ef96 280 /**
Kojto 112:6f327212ef96 281 * @}
Kojto 112:6f327212ef96 282 */
Kojto 112:6f327212ef96 283
Kojto 112:6f327212ef96 284 /** @defgroup LCD_Interrupts LCD Interrupts
Kojto 112:6f327212ef96 285 * @{
Kojto 112:6f327212ef96 286 */
Kojto 112:6f327212ef96 287 #define LCD_IT_SOF LCD_FCR_SOFIE
Kojto 112:6f327212ef96 288 #define LCD_IT_UDD LCD_FCR_UDDIE
Kojto 112:6f327212ef96 289
Kojto 112:6f327212ef96 290 /**
Kojto 112:6f327212ef96 291 * @}
Kojto 112:6f327212ef96 292 */
Kojto 112:6f327212ef96 293
Kojto 112:6f327212ef96 294 /** @defgroup LCD_PulseOnDuration LCD Pulse On Duration
Kojto 112:6f327212ef96 295 * @{
Kojto 112:6f327212ef96 296 */
Kojto 112:6f327212ef96 297
Kojto 112:6f327212ef96 298 #define LCD_PULSEONDURATION_0 ((uint32_t)0x00000000) /*!< Pulse ON duration = 0 pulse */
Kojto 112:6f327212ef96 299 #define LCD_PULSEONDURATION_1 (LCD_FCR_PON_0) /*!< Pulse ON duration = 1/CK_PS */
Kojto 112:6f327212ef96 300 #define LCD_PULSEONDURATION_2 (LCD_FCR_PON_1) /*!< Pulse ON duration = 2/CK_PS */
Kojto 112:6f327212ef96 301 #define LCD_PULSEONDURATION_3 (LCD_FCR_PON_1 | LCD_FCR_PON_0) /*!< Pulse ON duration = 3/CK_PS */
Kojto 112:6f327212ef96 302 #define LCD_PULSEONDURATION_4 (LCD_FCR_PON_2) /*!< Pulse ON duration = 4/CK_PS */
Kojto 112:6f327212ef96 303 #define LCD_PULSEONDURATION_5 (LCD_FCR_PON_2 | LCD_FCR_PON_0) /*!< Pulse ON duration = 5/CK_PS */
Kojto 112:6f327212ef96 304 #define LCD_PULSEONDURATION_6 (LCD_FCR_PON_2 | LCD_FCR_PON_1) /*!< Pulse ON duration = 6/CK_PS */
Kojto 112:6f327212ef96 305 #define LCD_PULSEONDURATION_7 (LCD_FCR_PON) /*!< Pulse ON duration = 7/CK_PS */
Kojto 112:6f327212ef96 306
Kojto 112:6f327212ef96 307 #define IS_LCD_PULSE_ON_DURATION(__DURATION__) (((__DURATION__) == LCD_PULSEONDURATION_0) || \
Kojto 112:6f327212ef96 308 ((__DURATION__) == LCD_PULSEONDURATION_1) || \
Kojto 112:6f327212ef96 309 ((__DURATION__) == LCD_PULSEONDURATION_2) || \
Kojto 112:6f327212ef96 310 ((__DURATION__) == LCD_PULSEONDURATION_3) || \
Kojto 112:6f327212ef96 311 ((__DURATION__) == LCD_PULSEONDURATION_4) || \
Kojto 112:6f327212ef96 312 ((__DURATION__) == LCD_PULSEONDURATION_5) || \
Kojto 112:6f327212ef96 313 ((__DURATION__) == LCD_PULSEONDURATION_6) || \
Kojto 112:6f327212ef96 314 ((__DURATION__) == LCD_PULSEONDURATION_7))
Kojto 112:6f327212ef96 315 /**
Kojto 112:6f327212ef96 316 * @}
Kojto 112:6f327212ef96 317 */
Kojto 112:6f327212ef96 318
Kojto 112:6f327212ef96 319
Kojto 112:6f327212ef96 320 /** @defgroup LCD_DeadTime LCD Dead Time
Kojto 112:6f327212ef96 321 * @{
Kojto 112:6f327212ef96 322 */
Kojto 112:6f327212ef96 323
Kojto 112:6f327212ef96 324 #define LCD_DEADTIME_0 ((uint32_t)0x00000000) /*!< No dead Time */
Kojto 112:6f327212ef96 325 #define LCD_DEADTIME_1 (LCD_FCR_DEAD_0) /*!< One Phase between different couple of Frame */
Kojto 112:6f327212ef96 326 #define LCD_DEADTIME_2 (LCD_FCR_DEAD_1) /*!< Two Phase between different couple of Frame */
Kojto 112:6f327212ef96 327 #define LCD_DEADTIME_3 (LCD_FCR_DEAD_1 | LCD_FCR_DEAD_0) /*!< Three Phase between different couple of Frame */
Kojto 112:6f327212ef96 328 #define LCD_DEADTIME_4 (LCD_FCR_DEAD_2) /*!< Four Phase between different couple of Frame */
Kojto 112:6f327212ef96 329 #define LCD_DEADTIME_5 (LCD_FCR_DEAD_2 | LCD_FCR_DEAD_0) /*!< Five Phase between different couple of Frame */
Kojto 112:6f327212ef96 330 #define LCD_DEADTIME_6 (LCD_FCR_DEAD_2 | LCD_FCR_DEAD_1) /*!< Six Phase between different couple of Frame */
Kojto 112:6f327212ef96 331 #define LCD_DEADTIME_7 (LCD_FCR_DEAD) /*!< Seven Phase between different couple of Frame */
Kojto 112:6f327212ef96 332
Kojto 112:6f327212ef96 333 #define IS_LCD_DEAD_TIME(__TIME__) (((__TIME__) == LCD_DEADTIME_0) || \
Kojto 112:6f327212ef96 334 ((__TIME__) == LCD_DEADTIME_1) || \
Kojto 112:6f327212ef96 335 ((__TIME__) == LCD_DEADTIME_2) || \
Kojto 112:6f327212ef96 336 ((__TIME__) == LCD_DEADTIME_3) || \
Kojto 112:6f327212ef96 337 ((__TIME__) == LCD_DEADTIME_4) || \
Kojto 112:6f327212ef96 338 ((__TIME__) == LCD_DEADTIME_5) || \
Kojto 112:6f327212ef96 339 ((__TIME__) == LCD_DEADTIME_6) || \
Kojto 112:6f327212ef96 340 ((__TIME__) == LCD_DEADTIME_7))
Kojto 112:6f327212ef96 341 /**
Kojto 112:6f327212ef96 342 * @}
Kojto 112:6f327212ef96 343 */
Kojto 112:6f327212ef96 344
Kojto 112:6f327212ef96 345 /** @defgroup LCD_BlinkMode LCD Blink Mode
Kojto 112:6f327212ef96 346 * @{
Kojto 112:6f327212ef96 347 */
Kojto 112:6f327212ef96 348
Kojto 112:6f327212ef96 349 #define LCD_BLINKMODE_OFF ((uint32_t)0x00000000) /*!< Blink disabled */
Kojto 112:6f327212ef96 350 #define LCD_BLINKMODE_SEG0_COM0 (LCD_FCR_BLINK_0) /*!< Blink enabled on SEG[0], COM[0] (1 pixel) */
Kojto 112:6f327212ef96 351 #define LCD_BLINKMODE_SEG0_ALLCOM (LCD_FCR_BLINK_1) /*!< Blink enabled on SEG[0], all COM (up to
Kojto 112:6f327212ef96 352 8 pixels according to the programmed duty) */
Kojto 112:6f327212ef96 353 #define LCD_BLINKMODE_ALLSEG_ALLCOM (LCD_FCR_BLINK) /*!< Blink enabled on all SEG and all COM (all pixels) */
Kojto 112:6f327212ef96 354
Kojto 112:6f327212ef96 355 #define IS_LCD_BLINK_MODE(__MODE__) (((__MODE__) == LCD_BLINKMODE_OFF) || \
Kojto 112:6f327212ef96 356 ((__MODE__) == LCD_BLINKMODE_SEG0_COM0) || \
Kojto 112:6f327212ef96 357 ((__MODE__) == LCD_BLINKMODE_SEG0_ALLCOM) || \
Kojto 112:6f327212ef96 358 ((__MODE__) == LCD_BLINKMODE_ALLSEG_ALLCOM))
Kojto 112:6f327212ef96 359 /**
Kojto 112:6f327212ef96 360 * @}
Kojto 112:6f327212ef96 361 */
Kojto 112:6f327212ef96 362
Kojto 112:6f327212ef96 363 /** @defgroup LCD_BlinkFrequency LCD Blink Frequency
Kojto 112:6f327212ef96 364 * @{
Kojto 112:6f327212ef96 365 */
Kojto 112:6f327212ef96 366
Kojto 112:6f327212ef96 367 #define LCD_BLINKFREQUENCY_DIV8 ((uint32_t)0x00000000) /*!< The Blink frequency = fLCD/8 */
Kojto 112:6f327212ef96 368 #define LCD_BLINKFREQUENCY_DIV16 (LCD_FCR_BLINKF_0) /*!< The Blink frequency = fLCD/16 */
Kojto 112:6f327212ef96 369 #define LCD_BLINKFREQUENCY_DIV32 (LCD_FCR_BLINKF_1) /*!< The Blink frequency = fLCD/32 */
Kojto 112:6f327212ef96 370 #define LCD_BLINKFREQUENCY_DIV64 (LCD_FCR_BLINKF_1 | LCD_FCR_BLINKF_0) /*!< The Blink frequency = fLCD/64 */
Kojto 112:6f327212ef96 371 #define LCD_BLINKFREQUENCY_DIV128 (LCD_FCR_BLINKF_2) /*!< The Blink frequency = fLCD/128 */
Kojto 112:6f327212ef96 372 #define LCD_BLINKFREQUENCY_DIV256 (LCD_FCR_BLINKF_2 |LCD_FCR_BLINKF_0) /*!< The Blink frequency = fLCD/256 */
Kojto 112:6f327212ef96 373 #define LCD_BLINKFREQUENCY_DIV512 (LCD_FCR_BLINKF_2 |LCD_FCR_BLINKF_1) /*!< The Blink frequency = fLCD/512 */
Kojto 112:6f327212ef96 374 #define LCD_BLINKFREQUENCY_DIV1024 (LCD_FCR_BLINKF) /*!< The Blink frequency = fLCD/1024 */
Kojto 112:6f327212ef96 375
Kojto 112:6f327212ef96 376 #define IS_LCD_BLINK_FREQUENCY(__FREQUENCY__) (((__FREQUENCY__) == LCD_BLINKFREQUENCY_DIV8) || \
Kojto 112:6f327212ef96 377 ((__FREQUENCY__) == LCD_BLINKFREQUENCY_DIV16) || \
Kojto 112:6f327212ef96 378 ((__FREQUENCY__) == LCD_BLINKFREQUENCY_DIV32) || \
Kojto 112:6f327212ef96 379 ((__FREQUENCY__) == LCD_BLINKFREQUENCY_DIV64) || \
Kojto 112:6f327212ef96 380 ((__FREQUENCY__) == LCD_BLINKFREQUENCY_DIV128) || \
Kojto 112:6f327212ef96 381 ((__FREQUENCY__) == LCD_BLINKFREQUENCY_DIV256) || \
Kojto 112:6f327212ef96 382 ((__FREQUENCY__) == LCD_BLINKFREQUENCY_DIV512) || \
Kojto 112:6f327212ef96 383 ((__FREQUENCY__) == LCD_BLINKFREQUENCY_DIV1024))
Kojto 112:6f327212ef96 384 /**
Kojto 112:6f327212ef96 385 * @}
Kojto 112:6f327212ef96 386 */
Kojto 112:6f327212ef96 387
Kojto 112:6f327212ef96 388 /** @defgroup LCD_Contrast LCD Contrast
Kojto 112:6f327212ef96 389 * @{
Kojto 112:6f327212ef96 390 */
Kojto 112:6f327212ef96 391
Kojto 112:6f327212ef96 392 #define LCD_CONTRASTLEVEL_0 ((uint32_t)0x00000000) /*!< Maximum Voltage = 2.60V */
Kojto 112:6f327212ef96 393 #define LCD_CONTRASTLEVEL_1 (LCD_FCR_CC_0) /*!< Maximum Voltage = 2.73V */
Kojto 112:6f327212ef96 394 #define LCD_CONTRASTLEVEL_2 (LCD_FCR_CC_1) /*!< Maximum Voltage = 2.86V */
Kojto 112:6f327212ef96 395 #define LCD_CONTRASTLEVEL_3 (LCD_FCR_CC_1 | LCD_FCR_CC_0) /*!< Maximum Voltage = 2.99V */
Kojto 112:6f327212ef96 396 #define LCD_CONTRASTLEVEL_4 (LCD_FCR_CC_2) /*!< Maximum Voltage = 3.12V */
Kojto 112:6f327212ef96 397 #define LCD_CONTRASTLEVEL_5 (LCD_FCR_CC_2 | LCD_FCR_CC_0) /*!< Maximum Voltage = 3.25V */
Kojto 112:6f327212ef96 398 #define LCD_CONTRASTLEVEL_6 (LCD_FCR_CC_2 | LCD_FCR_CC_1) /*!< Maximum Voltage = 3.38V */
Kojto 112:6f327212ef96 399 #define LCD_CONTRASTLEVEL_7 (LCD_FCR_CC) /*!< Maximum Voltage = 3.51V */
Kojto 112:6f327212ef96 400
Kojto 112:6f327212ef96 401 #define IS_LCD_CONTRAST(__CONTRAST__) (((__CONTRAST__) == LCD_CONTRASTLEVEL_0) || \
Kojto 112:6f327212ef96 402 ((__CONTRAST__) == LCD_CONTRASTLEVEL_1) || \
Kojto 112:6f327212ef96 403 ((__CONTRAST__) == LCD_CONTRASTLEVEL_2) || \
Kojto 112:6f327212ef96 404 ((__CONTRAST__) == LCD_CONTRASTLEVEL_3) || \
Kojto 112:6f327212ef96 405 ((__CONTRAST__) == LCD_CONTRASTLEVEL_4) || \
Kojto 112:6f327212ef96 406 ((__CONTRAST__) == LCD_CONTRASTLEVEL_5) || \
Kojto 112:6f327212ef96 407 ((__CONTRAST__) == LCD_CONTRASTLEVEL_6) || \
Kojto 112:6f327212ef96 408 ((__CONTRAST__) == LCD_CONTRASTLEVEL_7))
Kojto 112:6f327212ef96 409 /**
Kojto 112:6f327212ef96 410 * @}
Kojto 112:6f327212ef96 411 */
Kojto 112:6f327212ef96 412
Kojto 112:6f327212ef96 413 /** @defgroup LCD_MuxSegment LCD Mux Segment
Kojto 112:6f327212ef96 414 * @{
Kojto 112:6f327212ef96 415 */
Kojto 112:6f327212ef96 416
Kojto 112:6f327212ef96 417 #define LCD_MUXSEGMENT_DISABLE ((uint32_t)0x00000000) /*!< SEG pin multiplexing disabled */
Kojto 112:6f327212ef96 418 #define LCD_MUXSEGMENT_ENABLE (LCD_CR_MUX_SEG) /*!< SEG[31:28] are multiplexed with SEG[43:40] */
Kojto 112:6f327212ef96 419
Kojto 112:6f327212ef96 420 #define IS_LCD_MUXSEGMENT(__VALUE__) (((__VALUE__) == LCD_MUXSEGMENT_ENABLE) || \
Kojto 112:6f327212ef96 421 ((__VALUE__) == LCD_MUXSEGMENT_DISABLE))
Kojto 112:6f327212ef96 422 /**
Kojto 112:6f327212ef96 423 * @}
Kojto 112:6f327212ef96 424 */
Kojto 112:6f327212ef96 425
Kojto 112:6f327212ef96 426 /** @defgroup LCD_Flag LCD Flag
Kojto 112:6f327212ef96 427 * @{
Kojto 112:6f327212ef96 428 */
Kojto 112:6f327212ef96 429
Kojto 112:6f327212ef96 430 #define LCD_FLAG_ENS LCD_SR_ENS
Kojto 112:6f327212ef96 431 #define LCD_FLAG_SOF LCD_SR_SOF
Kojto 112:6f327212ef96 432 #define LCD_FLAG_UDR LCD_SR_UDR
Kojto 112:6f327212ef96 433 #define LCD_FLAG_UDD LCD_SR_UDD
Kojto 112:6f327212ef96 434 #define LCD_FLAG_RDY LCD_SR_RDY
Kojto 112:6f327212ef96 435 #define LCD_FLAG_FCRSF LCD_SR_FCRSR
Kojto 112:6f327212ef96 436
Kojto 112:6f327212ef96 437 /**
Kojto 112:6f327212ef96 438 * @}
Kojto 112:6f327212ef96 439 */
Kojto 112:6f327212ef96 440
Kojto 112:6f327212ef96 441 /** @defgroup LCD_RAMRegister LCD RAMRegister
Kojto 112:6f327212ef96 442 * @{
Kojto 112:6f327212ef96 443 */
Kojto 112:6f327212ef96 444
Kojto 112:6f327212ef96 445 #define LCD_RAM_REGISTER0 ((uint32_t)0x00000000) /*!< LCD RAM Register 0 */
Kojto 112:6f327212ef96 446 #define LCD_RAM_REGISTER1 ((uint32_t)0x00000001) /*!< LCD RAM Register 1 */
Kojto 112:6f327212ef96 447 #define LCD_RAM_REGISTER2 ((uint32_t)0x00000002) /*!< LCD RAM Register 2 */
Kojto 112:6f327212ef96 448 #define LCD_RAM_REGISTER3 ((uint32_t)0x00000003) /*!< LCD RAM Register 3 */
Kojto 112:6f327212ef96 449 #define LCD_RAM_REGISTER4 ((uint32_t)0x00000004) /*!< LCD RAM Register 4 */
Kojto 112:6f327212ef96 450 #define LCD_RAM_REGISTER5 ((uint32_t)0x00000005) /*!< LCD RAM Register 5 */
Kojto 112:6f327212ef96 451 #define LCD_RAM_REGISTER6 ((uint32_t)0x00000006) /*!< LCD RAM Register 6 */
Kojto 112:6f327212ef96 452 #define LCD_RAM_REGISTER7 ((uint32_t)0x00000007) /*!< LCD RAM Register 7 */
Kojto 112:6f327212ef96 453 #define LCD_RAM_REGISTER8 ((uint32_t)0x00000008) /*!< LCD RAM Register 8 */
Kojto 112:6f327212ef96 454 #define LCD_RAM_REGISTER9 ((uint32_t)0x00000009) /*!< LCD RAM Register 9 */
Kojto 112:6f327212ef96 455 #define LCD_RAM_REGISTER10 ((uint32_t)0x0000000A) /*!< LCD RAM Register 10 */
Kojto 112:6f327212ef96 456 #define LCD_RAM_REGISTER11 ((uint32_t)0x0000000B) /*!< LCD RAM Register 11 */
Kojto 112:6f327212ef96 457 #define LCD_RAM_REGISTER12 ((uint32_t)0x0000000C) /*!< LCD RAM Register 12 */
Kojto 112:6f327212ef96 458 #define LCD_RAM_REGISTER13 ((uint32_t)0x0000000D) /*!< LCD RAM Register 13 */
Kojto 112:6f327212ef96 459 #define LCD_RAM_REGISTER14 ((uint32_t)0x0000000E) /*!< LCD RAM Register 14 */
Kojto 112:6f327212ef96 460 #define LCD_RAM_REGISTER15 ((uint32_t)0x0000000F) /*!< LCD RAM Register 15 */
Kojto 112:6f327212ef96 461
Kojto 112:6f327212ef96 462 #define IS_LCD_RAM_REGISTER(__REGISTER__) (((__REGISTER__) == LCD_RAM_REGISTER0) || \
Kojto 112:6f327212ef96 463 ((__REGISTER__) == LCD_RAM_REGISTER1) || \
Kojto 112:6f327212ef96 464 ((__REGISTER__) == LCD_RAM_REGISTER2) || \
Kojto 112:6f327212ef96 465 ((__REGISTER__) == LCD_RAM_REGISTER3) || \
Kojto 112:6f327212ef96 466 ((__REGISTER__) == LCD_RAM_REGISTER4) || \
Kojto 112:6f327212ef96 467 ((__REGISTER__) == LCD_RAM_REGISTER5) || \
Kojto 112:6f327212ef96 468 ((__REGISTER__) == LCD_RAM_REGISTER6) || \
Kojto 112:6f327212ef96 469 ((__REGISTER__) == LCD_RAM_REGISTER7) || \
Kojto 112:6f327212ef96 470 ((__REGISTER__) == LCD_RAM_REGISTER8) || \
Kojto 112:6f327212ef96 471 ((__REGISTER__) == LCD_RAM_REGISTER9) || \
Kojto 112:6f327212ef96 472 ((__REGISTER__) == LCD_RAM_REGISTER10) || \
Kojto 112:6f327212ef96 473 ((__REGISTER__) == LCD_RAM_REGISTER11) || \
Kojto 112:6f327212ef96 474 ((__REGISTER__) == LCD_RAM_REGISTER12) || \
Kojto 112:6f327212ef96 475 ((__REGISTER__) == LCD_RAM_REGISTER13) || \
Kojto 112:6f327212ef96 476 ((__REGISTER__) == LCD_RAM_REGISTER14) || \
Kojto 112:6f327212ef96 477 ((__REGISTER__) == LCD_RAM_REGISTER15))
Kojto 112:6f327212ef96 478
Kojto 112:6f327212ef96 479 /**
Kojto 112:6f327212ef96 480 * @}
Kojto 112:6f327212ef96 481 */
Kojto 112:6f327212ef96 482
Kojto 112:6f327212ef96 483 /**
Kojto 112:6f327212ef96 484 * @}
Kojto 112:6f327212ef96 485 */
Kojto 112:6f327212ef96 486
Kojto 112:6f327212ef96 487 /* Exported macro ------------------------------------------------------------*/
Kojto 112:6f327212ef96 488
Kojto 112:6f327212ef96 489 /** @defgroup LCD_Exported_Macros LCD Exported Macros
Kojto 112:6f327212ef96 490 * @{
Kojto 112:6f327212ef96 491 */
Kojto 112:6f327212ef96 492
Kojto 112:6f327212ef96 493 /** @brief Reset LCD handle state
Kojto 112:6f327212ef96 494 * @param __HANDLE__: specifies the LCD Handle.
Kojto 112:6f327212ef96 495 * @retval None
Kojto 112:6f327212ef96 496 */
Kojto 112:6f327212ef96 497 #define __HAL_LCD_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_LCD_STATE_RESET)
Kojto 112:6f327212ef96 498
Kojto 112:6f327212ef96 499 /** @brief macros to enables or disables the LCD
Kojto 112:6f327212ef96 500 * @param __HANDLE__: specifies the LCD Handle.
Kojto 112:6f327212ef96 501 * @retval None
Kojto 112:6f327212ef96 502 */
Kojto 112:6f327212ef96 503 #define __HAL_LCD_ENABLE(__HANDLE__) (SET_BIT((__HANDLE__)->Instance->CR, LCD_CR_LCDEN))
Kojto 112:6f327212ef96 504 #define __HAL_LCD_DISABLE(__HANDLE__) (CLEAR_BIT((__HANDLE__)->Instance->CR, LCD_CR_LCDEN))
Kojto 112:6f327212ef96 505
Kojto 112:6f327212ef96 506 /** @brief Macros to enable or disable the low resistance divider. Displays with high
Kojto 112:6f327212ef96 507 * internal resistance may need a longer drive time to achieve
Kojto 112:6f327212ef96 508 * satisfactory contrast. This function is useful in this case if some
Kojto 112:6f327212ef96 509 * additional power consumption can be tolerated.
Kojto 112:6f327212ef96 510 * @param __HANDLE__: specifies the LCD Handle.
Kojto 112:6f327212ef96 511 * @note When this mode is enabled, the PulseOn Duration (PON) have to be
Kojto 112:6f327212ef96 512 * programmed to 1/CK_PS (LCD_PULSEONDURATION_1).
Kojto 112:6f327212ef96 513 * @retval None
Kojto 112:6f327212ef96 514 */
Kojto 112:6f327212ef96 515 #define __HAL_LCD_HIGHDRIVER_ENABLE(__HANDLE__) \
Kojto 112:6f327212ef96 516 do{ \
Kojto 112:6f327212ef96 517 SET_BIT((__HANDLE__)->Instance->FCR, LCD_FCR_HD); \
Kojto 112:6f327212ef96 518 LCD_WaitForSynchro(__HANDLE__); \
Kojto 112:6f327212ef96 519 }while(0)
Kojto 112:6f327212ef96 520
Kojto 112:6f327212ef96 521 #define __HAL_LCD_HIGHDRIVER_DISABLE(__HANDLE__) \
Kojto 112:6f327212ef96 522 do{ \
Kojto 112:6f327212ef96 523 CLEAR_BIT((__HANDLE__)->Instance->FCR, LCD_FCR_HD); \
Kojto 112:6f327212ef96 524 LCD_WaitForSynchro(__HANDLE__); \
Kojto 112:6f327212ef96 525 }while(0)
Kojto 112:6f327212ef96 526
Kojto 112:6f327212ef96 527 /**
Kojto 112:6f327212ef96 528 * @brief Macro to configure the LCD pulses on duration.
Kojto 112:6f327212ef96 529 * @param __HANDLE__: specifies the LCD Handle.
Kojto 112:6f327212ef96 530 * @param __DURATION__: specifies the LCD pulse on duration in terms of
Kojto 112:6f327212ef96 531 * CK_PS (prescaled LCD clock period) pulses.
Kojto 112:6f327212ef96 532 * This parameter can be one of the following values:
Kojto 112:6f327212ef96 533 * @arg LCD_PULSEONDURATION_0: 0 pulse
Kojto 112:6f327212ef96 534 * @arg LCD_PULSEONDURATION_1: Pulse ON duration = 1/CK_PS
Kojto 112:6f327212ef96 535 * @arg LCD_PULSEONDURATION_2: Pulse ON duration = 2/CK_PS
Kojto 112:6f327212ef96 536 * @arg LCD_PULSEONDURATION_3: Pulse ON duration = 3/CK_PS
Kojto 112:6f327212ef96 537 * @arg LCD_PULSEONDURATION_4: Pulse ON duration = 4/CK_PS
Kojto 112:6f327212ef96 538 * @arg LCD_PULSEONDURATION_5: Pulse ON duration = 5/CK_PS
Kojto 112:6f327212ef96 539 * @arg LCD_PULSEONDURATION_6: Pulse ON duration = 6/CK_PS
Kojto 112:6f327212ef96 540 * @arg LCD_PULSEONDURATION_7: Pulse ON duration = 7/CK_PS
Kojto 112:6f327212ef96 541 * @retval None
Kojto 112:6f327212ef96 542 */
Kojto 112:6f327212ef96 543 #define __HAL_LCD_PULSEONDURATION_CONFIG(__HANDLE__, __DURATION__) \
Kojto 112:6f327212ef96 544 do{ \
Kojto 112:6f327212ef96 545 MODIFY_REG((__HANDLE__)->Instance->FCR, LCD_FCR_PON, (__DURATION__)); \
Kojto 112:6f327212ef96 546 LCD_WaitForSynchro(__HANDLE__); \
Kojto 112:6f327212ef96 547 }while(0)
Kojto 112:6f327212ef96 548
Kojto 112:6f327212ef96 549 /**
Kojto 112:6f327212ef96 550 * @brief Macro to configure the LCD dead time.
Kojto 112:6f327212ef96 551 * @param __HANDLE__: specifies the LCD Handle.
Kojto 112:6f327212ef96 552 * @param __DEADTIME__: specifies the LCD dead time.
Kojto 112:6f327212ef96 553 * This parameter can be one of the following values:
Kojto 112:6f327212ef96 554 * @arg LCD_DEADTIME_0: No dead Time
Kojto 112:6f327212ef96 555 * @arg LCD_DEADTIME_1: One Phase between different couple of Frame
Kojto 112:6f327212ef96 556 * @arg LCD_DEADTIME_2: Two Phase between different couple of Frame
Kojto 112:6f327212ef96 557 * @arg LCD_DEADTIME_3: Three Phase between different couple of Frame
Kojto 112:6f327212ef96 558 * @arg LCD_DEADTIME_4: Four Phase between different couple of Frame
Kojto 112:6f327212ef96 559 * @arg LCD_DEADTIME_5: Five Phase between different couple of Frame
Kojto 112:6f327212ef96 560 * @arg LCD_DEADTIME_6: Six Phase between different couple of Frame
Kojto 112:6f327212ef96 561 * @arg LCD_DEADTIME_7: Seven Phase between different couple of Frame
Kojto 112:6f327212ef96 562 * @retval None
Kojto 112:6f327212ef96 563 */
Kojto 112:6f327212ef96 564 #define __HAL_LCD_DEADTIME_CONFIG(__HANDLE__, __DEADTIME__) \
Kojto 112:6f327212ef96 565 do{ \
Kojto 112:6f327212ef96 566 MODIFY_REG((__HANDLE__)->Instance->FCR, LCD_FCR_DEAD, (__DEADTIME__)); \
Kojto 112:6f327212ef96 567 LCD_WaitForSynchro(__HANDLE__); \
Kojto 112:6f327212ef96 568 }while(0)
Kojto 112:6f327212ef96 569
Kojto 112:6f327212ef96 570 /**
Kojto 112:6f327212ef96 571 * @brief Macro to configure the LCD Contrast.
Kojto 112:6f327212ef96 572 * @param __HANDLE__: specifies the LCD Handle.
Kojto 112:6f327212ef96 573 * @param __CONTRAST__: specifies the LCD Contrast.
Kojto 112:6f327212ef96 574 * This parameter can be one of the following values:
Kojto 112:6f327212ef96 575 * @arg LCD_CONTRASTLEVEL_0: Maximum Voltage = 2.60V
Kojto 112:6f327212ef96 576 * @arg LCD_CONTRASTLEVEL_1: Maximum Voltage = 2.73V
Kojto 112:6f327212ef96 577 * @arg LCD_CONTRASTLEVEL_2: Maximum Voltage = 2.86V
Kojto 112:6f327212ef96 578 * @arg LCD_CONTRASTLEVEL_3: Maximum Voltage = 2.99V
Kojto 112:6f327212ef96 579 * @arg LCD_CONTRASTLEVEL_4: Maximum Voltage = 3.12V
Kojto 112:6f327212ef96 580 * @arg LCD_CONTRASTLEVEL_5: Maximum Voltage = 3.25V
Kojto 112:6f327212ef96 581 * @arg LCD_CONTRASTLEVEL_6: Maximum Voltage = 3.38V
Kojto 112:6f327212ef96 582 * @arg LCD_CONTRASTLEVEL_7: Maximum Voltage = 3.51V
Kojto 112:6f327212ef96 583 * @retval None
Kojto 112:6f327212ef96 584 */
Kojto 112:6f327212ef96 585 #define __HAL_LCD_CONTRAST_CONFIG(__HANDLE__, __CONTRAST__) \
Kojto 112:6f327212ef96 586 do{ \
Kojto 112:6f327212ef96 587 MODIFY_REG((__HANDLE__)->Instance->FCR, LCD_FCR_CC, (__CONTRAST__)); \
Kojto 112:6f327212ef96 588 LCD_WaitForSynchro(__HANDLE__); \
Kojto 112:6f327212ef96 589 } while(0)
Kojto 112:6f327212ef96 590
Kojto 112:6f327212ef96 591 /**
Kojto 112:6f327212ef96 592 * @brief Macro to configure the LCD Blink mode and Blink frequency.
Kojto 112:6f327212ef96 593 * @param __HANDLE__: specifies the LCD Handle.
Kojto 112:6f327212ef96 594 * @param __BLINKMODE__: specifies the LCD blink mode.
Kojto 112:6f327212ef96 595 * This parameter can be one of the following values:
Kojto 112:6f327212ef96 596 * @arg LCD_BLINKMODE_OFF: Blink disabled
Kojto 112:6f327212ef96 597 * @arg LCD_BLINKMODE_SEG0_COM0: Blink enabled on SEG[0], COM[0] (1 pixel)
Kojto 112:6f327212ef96 598 * @arg LCD_BLINKMODE_SEG0_ALLCOM: Blink enabled on SEG[0], all COM (up to 8
Kojto 112:6f327212ef96 599 * pixels according to the programmed duty)
Kojto 112:6f327212ef96 600 * @arg LCD_BLINKMODE_ALLSEG_ALLCOM: Blink enabled on all SEG and all COM
Kojto 112:6f327212ef96 601 * (all pixels)
Kojto 112:6f327212ef96 602 * @param __BLINKFREQUENCY__: specifies the LCD blink frequency.
Kojto 112:6f327212ef96 603 * @arg LCD_BLINKFREQUENCY_DIV8: The Blink frequency = fLcd/8
Kojto 112:6f327212ef96 604 * @arg LCD_BLINKFREQUENCY_DIV16: The Blink frequency = fLcd/16
Kojto 112:6f327212ef96 605 * @arg LCD_BLINKFREQUENCY_DIV32: The Blink frequency = fLcd/32
Kojto 112:6f327212ef96 606 * @arg LCD_BLINKFREQUENCY_DIV64: The Blink frequency = fLcd/64
Kojto 112:6f327212ef96 607 * @arg LCD_BLINKFREQUENCY_DIV128: The Blink frequency = fLcd/128
Kojto 112:6f327212ef96 608 * @arg LCD_BLINKFREQUENCY_DIV256: The Blink frequency = fLcd/256
Kojto 112:6f327212ef96 609 * @arg LCD_BLINKFREQUENCY_DIV512: The Blink frequency = fLcd/512
Kojto 112:6f327212ef96 610 * @arg LCD_BLINKFREQUENCY_DIV1024: The Blink frequency = fLcd/1024
Kojto 112:6f327212ef96 611 * @retval None
Kojto 112:6f327212ef96 612 */
Kojto 112:6f327212ef96 613 #define __HAL_LCD_BLINK_CONFIG(__HANDLE__, __BLINKMODE__, __BLINKFREQUENCY__) \
Kojto 112:6f327212ef96 614 do{ \
Kojto 112:6f327212ef96 615 MODIFY_REG((__HANDLE__)->Instance->FCR, (LCD_FCR_BLINKF | LCD_FCR_BLINK), ((__BLINKMODE__) | (__BLINKFREQUENCY__))); \
Kojto 112:6f327212ef96 616 LCD_WaitForSynchro(__HANDLE__); \
Kojto 112:6f327212ef96 617 }while(0)
Kojto 112:6f327212ef96 618
Kojto 112:6f327212ef96 619 /** @brief Enables or disables the specified LCD interrupt.
Kojto 112:6f327212ef96 620 * @param __HANDLE__: specifies the LCD Handle.
Kojto 112:6f327212ef96 621 * @param __INTERRUPT__: specifies the LCD interrupt source to be enabled or disabled.
Kojto 112:6f327212ef96 622 * This parameter can be one of the following values:
Kojto 112:6f327212ef96 623 * @arg LCD_IT_SOF: Start of Frame Interrupt
Kojto 112:6f327212ef96 624 * @arg LCD_IT_UDD: Update Display Done Interrupt
Kojto 112:6f327212ef96 625 * @retval None
Kojto 112:6f327212ef96 626 */
Kojto 112:6f327212ef96 627 #define __HAL_LCD_ENABLE_IT(__HANDLE__, __INTERRUPT__) \
Kojto 112:6f327212ef96 628 do{ \
Kojto 112:6f327212ef96 629 SET_BIT((__HANDLE__)->Instance->FCR, (__INTERRUPT__)); \
Kojto 112:6f327212ef96 630 LCD_WaitForSynchro(__HANDLE__); \
Kojto 112:6f327212ef96 631 }while(0)
Kojto 112:6f327212ef96 632 #define __HAL_LCD_DISABLE_IT(__HANDLE__, __INTERRUPT__) \
Kojto 112:6f327212ef96 633 do{ \
Kojto 112:6f327212ef96 634 CLEAR_BIT((__HANDLE__)->Instance->FCR, (__INTERRUPT__)); \
Kojto 112:6f327212ef96 635 LCD_WaitForSynchro(__HANDLE__); \
Kojto 112:6f327212ef96 636 }while(0)
Kojto 112:6f327212ef96 637
Kojto 112:6f327212ef96 638 /** @brief Checks whether the specified LCD interrupt is enabled or not.
Kojto 112:6f327212ef96 639 * @param __HANDLE__: specifies the LCD Handle.
Kojto 112:6f327212ef96 640 * @param __IT__: specifies the LCD interrupt source to check.
Kojto 112:6f327212ef96 641 * This parameter can be one of the following values:
Kojto 112:6f327212ef96 642 * @arg LCD_IT_SOF: Start of Frame Interrupt
Kojto 112:6f327212ef96 643 * @arg LCD_IT_UDD: Update Display Done Interrupt.
Kojto 112:6f327212ef96 644 * @note If the device is in STOP mode (PCLK not provided) UDD will not
Kojto 112:6f327212ef96 645 * generate an interrupt even if UDDIE = 1.
Kojto 112:6f327212ef96 646 * If the display is not enabled the UDD interrupt will never occur.
Kojto 112:6f327212ef96 647 * @retval The state of __IT__ (TRUE or FALSE).
Kojto 112:6f327212ef96 648 */
Kojto 112:6f327212ef96 649 #define __HAL_LCD_GET_IT_SOURCE(__HANDLE__, __IT__) (((__HANDLE__)->Instance->FCR) & (__IT__))
Kojto 112:6f327212ef96 650
Kojto 112:6f327212ef96 651 /** @brief Checks whether the specified LCD flag is set or not.
Kojto 112:6f327212ef96 652 * @param __HANDLE__: specifies the LCD Handle.
Kojto 112:6f327212ef96 653 * @param __FLAG__: specifies the flag to check.
Kojto 112:6f327212ef96 654 * This parameter can be one of the following values:
Kojto 112:6f327212ef96 655 * @arg LCD_FLAG_ENS: LCD Enabled flag. It indicates the LCD controller status.
Kojto 112:6f327212ef96 656 * @note The ENS bit is set immediately when the LCDEN bit in the LCD_CR
Kojto 112:6f327212ef96 657 * goes from 0 to 1. On deactivation it reflects the real status of
Kojto 112:6f327212ef96 658 * LCD so it becomes 0 at the end of the last displayed frame.
Kojto 112:6f327212ef96 659 * @arg LCD_FLAG_SOF: Start of Frame flag. This flag is set by hardware at
Kojto 112:6f327212ef96 660 * the beginning of a new frame, at the same time as the display data is
Kojto 112:6f327212ef96 661 * updated.
Kojto 112:6f327212ef96 662 * @arg LCD_FLAG_UDR: Update Display Request flag.
Kojto 112:6f327212ef96 663 * @arg LCD_FLAG_UDD: Update Display Done flag.
Kojto 112:6f327212ef96 664 * @arg LCD_FLAG_RDY: Step_up converter Ready flag. It indicates the status
Kojto 112:6f327212ef96 665 * of the step-up converter.
Kojto 112:6f327212ef96 666 * @arg LCD_FLAG_FCRSF: LCD Frame Control Register Synchronization Flag.
Kojto 112:6f327212ef96 667 * This flag is set by hardware each time the LCD_FCR register is updated
Kojto 112:6f327212ef96 668 * in the LCDCLK domain.
Kojto 112:6f327212ef96 669 * @retval The new state of __FLAG__ (TRUE or FALSE).
Kojto 112:6f327212ef96 670 */
Kojto 112:6f327212ef96 671 #define __HAL_LCD_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__))
Kojto 112:6f327212ef96 672
Kojto 112:6f327212ef96 673 /** @brief Clears the specified LCD pending flag.
Kojto 112:6f327212ef96 674 * @param __HANDLE__: specifies the LCD Handle.
Kojto 112:6f327212ef96 675 * @param __FLAG__: specifies the flag to clear.
Kojto 112:6f327212ef96 676 * This parameter can be any combination of the following values:
Kojto 112:6f327212ef96 677 * @arg LCD_FLAG_SOF: Start of Frame Interrupt
Kojto 112:6f327212ef96 678 * @arg LCD_FLAG_UDD: Update Display Done Interrupt
Kojto 112:6f327212ef96 679 * @retval None
Kojto 112:6f327212ef96 680 */
Kojto 112:6f327212ef96 681 #define __HAL_LCD_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CLR = (__FLAG__))
Kojto 112:6f327212ef96 682
Kojto 112:6f327212ef96 683 /**
Kojto 112:6f327212ef96 684 * @}
Kojto 112:6f327212ef96 685 */
Kojto 112:6f327212ef96 686
Kojto 112:6f327212ef96 687 /* Exported functions ------------------------------------------------------- */
Kojto 112:6f327212ef96 688
Kojto 112:6f327212ef96 689 /** @addtogroup LCD_Exported_Functions
Kojto 112:6f327212ef96 690 * @{
Kojto 112:6f327212ef96 691 */
Kojto 112:6f327212ef96 692
Kojto 112:6f327212ef96 693 /** @addtogroup LCD_Exported_Functions_Group1
Kojto 112:6f327212ef96 694 * @{
Kojto 112:6f327212ef96 695 */
Kojto 112:6f327212ef96 696
Kojto 112:6f327212ef96 697 /* Initialization/de-initialization methods **********************************/
Kojto 112:6f327212ef96 698 HAL_StatusTypeDef HAL_LCD_DeInit(LCD_HandleTypeDef *hlcd);
Kojto 112:6f327212ef96 699 HAL_StatusTypeDef HAL_LCD_Init(LCD_HandleTypeDef *hlcd);
Kojto 112:6f327212ef96 700 void HAL_LCD_MspInit(LCD_HandleTypeDef *hlcd);
Kojto 112:6f327212ef96 701 void HAL_LCD_MspDeInit(LCD_HandleTypeDef *hlcd);
Kojto 112:6f327212ef96 702
Kojto 112:6f327212ef96 703 /**
Kojto 112:6f327212ef96 704 * @}
Kojto 112:6f327212ef96 705 */
Kojto 112:6f327212ef96 706
Kojto 112:6f327212ef96 707 /** @addtogroup LCD_Exported_Functions_Group2
Kojto 112:6f327212ef96 708 * @{
Kojto 112:6f327212ef96 709 */
Kojto 112:6f327212ef96 710
Kojto 112:6f327212ef96 711 /* IO operation methods *******************************************************/
Kojto 112:6f327212ef96 712 HAL_StatusTypeDef HAL_LCD_Write(LCD_HandleTypeDef *hlcd, uint32_t RAMRegisterIndex, uint32_t RAMRegisterMask, uint32_t Data);
Kojto 112:6f327212ef96 713 HAL_StatusTypeDef HAL_LCD_Clear(LCD_HandleTypeDef *hlcd);
Kojto 112:6f327212ef96 714 HAL_StatusTypeDef HAL_LCD_UpdateDisplayRequest(LCD_HandleTypeDef *hlcd);
Kojto 112:6f327212ef96 715
Kojto 112:6f327212ef96 716 /**
Kojto 112:6f327212ef96 717 * @}
Kojto 112:6f327212ef96 718 */
Kojto 112:6f327212ef96 719
Kojto 112:6f327212ef96 720 /** @addtogroup LCD_Exported_Functions_Group3
Kojto 112:6f327212ef96 721 * @{
Kojto 112:6f327212ef96 722 */
Kojto 112:6f327212ef96 723
Kojto 112:6f327212ef96 724 /* Peripheral State methods **************************************************/
Kojto 112:6f327212ef96 725 HAL_LCD_StateTypeDef HAL_LCD_GetState(LCD_HandleTypeDef *hlcd);
Kojto 112:6f327212ef96 726 uint32_t HAL_LCD_GetError(LCD_HandleTypeDef *hlcd);
Kojto 112:6f327212ef96 727
Kojto 112:6f327212ef96 728 /**
Kojto 112:6f327212ef96 729 * @}
Kojto 112:6f327212ef96 730 */
Kojto 112:6f327212ef96 731
Kojto 112:6f327212ef96 732 /**
Kojto 112:6f327212ef96 733 * @}
Kojto 112:6f327212ef96 734 */
Kojto 112:6f327212ef96 735
Kojto 112:6f327212ef96 736 /** @addtogroup LCD_Private_Functions
Kojto 112:6f327212ef96 737 * @{
Kojto 112:6f327212ef96 738 */
Kojto 112:6f327212ef96 739
Kojto 112:6f327212ef96 740 /* Private functions ---------------------------------------------------------*/
Kojto 112:6f327212ef96 741 HAL_StatusTypeDef LCD_WaitForSynchro(LCD_HandleTypeDef *hlcd);
Kojto 112:6f327212ef96 742
Kojto 112:6f327212ef96 743 /**
Kojto 112:6f327212ef96 744 * @}
Kojto 112:6f327212ef96 745 */
Kojto 112:6f327212ef96 746
Kojto 112:6f327212ef96 747 /**
Kojto 112:6f327212ef96 748 * @}
Kojto 112:6f327212ef96 749 */
Kojto 112:6f327212ef96 750
Kojto 112:6f327212ef96 751 #endif /* STM32L100xB || STM32L100xBA || STM32L100xC ||... || STM32L162xD || STM32L162xE */
Kojto 112:6f327212ef96 752
Kojto 112:6f327212ef96 753 /**
Kojto 112:6f327212ef96 754 * @}
Kojto 112:6f327212ef96 755 */
Kojto 112:6f327212ef96 756
Kojto 112:6f327212ef96 757 #ifdef __cplusplus
Kojto 112:6f327212ef96 758 }
Kojto 112:6f327212ef96 759 #endif
Kojto 112:6f327212ef96 760
Kojto 112:6f327212ef96 761 #endif /* __STM32L1xx_HAL_LCD_H */
Kojto 112:6f327212ef96 762
Kojto 112:6f327212ef96 763 /******************* (C) COPYRIGHT 2014 STMicroelectronics *****END OF FILE****/