Projet electro RFID
LCD_DISCO_F746NG.h@0:d44525b1de98, 2015-09-28 (annotated)
- Committer:
- bcostm
- Date:
- Mon Sep 28 13:34:04 2015 +0000
- Revision:
- 0:d44525b1de98
Initial version.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bcostm | 0:d44525b1de98 | 1 | /* Copyright (c) 2010-2011 mbed.org, MIT License |
bcostm | 0:d44525b1de98 | 2 | * |
bcostm | 0:d44525b1de98 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
bcostm | 0:d44525b1de98 | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
bcostm | 0:d44525b1de98 | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
bcostm | 0:d44525b1de98 | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
bcostm | 0:d44525b1de98 | 7 | * Software is furnished to do so, subject to the following conditions: |
bcostm | 0:d44525b1de98 | 8 | * |
bcostm | 0:d44525b1de98 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
bcostm | 0:d44525b1de98 | 10 | * substantial portions of the Software. |
bcostm | 0:d44525b1de98 | 11 | * |
bcostm | 0:d44525b1de98 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
bcostm | 0:d44525b1de98 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
bcostm | 0:d44525b1de98 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
bcostm | 0:d44525b1de98 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
bcostm | 0:d44525b1de98 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
bcostm | 0:d44525b1de98 | 17 | */ |
bcostm | 0:d44525b1de98 | 18 | |
bcostm | 0:d44525b1de98 | 19 | #ifndef __LCD_DISCO_F746NG_H |
bcostm | 0:d44525b1de98 | 20 | #define __LCD_DISCO_F746NG_H |
bcostm | 0:d44525b1de98 | 21 | |
bcostm | 0:d44525b1de98 | 22 | #ifdef TARGET_DISCO_F746NG |
bcostm | 0:d44525b1de98 | 23 | |
bcostm | 0:d44525b1de98 | 24 | #include "mbed.h" |
bcostm | 0:d44525b1de98 | 25 | #include "stm32746g_discovery_lcd.h" |
bcostm | 0:d44525b1de98 | 26 | |
bcostm | 0:d44525b1de98 | 27 | /* |
bcostm | 0:d44525b1de98 | 28 | This class drives the LCD display (RK043FN48H-CT672B 4,3" 480x272 pixels device) present on DISCO_F746NG board. |
bcostm | 0:d44525b1de98 | 29 | |
bcostm | 0:d44525b1de98 | 30 | Usage: |
bcostm | 0:d44525b1de98 | 31 | |
bcostm | 0:d44525b1de98 | 32 | #include "mbed.h" |
bcostm | 0:d44525b1de98 | 33 | #include "LCD_DISCO_F746NG.h" |
bcostm | 0:d44525b1de98 | 34 | |
bcostm | 0:d44525b1de98 | 35 | LCD_DISCO_F746NG lcd; |
bcostm | 0:d44525b1de98 | 36 | |
bcostm | 0:d44525b1de98 | 37 | int main() |
bcostm | 0:d44525b1de98 | 38 | { |
bcostm | 0:d44525b1de98 | 39 | lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"MBED EXAMPLE", CENTER_MODE); |
bcostm | 0:d44525b1de98 | 40 | wait(1); |
bcostm | 0:d44525b1de98 | 41 | lcd.Clear(LCD_COLOR_BLUE); |
bcostm | 0:d44525b1de98 | 42 | lcd.SetBackColor(LCD_COLOR_BLUE); |
bcostm | 0:d44525b1de98 | 43 | lcd.SetTextColor(LCD_COLOR_WHITE); |
bcostm | 0:d44525b1de98 | 44 | lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"DISCOVERY STM32F746NG", CENTER_MODE); |
bcostm | 0:d44525b1de98 | 45 | while(1) |
bcostm | 0:d44525b1de98 | 46 | { |
bcostm | 0:d44525b1de98 | 47 | } |
bcostm | 0:d44525b1de98 | 48 | } |
bcostm | 0:d44525b1de98 | 49 | */ |
bcostm | 0:d44525b1de98 | 50 | class LCD_DISCO_F746NG |
bcostm | 0:d44525b1de98 | 51 | { |
bcostm | 0:d44525b1de98 | 52 | |
bcostm | 0:d44525b1de98 | 53 | public: |
bcostm | 0:d44525b1de98 | 54 | //! Constructor |
bcostm | 0:d44525b1de98 | 55 | LCD_DISCO_F746NG(); |
bcostm | 0:d44525b1de98 | 56 | |
bcostm | 0:d44525b1de98 | 57 | //! Destructor |
bcostm | 0:d44525b1de98 | 58 | ~LCD_DISCO_F746NG(); |
bcostm | 0:d44525b1de98 | 59 | |
bcostm | 0:d44525b1de98 | 60 | /** |
bcostm | 0:d44525b1de98 | 61 | * @brief Initializes the LCD. |
bcostm | 0:d44525b1de98 | 62 | * @retval LCD state |
bcostm | 0:d44525b1de98 | 63 | */ |
bcostm | 0:d44525b1de98 | 64 | uint8_t Init(void); |
bcostm | 0:d44525b1de98 | 65 | |
bcostm | 0:d44525b1de98 | 66 | /** |
bcostm | 0:d44525b1de98 | 67 | * @brief DeInitializes the LCD. |
bcostm | 0:d44525b1de98 | 68 | * @retval LCD state |
bcostm | 0:d44525b1de98 | 69 | */ |
bcostm | 0:d44525b1de98 | 70 | uint8_t DeInit(void); |
bcostm | 0:d44525b1de98 | 71 | |
bcostm | 0:d44525b1de98 | 72 | /** |
bcostm | 0:d44525b1de98 | 73 | * @brief Gets the LCD X size. |
bcostm | 0:d44525b1de98 | 74 | * @retval Used LCD X size |
bcostm | 0:d44525b1de98 | 75 | */ |
bcostm | 0:d44525b1de98 | 76 | uint32_t GetXSize(void); |
bcostm | 0:d44525b1de98 | 77 | |
bcostm | 0:d44525b1de98 | 78 | /** |
bcostm | 0:d44525b1de98 | 79 | * @brief Gets the LCD Y size. |
bcostm | 0:d44525b1de98 | 80 | * @retval Used LCD Y size |
bcostm | 0:d44525b1de98 | 81 | */ |
bcostm | 0:d44525b1de98 | 82 | uint32_t GetYSize(void); |
bcostm | 0:d44525b1de98 | 83 | |
bcostm | 0:d44525b1de98 | 84 | /** |
bcostm | 0:d44525b1de98 | 85 | * @brief Set the LCD X size. |
bcostm | 0:d44525b1de98 | 86 | * @param imageWidthPixels : image width in pixels unit |
bcostm | 0:d44525b1de98 | 87 | * @retval None |
bcostm | 0:d44525b1de98 | 88 | */ |
bcostm | 0:d44525b1de98 | 89 | void SetXSize(uint32_t imageWidthPixels); |
bcostm | 0:d44525b1de98 | 90 | |
bcostm | 0:d44525b1de98 | 91 | /** |
bcostm | 0:d44525b1de98 | 92 | * @brief Set the LCD Y size. |
bcostm | 0:d44525b1de98 | 93 | * @param imageHeightPixels : image height in lines unit |
bcostm | 0:d44525b1de98 | 94 | * @retval None |
bcostm | 0:d44525b1de98 | 95 | */ |
bcostm | 0:d44525b1de98 | 96 | void SetYSize(uint32_t imageHeightPixels); |
bcostm | 0:d44525b1de98 | 97 | |
bcostm | 0:d44525b1de98 | 98 | /** |
bcostm | 0:d44525b1de98 | 99 | * @brief Initializes the LCD layer in ARGB8888 format (32 bits per pixel);. |
bcostm | 0:d44525b1de98 | 100 | * @param LayerIndex: Layer foreground or background |
bcostm | 0:d44525b1de98 | 101 | * @param FB_Address: Layer frame buffer |
bcostm | 0:d44525b1de98 | 102 | * @retval None |
bcostm | 0:d44525b1de98 | 103 | */ |
bcostm | 0:d44525b1de98 | 104 | void LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address); |
bcostm | 0:d44525b1de98 | 105 | |
bcostm | 0:d44525b1de98 | 106 | /** |
bcostm | 0:d44525b1de98 | 107 | * @brief Initializes the LCD layer in RGB565 format (16 bits per pixel);. |
bcostm | 0:d44525b1de98 | 108 | * @param LayerIndex: Layer foreground or background |
bcostm | 0:d44525b1de98 | 109 | * @param FB_Address: Layer frame buffer |
bcostm | 0:d44525b1de98 | 110 | * @retval None |
bcostm | 0:d44525b1de98 | 111 | */ |
bcostm | 0:d44525b1de98 | 112 | void LayerRgb565Init(uint16_t LayerIndex, uint32_t FB_Address); |
bcostm | 0:d44525b1de98 | 113 | |
bcostm | 0:d44525b1de98 | 114 | /** |
bcostm | 0:d44525b1de98 | 115 | * @brief Selects the LCD Layer. |
bcostm | 0:d44525b1de98 | 116 | * @param LayerIndex: Layer foreground or background |
bcostm | 0:d44525b1de98 | 117 | * @retval None |
bcostm | 0:d44525b1de98 | 118 | */ |
bcostm | 0:d44525b1de98 | 119 | void SelectLayer(uint32_t LayerIndex); |
bcostm | 0:d44525b1de98 | 120 | |
bcostm | 0:d44525b1de98 | 121 | /** |
bcostm | 0:d44525b1de98 | 122 | * @brief Sets an LCD Layer visible |
bcostm | 0:d44525b1de98 | 123 | * @param LayerIndex: Visible Layer |
bcostm | 0:d44525b1de98 | 124 | * @param State: New state of the specified layer |
bcostm | 0:d44525b1de98 | 125 | * This parameter can be one of the following values: |
bcostm | 0:d44525b1de98 | 126 | * @arg ENABLE |
bcostm | 0:d44525b1de98 | 127 | * @arg DISABLE |
bcostm | 0:d44525b1de98 | 128 | * @retval None |
bcostm | 0:d44525b1de98 | 129 | */ |
bcostm | 0:d44525b1de98 | 130 | void SetLayerVisible(uint32_t LayerIndex, FunctionalState State); |
bcostm | 0:d44525b1de98 | 131 | |
bcostm | 0:d44525b1de98 | 132 | /** |
bcostm | 0:d44525b1de98 | 133 | * @brief Configures the transparency. |
bcostm | 0:d44525b1de98 | 134 | * @param LayerIndex: Layer foreground or background. |
bcostm | 0:d44525b1de98 | 135 | * @param Transparency: Transparency |
bcostm | 0:d44525b1de98 | 136 | * This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF |
bcostm | 0:d44525b1de98 | 137 | * @retval None |
bcostm | 0:d44525b1de98 | 138 | */ |
bcostm | 0:d44525b1de98 | 139 | void SetTransparency(uint32_t LayerIndex, uint8_t Transparency); |
bcostm | 0:d44525b1de98 | 140 | |
bcostm | 0:d44525b1de98 | 141 | /** |
bcostm | 0:d44525b1de98 | 142 | * @brief Sets an LCD layer frame buffer address. |
bcostm | 0:d44525b1de98 | 143 | * @param LayerIndex: Layer foreground or background |
bcostm | 0:d44525b1de98 | 144 | * @param Address: New LCD frame buffer value |
bcostm | 0:d44525b1de98 | 145 | * @retval None |
bcostm | 0:d44525b1de98 | 146 | */ |
bcostm | 0:d44525b1de98 | 147 | void SetLayerAddress(uint32_t LayerIndex, uint32_t Address); |
bcostm | 0:d44525b1de98 | 148 | |
bcostm | 0:d44525b1de98 | 149 | /** |
bcostm | 0:d44525b1de98 | 150 | * @brief Sets display window. |
bcostm | 0:d44525b1de98 | 151 | * @param LayerIndex: Layer index |
bcostm | 0:d44525b1de98 | 152 | * @param Xpos: LCD X position |
bcostm | 0:d44525b1de98 | 153 | * @param Ypos: LCD Y position |
bcostm | 0:d44525b1de98 | 154 | * @param Width: LCD window width |
bcostm | 0:d44525b1de98 | 155 | * @param Height: LCD window height |
bcostm | 0:d44525b1de98 | 156 | * @retval None |
bcostm | 0:d44525b1de98 | 157 | */ |
bcostm | 0:d44525b1de98 | 158 | void SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); |
bcostm | 0:d44525b1de98 | 159 | |
bcostm | 0:d44525b1de98 | 160 | /** |
bcostm | 0:d44525b1de98 | 161 | * @brief Configures and sets the color keying. |
bcostm | 0:d44525b1de98 | 162 | * @param LayerIndex: Layer foreground or background |
bcostm | 0:d44525b1de98 | 163 | * @param RGBValue: Color reference |
bcostm | 0:d44525b1de98 | 164 | * @retval None |
bcostm | 0:d44525b1de98 | 165 | */ |
bcostm | 0:d44525b1de98 | 166 | void SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue); |
bcostm | 0:d44525b1de98 | 167 | |
bcostm | 0:d44525b1de98 | 168 | /** |
bcostm | 0:d44525b1de98 | 169 | * @brief Disables the color keying. |
bcostm | 0:d44525b1de98 | 170 | * @param LayerIndex: Layer foreground or background |
bcostm | 0:d44525b1de98 | 171 | * @retval None |
bcostm | 0:d44525b1de98 | 172 | */ |
bcostm | 0:d44525b1de98 | 173 | void ResetColorKeying(uint32_t LayerIndex); |
bcostm | 0:d44525b1de98 | 174 | |
bcostm | 0:d44525b1de98 | 175 | /** |
bcostm | 0:d44525b1de98 | 176 | * @brief Sets the LCD text color. |
bcostm | 0:d44525b1de98 | 177 | * @param Color: Text color code ARGB(8-8-8-8); |
bcostm | 0:d44525b1de98 | 178 | * @retval None |
bcostm | 0:d44525b1de98 | 179 | */ |
bcostm | 0:d44525b1de98 | 180 | void SetTextColor(uint32_t Color); |
bcostm | 0:d44525b1de98 | 181 | |
bcostm | 0:d44525b1de98 | 182 | /** |
bcostm | 0:d44525b1de98 | 183 | * @brief Gets the LCD text color. |
bcostm | 0:d44525b1de98 | 184 | * @retval Used text color. |
bcostm | 0:d44525b1de98 | 185 | */ |
bcostm | 0:d44525b1de98 | 186 | uint32_t GetTextColor(void); |
bcostm | 0:d44525b1de98 | 187 | |
bcostm | 0:d44525b1de98 | 188 | /** |
bcostm | 0:d44525b1de98 | 189 | * @brief Sets the LCD background color. |
bcostm | 0:d44525b1de98 | 190 | * @param Color: Layer background color code ARGB(8-8-8-8); |
bcostm | 0:d44525b1de98 | 191 | * @retval None |
bcostm | 0:d44525b1de98 | 192 | */ |
bcostm | 0:d44525b1de98 | 193 | void SetBackColor(uint32_t Color); |
bcostm | 0:d44525b1de98 | 194 | |
bcostm | 0:d44525b1de98 | 195 | /** |
bcostm | 0:d44525b1de98 | 196 | * @brief Gets the LCD background color. |
bcostm | 0:d44525b1de98 | 197 | * @retval Used background colour |
bcostm | 0:d44525b1de98 | 198 | */ |
bcostm | 0:d44525b1de98 | 199 | uint32_t GetBackColor(void); |
bcostm | 0:d44525b1de98 | 200 | |
bcostm | 0:d44525b1de98 | 201 | /** |
bcostm | 0:d44525b1de98 | 202 | * @brief Sets the LCD text font. |
bcostm | 0:d44525b1de98 | 203 | * @param fonts: Layer font to be used |
bcostm | 0:d44525b1de98 | 204 | * @retval None |
bcostm | 0:d44525b1de98 | 205 | */ |
bcostm | 0:d44525b1de98 | 206 | void SetFont(sFONT *fonts); |
bcostm | 0:d44525b1de98 | 207 | |
bcostm | 0:d44525b1de98 | 208 | /** |
bcostm | 0:d44525b1de98 | 209 | * @brief Gets the LCD text font. |
bcostm | 0:d44525b1de98 | 210 | * @retval Used layer font |
bcostm | 0:d44525b1de98 | 211 | */ |
bcostm | 0:d44525b1de98 | 212 | sFONT *GetFont(void); |
bcostm | 0:d44525b1de98 | 213 | |
bcostm | 0:d44525b1de98 | 214 | /** |
bcostm | 0:d44525b1de98 | 215 | * @brief Reads an LCD pixel. |
bcostm | 0:d44525b1de98 | 216 | * @param Xpos: X position |
bcostm | 0:d44525b1de98 | 217 | * @param Ypos: Y position |
bcostm | 0:d44525b1de98 | 218 | * @retval RGB pixel color |
bcostm | 0:d44525b1de98 | 219 | */ |
bcostm | 0:d44525b1de98 | 220 | uint32_t ReadPixel(uint16_t Xpos, uint16_t Ypos); |
bcostm | 0:d44525b1de98 | 221 | |
bcostm | 0:d44525b1de98 | 222 | /** |
bcostm | 0:d44525b1de98 | 223 | * @brief Clears the whole LCD. |
bcostm | 0:d44525b1de98 | 224 | * @param Color: Color of the background |
bcostm | 0:d44525b1de98 | 225 | * @retval None |
bcostm | 0:d44525b1de98 | 226 | */ |
bcostm | 0:d44525b1de98 | 227 | void Clear(uint32_t Color); |
bcostm | 0:d44525b1de98 | 228 | |
bcostm | 0:d44525b1de98 | 229 | /** |
bcostm | 0:d44525b1de98 | 230 | * @brief Clears the selected line. |
bcostm | 0:d44525b1de98 | 231 | * @param Line: Line to be cleared |
bcostm | 0:d44525b1de98 | 232 | * @retval None |
bcostm | 0:d44525b1de98 | 233 | */ |
bcostm | 0:d44525b1de98 | 234 | void ClearStringLine(uint32_t Line); |
bcostm | 0:d44525b1de98 | 235 | |
bcostm | 0:d44525b1de98 | 236 | /** |
bcostm | 0:d44525b1de98 | 237 | * @brief Displays one character. |
bcostm | 0:d44525b1de98 | 238 | * @param Xpos: Start column address |
bcostm | 0:d44525b1de98 | 239 | * @param Ypos: Line where to display the character shape. |
bcostm | 0:d44525b1de98 | 240 | * @param Ascii: Character ascii code |
bcostm | 0:d44525b1de98 | 241 | * This parameter must be a number between Min_Data = 0x20 and Max_Data = 0x7E |
bcostm | 0:d44525b1de98 | 242 | * @retval None |
bcostm | 0:d44525b1de98 | 243 | */ |
bcostm | 0:d44525b1de98 | 244 | void DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii); |
bcostm | 0:d44525b1de98 | 245 | |
bcostm | 0:d44525b1de98 | 246 | /** |
bcostm | 0:d44525b1de98 | 247 | * @brief Displays characters on the LCD. |
bcostm | 0:d44525b1de98 | 248 | * @param Xpos: X position (in pixel); |
bcostm | 0:d44525b1de98 | 249 | * @param Ypos: Y position (in pixel); |
bcostm | 0:d44525b1de98 | 250 | * @param Text: Pointer to string to display on LCD |
bcostm | 0:d44525b1de98 | 251 | * @param Mode: Display mode |
bcostm | 0:d44525b1de98 | 252 | * This parameter can be one of the following values: |
bcostm | 0:d44525b1de98 | 253 | * @arg CENTER_MODE |
bcostm | 0:d44525b1de98 | 254 | * @arg RIGHT_MODE |
bcostm | 0:d44525b1de98 | 255 | * @arg LEFT_MODE |
bcostm | 0:d44525b1de98 | 256 | * @retval None |
bcostm | 0:d44525b1de98 | 257 | */ |
bcostm | 0:d44525b1de98 | 258 | void DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode); |
bcostm | 0:d44525b1de98 | 259 | |
bcostm | 0:d44525b1de98 | 260 | /** |
bcostm | 0:d44525b1de98 | 261 | * @brief Displays a maximum of 60 characters on the LCD. |
bcostm | 0:d44525b1de98 | 262 | * @param Line: Line where to display the character shape |
bcostm | 0:d44525b1de98 | 263 | * @param ptr: Pointer to string to display on LCD |
bcostm | 0:d44525b1de98 | 264 | * @retval None |
bcostm | 0:d44525b1de98 | 265 | */ |
bcostm | 0:d44525b1de98 | 266 | void DisplayStringAtLine(uint16_t Line, uint8_t *ptr); |
bcostm | 0:d44525b1de98 | 267 | |
bcostm | 0:d44525b1de98 | 268 | /** |
bcostm | 0:d44525b1de98 | 269 | * @brief Draws an horizontal line. |
bcostm | 0:d44525b1de98 | 270 | * @param Xpos: X position |
bcostm | 0:d44525b1de98 | 271 | * @param Ypos: Y position |
bcostm | 0:d44525b1de98 | 272 | * @param Length: Line length |
bcostm | 0:d44525b1de98 | 273 | * @retval None |
bcostm | 0:d44525b1de98 | 274 | */ |
bcostm | 0:d44525b1de98 | 275 | void DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length); |
bcostm | 0:d44525b1de98 | 276 | |
bcostm | 0:d44525b1de98 | 277 | /** |
bcostm | 0:d44525b1de98 | 278 | * @brief Draws a vertical line. |
bcostm | 0:d44525b1de98 | 279 | * @param Xpos: X position |
bcostm | 0:d44525b1de98 | 280 | * @param Ypos: Y position |
bcostm | 0:d44525b1de98 | 281 | * @param Length: Line length |
bcostm | 0:d44525b1de98 | 282 | * @retval None |
bcostm | 0:d44525b1de98 | 283 | */ |
bcostm | 0:d44525b1de98 | 284 | void DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length); |
bcostm | 0:d44525b1de98 | 285 | |
bcostm | 0:d44525b1de98 | 286 | /** |
bcostm | 0:d44525b1de98 | 287 | * @brief Draws an uni-line (between two points);. |
bcostm | 0:d44525b1de98 | 288 | * @param x1: Point 1 X position |
bcostm | 0:d44525b1de98 | 289 | * @param y1: Point 1 Y position |
bcostm | 0:d44525b1de98 | 290 | * @param x2: Point 2 X position |
bcostm | 0:d44525b1de98 | 291 | * @param y2: Point 2 Y position |
bcostm | 0:d44525b1de98 | 292 | * @retval None |
bcostm | 0:d44525b1de98 | 293 | */ |
bcostm | 0:d44525b1de98 | 294 | void DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); |
bcostm | 0:d44525b1de98 | 295 | |
bcostm | 0:d44525b1de98 | 296 | /** |
bcostm | 0:d44525b1de98 | 297 | * @brief Draws a rectangle. |
bcostm | 0:d44525b1de98 | 298 | * @param Xpos: X position |
bcostm | 0:d44525b1de98 | 299 | * @param Ypos: Y position |
bcostm | 0:d44525b1de98 | 300 | * @param Width: Rectangle width |
bcostm | 0:d44525b1de98 | 301 | * @param Height: Rectangle height |
bcostm | 0:d44525b1de98 | 302 | * @retval None |
bcostm | 0:d44525b1de98 | 303 | */ |
bcostm | 0:d44525b1de98 | 304 | void DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); |
bcostm | 0:d44525b1de98 | 305 | |
bcostm | 0:d44525b1de98 | 306 | /** |
bcostm | 0:d44525b1de98 | 307 | * @brief Draws a circle. |
bcostm | 0:d44525b1de98 | 308 | * @param Xpos: X position |
bcostm | 0:d44525b1de98 | 309 | * @param Ypos: Y position |
bcostm | 0:d44525b1de98 | 310 | * @param Radius: Circle radius |
bcostm | 0:d44525b1de98 | 311 | * @retval None |
bcostm | 0:d44525b1de98 | 312 | */ |
bcostm | 0:d44525b1de98 | 313 | void DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius); |
bcostm | 0:d44525b1de98 | 314 | |
bcostm | 0:d44525b1de98 | 315 | /** |
bcostm | 0:d44525b1de98 | 316 | * @brief Draws an poly-line (between many points);. |
bcostm | 0:d44525b1de98 | 317 | * @param Points: Pointer to the points array |
bcostm | 0:d44525b1de98 | 318 | * @param PointCount: Number of points |
bcostm | 0:d44525b1de98 | 319 | * @retval None |
bcostm | 0:d44525b1de98 | 320 | */ |
bcostm | 0:d44525b1de98 | 321 | void DrawPolygon(pPoint Points, uint16_t PointCount); |
bcostm | 0:d44525b1de98 | 322 | |
bcostm | 0:d44525b1de98 | 323 | /** |
bcostm | 0:d44525b1de98 | 324 | * @brief Draws an ellipse on LCD. |
bcostm | 0:d44525b1de98 | 325 | * @param Xpos: X position |
bcostm | 0:d44525b1de98 | 326 | * @param Ypos: Y position |
bcostm | 0:d44525b1de98 | 327 | * @param XRadius: Ellipse X radius |
bcostm | 0:d44525b1de98 | 328 | * @param YRadius: Ellipse Y radius |
bcostm | 0:d44525b1de98 | 329 | * @retval None |
bcostm | 0:d44525b1de98 | 330 | */ |
bcostm | 0:d44525b1de98 | 331 | void DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius); |
bcostm | 0:d44525b1de98 | 332 | |
bcostm | 0:d44525b1de98 | 333 | /** |
bcostm | 0:d44525b1de98 | 334 | * @brief Draws a pixel on LCD. |
bcostm | 0:d44525b1de98 | 335 | * @param Xpos: X position |
bcostm | 0:d44525b1de98 | 336 | * @param Ypos: Y position |
bcostm | 0:d44525b1de98 | 337 | * @param RGB_Code: Pixel color in ARGB mode (8-8-8-8); |
bcostm | 0:d44525b1de98 | 338 | * @retval None |
bcostm | 0:d44525b1de98 | 339 | */ |
bcostm | 0:d44525b1de98 | 340 | void DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code); |
bcostm | 0:d44525b1de98 | 341 | |
bcostm | 0:d44525b1de98 | 342 | /** |
bcostm | 0:d44525b1de98 | 343 | * @brief Draws a bitmap picture loaded in the internal Flash in ARGB888 format (32 bits per pixel);. |
bcostm | 0:d44525b1de98 | 344 | * @param Xpos: Bmp X position in the LCD |
bcostm | 0:d44525b1de98 | 345 | * @param Ypos: Bmp Y position in the LCD |
bcostm | 0:d44525b1de98 | 346 | * @param pbmp: Pointer to Bmp picture address in the internal Flash |
bcostm | 0:d44525b1de98 | 347 | * @retval None |
bcostm | 0:d44525b1de98 | 348 | */ |
bcostm | 0:d44525b1de98 | 349 | void DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp); |
bcostm | 0:d44525b1de98 | 350 | |
bcostm | 0:d44525b1de98 | 351 | /** |
bcostm | 0:d44525b1de98 | 352 | * @brief Draws a full rectangle. |
bcostm | 0:d44525b1de98 | 353 | * @param Xpos: X position |
bcostm | 0:d44525b1de98 | 354 | * @param Ypos: Y position |
bcostm | 0:d44525b1de98 | 355 | * @param Width: Rectangle width |
bcostm | 0:d44525b1de98 | 356 | * @param Height: Rectangle height |
bcostm | 0:d44525b1de98 | 357 | * @retval None |
bcostm | 0:d44525b1de98 | 358 | */ |
bcostm | 0:d44525b1de98 | 359 | void FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height); |
bcostm | 0:d44525b1de98 | 360 | |
bcostm | 0:d44525b1de98 | 361 | /** |
bcostm | 0:d44525b1de98 | 362 | * @brief Draws a full circle. |
bcostm | 0:d44525b1de98 | 363 | * @param Xpos: X position |
bcostm | 0:d44525b1de98 | 364 | * @param Ypos: Y position |
bcostm | 0:d44525b1de98 | 365 | * @param Radius: Circle radius |
bcostm | 0:d44525b1de98 | 366 | * @retval None |
bcostm | 0:d44525b1de98 | 367 | */ |
bcostm | 0:d44525b1de98 | 368 | void FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius); |
bcostm | 0:d44525b1de98 | 369 | |
bcostm | 0:d44525b1de98 | 370 | /** |
bcostm | 0:d44525b1de98 | 371 | * @brief Draws a full poly-line (between many points);. |
bcostm | 0:d44525b1de98 | 372 | * @param Points: Pointer to the points array |
bcostm | 0:d44525b1de98 | 373 | * @param PointCount: Number of points |
bcostm | 0:d44525b1de98 | 374 | * @retval None |
bcostm | 0:d44525b1de98 | 375 | */ |
bcostm | 0:d44525b1de98 | 376 | void FillPolygon(pPoint Points, uint16_t PointCount); |
bcostm | 0:d44525b1de98 | 377 | |
bcostm | 0:d44525b1de98 | 378 | /** |
bcostm | 0:d44525b1de98 | 379 | * @brief Draws a full ellipse. |
bcostm | 0:d44525b1de98 | 380 | * @param Xpos: X position |
bcostm | 0:d44525b1de98 | 381 | * @param Ypos: Y position |
bcostm | 0:d44525b1de98 | 382 | * @param XRadius: Ellipse X radius |
bcostm | 0:d44525b1de98 | 383 | * @param YRadius: Ellipse Y radius |
bcostm | 0:d44525b1de98 | 384 | * @retval None |
bcostm | 0:d44525b1de98 | 385 | */ |
bcostm | 0:d44525b1de98 | 386 | void FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius); |
bcostm | 0:d44525b1de98 | 387 | |
bcostm | 0:d44525b1de98 | 388 | /** |
bcostm | 0:d44525b1de98 | 389 | * @brief Enables the display. |
bcostm | 0:d44525b1de98 | 390 | * @retval None |
bcostm | 0:d44525b1de98 | 391 | */ |
bcostm | 0:d44525b1de98 | 392 | void DisplayOn(void); |
bcostm | 0:d44525b1de98 | 393 | |
bcostm | 0:d44525b1de98 | 394 | /** |
bcostm | 0:d44525b1de98 | 395 | * @brief Disables the display. |
bcostm | 0:d44525b1de98 | 396 | * @retval None |
bcostm | 0:d44525b1de98 | 397 | */ |
bcostm | 0:d44525b1de98 | 398 | void DisplayOff(void); |
bcostm | 0:d44525b1de98 | 399 | |
bcostm | 0:d44525b1de98 | 400 | private: |
bcostm | 0:d44525b1de98 | 401 | |
bcostm | 0:d44525b1de98 | 402 | }; |
bcostm | 0:d44525b1de98 | 403 | |
bcostm | 0:d44525b1de98 | 404 | #else |
bcostm | 0:d44525b1de98 | 405 | #error "This class must be used with DISCO_F746NG board only." |
bcostm | 0:d44525b1de98 | 406 | #endif // TARGET_DISCO_F746NG |
bcostm | 0:d44525b1de98 | 407 | |
bcostm | 0:d44525b1de98 | 408 | #endif |