Headers for emWin lib

Dependents:   DISCO-F746NG_rtos_test

Committer:
redbird
Date:
Sat Mar 26 22:49:50 2016 +0000
Revision:
0:1bf8f02b0770
new code integration

Who changed what in which revision?

UserRevisionLine numberNew contents of line
redbird 0:1bf8f02b0770 1 /*********************************************************************
redbird 0:1bf8f02b0770 2 * SEGGER Microcontroller GmbH & Co. KG *
redbird 0:1bf8f02b0770 3 * Solutions for real time microcontroller applications *
redbird 0:1bf8f02b0770 4 **********************************************************************
redbird 0:1bf8f02b0770 5 * *
redbird 0:1bf8f02b0770 6 * (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG *
redbird 0:1bf8f02b0770 7 * *
redbird 0:1bf8f02b0770 8 * Internet: www.segger.com Support: support@segger.com *
redbird 0:1bf8f02b0770 9 * *
redbird 0:1bf8f02b0770 10 **********************************************************************
redbird 0:1bf8f02b0770 11
redbird 0:1bf8f02b0770 12 ** emWin V5.24 - Graphical user interface for embedded applications **
redbird 0:1bf8f02b0770 13 All Intellectual Property rights in the Software belongs to SEGGER.
redbird 0:1bf8f02b0770 14 emWin is protected by international copyright laws. Knowledge of the
redbird 0:1bf8f02b0770 15 source code may not be used to write a similar product. This file may
redbird 0:1bf8f02b0770 16 only be used in accordance with the following terms:
redbird 0:1bf8f02b0770 17
redbird 0:1bf8f02b0770 18 The software has been licensed to NXP Semiconductors USA, Inc. whose
redbird 0:1bf8f02b0770 19 registered office is situated at 411 E. Plumeria Drive, San Jose,
redbird 0:1bf8f02b0770 20 CA 95134, USA solely for the purposes of creating libraries for
redbird 0:1bf8f02b0770 21 NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and
redbird 0:1bf8f02b0770 22 distributed under the terms and conditions of the NXP End User License
redbird 0:1bf8f02b0770 23 Agreement.
redbird 0:1bf8f02b0770 24 Full source code is available at: www.segger.com
redbird 0:1bf8f02b0770 25
redbird 0:1bf8f02b0770 26 We appreciate your understanding and fairness.
redbird 0:1bf8f02b0770 27 ----------------------------------------------------------------------
redbird 0:1bf8f02b0770 28 File : GUIDRV_Lin_Opt_32.h
redbird 0:1bf8f02b0770 29 Purpose : Optimized routines, included by GUIDRV_Lin_..._32.c
redbird 0:1bf8f02b0770 30 ---------------------------END-OF-HEADER------------------------------
redbird 0:1bf8f02b0770 31 */
redbird 0:1bf8f02b0770 32
redbird 0:1bf8f02b0770 33 /*********************************************************************
redbird 0:1bf8f02b0770 34 *
redbird 0:1bf8f02b0770 35 * Static functions
redbird 0:1bf8f02b0770 36 *
redbird 0:1bf8f02b0770 37 **********************************************************************
redbird 0:1bf8f02b0770 38 */
redbird 0:1bf8f02b0770 39
redbird 0:1bf8f02b0770 40 #ifdef __cplusplus
redbird 0:1bf8f02b0770 41 extern "C" {
redbird 0:1bf8f02b0770 42 #endif
redbird 0:1bf8f02b0770 43
redbird 0:1bf8f02b0770 44 /*********************************************************************
redbird 0:1bf8f02b0770 45 *
redbird 0:1bf8f02b0770 46 * _FillRectOpt32
redbird 0:1bf8f02b0770 47 *
redbird 0:1bf8f02b0770 48 * Purpose:
redbird 0:1bf8f02b0770 49 * Optimized filling routine for 32 bpp
redbird 0:1bf8f02b0770 50 */
redbird 0:1bf8f02b0770 51 static void _FillRectOpt32(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) {
redbird 0:1bf8f02b0770 52 DRIVER_CONTEXT * pContext;
redbird 0:1bf8f02b0770 53 register LCD_PIXELINDEX ColorIndex;
redbird 0:1bf8f02b0770 54 U32 * pDest;
redbird 0:1bf8f02b0770 55 U32 * pDest0;
redbird 0:1bf8f02b0770 56 U32 Off, Off0, RemPixels, NumLines, RemLines, OffLine, RemItems;
redbird 0:1bf8f02b0770 57 LCD_PIXELINDEX IndexMask;
redbird 0:1bf8f02b0770 58
redbird 0:1bf8f02b0770 59 pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
redbird 0:1bf8f02b0770 60 RemPixels = x1 - x0 + 1;
redbird 0:1bf8f02b0770 61 NumLines = y1 - y0 + 1;
redbird 0:1bf8f02b0770 62 OffLine = pContext->vxSizePhys;
redbird 0:1bf8f02b0770 63 pDest = NULL;
redbird 0:1bf8f02b0770 64 if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) {
redbird 0:1bf8f02b0770 65 IndexMask = pDevice->pColorConvAPI->pfGetIndexMask();
redbird 0:1bf8f02b0770 66 Off0 = XY2OFF32(pContext->vxSizePhys, x0, y0);
redbird 0:1bf8f02b0770 67 if (RemPixels) {
redbird 0:1bf8f02b0770 68 for (RemLines = NumLines; RemLines; RemLines--) {
redbird 0:1bf8f02b0770 69 RemItems = RemPixels;
redbird 0:1bf8f02b0770 70 Off = Off0 + OffLine * (RemLines - 1);
redbird 0:1bf8f02b0770 71 do {
redbird 0:1bf8f02b0770 72 ColorIndex = READ_MEM32(pContext->VRAMAddr, Off);
redbird 0:1bf8f02b0770 73 ColorIndex ^= IndexMask;
redbird 0:1bf8f02b0770 74 WRITE_MEM32(pContext->VRAMAddr, Off, ColorIndex);
redbird 0:1bf8f02b0770 75 Off++;
redbird 0:1bf8f02b0770 76 } while (--RemItems);
redbird 0:1bf8f02b0770 77 }
redbird 0:1bf8f02b0770 78 }
redbird 0:1bf8f02b0770 79 } else {
redbird 0:1bf8f02b0770 80 Off = XY2OFF32(pContext->vxSizePhys, x0, y0);
redbird 0:1bf8f02b0770 81 pDest0 = OFF2PTR32(pContext->VRAMAddr, Off);
redbird 0:1bf8f02b0770 82 ColorIndex = LCD__GetColorIndex();
redbird 0:1bf8f02b0770 83 if (RemPixels >= 16) {
redbird 0:1bf8f02b0770 84 for (RemLines = NumLines; RemLines; RemLines--) {
redbird 0:1bf8f02b0770 85 RemItems = RemPixels;
redbird 0:1bf8f02b0770 86 pDest = pDest0 + OffLine * (RemLines - 1);
redbird 0:1bf8f02b0770 87 do {
redbird 0:1bf8f02b0770 88 WRITE_MEM32P(pDest , ColorIndex);
redbird 0:1bf8f02b0770 89 WRITE_MEM32P(pDest + 1, ColorIndex);
redbird 0:1bf8f02b0770 90 WRITE_MEM32P(pDest + 2, ColorIndex);
redbird 0:1bf8f02b0770 91 WRITE_MEM32P(pDest + 3, ColorIndex);
redbird 0:1bf8f02b0770 92 WRITE_MEM32P(pDest + 4, ColorIndex);
redbird 0:1bf8f02b0770 93 WRITE_MEM32P(pDest + 5, ColorIndex);
redbird 0:1bf8f02b0770 94 WRITE_MEM32P(pDest + 6, ColorIndex);
redbird 0:1bf8f02b0770 95 WRITE_MEM32P(pDest + 7, ColorIndex);
redbird 0:1bf8f02b0770 96 WRITE_MEM32P(pDest + 8, ColorIndex);
redbird 0:1bf8f02b0770 97 WRITE_MEM32P(pDest + 9, ColorIndex);
redbird 0:1bf8f02b0770 98 WRITE_MEM32P(pDest + 10, ColorIndex);
redbird 0:1bf8f02b0770 99 WRITE_MEM32P(pDest + 11, ColorIndex);
redbird 0:1bf8f02b0770 100 WRITE_MEM32P(pDest + 12, ColorIndex);
redbird 0:1bf8f02b0770 101 WRITE_MEM32P(pDest + 13, ColorIndex);
redbird 0:1bf8f02b0770 102 WRITE_MEM32P(pDest + 14, ColorIndex);
redbird 0:1bf8f02b0770 103 WRITE_MEM32P(pDest + 15, ColorIndex);
redbird 0:1bf8f02b0770 104 pDest += 16;
redbird 0:1bf8f02b0770 105 RemItems -= 16;
redbird 0:1bf8f02b0770 106 } while (RemItems >= 16);
redbird 0:1bf8f02b0770 107 }
redbird 0:1bf8f02b0770 108 pDest0 = pDest;
redbird 0:1bf8f02b0770 109 RemPixels -= (RemPixels >> 4) << 4;
redbird 0:1bf8f02b0770 110 }
redbird 0:1bf8f02b0770 111 if (RemPixels) {
redbird 0:1bf8f02b0770 112 for (RemLines = NumLines; RemLines; RemLines--) {
redbird 0:1bf8f02b0770 113 RemItems = RemPixels;
redbird 0:1bf8f02b0770 114 pDest = pDest0 + OffLine * (RemLines - 1);
redbird 0:1bf8f02b0770 115 do {
redbird 0:1bf8f02b0770 116 WRITE_MEM32P(pDest, ColorIndex);
redbird 0:1bf8f02b0770 117 pDest++;
redbird 0:1bf8f02b0770 118 } while (--RemItems);
redbird 0:1bf8f02b0770 119 }
redbird 0:1bf8f02b0770 120 }
redbird 0:1bf8f02b0770 121 }
redbird 0:1bf8f02b0770 122 }
redbird 0:1bf8f02b0770 123
redbird 0:1bf8f02b0770 124 #ifdef __cplusplus
redbird 0:1bf8f02b0770 125 }
redbird 0:1bf8f02b0770 126 #endif
redbird 0:1bf8f02b0770 127 /*************************** End of file ****************************/