STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
GUIDRV_Lin_Opt_32.h
Go to the documentation of this file.
1 /*********************************************************************
2 * SEGGER Microcontroller GmbH & Co. KG *
3 * Solutions for real time microcontroller applications *
4 **********************************************************************
5 * *
6 * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
7 * *
8 * Internet: www.segger.com Support: support@segger.com *
9 * *
10 **********************************************************************
11 
12 ** emWin V5.28 - Graphical user interface for embedded applications **
13 All Intellectual Property rights in the Software belongs to SEGGER.
14 emWin is protected by international copyright laws. Knowledge of the
15 source code may not be used to write a similar product. This file may
16 only be used in accordance with the following terms:
17 
18 The software has been licensed to STMicroelectronics International
19 N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
20 les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
21 purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
22 troller products commercialized by Licensee only, sublicensed and dis_
23 tributed under the terms and conditions of the End User License Agree_
24 ment supplied by STMicroelectronics International N.V.
25 Full source code is available at: www.segger.com
26 
27 We appreciate your understanding and fairness.
28 ----------------------------------------------------------------------
29 File : GUIDRV_Lin_Opt_32.h
30 Purpose : Optimized routines, included by GUIDRV_Lin_..._32.c
31 ---------------------------END-OF-HEADER------------------------------
32 */
33 
34 /*********************************************************************
35 *
36 * Static functions
37 *
38 **********************************************************************
39 */
40 /*********************************************************************
41 *
42 * _FillRectOpt32
43 *
44 * Purpose:
45 * Optimized filling routine for 32 bpp
46 */
47 static void _FillRectOpt32(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) {
48  DRIVER_CONTEXT * pContext;
49  register LCD_PIXELINDEX ColorIndex;
50  U32 * pDest;
51  U32 * pDest0;
52  U32 Off, Off0, RemPixels, NumLines, RemLines, OffLine, RemItems;
53  LCD_PIXELINDEX IndexMask;
54 
55  pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
56  RemPixels = x1 - x0 + 1;
57  NumLines = y1 - y0 + 1;
58  OffLine = pContext->vxSizePhys;
59  pDest = NULL;
61  IndexMask = pDevice->pColorConvAPI->pfGetIndexMask();
62  Off0 = XY2OFF32(pContext->vxSizePhys, x0, y0);
63  if (RemPixels) {
64  for (RemLines = NumLines; RemLines; RemLines--) {
65  RemItems = RemPixels;
66  Off = Off0 + OffLine * (RemLines - 1);
67  do {
68  ColorIndex = READ_MEM32(pContext->VRAMAddr, Off);
69  ColorIndex ^= IndexMask;
70  WRITE_MEM32(pContext->VRAMAddr, Off, ColorIndex);
71  Off++;
72  } while (--RemItems);
73  }
74  }
75  } else {
76  Off = XY2OFF32(pContext->vxSizePhys, x0, y0);
77  pDest0 = OFF2PTR32(pContext->VRAMAddr, Off);
78  ColorIndex = LCD__GetColorIndex();
79  if (RemPixels >= 16) {
80  for (RemLines = NumLines; RemLines; RemLines--) {
81  RemItems = RemPixels;
82  pDest = pDest0 + OffLine * (RemLines - 1);
83  do {
84  WRITE_MEM32P(pDest , ColorIndex);
85  WRITE_MEM32P(pDest + 1, ColorIndex);
86  WRITE_MEM32P(pDest + 2, ColorIndex);
87  WRITE_MEM32P(pDest + 3, ColorIndex);
88  WRITE_MEM32P(pDest + 4, ColorIndex);
89  WRITE_MEM32P(pDest + 5, ColorIndex);
90  WRITE_MEM32P(pDest + 6, ColorIndex);
91  WRITE_MEM32P(pDest + 7, ColorIndex);
92  WRITE_MEM32P(pDest + 8, ColorIndex);
93  WRITE_MEM32P(pDest + 9, ColorIndex);
94  WRITE_MEM32P(pDest + 10, ColorIndex);
95  WRITE_MEM32P(pDest + 11, ColorIndex);
96  WRITE_MEM32P(pDest + 12, ColorIndex);
97  WRITE_MEM32P(pDest + 13, ColorIndex);
98  WRITE_MEM32P(pDest + 14, ColorIndex);
99  WRITE_MEM32P(pDest + 15, ColorIndex);
100  pDest += 16;
101  RemItems -= 16;
102  } while (RemItems >= 16);
103  }
104  pDest0 = pDest;
105  RemPixels -= (RemPixels >> 4) << 4;
106  }
107  if (RemPixels) {
108  for (RemLines = NumLines; RemLines; RemLines--) {
109  RemItems = RemPixels;
110  pDest = pDest0 + OffLine * (RemLines - 1);
111  do {
112  WRITE_MEM32P(pDest, ColorIndex);
113  pDest++;
114  } while (--RemItems);
115  }
116  }
117  }
118 }
119 
120 /*************************** End of file ****************************/
GUI_SADDR GUI_CONTEXT * GUI_pContext
#define LCD__GetColorIndex()
Definition: GUI_Private.h:588
tLCDDEV_GetIndexMask * pfGetIndexMask
Definition: LCD.h:139
#define WRITE_MEM32P(p, Data)
#define U32
Definition: Global.h:50
if(LCD_Lock==DISABLE)
Definition: lcd_log.c:249
#define LCD_PIXELINDEX
union GUI_DEVICE::@32 u
void * pContext
Definition: GUI.h:179
#define NULL
Definition: usbd_def.h:53
U8 DrawMode
Definition: GUI.h:214
#define LCD_DRAWMODE_XOR
Definition: LCD.h:86
const LCD_API_COLOR_CONV * pColorConvAPI
Definition: GUI.h:185
#define OFF2PTR32(VRAMAddr, Off)
#define READ_MEM32(VRAMAddr, Off)
#define WRITE_MEM32(VRAMAddr, Off, Data)