Hal Drivers for L4

Dependents:   BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo

Fork of STM32L4xx_HAL_Driver by Senior Design: Sound Monitor

Committer:
EricLew
Date:
Mon Nov 02 19:37:23 2015 +0000
Revision:
0:80ee8f3b695e
Errors are with definitions of LCD and QSPI functions. I believe all .h and .c files are  uploaded, but there may need to be certain functions called.

Who changed what in which revision?

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