STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
GUIDRV_TemplateI_Private.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_TemplateI_Private.h
30 Purpose : Interface definition for GUIDRV_TemplateI driver
31 ---------------------------END-OF-HEADER------------------------------
32 */
33 
34 #include "GUIDRV_TemplateI.h"
35 #include "GUIDRV_NoOpt_1_8.h"
36 
37 #ifndef GUIDRV_TEMPLATE_I_PRIVATE_H
38 #define GUIDRV_TEMPLATE_I_PRIVATE_H
39 
40 /*********************************************************************
41 *
42 * Defines
43 *
44 **********************************************************************
45 */
46 #define PRIVATE_DEVFUNC_ONINITHOOK 0x1000
47 
48 /*********************************************************************
49 *
50 * Types
51 *
52 **********************************************************************
53 */
55 
56 typedef void (* T_ONINITHOOK)(DRIVER_CONTEXT * pContext);
57 
58 /*********************************************************************
59 *
60 * MANAGE_VMEM_API
61 */
62 typedef struct {
63  //
64  // TBD: Add private function pointers...
65  //
66  int Dummy;
68 
69 /*********************************************************************
70 *
71 * DRIVER_CONTEXT
72 */
73 struct DRIVER_CONTEXT {
74  //
75  // Common data
76  //
77  int xSize, ySize;
78  int vxSize, vySize;
79  //
80  // Driver specific data
81  //
82  //
83  // Accelerators for calculation
84  //
85  int BytesPerLine;
86  int BitsPerPixel;
87  //
88  // VRAM
89  //
90  U8 * pVMEM;
91  //
92  // Pointer to driver internal initialization routine
93  //
94  void (* pfInit) (GUI_DEVICE * pDevice);
95  void (* pfCheck)(GUI_DEVICE * pDevice);
96  //
97  // API-Tables
98  //
99  MANAGE_VMEM_API ManageVMEM_API; // Memory management
100  GUI_PORT_API HW_API; // Hardware routines
101 };
102 
103 /*********************************************************************
104 *
105 * LOG2PHYS_xxx
106 */
107 #define LOG2PHYS_X ( x )
108 #define LOG2PHYS_X_OX (pContext->xSize - x - 1)
109 #define LOG2PHYS_X_OY ( x )
110 #define LOG2PHYS_X_OXY (pContext->xSize - x - 1)
111 #define LOG2PHYS_X_OS ( y )
112 #define LOG2PHYS_X_OSX (pContext->ySize - y - 1)
113 #define LOG2PHYS_X_OSY ( y )
114 #define LOG2PHYS_X_OSXY (pContext->ySize - y - 1)
115 
116 #define LOG2PHYS_Y ( y )
117 #define LOG2PHYS_Y_OX ( y )
118 #define LOG2PHYS_Y_OY (pContext->ySize - y - 1)
119 #define LOG2PHYS_Y_OXY (pContext->ySize - y - 1)
120 #define LOG2PHYS_Y_OS ( x )
121 #define LOG2PHYS_Y_OSX ( x )
122 #define LOG2PHYS_Y_OSY (pContext->xSize - x - 1)
123 #define LOG2PHYS_Y_OSXY (pContext->xSize - x - 1)
124 
125 /*********************************************************************
126 *
127 * _SetPixelIndex_##EXT
128 */
129 #define DEFINE_SETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \
130 static void _SetPixelIndex_##EXT(GUI_DEVICE * pDevice, int x, int y, int PixelIndex) { \
131  DRIVER_CONTEXT * pContext; \
132  \
133  pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; \
134  pContext->xSize = pContext->xSize; /* Keep compiler happy */ \
135  _SetPixelIndex(pDevice, X_PHYS, Y_PHYS, PixelIndex); \
136 }
137 
138 /*********************************************************************
139 *
140 * _GetPixelIndex_##EXT
141 */
142 #define DEFINE_GETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \
143 static unsigned int _GetPixelIndex_##EXT(GUI_DEVICE * pDevice, int x, int y) { \
144  LCD_PIXELINDEX PixelIndex; \
145  DRIVER_CONTEXT * pContext; \
146  \
147  pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; \
148  pContext->xSize = pContext->xSize; /* Keep compiler happy */ \
149  PixelIndex = _GetPixelIndex(pDevice, X_PHYS, Y_PHYS); \
150  return PixelIndex; \
151 }
152 
153 /*********************************************************************
154 *
155 * _GetDevProp_##EXT
156 */
157 #define DEFINE_GETDEVPROP(EXT, MX, MY, SWAP) \
158 static I32 _GetDevProp_##EXT(GUI_DEVICE * pDevice, int Index) { \
159  switch (Index) { \
160  case LCD_DEVCAP_MIRROR_X: return MX; \
161  case LCD_DEVCAP_MIRROR_Y: return MY; \
162  case LCD_DEVCAP_SWAP_XY: return SWAP; \
163  } \
164  return _GetDevProp(pDevice, Index); \
165 }
166 
167 /*********************************************************************
168 *
169 * DEFINE_FUNCTIONS
170 */
171 #define DEFINE_FUNCTIONS(EXT, X_PHYS, Y_PHYS, MX, MY, SWAP) \
172  DEFINE_SETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \
173  DEFINE_GETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \
174  DEFINE_GETDEVPROP(EXT, MX, MY, SWAP) \
175  DEFINE_GUI_DEVICE_API(EXT)
176 
177 
178 /*********************************************************************
179 *
180 * Private functions
181 *
182 **********************************************************************
183 */
184 void (*GUIDRV__TemplateI_GetDevFunc(GUI_DEVICE ** ppDevice, int Index))(void);
185 void GUIDRV__TemplateI_SetOrg (GUI_DEVICE * pDevice, int x, int y);
188 
189 #endif
190 
191 /*************************** End of file ****************************/
void GUIDRV__TemplateI_SetOrg(GUI_DEVICE *pDevice, int x, int y)
Definition: LCD.h:102
void(* T_ONINITHOOK)(DRIVER_CONTEXT *pContext)
I32 GUIDRV__TemplateI_GetDevProp(GUI_DEVICE *pDevice, int Index)
void(*)(void) GUIDRV__TemplateI_GetDevFunc(GUI_DEVICE **ppDevice, int Index)
MANAGE_VMEM_API ManageVMEM_API
void GUIDRV__TemplateI_GetRect(GUI_DEVICE *pDevice, LCD_RECT *pRect)
void(* pfInit)(GUI_DEVICE *pDevice)
#define I32
Definition: Global.h:59
void(* pfCheck)(GUI_DEVICE *pDevice)
#define U8
Definition: Global.h:44