1 /* ----------------------------------------------------------------------------
\r
2 * SAM Software Package License
\r
3 * ----------------------------------------------------------------------------
\r
4 * Copyright (c) 2011, Atmel Corporation
\r
6 * All rights reserved.
\r
8 * Redistribution and use in source and binary forms, with or without
\r
9 * modification, are permitted provided that the following conditions are met:
\r
11 * - Redistributions of source code must retain the above copyright notice,
\r
12 * this list of conditions and the disclaimer below.
\r
14 * Atmel's name may not be used to endorse or promote products derived from
\r
15 * this software without specific prior written permission.
\r
17 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
\r
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
\r
20 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
\r
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
\r
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
\r
23 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
\r
24 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
\r
25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
\r
26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
27 * ----------------------------------------------------------------------------
\r
33 * Implementation of draw function on LCD, Include draw text, image
\r
34 * and basic shapes (line, rectangle, circle).
\r
38 /*----------------------------------------------------------------------------
\r
40 *----------------------------------------------------------------------------*/
\r
48 /*----------------------------------------------------------------------------
\r
50 *----------------------------------------------------------------------------*/
\r
51 static void* gpCanvasBuffer;
\r
52 static uint32_t gwCanvasBufferSize;
\r
53 static uint32_t gwCanvasMaxWidth, gwCanvasMaxHeight;
\r
54 extern uint8_t ili9488_lcdMode;
\r
55 /*----------------------------------------------------------------------------
\r
57 *----------------------------------------------------------------------------*/
\r
60 * \brief Fill rectangle with given color
\r
61 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
62 * \param rc rectangle defines X and Y coordinate, width and height of windows.
\r
63 * \param dwColor color to be filled.
\r
65 static void LCDD_FillSolidRect(uint16_t *pCanvasBuffer, rect rc, uint32_t dwColor )
\r
70 //assert(gpCanvasBuffer!=NULL);
\r
71 w = rc.x + rc.width;
\r
72 w = w > gwCanvasMaxWidth ? gwCanvasMaxWidth : w;
\r
73 h = rc.y + rc.height;
\r
74 h = h > gwCanvasMaxHeight ? gwCanvasMaxHeight : h;
\r
76 if (ili9488_lcdMode == ILI9488_SPIMODE) {
\r
77 sBGR *p_buf = gpCanvasBuffer;
\r
78 if(pCanvasBuffer != NULL) p_buf = (sBGR *)((uint8_t*)pCanvasBuffer);
\r
79 //it'd better change to a DMA transfer
\r
80 for(row = rc.y; row < h; row++) {
\r
81 for(col = rc.x; col < w; col++) {
\r
82 //*p_buf++ = dwColor;
\r
83 p_buf[row * gwCanvasMaxWidth + col].b = dwColor&0xFF;
\r
84 p_buf[row * gwCanvasMaxWidth + col].g = dwColor>>8;
\r
85 p_buf[row * gwCanvasMaxWidth + col].r = dwColor>>16;
\r
89 uint16_t *p_buf = gpCanvasBuffer;
\r
90 if(pCanvasBuffer != NULL) p_buf = pCanvasBuffer;
\r
91 //it'd better change to a DMA transfer
\r
92 for(row = rc.y; row < h; row++) {
\r
93 for(col = rc.x; col < w; col++) {
\r
94 p_buf[row * gwCanvasMaxWidth + col] = (uint16_t)dwColor;
\r
100 /*----------------------------------------------------------------------------
\r
101 * Exported functions
\r
102 *----------------------------------------------------------------------------*/
\r
104 * \brief Update windows size.
\r
105 * \param rc rectangle defines X and Y coordinate, width and height of windows.
\r
107 void LCDD_SetUpdateWindowSize(rect rc)
\r
109 gwCanvasMaxWidth = rc.width + 1;
\r
110 gwCanvasMaxHeight = rc.height + 1;
\r
111 if (ili9488_lcdMode == ILI9488_SPIMODE) {
\r
112 ILI9488_SpiSetWindow( rc.x, rc.y, rc.width, rc.height);
\r
114 ILI9488_EbiSetWindow( rc.x, rc.y, rc.width, rc.height);
\r
119 * \brief Update windows in current canvas.
\r
121 void LCDD_UpdateWindow(void)
\r
124 if (ili9488_lcdMode == ILI9488_SPIMODE) {
\r
125 size = gwCanvasBufferSize / (sizeof(sBGR)) *3 ;
\r
126 ILI9488_SpiSendCommand(ILI9488_CMD_MEMORY_WRITE,
\r
127 (uint8_t*)gpCanvasBuffer, 0, AccessWrite, size);
\r
129 size = gwCanvasBufferSize / sizeof(uint16_t);
\r
130 ILI9488_EbiSendCommand(ILI9488_CMD_MEMORY_WRITE,
\r
131 (uint16_t*)gpCanvasBuffer, 0, AccessWrite, size);
\r
136 * \brief Update windows in partial canvas.
\r
137 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
138 * \param size Size of canvas buffer.
\r
140 void LCDD_UpdatePartialWindow(uint8_t* pCanvasBuffer,uint32_t size)
\r
143 if (ili9488_lcdMode == ILI9488_SPIMODE) {
\r
144 cnt = size/sizeof(sBGR) * 3;
\r
145 ILI9488_SpiSendCommand(ILI9488_CMD_MEMORY_WRITE,
\r
146 (uint8_t*)pCanvasBuffer, 0, AccessWrite, cnt);
\r
148 cnt = size/sizeof(uint16_t);
\r
149 ILI9488_EbiSendCommand(ILI9488_CMD_MEMORY_WRITE,
\r
150 (uint16_t*)pCanvasBuffer, 0, AccessWrite, cnt);
\r
154 * \brief Draws a rectangle with fill inside on LCD, at the given coordinates.
\r
156 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
157 * \param x X-coordinate of upper-left rectangle corner.
\r
158 * \param y Y-coordinate of upper-left rectangle corner.
\r
159 * \param width Rectangle width in pixels.
\r
160 * \param height Rectangle height in pixels.
\r
161 * \param color Rectangle color.
\r
163 void LCDD_DrawRectangleWithFill(uint16_t *pCanvasBuffer, uint32_t dwX, uint32_t dwY, uint32_t dwWidth,
\r
164 uint32_t dwHeight, uint32_t dwColor)
\r
169 rc.width = dwWidth + 1;
\r
170 rc.height = dwHeight + 1;
\r
171 LCDD_FillSolidRect(pCanvasBuffer, rc , dwColor);
\r
175 * \brief Draws a circle on LCD, at the given coordinates.
\r
177 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
178 * \param x X-coordinate of circle centre.
\r
179 * \param y Y-coordinate of circle centre.
\r
180 * \param r circle radius.
\r
181 * \param color circle color.
\r
183 uint32_t LCDD_DrawCircle(uint16_t *pCanvasBuffer, uint32_t x, uint32_t y, uint32_t r, uint32_t color )
\r
185 signed int d; /* Decision Variable */
\r
186 uint32_t curX; /* Current X Value */
\r
187 uint32_t curY; /* Current Y Value */
\r
193 while (curX <= curY) {
\r
194 LCDD_DrawPixel(pCanvasBuffer, x + curX, y + curY, color);
\r
195 LCDD_DrawPixel(pCanvasBuffer, x + curX, y - curY, color);
\r
196 LCDD_DrawPixel(pCanvasBuffer, x - curX, y + curY, color);
\r
197 LCDD_DrawPixel(pCanvasBuffer, x - curX, y - curY, color);
\r
198 LCDD_DrawPixel(pCanvasBuffer, x + curY, y + curX, color);
\r
199 LCDD_DrawPixel(pCanvasBuffer, x + curY, y - curX, color);
\r
200 LCDD_DrawPixel(pCanvasBuffer, x - curY, y + curX, color);
\r
201 LCDD_DrawPixel(pCanvasBuffer, x - curY, y - curX, color);
\r
204 d += (curX << 2) + 6;
\r
206 d += ((curX - curY) << 2) + 10;
\r
215 * \brief Draws a circle with fill inside on LCD, at the given coordinates.
\r
217 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
218 * \param dwX X-coordinate of upper-left rectangle corner.
\r
219 * \param dwY Y-coordinate of upper-left rectangle corner.
\r
220 * \param dwRadius Radius.
\r
221 * \param color Rectangle color.
\r
223 uint32_t LCD_DrawFilledCircle(uint16_t *pCanvasBuffer, uint32_t dwX, uint32_t dwY,
\r
224 uint32_t dwRadius, uint32_t color)
\r
226 signed int d; /* Decision Variable */
\r
227 uint32_t dwCurX; /* Current X Value */
\r
228 uint32_t dwCurY; /* Current Y Value */
\r
229 uint32_t dwXmin, dwYmin;
\r
231 if (dwRadius == 0) {
\r
234 d = 3 - (dwRadius << 1);
\r
238 while ( dwCurX <= dwCurY ) {
\r
239 dwXmin = (dwCurX > dwX) ? 0 : dwX-dwCurX;
\r
240 dwYmin = (dwCurY > dwY) ? 0 : dwY-dwCurY;
\r
241 LCDD_DrawRectangleWithFill(pCanvasBuffer, dwXmin, dwYmin,
\r
242 dwX + dwCurX - dwXmin, 1 ,color);
\r
243 LCDD_DrawRectangleWithFill(pCanvasBuffer, dwXmin,
\r
244 dwY+dwCurY, dwX + dwCurX - dwXmin, 1,
\r
246 dwXmin = (dwCurY > dwX) ? 0 : dwX-dwCurY;
\r
247 dwYmin = (dwCurX > dwY) ? 0 : dwY-dwCurX;
\r
248 LCDD_DrawRectangleWithFill(pCanvasBuffer, dwXmin, dwYmin,
\r
249 dwX + dwCurY -dwXmin , 1, color );
\r
250 LCDD_DrawRectangleWithFill(pCanvasBuffer, dwXmin,
\r
251 dwY + dwCurX, dwX+dwCurY - dwXmin, 1,
\r
254 d += (dwCurX << 2) + 6;
\r
256 d += ((dwCurX - dwCurY) << 2) + 10;
\r
266 * \brief Draws a string inside a LCD buffer, at the given coordinates.
\r
268 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
269 * \param x X-coordinate of string top-left corner.
\r
270 * \param y Y-coordinate of string top-left corner.
\r
271 * \param pString String to display.
\r
272 * \param color String color.
\r
274 void LCDD_DrawString( uint16_t* pCanvasBuffer, uint32_t x, uint32_t y,
\r
275 const uint8_t *pString, uint32_t color )
\r
279 while ( *pString != 0 ) {
\r
280 if ( *pString == '\n' ) {
\r
281 y += gFont.height + 2;
\r
284 LCDD_DrawChar(pCanvasBuffer, x, y, *pString, color );
\r
285 x += gFont.width + 2;
\r
292 * \brief Returns the width & height in pixels that a string will occupy on the
\r
293 * screen if drawn using LCDD_DrawString.
\r
295 * \param pString String.
\r
296 * \param pWidth Pointer for storing the string width (optional).
\r
297 * \param pHeight Pointer for storing the string height (optional).
\r
299 * \return String width in pixels.
\r
301 void LCDD_GetStringSize( const uint8_t *pString, uint32_t *pWidth,
\r
302 uint32_t *pHeight )
\r
304 uint32_t width = 0;
\r
305 uint32_t height = gFont.height;
\r
307 while ( *pString != 0 ) {
\r
308 if ( *pString == '\n' ) {
\r
309 height += gFont.height + 2;
\r
311 width += gFont.width + 2;
\r
320 if ( pWidth != NULL ) {
\r
324 if ( pHeight != NULL ) {
\r
331 * \brief Performs a bit-block transfer of the color data corresponding to a
\r
332 * rectangle of pixels from the given source context into destination context.
\r
334 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
335 * \param dst_x X-coordinate of source rectangle.
\r
336 * \param dst_y Y-coordinate of source rectangle.
\r
337 * \param dst_w Rectangle width in pixels of source rectangle.
\r
338 * \param dst_h Rectangle height in pixels of source rectangle.
\r
339 * \param src Pointer to the source device context.
\r
340 * \param src_x X-coordinate of destination rectangle.
\r
341 * \param src_y Y-coordinate of destination rectangle.
\r
342 * \param src_w Rectangle width in pixels of destination rectangle.
\r
343 * \param src_h Rectangle height in pixels of destination rectangle.
\r
345 void LCDD_BitBlt( uint16_t* pCanvasBuffer, uint32_t dst_x,uint32_t dst_y,uint32_t dst_w,uint32_t dst_h,
\r
346 const LcdColor_t *src,
\r
347 uint32_t src_x,uint32_t src_y,uint32_t src_w,uint32_t src_h)
\r
350 uint32_t src_row,src_col;
\r
351 //assert(gpCanvasBuffer!=NULL);
\r
354 if (ili9488_lcdMode == ILI9488_SPIMODE) {
\r
355 sBGR *p_buf = gpCanvasBuffer;
\r
356 if(pCanvasBuffer != NULL) p_buf = (sBGR *)((uint8_t*)pCanvasBuffer);
\r
357 //it'd better change to a DMA transfer
\r
358 SCB_CleanInvalidateDCache();
\r
359 for(src_row = src_y,row = dst_y; row < dst_h; row++,src_row++) {
\r
360 for(src_col = src_x,col = dst_x; col < dst_w; col++,src_col++) {
\r
361 p_buf[row * gwCanvasMaxWidth+col].r = src[src_row*src_w + src_col]&0xFF;
\r
362 p_buf[row * gwCanvasMaxWidth+col].g = src[src_row*src_w + src_col]>>8;
\r
363 p_buf[row * gwCanvasMaxWidth+col].b = src[src_row*src_w + src_col]>>16;
\r
369 uint16_t *p_buf = gpCanvasBuffer;
\r
370 if(pCanvasBuffer != NULL) p_buf = pCanvasBuffer;
\r
371 //it'd better change to a DMA transfer
\r
372 SCB_CleanInvalidateDCache();
\r
373 for(src_row = src_y,row = dst_y; row < dst_h; row++,src_row++) {
\r
374 for(src_col = src_x, col = dst_x; col < dst_w; col++,src_col++) {
\r
375 p_buf[row * gwCanvasMaxWidth+col] = src[src_row*src_w + src_col];
\r
384 * \brief Performs a bit-block transfer of the color data corresponding to a
\r
385 * rectangle of pixels from the given source context into destination context.
\r
387 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
388 * \param dst_x X-coordinate of source rectangle.
\r
389 * \param dst_y Y-coordinate of source rectangle.
\r
390 * \param dst_w Rectangle width in pixels of source rectangle.
\r
391 * \param dst_h Rectangle height in pixels of source rectangle.
\r
392 * \param src Pointer to the source device context.
\r
393 * \param src_x X-coordinate of destination rectangle.
\r
394 * \param src_y Y-coordinate of destination rectangle.
\r
395 * \param src_w Rectangle width in pixels of destination rectangle.
\r
396 * \param src_h Rectangle height in pixels of destination rectangle.
\r
397 * \param alpha alpha value.
\r
399 void LCDD_BitBltAlphaBlend(uint16_t* pCanvasBuffer,
\r
404 const LcdColor_t *src,
\r
412 uint32_t src_row,src_col;
\r
417 if (ili9488_lcdMode == ILI9488_SPIMODE) {
\r
418 sBGR *p_buf = gpCanvasBuffer;
\r
419 if(pCanvasBuffer != NULL) p_buf = (sBGR *)((uint8_t*)pCanvasBuffer);
\r
421 //it'd better change to a DMA transfer
\r
422 SCB_CleanInvalidateDCache();
\r
423 for(src_row = src_y,row = dst_y; row < dst_h; row++,src_row++) {
\r
424 for(src_col = src_x,col = dst_x; col < dst_w; col++,src_col++) {
\r
425 p_buf[row *dst_w +col].r = src[src_row*src_w + src_col]&0xFF;
\r
426 p_buf[row *dst_w +col].g = src[src_row*src_w + src_col]>>8;
\r
427 p_buf[row *dst_w +col].b = src[src_row*src_w + src_col]>>16;
\r
432 uint16_t *p_buf = gpCanvasBuffer;
\r
433 if(pCanvasBuffer != NULL) p_buf = pCanvasBuffer;
\r
437 p_buf += (dst_row*dst_w + dst_x);
\r
438 src += src_y*w + src_x;
\r
439 SCB_CleanInvalidateDCache();
\r
440 for(src_row = src_y; src_row < h; src_row++,dst_row++) {
\r
441 for(src_col = src_x; src_col < w; src_col++){
\r
442 r = (p_buf[src_col] >> 11) * (255 - alpha) / 255 +
\r
443 (src[src_col] >> 11) * alpha / 255;
\r
444 if(r > 0x1F) r = 0x1F;
\r
445 g = ((p_buf[src_col] >> 5) & 0x3F) * (255 - alpha) / 255 +
\r
446 ((src[src_col] >> 5) & 0x3f) * alpha / 255;
\r
447 if(g > 0x3F) g = 0x3F;
\r
448 b = ((p_buf[src_col]) & 0x1F) * (255 - alpha) / 255
\r
449 + ((src[src_col]) & 0x1f) * alpha / 255;
\r
450 if(b > 0x1F) b = 0x1F;
\r
451 p_buf[src_col] = ((r & 0x1F) << 11)|((g & 0x3F) << 5)|( b & 0x1F);
\r
461 * \brief Draw a raw image at given position on LCD.
\r
463 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
464 * \param dwX X-coordinate of image start.
\r
465 * \param dwY Y-coordinate of image start.
\r
466 * \param pImage Image buffer.
\r
467 * \param width Image width.
\r
468 * \param height Image height.
\r
470 void LCDD_DrawImage(uint16_t* pCanvasBuffer, uint32_t dwX, uint32_t dwY,
\r
471 const LcdColor_t *pImage, uint32_t dwWidth, uint32_t dwHeight )
\r
473 /* Determine the refresh window area */
\r
474 /* Horizontal and Vertical RAM Address Position (R50h, R51h, R52h, R53h) */
\r
475 //CheckBoxCoordinates(&dwX, &dwY, &dwWidth, &dwHeight);
\r
477 LCDD_BitBlt(pCanvasBuffer, dwX, dwY, dwWidth, dwHeight,
\r
478 pImage, 0, 0, dwWidth - dwX, dwHeight - dwY);
\r
482 * \brief Draw a pixel on LCD of given color.
\r
484 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
485 * \param x X-coordinate of pixel.
\r
486 * \param y Y-coordinate of pixel.
\r
487 * \param color Pixel color.
\r
489 void LCDD_DrawPixel(uint16_t* pCanvasBuffer, uint32_t x, uint32_t y, uint32_t color )
\r
491 //assert(gpCanvasBuffer!=NULL);
\r
492 if (ili9488_lcdMode == ILI9488_SPIMODE) {
\r
493 sBGR *p_buf = gpCanvasBuffer;
\r
494 if(pCanvasBuffer != NULL) p_buf = (sBGR *)((uint8_t*)pCanvasBuffer);
\r
495 p_buf += y * gwCanvasMaxWidth;
\r
497 p_buf->b = color&0xFF;
\r
498 p_buf->g = color>>8;
\r
499 p_buf->r = color>>16;
\r
503 uint16_t *p_buf = gpCanvasBuffer;
\r
504 if(pCanvasBuffer != NULL) p_buf = pCanvasBuffer;
\r
505 p_buf += y * gwCanvasMaxWidth;
\r
507 *p_buf = (uint16_t)color;
\r
512 * \brief Draw a line on LCD, horizontal and vertical line are supported.
\r
514 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
515 * \param dwX1 X-coordinate of line start.
\r
516 * \param dwY1 Y-coordinate of line start.
\r
517 * \param dwX2 X-coordinate of line end.
\r
518 * \param dwY2 Y-coordinate of line end.
\r
519 * \param color Pixel color.
\r
521 void LCDD_DrawLine(uint16_t* pCanvasBuffer, uint32_t dwX1, uint32_t dwY1,
\r
522 uint32_t dwX2, uint32_t dwY2 , uint32_t color )
\r
524 if (( dwY1 == dwY2 ) || (dwX1 == dwX2)) {
\r
525 //LCDD_DrawRectangleWithFill( dwX1, dwY1, dwX2, dwY2, color );
\r
526 LCDD_DrawStraightLine(pCanvasBuffer, dwX1, dwY1, dwX2, dwY2, color );
\r
528 LCDD_DrawLineBresenham(pCanvasBuffer, dwX1, dwY1, dwX2, dwY2 , color);
\r
532 void LCDD_DrawStraightLine(uint16_t* pCanvasBuffer, uint32_t dwX1, uint32_t dwY1,
\r
533 uint32_t dwX2, uint32_t dwY2 , uint32_t color )
\r
550 for(y = dwY1; y<=dwY2; y++)
\r
552 for(x=dwX1;x<=dwX2;x++)
\r
554 LCDD_DrawPixel(pCanvasBuffer, x , y , color);
\r
560 * \brief Draw a line on LCD, which is not horizontal or vertical.
\r
562 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
563 * \param dwX1 X-coordinate of line start.
\r
564 * \param dwY1 Y-coordinate of line start.
\r
565 * \param dwX2 X-coordinate of line end.
\r
566 * \param dwY2 Y-coordinate of line end.
\r
567 * \param color pixel color.
\r
569 uint32_t LCDD_DrawLineBresenham(uint16_t* pCanvasBuffer, uint32_t dwX1,
\r
570 uint32_t dwY1, uint32_t dwX2, uint32_t dwY2 , uint32_t color)
\r
574 int xinc, yinc, cumul;
\r
582 xinc = ( dx > 0 ) ? 1 : -1;
\r
583 yinc = ( dy > 0 ) ? 1 : -1;
\r
584 dx = ( dx > 0 ) ? dx : -dx;
\r
585 dy = ( dy > 0 ) ? dy : -dy;
\r
587 LCDD_DrawPixel(pCanvasBuffer, x , y , color);
\r
591 for ( i = 1; i <= dx; i++ ) {
\r
595 if ( cumul >= dx ) {
\r
599 LCDD_DrawPixel(pCanvasBuffer, x , y , color);
\r
603 for ( i = 1; i <= dy; i++ ) {
\r
607 if ( cumul >= dy ) {
\r
611 LCDD_DrawPixel(pCanvasBuffer, x , y , color);
\r
619 * \brief Draws a rectangle on LCD, at the given coordinates.
\r
621 * \param pCanvasBuffer Pointer to dedicate canvas buffer.
\r
622 * \param x X-coordinate of upper-left rectangle corner.
\r
623 * \param y Y-coordinate of upper-left rectangle corner.
\r
624 * \param width Rectangle width in pixels.
\r
625 * \param height Rectangle height in pixels.
\r
626 * \param color Rectangle color.
\r
628 void LCDD_DrawRectangle(uint16_t* pCanvasBuffer, uint32_t x, uint32_t y,
\r
629 uint32_t width, uint32_t height, uint32_t color )
\r
631 LCDD_DrawRectangleWithFill(pCanvasBuffer, x, y, width, 1, color);
\r
632 LCDD_DrawRectangleWithFill(pCanvasBuffer, x, y, 1, height, color);
\r
634 LCDD_DrawRectangleWithFill(pCanvasBuffer, x + width , y, 1, height, color);
\r
635 LCDD_DrawRectangleWithFill(pCanvasBuffer, x, y + height, width, 1, color);
\r
639 * \brief Set buffer for pCanvas.
\r
641 * \param pCanvasBuffer Pointer of external buffer.
\r
642 * \param wBufferSize Size of buffer.
\r
644 void LCDD_SetCavasBuffer( void* pCanvasBuffer, uint32_t wBufferSize)
\r
646 if (ili9488_lcdMode == ILI9488_SPIMODE) {
\r
647 gpCanvasBuffer = (sBGR*)pCanvasBuffer;
\r
648 gwCanvasBufferSize = wBufferSize;
\r
650 gpCanvasBuffer = (uint16_t*)pCanvasBuffer;
\r
651 gwCanvasBufferSize = wBufferSize;
\r