eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d_lldapi.h
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * Copyright 2014 by Petr Gargulak. eGUI Community.
4 * Copyright 2009-2013 by Petr Gargulak. Freescale Semiconductor, Inc.
5 *
6 ***************************************************************************
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License Version 3
9 * or later (the "LGPL").
10 *
11 * As a special exception, the copyright holders of the eGUI project give you
12 * permission to link the eGUI sources with independent modules to produce an
13 * executable, regardless of the license terms of these independent modules,
14 * and to copy and distribute the resulting executable under terms of your
15 * choice, provided that you also meet, for each linked independent module,
16 * the terms and conditions of the license of that module.
17 * An independent module is a module which is not derived from or based
18 * on this library.
19 * If you modify the eGUI sources, you may extend this exception
20 * to your version of the eGUI sources, but you are not obligated
21 * to do so. If you do not wish to do so, delete this
22 * exception statement from your version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 *
28 * You should have received a copy of the GNU General Public License
29 * and the GNU Lesser General Public License along with this program.
30 * If not, see <http://www.gnu.org/licenses/>.
31 *
32 ***************************************************************************/
46 #ifndef __D4D_LLD_API_H
47 #define __D4D_LLD_API_H
48 
49 
50 /******************************************************************************
51 * Includes
52 ******************************************************************************/
53 #include "d4d_user_cfg.h"
54 #include "common_files/d4d_types.h"
55 
56 /******************************************************************************
57 * D4D LLD API types
58 *
59 */
64 typedef enum
65 {
71 
73 typedef enum
74 {
85 
87 typedef enum
88 {
94 
96 typedef enum
97 {
102 
106 {
107  unsigned short rawDataScale;
108  unsigned short touchMinX;
109  unsigned short touchMinY;
110  unsigned short touchOffMaxX;
111  unsigned short touchOffMaxY;
113 
118 {
119  unsigned long fb_start_addr;
120  unsigned short lcd_x_max;
121  unsigned short lcd_y_max;
122  unsigned char bpp_byte;
124 
128 typedef struct
129 {
134 
136 typedef enum
137 {
143 
147 typedef struct D4DLCD_FUNCTIONS_S
148 {
149  unsigned char (*D4DLCD_Init)(void);
150  unsigned char (*D4DLCD_SetWindow)(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2);
151  unsigned char (*D4DLCD_SetOrientation)(D4DLCD_ORIENTATION new_orientation);
155  void (*D4DLCD_Delay_ms)(unsigned short period);
156  unsigned char (*D4DLCD_DeInit)(void);
158 
159 
163 typedef struct D4DLCDHW_FUNCTIONS_S
164 {
165  unsigned char (*D4DLCDHW_Init)(void);
166  void (*D4DLCDHW_SendDataWord)(Word value);
167  void (*D4DLCDHW_SendCmdWord)(Word cmd);
170  unsigned char (*D4DLCDHW_PinCtl)(D4DLCDHW_PINS pinId, D4DHW_PIN_STATE setState);
172  unsigned char (*D4DLCDHW_DeInit)(void);
174 
175 
180 {
181  unsigned char (*D4DLCDHW_Init)(void);
182  void (*D4DLCDHW_WriteData)(unsigned long addr, D4D_COLOR value);
183  D4D_COLOR (*D4DLCDHW_ReadData)(unsigned long addr);
184  D4DLCD_FRAMEBUFF_DESC* (*D4DLCDHW_GetFbDescriptor)(void);
185  unsigned char (*D4DLCDHW_PinCtl)(D4DLCDHW_PINS pinId, D4DHW_PIN_STATE setState);
187  unsigned char (*D4DLCDHW_DeInit)(void);
189 
190 
191 
195 typedef struct D4DTCH_FUNCTIONS_S
196 {
197  unsigned char (*D4DTCH_Init)(void);
198  unsigned char (*D4DTCH_GetPositionRaw)(unsigned short *TouchPositionX, unsigned short *TouchPositionY);
199  D4D_TOUCHSCREEN_LIMITS* (*D4DTCH_GetRawLimits)(void);
200  unsigned char (*D4DTCH_DeInit)(void);
202 
203 
207 typedef struct D4DTCHHW_FUNCTIONS_S
208 {
209  unsigned char (*D4DTCHHW_Init)(void);
210  unsigned short (*D4DTCHHW_ReadTouchAxis)(D4DTCHHW_PINS pinId);
211  D4D_TOUCHSCREEN_LIMITS* (*D4DTCHHW_GetRawLimits)(void);
212  unsigned char (*D4DTCHHW_PinCtl)(D4DTCHHW_PINS pinId, D4DHW_PIN_STATE setState);
213  unsigned char (*D4DTCHHW_DeInit)(void);
215 
219 typedef struct D4DMOUSE_FUNCTIONS_S
220 {
221  unsigned char (*D4DMOUSE_Init)(void);
222  void (*D4DMOUSE_SetCoor)(unsigned short x, unsigned short y);
223  void (*D4DMOUSE_SetPointerBmp)(void** pPntrData, D4D_INDEX cnt, D4D_COLOR keyColor);
225  D4DMOUSE_DESC* (*D4DMOUSE_GetDescriptor)(void);
226  unsigned char (*D4DMOUSE_DeInit)(void);
228 
231 // Include the right low level driver for LCD/TFT
232 
233 #ifndef D4D_LLD_LCD
234  #error "You must #define symbol D4D_LLD_LCD in d4d_user_cfg.h header file"
235 #endif
236 
237 extern const D4DLCD_FUNCTIONS D4D_LLD_LCD;
238 
239 #ifdef D4D_LLD_TCH
240  extern const D4DTCH_FUNCTIONS D4D_LLD_TCH;
241 #endif
242 
243 #ifdef D4D_LLD_TCH_HW
244  extern const D4DTCHHW_FUNCTIONS D4D_LLD_TCH_HW;
245 #endif
246 
247 #ifdef D4D_LLD_MOUSE
248  extern const D4DMOUSE_FUNCTIONS D4D_LLD_MOUSE;
249 #endif
250 
251 
252 #endif /* __D4D_LLD_API_H */
253 
254 
255 
256 
257 
258 
259 
260 
261 
262 
#define D4D_LLD_TCH
Definition: d4d_types.h:79
void(* D4DMOUSE_SetPointer)(D4D_INDEX cnt, D4D_BOOL show)
The mouse pointer interface driver set cursor index and also visibility function. ...
Definition: d4d_lldapi.h:224
Switch on the pin for read by ADC.
Definition: d4d_lldapi.h:82
unsigned char(* D4DTCH_GetPositionRaw)(unsigned short *TouchPositionX, unsigned short *TouchPositionY)
The touch screen driver get raw data function.
Definition: d4d_lldapi.h:198
void(* D4DLCDHW_SendDataWord)(Word value)
The LCD HW interface driver send data word function.
Definition: d4d_lldapi.h:166
void(* D4DMOUSE_SetPointerBmp)(void **pPntrData, D4D_INDEX cnt, D4D_COLOR keyColor)
The mouse pointer interface driver set pointer to mouse cursors bitmaps function. ...
Definition: d4d_lldapi.h:223
D4D low level standard LCD interface API structure.
Definition: d4d_lldapi.h:147
unsigned char(* D4DTCH_DeInit)(void)
The touch screen driver deinitialization function.
Definition: d4d_lldapi.h:200
#define D4D_LLD_MOUSE
Definition: d4d_types.h:85
D4D low level standard LCD Hardware interface API structure.
Definition: d4d_lldapi.h:163
D4D_COLOR(* D4DLCD_Read_PixelColor)(void)
The LCD driver read pixel function. The pixels will be read on position (automaticaly incremented) se...
Definition: d4d_lldapi.h:153
struct D4DMOUSE_FUNCTIONS_S D4DMOUSE_FUNCTIONS
D4D low level mouse pointer interface API structure.
void(* D4DLCD_FlushBuffer)(D4DLCD_FLUSH_MODE mode)
The LCD driver flush function.
Definition: d4d_lldapi.h:154
The notification that the end of screen is draw.
Definition: d4d_lldapi.h:140
unsigned short(* D4DTCHHW_ReadTouchAxis)(D4DTCHHW_PINS pinId)
The touch screen hardware interface driver read one axis function.
Definition: d4d_lldapi.h:210
Analog touch screen X- signal.
Definition: d4d_lldapi.h:90
unsigned short touchOffMaxX
Maximal valid raw value of axis X.
Definition: d4d_lldapi.h:110
unsigned char(* D4DTCHHW_PinCtl)(D4DTCHHW_PINS pinId, D4DHW_PIN_STATE setState)
The touch screen hardware interface driver control HW pins function.
Definition: d4d_lldapi.h:212
LWord bmpFormat
The bitmap format of mouse pointer (corresponded to main eGUI internal bitmap types) ...
Definition: d4d_lldapi.h:132
The flush after one basic element is draw.
Definition: d4d_lldapi.h:138
D4DTCHHW_PINS
D4D low level MCU types definition for analog resistive touch screen signals.
Definition: d4d_lldapi.h:87
D4D low level touch screen interface API structure.
Definition: d4d_lldapi.h:195
Landscape up side down orientation.
Definition: d4d_types.h:346
unsigned char(* D4DLCD_DeInit)(void)
The LCD driver deinicialization function.
Definition: d4d_lldapi.h:156
Orientation LandScape up side down.
Definition: d4d_lldapi.h:69
D4D low level mouse pointer interface API structure.
Definition: d4d_lldapi.h:219
unsigned char(* D4DTCHHW_Init)(void)
The touch screen hardware interface driver initialization function.
Definition: d4d_lldapi.h:209
unsigned short lcd_x_max
The resolution of LCD in axis X.
Definition: d4d_lldapi.h:120
LCD device chip select signal.
Definition: d4d_lldapi.h:100
unsigned short touchMinX
Minimal valid raw value of axis X.
Definition: d4d_lldapi.h:108
D4D_COOR size_y
The size of omuse pointer in axis Y.
Definition: d4d_lldapi.h:131
Get the pin input value.
Definition: d4d_lldapi.h:81
unsigned char(* D4DMOUSE_DeInit)(void)
The mouse pointer interface driver deinitialization function.
Definition: d4d_lldapi.h:226
D4DHW_PIN_STATE
D4D low level MCU pin state enumeration type.
Definition: d4d_lldapi.h:73
Orientation LandScape.
Definition: d4d_lldapi.h:68
D4DLCD_FLUSH_MODE
D4D low level eGUI flush screen types enumeration.
Definition: d4d_lldapi.h:136
D4DLCDHW_PINS
D4D low level MCU types definition for general LCD screen control signals.
Definition: d4d_lldapi.h:96
Orientation Portrait up side down.
Definition: d4d_lldapi.h:67
struct D4DLCDHWFB_FUNCTIONS_S D4DLCDHWFB_FUNCTIONS
D4D low level frame buffer LCD interface API structure.
D4D low level frame buffer LCD interface API structure.
Definition: d4d_lldapi.h:179
Word(* D4DLCDHW_ReadCmdWord)(void)
The LCD HW interface driver read command word function.
Definition: d4d_lldapi.h:169
unsigned char(* D4DTCHHW_DeInit)(void)
The touch screen hardware interface driver deinitialization function.
Definition: d4d_lldapi.h:213
Portrait up side down orientation.
Definition: d4d_types.h:344
D4DLCD_ORIENTATION
D4D low level screen orientation enumeration type.
Definition: d4d_lldapi.h:64
Byte D4D_COOR
Type definition of eGUI coordination variables.
Definition: d4d_types.h:219
#define D4D_LLD_TCH_HW
Definition: d4d_types.h:82
D4D Driver global types header file.
unsigned short touchMinY
Minimal valid raw value of axis Y.
Definition: d4d_lldapi.h:109
Switch pin to input mode (equivalent to high-Z)
Definition: d4d_lldapi.h:78
D4D_COOR size_x
The size of omuse pointer in axis X.
Definition: d4d_lldapi.h:130
D4D low level touch screen limitation structure.
Definition: d4d_lldapi.h:105
unsigned char(* D4DLCDHW_PinCtl)(D4DLCDHW_PINS pinId, D4DHW_PIN_STATE setState)
The LCD HW interface driver control HW pins function.
Definition: d4d_lldapi.h:170
Switch pin to output mode.
Definition: d4d_lldapi.h:77
D4D low level frame buffer description structure.
Definition: d4d_lldapi.h:117
void(* D4DMOUSE_SetCoor)(unsigned short x, unsigned short y)
The mouse pointer interface driver set current coordination function.
Definition: d4d_lldapi.h:222
Landscape orientation.
Definition: d4d_types.h:345
unsigned char(* D4DLCDHW_Init)(void)
The LCD HW interface driver initialization function.
Definition: d4d_lldapi.h:165
Set pin output register to logic 1.
Definition: d4d_lldapi.h:80
Switch off the pin for read by ADC.
Definition: d4d_lldapi.h:83
void(* D4DLCDHW_WriteData)(unsigned long addr, D4D_COLOR value)
The frame buffer LCD driver write data to buffer function.
Definition: d4d_lldapi.h:182
unsigned long LWord
Type definition of LWord (unsigned 32-bit).
Definition: d4d_types.h:167
D4D_COLOR(* D4DLCDHW_ReadData)(unsigned long addr)
The frame buffer LCD driver read data from buffer function.
Definition: d4d_lldapi.h:183
unsigned short lcd_y_max
The resolution of LCD in axis Y.
Definition: d4d_lldapi.h:121
Switch on Pull Up resistor on pin.
Definition: d4d_lldapi.h:75
struct D4D_TOUCHSCREEN_LIMITS_S D4D_TOUCHSCREEN_LIMITS
D4D low level touch screen limitation structure.
LCD device backlight enable signal.
Definition: d4d_lldapi.h:99
unsigned short rawDataScale
The scale mask of ADC convertor.
Definition: d4d_lldapi.h:107
LWord D4D_INDEX
Type definition of eGUI general index variables.
Definition: d4d_types.h:206
unsigned char bpp_byte
The bytes per pixel.
Definition: d4d_lldapi.h:122
Analog touch screen X+ signal.
Definition: d4d_lldapi.h:89
void(* D4DLCDHW_SendCmdWord)(Word cmd)
The LCD HW interface driver send command word function.
Definition: d4d_lldapi.h:167
unsigned char(* D4DTCH_Init)(void)
The touch screen driver initialization function.
Definition: d4d_lldapi.h:197
unsigned char(* D4DLCD_SetOrientation)(D4DLCD_ORIENTATION new_orientation)
The LCD driver set orientation function.
Definition: d4d_lldapi.h:151
const D4DLCD_FUNCTIONS D4D_LLD_LCD
LWord D4D_BOOL
Type definition of eGUI boolean.
Definition: d4d_types.h:204
The notification that the start of screen is done.
Definition: d4d_lldapi.h:139
struct D4DLCD_FRAMEBUFF_DESC_S D4DLCD_FRAMEBUFF_DESC
D4D low level frame buffer description structure.
Set pin output register to logic 0.
Definition: d4d_lldapi.h:79
struct D4DLCDHW_FUNCTIONS_S D4DLCDHW_FUNCTIONS
D4D low level standard LCD Hardware interface API structure.
unsigned long fb_start_addr
The address of frame buffer.
Definition: d4d_lldapi.h:119
Portrait orientation.
Definition: d4d_types.h:343
unsigned char(* D4DMOUSE_Init)(void)
The mouse pointer interface driver initialization function.
Definition: d4d_lldapi.h:221
struct D4DTCHHW_FUNCTIONS_S D4DTCHHW_FUNCTIONS
D4D low level touch screen hardware interface API structure.
unsigned short touchOffMaxY
Maximal valid raw value of axis Y.
Definition: d4d_lldapi.h:111
Word(* D4DLCDHW_ReadDataWord)(void)
The LCD HW interface driver read data word function.
Definition: d4d_lldapi.h:168
Orientation Portrait.
Definition: d4d_lldapi.h:66
unsigned char(* D4DLCDHW_DeInit)(void)
The LCD HW interface driver deinicialization function.
Definition: d4d_lldapi.h:172
struct D4DTCH_FUNCTIONS_S D4DTCH_FUNCTIONS
D4D low level touch screen interface API structure.
void(* D4DLCD_Send_PixelColor)(D4D_COLOR value)
The LCD driver send pixel function. The pixels will be draw on position (automaticaly incremented) se...
Definition: d4d_lldapi.h:152
D4D low level touch screen hardware interface API structure.
Definition: d4d_lldapi.h:207
D4D low level mouse pointer structure.
Definition: d4d_lldapi.h:128
void(* D4DLCDHW_FlushBuffer)(D4DLCD_FLUSH_MODE mode)
The LCD HW interface driver flush data function.
Definition: d4d_lldapi.h:171
unsigned char(* D4DLCD_Init)(void)
The LCD driver initialization function.
Definition: d4d_lldapi.h:149
LWord D4D_COLOR
Type definition of eGUI color variables.
Definition: d4d_types.h:262
struct D4DLCD_FUNCTIONS_S D4DLCD_FUNCTIONS
D4D low level standard LCD interface API structure.
Switch off Pull Up resistor on pin.
Definition: d4d_lldapi.h:76
unsigned short Word
Type definition of Word (unsigned 16-bit).
Definition: d4d_types.h:159
LCD device reset signal.
Definition: d4d_lldapi.h:98
The notification of forcing flush by user code.
Definition: d4d_lldapi.h:141
Analog touch screen Y- signal.
Definition: d4d_lldapi.h:92
Analog touch screen Y+ signal.
Definition: d4d_lldapi.h:91
unsigned char(* D4DLCD_SetWindow)(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2)
The LCD driver Set logic window function. Into this logic window will be draw pixels.
Definition: d4d_lldapi.h:150
void(* D4DLCD_Delay_ms)(unsigned short period)
The LCD driver delay function.
Definition: d4d_lldapi.h:155