stm3210e_eval_lcd.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm3210e_eval_lcd.h
00004   * @author  MCD Application Team
00005   * @version V4.3.0
00006   * @date    10/15/2010
00007   * @brief   This file contains all the functions prototypes for the stm3210e_eval_lcd
00008   *          firmware driver.
00009   ******************************************************************************
00010   * @copy
00011   *
00012   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00013   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00014   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00015   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00016   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00017   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00018   *
00019   * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
00020   */ 
00021 
00022 /* Define to prevent recursive inclusion -------------------------------------*/
00023 #ifndef __STM3210E_EVAL_LCD_H
00024 #define __STM3210E_EVAL_LCD_H
00025 
00026 #ifdef __cplusplus
00027  extern "C" {
00028 #endif 
00029 
00030 /* Includes ------------------------------------------------------------------*/
00031 #include "stm32f10x.h"
00032 #include "../Common/fonts.h"
00033 
00034 /** @addtogroup Utilities
00035   * @{
00036   */
00037 
00038 /** @addtogroup STM32_EVAL
00039   * @{
00040   */ 
00041 
00042 /** @addtogroup STM3210E_EVAL
00043   * @{
00044   */
00045     
00046 /** @addtogroup STM3210E_EVAL_LCD
00047   * @{
00048   */ 
00049 
00050 /** @defgroup STM3210E_EVAL_LCD_Exported_Types
00051   * @{
00052   */
00053 typedef struct 
00054 {
00055   int16_t X;
00056   int16_t Y;
00057 } Point, * pPoint;   
00058 /**
00059   * @}
00060   */ 
00061 
00062 /** @defgroup STM3210E_EVAL_LCD_Exported_Constants
00063   * @{
00064   */ 
00065 
00066 /**
00067  * @brief Uncomment the line below if you want to use user defined Delay function
00068  *        (for precise timing), otherwise default _delay_ function defined within
00069  *         this driver is used (less precise timing).  
00070  */
00071 /* #define USE_Delay */
00072 
00073 #ifdef USE_Delay
00074 #include "main.h" 
00075   #define _delay_     Delay  /* !< User can provide more timing precise _delay_ function
00076                                    (with 10ms time base), using SysTick for example */
00077 #else
00078   #define _delay_     delay      /* !< Default _delay_ function with less precise timing */
00079 #endif
00080  
00081 /** 
00082   * @brief  LCD Registers  
00083   */ 
00084 #define LCD_REG_0             0x00
00085 #define LCD_REG_1             0x01
00086 #define LCD_REG_2             0x02
00087 #define LCD_REG_3             0x03
00088 #define LCD_REG_4             0x04
00089 #define LCD_REG_5             0x05
00090 #define LCD_REG_6             0x06
00091 #define LCD_REG_7             0x07
00092 #define LCD_REG_8             0x08
00093 #define LCD_REG_9             0x09
00094 #define LCD_REG_10            0x0A
00095 #define LCD_REG_12            0x0C
00096 #define LCD_REG_13            0x0D
00097 #define LCD_REG_14            0x0E
00098 #define LCD_REG_15            0x0F
00099 #define LCD_REG_16            0x10
00100 #define LCD_REG_17            0x11
00101 #define LCD_REG_18            0x12
00102 #define LCD_REG_19            0x13
00103 #define LCD_REG_20            0x14
00104 #define LCD_REG_21            0x15
00105 #define LCD_REG_22            0x16
00106 #define LCD_REG_23            0x17
00107 #define LCD_REG_24            0x18
00108 #define LCD_REG_25            0x19
00109 #define LCD_REG_26            0x1A
00110 #define LCD_REG_27            0x1B
00111 #define LCD_REG_28            0x1C
00112 #define LCD_REG_29            0x1D
00113 #define LCD_REG_30            0x1E
00114 #define LCD_REG_31            0x1F
00115 #define LCD_REG_32            0x20
00116 #define LCD_REG_33            0x21
00117 #define LCD_REG_34            0x22
00118 #define LCD_REG_36            0x24
00119 #define LCD_REG_37            0x25
00120 #define LCD_REG_40            0x28
00121 #define LCD_REG_41            0x29
00122 #define LCD_REG_43            0x2B
00123 #define LCD_REG_45            0x2D
00124 #define LCD_REG_48            0x30
00125 #define LCD_REG_49            0x31
00126 #define LCD_REG_50            0x32
00127 #define LCD_REG_51            0x33
00128 #define LCD_REG_52            0x34
00129 #define LCD_REG_53            0x35
00130 #define LCD_REG_54            0x36
00131 #define LCD_REG_55            0x37
00132 #define LCD_REG_56            0x38
00133 #define LCD_REG_57            0x39
00134 #define LCD_REG_58            0x3A
00135 #define LCD_REG_59            0x3B
00136 #define LCD_REG_60            0x3C
00137 #define LCD_REG_61            0x3D
00138 #define LCD_REG_62            0x3E
00139 #define LCD_REG_63            0x3F
00140 #define LCD_REG_64            0x40
00141 #define LCD_REG_65            0x41
00142 #define LCD_REG_66            0x42
00143 #define LCD_REG_67            0x43
00144 #define LCD_REG_68            0x44
00145 #define LCD_REG_69            0x45
00146 #define LCD_REG_70            0x46
00147 #define LCD_REG_71            0x47
00148 #define LCD_REG_72            0x48
00149 #define LCD_REG_73            0x49
00150 #define LCD_REG_74            0x4A
00151 #define LCD_REG_75            0x4B
00152 #define LCD_REG_76            0x4C
00153 #define LCD_REG_77            0x4D
00154 #define LCD_REG_78            0x4E
00155 #define LCD_REG_79            0x4F
00156 #define LCD_REG_80            0x50
00157 #define LCD_REG_81            0x51
00158 #define LCD_REG_82            0x52
00159 #define LCD_REG_83            0x53
00160 #define LCD_REG_96            0x60
00161 #define LCD_REG_97            0x61
00162 #define LCD_REG_106           0x6A
00163 #define LCD_REG_118           0x76
00164 #define LCD_REG_128           0x80
00165 #define LCD_REG_129           0x81
00166 #define LCD_REG_130           0x82
00167 #define LCD_REG_131           0x83
00168 #define LCD_REG_132           0x84
00169 #define LCD_REG_133           0x85
00170 #define LCD_REG_134           0x86
00171 #define LCD_REG_135           0x87
00172 #define LCD_REG_136           0x88
00173 #define LCD_REG_137           0x89
00174 #define LCD_REG_139           0x8B
00175 #define LCD_REG_140           0x8C
00176 #define LCD_REG_141           0x8D
00177 #define LCD_REG_143           0x8F
00178 #define LCD_REG_144           0x90
00179 #define LCD_REG_145           0x91
00180 #define LCD_REG_146           0x92
00181 #define LCD_REG_147           0x93
00182 #define LCD_REG_148           0x94
00183 #define LCD_REG_149           0x95
00184 #define LCD_REG_150           0x96
00185 #define LCD_REG_151           0x97
00186 #define LCD_REG_152           0x98
00187 #define LCD_REG_153           0x99
00188 #define LCD_REG_154           0x9A
00189 #define LCD_REG_157           0x9D
00190 #define LCD_REG_192           0xC0
00191 #define LCD_REG_193           0xC1
00192 #define LCD_REG_229           0xE5
00193 
00194 /** 
00195   * @brief  LCD color  
00196   */ 
00197 #define LCD_COLOR_WHITE          0xFFFF
00198 #define LCD_COLOR_BLACK          0x0000
00199 #define LCD_COLOR_GREY           0xF7DE
00200 #define LCD_COLOR_BLUE           0x001F
00201 #define LCD_COLOR_BLUE2          0x051F
00202 #define LCD_COLOR_RED            0xF800
00203 #define LCD_COLOR_MAGENTA        0xF81F
00204 #define LCD_COLOR_GREEN          0x07E0
00205 #define LCD_COLOR_CYAN           0x7FFF
00206 #define LCD_COLOR_YELLOW         0xFFE0
00207 
00208 /** 
00209   * @brief  LCD Lines depending on the chosen fonts.  
00210   */
00211 #define LCD_LINE_0               LINE(0)
00212 #define LCD_LINE_1               LINE(1)
00213 #define LCD_LINE_2               LINE(2)
00214 #define LCD_LINE_3               LINE(3)
00215 #define LCD_LINE_4               LINE(4)
00216 #define LCD_LINE_5               LINE(5)
00217 #define LCD_LINE_6               LINE(6)
00218 #define LCD_LINE_7               LINE(7)
00219 #define LCD_LINE_8               LINE(8)
00220 #define LCD_LINE_9               LINE(9)
00221 #define LCD_LINE_10              LINE(10)
00222 #define LCD_LINE_11              LINE(11)
00223 #define LCD_LINE_12              LINE(12)
00224 #define LCD_LINE_13              LINE(13)
00225 #define LCD_LINE_14              LINE(14)
00226 #define LCD_LINE_15              LINE(15)
00227 #define LCD_LINE_16              LINE(16)
00228 #define LCD_LINE_17              LINE(17)
00229 #define LCD_LINE_18              LINE(18)
00230 #define LCD_LINE_19              LINE(19)
00231 #define LCD_LINE_20              LINE(20)
00232 #define LCD_LINE_21              LINE(21)
00233 #define LCD_LINE_22              LINE(22)
00234 #define LCD_LINE_23              LINE(23)
00235 #define LCD_LINE_24              LINE(24)
00236 #define LCD_LINE_25              LINE(25)
00237 #define LCD_LINE_26              LINE(26)
00238 #define LCD_LINE_27              LINE(27)
00239 #define LCD_LINE_28              LINE(28)
00240 #define LCD_LINE_29              LINE(29)
00241 
00242 /** 
00243   * @brief LCD default font 
00244   */ 
00245 #define LCD_DEFAULT_FONT         Font16x24
00246 
00247 /** 
00248   * @brief  LCD Direction  
00249   */ 
00250 #define LCD_DIR_HORIZONTAL       0x0000
00251 #define LCD_DIR_VERTICAL         0x0001
00252 
00253 /** 
00254   * @brief  LCD Size (Width and Height)  
00255   */ 
00256 #define LCD_PIXEL_WIDTH          0x0140
00257 #define LCD_PIXEL_HEIGHT         0x00F0
00258 
00259 /**
00260   * @}
00261   */ 
00262 
00263 /** @defgroup STM3210E_EVAL_LCD_Exported_Macros
00264   * @{
00265   */ 
00266 #define ASSEMBLE_RGB(R, G, B)    ((((R)& 0xF8) << 8) | (((G) & 0xFC) << 3) | (((B) & 0xF8) >> 3))  
00267 /**
00268   * @}
00269   */ 
00270 
00271 /** @defgroup STM3210E_EVAL_LCD_Exported_Functions
00272   * @{
00273   */ 
00274 /** @defgroup  
00275   * @{
00276   */ 
00277 void LCD_DeInit(void);  
00278 void STM3210E_LCD_Init(void);
00279 void LCD_SetColors(__IO uint16_t _TextColor, __IO uint16_t _BackColor); 
00280 void LCD_GetColors(__IO uint16_t *_TextColor, __IO uint16_t *_BackColor);
00281 void LCD_SetTextColor(__IO uint16_t Color);
00282 void LCD_SetBackColor(__IO uint16_t Color);
00283 void LCD_ClearLine(uint8_t Line);
00284 void LCD_Clear(uint16_t Color);
00285 void LCD_SetCursor(uint8_t Xpos, uint16_t Ypos);
00286 void LCD_DrawChar(uint8_t Xpos, uint16_t Ypos, const uint16_t *c);
00287 void LCD_DisplayChar(uint8_t Line, uint16_t Column, uint8_t Ascii);
00288 void LCD_SetFont(sFONT *fonts);
00289 sFONT *LCD_GetFont(void);
00290 void LCD_DisplayStringLine(uint8_t Line, uint8_t *ptr);
00291 void LCD_SetDisplayWindow(uint8_t Xpos, uint16_t Ypos, uint8_t Height, uint16_t Width);
00292 void LCD_WindowModeDisable(void);
00293 void LCD_DrawLine(uint8_t Xpos, uint16_t Ypos, uint16_t Length, uint8_t Direction);
00294 void LCD_DrawRect(uint8_t Xpos, uint16_t Ypos, uint8_t Height, uint16_t Width);
00295 void LCD_DrawCircle(uint8_t Xpos, uint16_t Ypos, uint16_t Radius);
00296 void LCD_DrawMonoPict(const uint32_t *Pict);
00297 void LCD_WriteBMP(uint32_t BmpAddress);
00298 void LCD_DrawUniLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
00299 void LCD_DrawFullRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
00300 void LCD_DrawFullCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
00301 void LCD_PolyLine(pPoint Points, uint16_t PointCount);
00302 void LCD_PolyLineRelative(pPoint Points, uint16_t PointCount);
00303 void LCD_ClosedPolyLine(pPoint Points, uint16_t PointCount);
00304 void LCD_ClosedPolyLineRelative(pPoint Points, uint16_t PointCount);
00305 void LCD_FillPolyLine(pPoint Points, uint16_t PointCount);
00306 /**
00307   * @}
00308   */ 
00309 
00310 /** @defgroup  
00311   * @{
00312   */ 
00313 void LCD_WriteReg(uint8_t LCD_Reg, uint16_t LCD_RegValue);
00314 uint16_t LCD_ReadReg(uint8_t LCD_Reg);
00315 void LCD_WriteRAM_Prepare(void);
00316 void LCD_WriteRAM(uint16_t RGB_Code);
00317 uint16_t LCD_ReadRAM(void);
00318 void LCD_PowerOn(void);
00319 void LCD_DisplayOn(void);
00320 void LCD_DisplayOff(void);
00321 /**
00322   * @}
00323   */ 
00324 
00325 /** @defgroup  
00326   * @{
00327   */ 
00328 void LCD_CtrlLinesConfig(void);
00329 void LCD_FSMCConfig(void);
00330 /**
00331   * @}
00332   */
00333 
00334 /**
00335   * @}
00336   */    
00337 #ifdef __cplusplus
00338 }
00339 #endif
00340 
00341 #endif /* __STM3210E_EVAL_LCD_H */
00342 /**
00343   * @}
00344   */ 
00345 
00346 /**
00347   * @}
00348   */ 
00349 
00350 /**
00351   * @}
00352   */ 
00353 
00354 /**
00355   * @}
00356   */
00357   
00358 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32