this repository aim to make the official ST DISCO F746NG demo from STM32Cube_FW_F7_V1.2.0 working on mbed.
Dependencies: BSP_DISCO_F746NG_patch mbed-rtos mbed
patch/inc/GUIDRV_TemplateI_Private.h@0:c00e6c923941, 2015-11-02 (annotated)
- Committer:
- NirT
- Date:
- Mon Nov 02 23:38:08 2015 +0000
- Revision:
- 0:c00e6c923941
Error: Incomplete type is not allowed in "patch/LwIP/src/include/lwip/dhcp.h", Line: 83, Col: 4; ; and more like this.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
NirT | 0:c00e6c923941 | 1 | /********************************************************************* |
NirT | 0:c00e6c923941 | 2 | * SEGGER Microcontroller GmbH & Co. KG * |
NirT | 0:c00e6c923941 | 3 | * Solutions for real time microcontroller applications * |
NirT | 0:c00e6c923941 | 4 | ********************************************************************** |
NirT | 0:c00e6c923941 | 5 | * * |
NirT | 0:c00e6c923941 | 6 | * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG * |
NirT | 0:c00e6c923941 | 7 | * * |
NirT | 0:c00e6c923941 | 8 | * Internet: www.segger.com Support: support@segger.com * |
NirT | 0:c00e6c923941 | 9 | * * |
NirT | 0:c00e6c923941 | 10 | ********************************************************************** |
NirT | 0:c00e6c923941 | 11 | |
NirT | 0:c00e6c923941 | 12 | ** emWin V5.28 - Graphical user interface for embedded applications ** |
NirT | 0:c00e6c923941 | 13 | All Intellectual Property rights in the Software belongs to SEGGER. |
NirT | 0:c00e6c923941 | 14 | emWin is protected by international copyright laws. Knowledge of the |
NirT | 0:c00e6c923941 | 15 | source code may not be used to write a similar product. This file may |
NirT | 0:c00e6c923941 | 16 | only be used in accordance with the following terms: |
NirT | 0:c00e6c923941 | 17 | |
NirT | 0:c00e6c923941 | 18 | The software has been licensed to STMicroelectronics International |
NirT | 0:c00e6c923941 | 19 | N.V. a Dutch company with a Swiss branch and its headquarters in Plan- |
NirT | 0:c00e6c923941 | 20 | les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the |
NirT | 0:c00e6c923941 | 21 | purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_ |
NirT | 0:c00e6c923941 | 22 | troller products commercialized by Licensee only, sublicensed and dis_ |
NirT | 0:c00e6c923941 | 23 | tributed under the terms and conditions of the End User License Agree_ |
NirT | 0:c00e6c923941 | 24 | ment supplied by STMicroelectronics International N.V. |
NirT | 0:c00e6c923941 | 25 | Full source code is available at: www.segger.com |
NirT | 0:c00e6c923941 | 26 | |
NirT | 0:c00e6c923941 | 27 | We appreciate your understanding and fairness. |
NirT | 0:c00e6c923941 | 28 | ---------------------------------------------------------------------- |
NirT | 0:c00e6c923941 | 29 | File : GUIDRV_TemplateI_Private.h |
NirT | 0:c00e6c923941 | 30 | Purpose : Interface definition for GUIDRV_TemplateI driver |
NirT | 0:c00e6c923941 | 31 | ---------------------------END-OF-HEADER------------------------------ |
NirT | 0:c00e6c923941 | 32 | */ |
NirT | 0:c00e6c923941 | 33 | |
NirT | 0:c00e6c923941 | 34 | #include "GUIDRV_TemplateI.h" |
NirT | 0:c00e6c923941 | 35 | #include "GUIDRV_NoOpt_1_8.h" |
NirT | 0:c00e6c923941 | 36 | |
NirT | 0:c00e6c923941 | 37 | #ifndef GUIDRV_TEMPLATE_I_PRIVATE_H |
NirT | 0:c00e6c923941 | 38 | #define GUIDRV_TEMPLATE_I_PRIVATE_H |
NirT | 0:c00e6c923941 | 39 | |
NirT | 0:c00e6c923941 | 40 | /********************************************************************* |
NirT | 0:c00e6c923941 | 41 | * |
NirT | 0:c00e6c923941 | 42 | * Defines |
NirT | 0:c00e6c923941 | 43 | * |
NirT | 0:c00e6c923941 | 44 | ********************************************************************** |
NirT | 0:c00e6c923941 | 45 | */ |
NirT | 0:c00e6c923941 | 46 | #define PRIVATE_DEVFUNC_ONINITHOOK 0x1000 |
NirT | 0:c00e6c923941 | 47 | |
NirT | 0:c00e6c923941 | 48 | /********************************************************************* |
NirT | 0:c00e6c923941 | 49 | * |
NirT | 0:c00e6c923941 | 50 | * Types |
NirT | 0:c00e6c923941 | 51 | * |
NirT | 0:c00e6c923941 | 52 | ********************************************************************** |
NirT | 0:c00e6c923941 | 53 | */ |
NirT | 0:c00e6c923941 | 54 | typedef struct DRIVER_CONTEXT DRIVER_CONTEXT; |
NirT | 0:c00e6c923941 | 55 | |
NirT | 0:c00e6c923941 | 56 | typedef void (* T_ONINITHOOK)(DRIVER_CONTEXT * pContext); |
NirT | 0:c00e6c923941 | 57 | |
NirT | 0:c00e6c923941 | 58 | /********************************************************************* |
NirT | 0:c00e6c923941 | 59 | * |
NirT | 0:c00e6c923941 | 60 | * MANAGE_VMEM_API |
NirT | 0:c00e6c923941 | 61 | */ |
NirT | 0:c00e6c923941 | 62 | typedef struct { |
NirT | 0:c00e6c923941 | 63 | // |
NirT | 0:c00e6c923941 | 64 | // TBD: Add private function pointers... |
NirT | 0:c00e6c923941 | 65 | // |
NirT | 0:c00e6c923941 | 66 | int Dummy; |
NirT | 0:c00e6c923941 | 67 | } MANAGE_VMEM_API; |
NirT | 0:c00e6c923941 | 68 | |
NirT | 0:c00e6c923941 | 69 | /********************************************************************* |
NirT | 0:c00e6c923941 | 70 | * |
NirT | 0:c00e6c923941 | 71 | * DRIVER_CONTEXT |
NirT | 0:c00e6c923941 | 72 | */ |
NirT | 0:c00e6c923941 | 73 | struct DRIVER_CONTEXT { |
NirT | 0:c00e6c923941 | 74 | // |
NirT | 0:c00e6c923941 | 75 | // Common data |
NirT | 0:c00e6c923941 | 76 | // |
NirT | 0:c00e6c923941 | 77 | int xSize, ySize; |
NirT | 0:c00e6c923941 | 78 | int vxSize, vySize; |
NirT | 0:c00e6c923941 | 79 | // |
NirT | 0:c00e6c923941 | 80 | // Driver specific data |
NirT | 0:c00e6c923941 | 81 | // |
NirT | 0:c00e6c923941 | 82 | // |
NirT | 0:c00e6c923941 | 83 | // Accelerators for calculation |
NirT | 0:c00e6c923941 | 84 | // |
NirT | 0:c00e6c923941 | 85 | int BytesPerLine; |
NirT | 0:c00e6c923941 | 86 | int BitsPerPixel; |
NirT | 0:c00e6c923941 | 87 | // |
NirT | 0:c00e6c923941 | 88 | // VRAM |
NirT | 0:c00e6c923941 | 89 | // |
NirT | 0:c00e6c923941 | 90 | U8 * pVMEM; |
NirT | 0:c00e6c923941 | 91 | // |
NirT | 0:c00e6c923941 | 92 | // Pointer to driver internal initialization routine |
NirT | 0:c00e6c923941 | 93 | // |
NirT | 0:c00e6c923941 | 94 | void (* pfInit) (GUI_DEVICE * pDevice); |
NirT | 0:c00e6c923941 | 95 | void (* pfCheck)(GUI_DEVICE * pDevice); |
NirT | 0:c00e6c923941 | 96 | // |
NirT | 0:c00e6c923941 | 97 | // API-Tables |
NirT | 0:c00e6c923941 | 98 | // |
NirT | 0:c00e6c923941 | 99 | MANAGE_VMEM_API ManageVMEM_API; // Memory management |
NirT | 0:c00e6c923941 | 100 | GUI_PORT_API HW_API; // Hardware routines |
NirT | 0:c00e6c923941 | 101 | }; |
NirT | 0:c00e6c923941 | 102 | |
NirT | 0:c00e6c923941 | 103 | /********************************************************************* |
NirT | 0:c00e6c923941 | 104 | * |
NirT | 0:c00e6c923941 | 105 | * LOG2PHYS_xxx |
NirT | 0:c00e6c923941 | 106 | */ |
NirT | 0:c00e6c923941 | 107 | #define LOG2PHYS_X ( x ) |
NirT | 0:c00e6c923941 | 108 | #define LOG2PHYS_X_OX (pContext->xSize - x - 1) |
NirT | 0:c00e6c923941 | 109 | #define LOG2PHYS_X_OY ( x ) |
NirT | 0:c00e6c923941 | 110 | #define LOG2PHYS_X_OXY (pContext->xSize - x - 1) |
NirT | 0:c00e6c923941 | 111 | #define LOG2PHYS_X_OS ( y ) |
NirT | 0:c00e6c923941 | 112 | #define LOG2PHYS_X_OSX (pContext->ySize - y - 1) |
NirT | 0:c00e6c923941 | 113 | #define LOG2PHYS_X_OSY ( y ) |
NirT | 0:c00e6c923941 | 114 | #define LOG2PHYS_X_OSXY (pContext->ySize - y - 1) |
NirT | 0:c00e6c923941 | 115 | |
NirT | 0:c00e6c923941 | 116 | #define LOG2PHYS_Y ( y ) |
NirT | 0:c00e6c923941 | 117 | #define LOG2PHYS_Y_OX ( y ) |
NirT | 0:c00e6c923941 | 118 | #define LOG2PHYS_Y_OY (pContext->ySize - y - 1) |
NirT | 0:c00e6c923941 | 119 | #define LOG2PHYS_Y_OXY (pContext->ySize - y - 1) |
NirT | 0:c00e6c923941 | 120 | #define LOG2PHYS_Y_OS ( x ) |
NirT | 0:c00e6c923941 | 121 | #define LOG2PHYS_Y_OSX ( x ) |
NirT | 0:c00e6c923941 | 122 | #define LOG2PHYS_Y_OSY (pContext->xSize - x - 1) |
NirT | 0:c00e6c923941 | 123 | #define LOG2PHYS_Y_OSXY (pContext->xSize - x - 1) |
NirT | 0:c00e6c923941 | 124 | |
NirT | 0:c00e6c923941 | 125 | /********************************************************************* |
NirT | 0:c00e6c923941 | 126 | * |
NirT | 0:c00e6c923941 | 127 | * _SetPixelIndex_##EXT |
NirT | 0:c00e6c923941 | 128 | */ |
NirT | 0:c00e6c923941 | 129 | #define DEFINE_SETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \ |
NirT | 0:c00e6c923941 | 130 | static void _SetPixelIndex_##EXT(GUI_DEVICE * pDevice, int x, int y, int PixelIndex) { \ |
NirT | 0:c00e6c923941 | 131 | DRIVER_CONTEXT * pContext; \ |
NirT | 0:c00e6c923941 | 132 | \ |
NirT | 0:c00e6c923941 | 133 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; \ |
NirT | 0:c00e6c923941 | 134 | pContext->xSize = pContext->xSize; /* Keep compiler happy */ \ |
NirT | 0:c00e6c923941 | 135 | _SetPixelIndex(pDevice, X_PHYS, Y_PHYS, PixelIndex); \ |
NirT | 0:c00e6c923941 | 136 | } |
NirT | 0:c00e6c923941 | 137 | |
NirT | 0:c00e6c923941 | 138 | /********************************************************************* |
NirT | 0:c00e6c923941 | 139 | * |
NirT | 0:c00e6c923941 | 140 | * _GetPixelIndex_##EXT |
NirT | 0:c00e6c923941 | 141 | */ |
NirT | 0:c00e6c923941 | 142 | #define DEFINE_GETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \ |
NirT | 0:c00e6c923941 | 143 | static unsigned int _GetPixelIndex_##EXT(GUI_DEVICE * pDevice, int x, int y) { \ |
NirT | 0:c00e6c923941 | 144 | LCD_PIXELINDEX PixelIndex; \ |
NirT | 0:c00e6c923941 | 145 | DRIVER_CONTEXT * pContext; \ |
NirT | 0:c00e6c923941 | 146 | \ |
NirT | 0:c00e6c923941 | 147 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; \ |
NirT | 0:c00e6c923941 | 148 | pContext->xSize = pContext->xSize; /* Keep compiler happy */ \ |
NirT | 0:c00e6c923941 | 149 | PixelIndex = _GetPixelIndex(pDevice, X_PHYS, Y_PHYS); \ |
NirT | 0:c00e6c923941 | 150 | return PixelIndex; \ |
NirT | 0:c00e6c923941 | 151 | } |
NirT | 0:c00e6c923941 | 152 | |
NirT | 0:c00e6c923941 | 153 | /********************************************************************* |
NirT | 0:c00e6c923941 | 154 | * |
NirT | 0:c00e6c923941 | 155 | * _GetDevProp_##EXT |
NirT | 0:c00e6c923941 | 156 | */ |
NirT | 0:c00e6c923941 | 157 | #define DEFINE_GETDEVPROP(EXT, MX, MY, SWAP) \ |
NirT | 0:c00e6c923941 | 158 | static I32 _GetDevProp_##EXT(GUI_DEVICE * pDevice, int Index) { \ |
NirT | 0:c00e6c923941 | 159 | switch (Index) { \ |
NirT | 0:c00e6c923941 | 160 | case LCD_DEVCAP_MIRROR_X: return MX; \ |
NirT | 0:c00e6c923941 | 161 | case LCD_DEVCAP_MIRROR_Y: return MY; \ |
NirT | 0:c00e6c923941 | 162 | case LCD_DEVCAP_SWAP_XY: return SWAP; \ |
NirT | 0:c00e6c923941 | 163 | } \ |
NirT | 0:c00e6c923941 | 164 | return _GetDevProp(pDevice, Index); \ |
NirT | 0:c00e6c923941 | 165 | } |
NirT | 0:c00e6c923941 | 166 | |
NirT | 0:c00e6c923941 | 167 | /********************************************************************* |
NirT | 0:c00e6c923941 | 168 | * |
NirT | 0:c00e6c923941 | 169 | * DEFINE_FUNCTIONS |
NirT | 0:c00e6c923941 | 170 | */ |
NirT | 0:c00e6c923941 | 171 | #define DEFINE_FUNCTIONS(EXT, X_PHYS, Y_PHYS, MX, MY, SWAP) \ |
NirT | 0:c00e6c923941 | 172 | DEFINE_SETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \ |
NirT | 0:c00e6c923941 | 173 | DEFINE_GETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \ |
NirT | 0:c00e6c923941 | 174 | DEFINE_GETDEVPROP(EXT, MX, MY, SWAP) \ |
NirT | 0:c00e6c923941 | 175 | DEFINE_GUI_DEVICE_API(EXT) |
NirT | 0:c00e6c923941 | 176 | |
NirT | 0:c00e6c923941 | 177 | |
NirT | 0:c00e6c923941 | 178 | /********************************************************************* |
NirT | 0:c00e6c923941 | 179 | * |
NirT | 0:c00e6c923941 | 180 | * Private functions |
NirT | 0:c00e6c923941 | 181 | * |
NirT | 0:c00e6c923941 | 182 | ********************************************************************** |
NirT | 0:c00e6c923941 | 183 | */ |
NirT | 0:c00e6c923941 | 184 | void (*GUIDRV__TemplateI_GetDevFunc(GUI_DEVICE ** ppDevice, int Index))(void); |
NirT | 0:c00e6c923941 | 185 | void GUIDRV__TemplateI_SetOrg (GUI_DEVICE * pDevice, int x, int y); |
NirT | 0:c00e6c923941 | 186 | I32 GUIDRV__TemplateI_GetDevProp(GUI_DEVICE * pDevice, int Index); |
NirT | 0:c00e6c923941 | 187 | void GUIDRV__TemplateI_GetRect (GUI_DEVICE * pDevice, LCD_RECT * pRect); |
NirT | 0:c00e6c923941 | 188 | |
NirT | 0:c00e6c923941 | 189 | #endif |
NirT | 0:c00e6c923941 | 190 | |
NirT | 0:c00e6c923941 | 191 | /*************************** End of file ****************************/ |