STM32L476G-Discovery BSP User Manual
|
stm32l476g_discovery_glass_lcd.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file stm32l476g_discovery_glass_lcd.h 00004 * @author MCD Application Team 00005 * @version $VERSION$ 00006 * @date $DATE$ 00007 * @brief Header file for stm32l476g_discovery_glass_lcd.c module. 00008 ****************************************************************************** 00009 * @attention 00010 * 00011 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> 00012 * 00013 * Redistribution and use in source and binary forms, with or without modification, 00014 * are permitted provided that the following conditions are met: 00015 * 1. Redistributions of source code must retain the above copyright notice, 00016 * this list of conditions and the following disclaimer. 00017 * 2. Redistributions in binary form must reproduce the above copyright notice, 00018 * this list of conditions and the following disclaimer in the documentation 00019 * and/or other materials provided with the distribution. 00020 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00021 * may be used to endorse or promote products derived from this software 00022 * without specific prior written permission. 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00025 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00026 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00027 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00028 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00029 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00030 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00031 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00032 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00033 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 * 00035 ****************************************************************************** 00036 */ 00037 00038 /* Define to prevent recursive inclusion -------------------------------------*/ 00039 #ifndef __STM32L476G_DISCOVERY_GLASS_LCD_H 00040 #define __STM32L476G_DISCOVERY_GLASS_LCD_H 00041 00042 #ifdef __cplusplus 00043 extern "C" { 00044 #endif 00045 00046 /* Includes ------------------------------------------------------------------*/ 00047 #include "stm32l476g_discovery.h" 00048 00049 /** @addtogroup BSP 00050 * @{ 00051 */ 00052 00053 /** @addtogroup STM32L476G_DISCOVERY 00054 * @{ 00055 */ 00056 00057 /** @addtogroup STM32L476G_DISCOVERY_GLASS_LCD 00058 * @{ 00059 */ 00060 00061 /* Exported types ------------------------------------------------------------*/ 00062 00063 /** @defgroup STM32L476G_DISCOVERY_GLASS_LCD_Exported_Types Exported Types 00064 * @{ 00065 */ 00066 /** 00067 * @brief LCD Glass digit position 00068 */ 00069 typedef enum 00070 { 00071 LCD_DIGIT_POSITION_1 = 0, 00072 LCD_DIGIT_POSITION_2 = 1, 00073 LCD_DIGIT_POSITION_3 = 2, 00074 LCD_DIGIT_POSITION_4 = 3, 00075 LCD_DIGIT_POSITION_5 = 4, 00076 LCD_DIGIT_POSITION_6 = 5, 00077 LCD_DIGIT_MAX_NUMBER = 6, 00078 }DigitPosition_Typedef; 00079 /** 00080 * @brief LCD Glass point 00081 * Warning: element values correspond to LCD Glass point. 00082 */ 00083 00084 typedef enum 00085 { 00086 POINT_OFF = 0, 00087 POINT_ON = 1 00088 }Point_Typedef; 00089 00090 /** 00091 * @brief LCD Glass Double point 00092 * Warning: element values correspond to LCD Glass Double point. 00093 */ 00094 typedef enum 00095 { 00096 DOUBLEPOINT_OFF = 0, 00097 DOUBLEPOINT_ON = 1 00098 }DoublePoint_Typedef; 00099 00100 /** 00101 * @brief LCD Glass Battery Level 00102 * element values correspond to different LCD Glass battery levels 00103 */ 00104 typedef enum 00105 { 00106 BATTERYLEVEL_OFF = 0, 00107 BATTERYLEVEL_1_4 = 1, 00108 BATTERYLEVEL_1_2 = 2, 00109 BATTERYLEVEL_3_4 = 3, 00110 BATTERYLEVEL_FULL = 4 00111 }BatteryLevel_Typedef; 00112 00113 /** 00114 * @brief LCD Glass Bar Id 00115 */ 00116 typedef enum 00117 { 00118 LCD_BAR_NONE = 0, 00119 LCD_BAR_0 = (1 << 0), 00120 LCD_BAR_1 = (1 << 1), 00121 LCD_BAR_2 = (1 << 2), 00122 LCD_BAR_3 = (1 << 3) 00123 }BarId_Typedef; 00124 /** 00125 * @} 00126 */ 00127 00128 /** @defgroup STM32L476G_DISCOVERY_GLASS_LCD_Exported_Constants Exported Constants 00129 * @{ 00130 */ 00131 /** 00132 * @brief LCD digit defintion 00133 */ 00134 #define COM_PER_DIGIT_NB 4/*!< Specifies number of COM to address a digit */ 00135 #define SEG_PER_DIGIT_NB 4/*!< Specifies number of SEG to address a digit */ 00136 00137 #define LCD_MAP_CHAR_COM0_SEG_1ST_POS (1 << LCD_MAP_CHAR_COM0_SEG_1ST_SHIFT) 00138 #define LCD_MAP_CHAR_COM0_SEG_2ND_POS (1 << LCD_MAP_CHAR_COM0_SEG_2ND_SHIFT) 00139 #define LCD_MAP_CHAR_COM0_SEG_3RD_POS (1 << LCD_MAP_CHAR_COM0_SEG_3RD_SHIFT) 00140 #define LCD_MAP_CHAR_COM0_SEG_4TH_POS (1 << LCD_MAP_CHAR_COM0_SEG_4TH_SHIFT) 00141 #define LCD_MAP_CHAR_COM1_SEG_1ST_POS (1 << LCD_MAP_CHAR_COM1_SEG_1ST_SHIFT) 00142 #define LCD_MAP_CHAR_COM1_SEG_2ND_POS (1 << LCD_MAP_CHAR_COM1_SEG_2ND_SHIFT) 00143 #define LCD_MAP_CHAR_COM1_SEG_3RD_POS (1 << LCD_MAP_CHAR_COM1_SEG_3RD_SHIFT) 00144 #define LCD_MAP_CHAR_COM1_SEG_4TH_POS (1 << LCD_MAP_CHAR_COM1_SEG_4TH_SHIFT) 00145 #define LCD_MAP_CHAR_COM2_SEG_1ST_POS (1 << LCD_MAP_CHAR_COM2_SEG_1ST_SHIFT) 00146 #define LCD_MAP_CHAR_COM2_SEG_2ND_POS (1 << LCD_MAP_CHAR_COM2_SEG_2ND_SHIFT) 00147 #define LCD_MAP_CHAR_COM2_SEG_3RD_POS (1 << LCD_MAP_CHAR_COM2_SEG_3RD_SHIFT) 00148 #define LCD_MAP_CHAR_COM2_SEG_4TH_POS (1 << LCD_MAP_CHAR_COM2_SEG_4TH_SHIFT) 00149 #define LCD_MAP_CHAR_COM3_SEG_1ST_POS (1 << LCD_MAP_CHAR_COM3_SEG_1ST_SHIFT) 00150 #define LCD_MAP_CHAR_COM3_SEG_2ND_POS (1 << LCD_MAP_CHAR_COM3_SEG_2ND_SHIFT) 00151 #define LCD_MAP_CHAR_COM3_SEG_3RD_POS (1 << LCD_MAP_CHAR_COM3_SEG_3RD_SHIFT) 00152 #define LCD_MAP_CHAR_COM3_SEG_4TH_POS (1 << LCD_MAP_CHAR_COM3_SEG_4TH_SHIFT) 00153 #define LCD_MAP_CHAR_COM0_SEG_1ST_SHIFT 0x00000000 00154 #define LCD_MAP_CHAR_COM0_SEG_2ND_SHIFT 0x00000001 00155 #define LCD_MAP_CHAR_COM0_SEG_3RD_SHIFT 0x00000002 00156 #define LCD_MAP_CHAR_COM0_SEG_4TH_SHIFT 0x00000003 00157 #define LCD_MAP_CHAR_COM1_SEG_1ST_SHIFT 0x00000004 00158 #define LCD_MAP_CHAR_COM1_SEG_2ND_SHIFT 0x00000005 00159 #define LCD_MAP_CHAR_COM1_SEG_3RD_SHIFT 0x00000006 00160 #define LCD_MAP_CHAR_COM1_SEG_4TH_SHIFT 0x00000007 00161 #define LCD_MAP_CHAR_COM2_SEG_1ST_SHIFT 0x00000008 00162 #define LCD_MAP_CHAR_COM2_SEG_2ND_SHIFT 0x00000009 00163 #define LCD_MAP_CHAR_COM2_SEG_3RD_SHIFT 0x00000010 00164 #define LCD_MAP_CHAR_COM2_SEG_4TH_SHIFT 0x00000011 00165 #define LCD_MAP_CHAR_COM3_SEG_1ST_SHIFT 0x00000012 00166 #define LCD_MAP_CHAR_COM3_SEG_2ND_SHIFT 0x00000013 00167 #define LCD_MAP_CHAR_COM3_SEG_3RD_SHIFT 0x00000014 00168 #define LCD_MAP_CHAR_COM3_SEG_4TH_SHIFT 0x00000015 00169 00170 /** 00171 * @brief LCD Digit defines 00172 */ 00173 #define LCD_DIGIT1_COM0 LCD_COM0 00174 #define LCD_DIGIT1_COM0_SEG_MASK ~(LCD_SEG0 | LCD_SEG1 | LCD_SEG22 | LCD_SEG23) 00175 #define LCD_DIGIT1_COM1 LCD_COM1 00176 #define LCD_DIGIT1_COM1_SEG_MASK ~(LCD_SEG0 | LCD_SEG1 | LCD_SEG22 | LCD_SEG23) 00177 #define LCD_DIGIT1_COM2 LCD_COM2 00178 #define LCD_DIGIT1_COM2_SEG_MASK ~(LCD_SEG0 | LCD_SEG1 | LCD_SEG22 | LCD_SEG23) 00179 #define LCD_DIGIT1_COM3 LCD_COM3 00180 #define LCD_DIGIT1_COM3_SEG_MASK ~(LCD_SEG0 | LCD_SEG1 | LCD_SEG22 | LCD_SEG23) 00181 00182 #define LCD_DIGIT2_COM0 LCD_COM0 00183 #define LCD_DIGIT2_COM0_SEG_MASK ~(LCD_SEG2 | LCD_SEG3 | LCD_SEG20 | LCD_SEG21) 00184 #define LCD_DIGIT2_COM1 LCD_COM1 00185 #define LCD_DIGIT2_COM1_SEG_MASK ~(LCD_SEG2 | LCD_SEG3 | LCD_SEG20 | LCD_SEG21) 00186 #define LCD_DIGIT2_COM2 LCD_COM2 00187 #define LCD_DIGIT2_COM2_SEG_MASK ~(LCD_SEG2 | LCD_SEG3 | LCD_SEG20 | LCD_SEG21) 00188 #define LCD_DIGIT2_COM3 LCD_COM3 00189 #define LCD_DIGIT2_COM3_SEG_MASK ~(LCD_SEG2 | LCD_SEG3 | LCD_SEG20 | LCD_SEG21) 00190 00191 #define LCD_DIGIT3_COM0 LCD_COM0 00192 #define LCD_DIGIT3_COM0_SEG_MASK ~(LCD_SEG4 | LCD_SEG5 | LCD_SEG18 | LCD_SEG19) 00193 #define LCD_DIGIT3_COM1 LCD_COM1 00194 #define LCD_DIGIT3_COM1_SEG_MASK ~(LCD_SEG4 | LCD_SEG5 | LCD_SEG18 | LCD_SEG19) 00195 #define LCD_DIGIT3_COM2 LCD_COM2 00196 #define LCD_DIGIT3_COM2_SEG_MASK ~(LCD_SEG4 | LCD_SEG5 | LCD_SEG18 | LCD_SEG19) 00197 #define LCD_DIGIT3_COM3 LCD_COM3 00198 #define LCD_DIGIT3_COM3_SEG_MASK ~(LCD_SEG4 | LCD_SEG5 | LCD_SEG18 | LCD_SEG19) 00199 00200 #define LCD_DIGIT4_COM0 LCD_COM0 00201 #define LCD_DIGIT4_COM0_SEG_MASK ~(LCD_SEG6 | LCD_SEG17) 00202 #define LCD_DIGIT4_COM0_1 LCD_COM0_1 00203 #define LCD_DIGIT4_COM0_1_SEG_MASK ~(LCD_SEG7 | LCD_SEG16) 00204 #define LCD_DIGIT4_COM1 LCD_COM1 00205 #define LCD_DIGIT4_COM1_SEG_MASK ~(LCD_SEG6 | LCD_SEG17) 00206 #define LCD_DIGIT4_COM1_1 LCD_COM1_1 00207 #define LCD_DIGIT4_COM1_1_SEG_MASK ~(LCD_SEG7 | LCD_SEG16) 00208 #define LCD_DIGIT4_COM2 LCD_COM2 00209 #define LCD_DIGIT4_COM2_SEG_MASK ~(LCD_SEG6 | LCD_SEG17) 00210 #define LCD_DIGIT4_COM2_1 LCD_COM2_1 00211 #define LCD_DIGIT4_COM2_1_SEG_MASK ~(LCD_SEG7 | LCD_SEG16) 00212 #define LCD_DIGIT4_COM3 LCD_COM3 00213 #define LCD_DIGIT4_COM3_SEG_MASK ~(LCD_SEG6 | LCD_SEG17) 00214 #define LCD_DIGIT4_COM3_1 LCD_COM3_1 00215 #define LCD_DIGIT4_COM3_1_SEG_MASK ~(LCD_SEG7 | LCD_SEG16) 00216 00217 #define LCD_DIGIT5_COM0 LCD_COM0 00218 #define LCD_DIGIT5_COM0_SEG_MASK ~(LCD_SEG9 | LCD_SEG14) 00219 #define LCD_DIGIT5_COM0_1 LCD_COM0_1 00220 #define LCD_DIGIT5_COM0_1_SEG_MASK ~(LCD_SEG8 | LCD_SEG15) 00221 #define LCD_DIGIT5_COM1 LCD_COM1 00222 #define LCD_DIGIT5_COM1_SEG_MASK ~(LCD_SEG9 | LCD_SEG14) 00223 #define LCD_DIGIT5_COM1_1 LCD_COM1_1 00224 #define LCD_DIGIT5_COM1_1_SEG_MASK ~(LCD_SEG8 | LCD_SEG15) 00225 #define LCD_DIGIT5_COM2 LCD_COM2 00226 #define LCD_DIGIT5_COM2_SEG_MASK ~(LCD_SEG9 | LCD_SEG14) 00227 #define LCD_DIGIT5_COM2_1 LCD_COM2_1 00228 #define LCD_DIGIT5_COM2_1_SEG_MASK ~(LCD_SEG8 | LCD_SEG15) 00229 #define LCD_DIGIT5_COM3 LCD_COM3 00230 #define LCD_DIGIT5_COM3_SEG_MASK ~(LCD_SEG9 | LCD_SEG14) 00231 #define LCD_DIGIT5_COM3_1 LCD_COM3_1 00232 #define LCD_DIGIT5_COM3_1_SEG_MASK ~(LCD_SEG8 | LCD_SEG15) 00233 00234 #define LCD_DIGIT6_COM0 LCD_COM0 00235 #define LCD_DIGIT6_COM0_SEG_MASK ~(LCD_SEG10 | LCD_SEG11 | LCD_SEG12 | LCD_SEG13) 00236 #define LCD_DIGIT6_COM1 LCD_COM1 00237 #define LCD_DIGIT6_COM1_SEG_MASK ~(LCD_SEG10 | LCD_SEG11 | LCD_SEG12 | LCD_SEG13) 00238 #define LCD_DIGIT6_COM2 LCD_COM2 00239 #define LCD_DIGIT6_COM2_SEG_MASK ~(LCD_SEG10 | LCD_SEG11 | LCD_SEG12 | LCD_SEG13) 00240 #define LCD_DIGIT6_COM3 LCD_COM3 00241 #define LCD_DIGIT6_COM3_SEG_MASK ~(LCD_SEG10 | LCD_SEG11 | LCD_SEG12 | LCD_SEG13) 00242 00243 /** 00244 * @brief LCD Bar location 00245 */ 00246 #define LCD_BAR0_2_COM LCD_COM3 00247 #define LCD_BAR1_3_COM LCD_COM2 00248 #define LCD_BAR0_SEG LCD_SEG11 00249 #define LCD_BAR1_SEG LCD_SEG11 00250 #define LCD_BAR2_SEG LCD_SEG9 00251 #define LCD_BAR3_SEG LCD_SEG9 00252 #define LCD_BAR0_2_SEG_MASK ~(LCD_BAR0_SEG | LCD_BAR2_SEG) 00253 #define LCD_BAR1_3_SEG_MASK ~(LCD_BAR1_SEG | LCD_BAR3_SEG) 00254 00255 /** 00256 * @brief LCD segments & coms redefinition. 00257 * LCD component segments & coms are not necessarily link to MCU segmnents & coms output. 00258 */ 00259 #if defined (USE_STM32L476G_DISCO_REVC) || defined (USE_STM32L476G_DISCO_REVB) 00260 #define LCD_COM0 MCU_LCD_COM0 00261 #define LCD_COM0_1 MCU_LCD_COM0_1 00262 #define LCD_COM1 MCU_LCD_COM1 00263 #define LCD_COM1_1 MCU_LCD_COM1_1 00264 #define LCD_COM2 MCU_LCD_COM2 00265 #define LCD_COM2_1 MCU_LCD_COM2_1 00266 #define LCD_COM3 MCU_LCD_COM3 00267 #define LCD_COM3_1 MCU_LCD_COM3_1 00268 #elif defined (USE_STM32L476G_DISCO_REVA) 00269 #define LCD_COM0 MCU_LCD_COM5 00270 #define LCD_COM0_1 MCU_LCD_COM5_1 00271 #define LCD_COM1 MCU_LCD_COM7 00272 #define LCD_COM1_1 MCU_LCD_COM7_1 00273 #define LCD_COM2 MCU_LCD_COM6 00274 #define LCD_COM2_1 MCU_LCD_COM6_1 00275 #define LCD_COM3 MCU_LCD_COM4 00276 #define LCD_COM3_1 MCU_LCD_COM4_1 00277 #endif 00278 #define LCD_SEG0 MCU_LCD_SEG4 00279 #define LCD_SEG1 MCU_LCD_SEG23 00280 #define LCD_SEG2 MCU_LCD_SEG6 00281 #define LCD_SEG3 MCU_LCD_SEG13 00282 #define LCD_SEG4 MCU_LCD_SEG15 00283 #define LCD_SEG5 MCU_LCD_SEG29 00284 #define LCD_SEG6 MCU_LCD_SEG31 00285 #define LCD_SEG7 MCU_LCD_SEG33 00286 #define LCD_SEG8 MCU_LCD_SEG35 00287 #define LCD_SEG9 MCU_LCD_SEG25 00288 #define LCD_SEG10 MCU_LCD_SEG17 00289 #define LCD_SEG11 MCU_LCD_SEG8 00290 #define LCD_SEG12 MCU_LCD_SEG9 00291 #define LCD_SEG13 MCU_LCD_SEG26 00292 #define LCD_SEG14 MCU_LCD_SEG24 00293 #define LCD_SEG15 MCU_LCD_SEG34 00294 #define LCD_SEG16 MCU_LCD_SEG32 00295 #define LCD_SEG17 MCU_LCD_SEG30 00296 #define LCD_SEG18 MCU_LCD_SEG28 00297 #define LCD_SEG19 MCU_LCD_SEG14 00298 #define LCD_SEG20 MCU_LCD_SEG12 00299 #define LCD_SEG21 MCU_LCD_SEG5 00300 #define LCD_SEG22 MCU_LCD_SEG22 00301 #define LCD_SEG23 MCU_LCD_SEG3 00302 #define LCD_SEG0_SHIFT MCU_LCD_SEG4_SHIFT 00303 #define LCD_SEG1_SHIFT MCU_LCD_SEG23_SHIFT 00304 #define LCD_SEG2_SHIFT MCU_LCD_SEG6_SHIFT 00305 #define LCD_SEG3_SHIFT MCU_LCD_SEG13_SHIFT 00306 #define LCD_SEG4_SHIFT MCU_LCD_SEG15_SHIFT 00307 #define LCD_SEG5_SHIFT MCU_LCD_SEG29_SHIFT 00308 #define LCD_SEG6_SHIFT MCU_LCD_SEG31_SHIFT 00309 #define LCD_SEG7_SHIFT MCU_LCD_SEG33_SHIFT 00310 #define LCD_SEG8_SHIFT MCU_LCD_SEG35_SHIFT 00311 #define LCD_SEG9_SHIFT MCU_LCD_SEG25_SHIFT 00312 #define LCD_SEG10_SHIFT MCU_LCD_SEG17_SHIFT 00313 #define LCD_SEG11_SHIFT MCU_LCD_SEG8_SHIFT 00314 #define LCD_SEG12_SHIFT MCU_LCD_SEG9_SHIFT 00315 #define LCD_SEG13_SHIFT MCU_LCD_SEG26_SHIFT 00316 #define LCD_SEG14_SHIFT MCU_LCD_SEG24_SHIFT 00317 #define LCD_SEG15_SHIFT MCU_LCD_SEG34_SHIFT 00318 #define LCD_SEG16_SHIFT MCU_LCD_SEG32_SHIFT 00319 #define LCD_SEG17_SHIFT MCU_LCD_SEG30_SHIFT 00320 #define LCD_SEG18_SHIFT MCU_LCD_SEG28_SHIFT 00321 #define LCD_SEG19_SHIFT MCU_LCD_SEG14_SHIFT 00322 #define LCD_SEG20_SHIFT MCU_LCD_SEG12_SHIFT 00323 #define LCD_SEG21_SHIFT MCU_LCD_SEG5_SHIFT 00324 #define LCD_SEG22_SHIFT MCU_LCD_SEG22_SHIFT 00325 #define LCD_SEG23_SHIFT MCU_LCD_SEG3_SHIFT 00326 00327 /** 00328 * @brief STM32 LCD segments & coms definitions. 00329 */ 00330 #define MCU_LCD_COM0 LCD_RAM_REGISTER0 00331 #define MCU_LCD_COM0_1 LCD_RAM_REGISTER1 00332 #define MCU_LCD_COM1 LCD_RAM_REGISTER2 00333 #define MCU_LCD_COM1_1 LCD_RAM_REGISTER3 00334 #define MCU_LCD_COM2 LCD_RAM_REGISTER4 00335 #define MCU_LCD_COM2_1 LCD_RAM_REGISTER5 00336 #define MCU_LCD_COM3 LCD_RAM_REGISTER6 00337 #define MCU_LCD_COM3_1 LCD_RAM_REGISTER7 00338 #define MCU_LCD_COM4 LCD_RAM_REGISTER8 00339 #define MCU_LCD_COM4_1 LCD_RAM_REGISTER9 00340 #define MCU_LCD_COM5 LCD_RAM_REGISTER10 00341 #define MCU_LCD_COM5_1 LCD_RAM_REGISTER11 00342 #define MCU_LCD_COM6 LCD_RAM_REGISTER12 00343 #define MCU_LCD_COM6_1 LCD_RAM_REGISTER13 00344 #define MCU_LCD_COM7 LCD_RAM_REGISTER14 00345 #define MCU_LCD_COM7_1 LCD_RAM_REGISTER15 00346 #define MCU_LCD_SEG0 (1U << MCU_LCD_SEG0_SHIFT) 00347 #define MCU_LCD_SEG1 (1U << MCU_LCD_SEG1_SHIFT) 00348 #define MCU_LCD_SEG2 (1U << MCU_LCD_SEG2_SHIFT) 00349 #define MCU_LCD_SEG3 (1U << MCU_LCD_SEG3_SHIFT) 00350 #define MCU_LCD_SEG4 (1U << MCU_LCD_SEG4_SHIFT) 00351 #define MCU_LCD_SEG5 (1U << MCU_LCD_SEG5_SHIFT) 00352 #define MCU_LCD_SEG6 (1U << MCU_LCD_SEG6_SHIFT) 00353 #define MCU_LCD_SEG7 (1U << MCU_LCD_SEG7_SHIFT) 00354 #define MCU_LCD_SEG8 (1U << MCU_LCD_SEG8_SHIFT) 00355 #define MCU_LCD_SEG9 (1U << MCU_LCD_SEG9_SHIFT) 00356 #define MCU_LCD_SEG10 (1U << MCU_LCD_SEG10_SHIFT) 00357 #define MCU_LCD_SEG11 (1U << MCU_LCD_SEG11_SHIFT) 00358 #define MCU_LCD_SEG12 (1U << MCU_LCD_SEG12_SHIFT) 00359 #define MCU_LCD_SEG13 (1U << MCU_LCD_SEG13_SHIFT) 00360 #define MCU_LCD_SEG14 (1U << MCU_LCD_SEG14_SHIFT) 00361 #define MCU_LCD_SEG15 (1U << MCU_LCD_SEG15_SHIFT) 00362 #define MCU_LCD_SEG16 (1U << MCU_LCD_SEG16_SHIFT) 00363 #define MCU_LCD_SEG17 (1U << MCU_LCD_SEG17_SHIFT) 00364 #define MCU_LCD_SEG18 (1U << MCU_LCD_SEG18_SHIFT) 00365 #define MCU_LCD_SEG19 (1U << MCU_LCD_SEG19_SHIFT) 00366 #define MCU_LCD_SEG20 (1U << MCU_LCD_SEG20_SHIFT) 00367 #define MCU_LCD_SEG21 (1U << MCU_LCD_SEG21_SHIFT) 00368 #define MCU_LCD_SEG22 (1U << MCU_LCD_SEG22_SHIFT) 00369 #define MCU_LCD_SEG23 (1U << MCU_LCD_SEG23_SHIFT) 00370 #define MCU_LCD_SEG24 (1U << MCU_LCD_SEG24_SHIFT) 00371 #define MCU_LCD_SEG25 (1U << MCU_LCD_SEG25_SHIFT) 00372 #define MCU_LCD_SEG26 (1U << MCU_LCD_SEG26_SHIFT) 00373 #define MCU_LCD_SEG27 (1U << MCU_LCD_SEG27_SHIFT) 00374 #define MCU_LCD_SEG28 (1U << MCU_LCD_SEG28_SHIFT) 00375 #define MCU_LCD_SEG29 (1U << MCU_LCD_SEG29_SHIFT) 00376 #define MCU_LCD_SEG30 (1U << MCU_LCD_SEG30_SHIFT) 00377 #define MCU_LCD_SEG31 (1U << MCU_LCD_SEG31_SHIFT) 00378 #define MCU_LCD_SEG32 (1U << MCU_LCD_SEG32_SHIFT) 00379 #define MCU_LCD_SEG33 (1U << MCU_LCD_SEG33_SHIFT) 00380 #define MCU_LCD_SEG34 (1U << MCU_LCD_SEG34_SHIFT) 00381 #define MCU_LCD_SEG35 (1U << MCU_LCD_SEG35_SHIFT) 00382 #define MCU_LCD_SEG36 (1U << MCU_LCD_SEG36_SHIFT) 00383 #define MCU_LCD_SEG37 (1U << MCU_LCD_SEG37_SHIFT) 00384 #define MCU_LCD_SEG38 (1U << MCU_LCD_SEG38_SHIFT) 00385 #define MCU_LCD_SEG0_SHIFT 0 00386 #define MCU_LCD_SEG1_SHIFT 1 00387 #define MCU_LCD_SEG2_SHIFT 2 00388 #define MCU_LCD_SEG3_SHIFT 3 00389 #define MCU_LCD_SEG4_SHIFT 4 00390 #define MCU_LCD_SEG5_SHIFT 5 00391 #define MCU_LCD_SEG6_SHIFT 6 00392 #define MCU_LCD_SEG7_SHIFT 7 00393 #define MCU_LCD_SEG8_SHIFT 8 00394 #define MCU_LCD_SEG9_SHIFT 9 00395 #define MCU_LCD_SEG10_SHIFT 10 00396 #define MCU_LCD_SEG11_SHIFT 11 00397 #define MCU_LCD_SEG12_SHIFT 12 00398 #define MCU_LCD_SEG13_SHIFT 13 00399 #define MCU_LCD_SEG14_SHIFT 14 00400 #define MCU_LCD_SEG15_SHIFT 15 00401 #define MCU_LCD_SEG16_SHIFT 16 00402 #define MCU_LCD_SEG17_SHIFT 17 00403 #define MCU_LCD_SEG18_SHIFT 18 00404 #define MCU_LCD_SEG19_SHIFT 19 00405 #define MCU_LCD_SEG20_SHIFT 20 00406 #define MCU_LCD_SEG21_SHIFT 21 00407 #define MCU_LCD_SEG22_SHIFT 22 00408 #define MCU_LCD_SEG23_SHIFT 23 00409 #define MCU_LCD_SEG24_SHIFT 24 00410 #define MCU_LCD_SEG25_SHIFT 25 00411 #define MCU_LCD_SEG26_SHIFT 26 00412 #define MCU_LCD_SEG27_SHIFT 27 00413 #define MCU_LCD_SEG28_SHIFT 28 00414 #define MCU_LCD_SEG29_SHIFT 29 00415 #define MCU_LCD_SEG30_SHIFT 30 00416 #define MCU_LCD_SEG31_SHIFT 31 00417 #define MCU_LCD_SEG32_SHIFT 0 00418 #define MCU_LCD_SEG33_SHIFT 1 00419 #define MCU_LCD_SEG34_SHIFT 2 00420 #define MCU_LCD_SEG35_SHIFT 3 00421 #define MCU_LCD_SEG36_SHIFT 4 00422 #define MCU_LCD_SEG37_SHIFT 5 00423 #define MCU_LCD_SEG38_SHIFT 6 00424 #define MCU_LCD_SEG39_SHIFT 7 00425 #define MCU_LCD_SEG40_SHIFT 8 00426 #define MCU_LCD_SEG41_SHIFT 9 00427 #define MCU_LCD_SEG42_SHIFT 10 00428 #define MCU_LCD_SEG43_SHIFT 11 00429 00430 /** 00431 * @brief LCD Pins definition. 00432 */ 00433 #if defined (USE_STM32L476G_DISCO_REVC) || defined (USE_STM32L476G_DISCO_REVB) 00434 #define LCD_GPIO_BANKA_PINS (GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_8 | \ 00435 GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_15) 00436 #define LCD_GPIO_BANKB_PINS (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_4 | \ 00437 GPIO_PIN_5 | GPIO_PIN_9 | GPIO_PIN_12 | \ 00438 GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15) 00439 #define LCD_GPIO_BANKC_PINS (GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | \ 00440 GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_8) 00441 #define LCD_GPIO_BANKD_PINS (GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | \ 00442 GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | \ 00443 GPIO_PIN_14 | GPIO_PIN_15) 00444 #elif defined (USE_STM32L476G_DISCO_REVA) 00445 #define LCD_GPIO_BANKA_PINS (GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_15) 00446 #define LCD_GPIO_BANKB_PINS (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_4 | \ 00447 GPIO_PIN_5 | GPIO_PIN_12 | GPIO_PIN_13 | \ 00448 GPIO_PIN_14 | GPIO_PIN_15) 00449 #define LCD_GPIO_BANKC_PINS (GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | \ 00450 GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_8 | \ 00451 GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12) 00452 #define LCD_GPIO_BANKD_PINS (GPIO_PIN_2 | GPIO_PIN_8 | GPIO_PIN_9 | \ 00453 GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | \ 00454 GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15) 00455 #endif 00456 00457 /* Define for scrolling sentences*/ 00458 #define SCROLL_SPEED_HIGH 150 00459 #define SCROLL_SPEED_MEDIUM 300 00460 #define SCROLL_SPEED_LOW 450 00461 00462 #define DOT ((uint16_t) 0x8000 ) /* for add decimal point in string */ 00463 #define DOUBLE_DOT ((uint16_t) 0x4000) /* for add decimal point in string */ 00464 00465 /* code for '(' character */ 00466 #define C_OPENPARMAP ((uint16_t) 0x0028) 00467 00468 /* code for ')' character */ 00469 #define C_CLOSEPARMAP ((uint16_t) 0x0011) 00470 00471 /* code for 'd' character */ 00472 #define C_DMAP ((uint16_t) 0xf300) 00473 00474 /* code for 'm' character */ 00475 #define C_MMAP ((uint16_t) 0xb210) 00476 00477 /* code for 'n' character */ 00478 #define C_NMAP ((uint16_t) 0x2210) 00479 00480 /* code for '�' character */ 00481 #define C_UMAP ((uint16_t) 0x6084) 00482 00483 /* constant code for '*' character */ 00484 #define C_STAR ((uint16_t) 0xA0DD) 00485 00486 /* constant code for '-' character */ 00487 #define C_MINUS ((uint16_t) 0xA000) 00488 00489 /* constant code for '+' character */ 00490 #define C_PLUS ((uint16_t) 0xA014) 00491 00492 /* constant code for '/' */ 00493 #define C_SLATCH ((uint16_t) 0x00c0) 00494 00495 /* constant code for � */ 00496 #define C_PERCENT_1 ((uint16_t) 0xec00) 00497 00498 /* constant code for small o */ 00499 #define C_PERCENT_2 ((uint16_t) 0xb300) 00500 00501 #define C_FULL ((uint16_t) 0xffdd) 00502 00503 /** 00504 * @} 00505 */ 00506 00507 /* Exported functions --------------------------------------------------------*/ 00508 00509 /** @defgroup STM32L476G_DISCOVERY_LCD_Exported_Functions Exported Functions 00510 * @{ 00511 */ 00512 void BSP_LCD_GLASS_Init(void); 00513 void BSP_LCD_GLASS_DeInit(void); 00514 void BSP_LCD_GLASS_BlinkConfig(uint32_t BlinkMode, uint32_t BlinkFrequency); 00515 void BSP_LCD_GLASS_Contrast(uint32_t Contrast); 00516 void BSP_LCD_GLASS_DisplayChar(uint8_t* ch, Point_Typedef Point, DoublePoint_Typedef Column, DigitPosition_Typedef Position); 00517 void BSP_LCD_GLASS_DisplayString(uint8_t* ptr); 00518 void BSP_LCD_GLASS_DisplayStrDeci(uint16_t* ptr); 00519 void BSP_LCD_GLASS_ScrollSentence(uint8_t* ptr, uint16_t nScroll, uint16_t ScrollSpeed); 00520 void BSP_LCD_GLASS_DisplayBar(uint32_t BarId); 00521 void BSP_LCD_GLASS_ClearBar(uint32_t BarId); 00522 void BSP_LCD_GLASS_BarLevelConfig(uint8_t BarLevel); 00523 void BSP_LCD_GLASS_Clear(void); 00524 /** 00525 * @} 00526 */ 00527 00528 /** 00529 * @} 00530 */ 00531 00532 /** 00533 * @} 00534 */ 00535 00536 /** 00537 * @} 00538 */ 00539 00540 #ifdef __cplusplus 00541 } 00542 #endif 00543 00544 #endif /* __STM32L476G_DISCOVERY_GLASS_LCD_H */ 00545 00546 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Tue Jun 23 2015 17:15:45 for STM32L476G-Discovery BSP User Manual by 1.7.6.1