WebRadioApp  0.1
ew_bsp_touch.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * E M B E D D E D W I Z A R D P R O J E C T
4  *
5  * Copyright (c) TARA Systems
6  *GmbH written by Paul Banach and Manfred Schweyer
7  *
8  ********************************************************************************
9  *
10  * This software is delivered "as is" and shows the usage of other software
11  * components. It is provided as an example software which is intended to be
12  * modified and extended according to particular requirements.
13  *
14  * TARA Systems hereby disclaims all warranties and conditions with regard to
15  *the software, including all implied warranties and conditions of
16  *merchantability and non-infringement of any third party IPR or other rights
17  *which may result from the use or the inability to use the software.
18  *
19  ********************************************************************************
20  *
21  * DESCRIPTION:
22  * This file is part of the interface (glue layer) between an Embedded Wizard
23  * generated UI application and the board support package (BSP) of a dedicated
24  * target.
25  * This template is responsible to initialize the touch driver of the display
26  * hardware and to receive the touch events for the UI application.
27  *
28  *******************************************************************************/
29 
42 #ifndef EW_BSP_TOUCH_H
43 #define EW_BSP_TOUCH_H
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /* flag to indicate begin of a touch cycle for a certain finger (event down) */
50 #define EW_BSP_TOUCH_DOWN 1
51 
52 /* flag to indicate movement within a touch cycle for a certain finger (event
53  * move) */
54 #define EW_BSP_TOUCH_MOVE 2
55 
56 /* flag to indicate end of a touch cycle for a certain finger (event up) */
57 #define EW_BSP_TOUCH_UP 3
58 
59 /******************************************************************************
60  * TYPE:
61  * XTouchEvent
62  *
63  * DESCRIPTION:
64  * The structure XTouchEvent describes the touch position and touch state of a
65  * single finger.
66  *
67  * ELEMENTS:
68  * XPos - Horizontal position of the touch event.
69  * YPos - Vertical position of the touch event.
70  * Finger - Number of the finger (0...9).
71  * State - State within the touch cycle (down - move - up).
72  *
73  ******************************************************************************/
74 typedef struct {
75  int XPos;
76  int YPos;
77  int Finger;
78  int State;
79 } XTouchEvent;
80 
81 /*******************************************************************************
82  * FUNCTION:
83  * EwBspTouchInit
84  *
85  * DESCRIPTION:
86  * Initializes the touch driver.
87  *
88  * ARGUMENTS:
89  * aWidth - Width of the toucharea (framebuffer) in pixel.
90  * aHeight - Height of the toucharea (framebuffer) in pixel.
91  *
92  * RETURN VALUE:
93  * None
94  *
95  *******************************************************************************/
96 void EwBspTouchInit(int aWidth, int aHeight);
97 
98 /*******************************************************************************
99  * FUNCTION:
100  * EwBspTouchDone
101  *
102  * DESCRIPTION:
103  * Terminates the touch driver.
104  *
105  * ARGUMENTS:
106  * None
107  *
108  * RETURN VALUE:
109  * None
110  *
111  *******************************************************************************/
112 void EwBspTouchDone(void);
113 
114 /*******************************************************************************
115  * FUNCTION:
116  * EwBspTouchGetEvents
117  *
118  * DESCRIPTION:
119  * The function EwBspTouchGetEvents reads the current touch positions from the
120  * touch driver and returns the current touch position and touch status of the
121  * different fingers. The returned number of touch events indicates the number
122  * of XTouchEvent that contain position and status information.
123  * The orientation of the touch positions is adjusted to match GUI
124  *coordinates. If the hardware supports only single touch, the finger number is
125  *always 0.
126  *
127  * ARGUMENTS:
128  * aTouchEvent - Pointer to return array of XTouchEvent.
129  *
130  * RETURN VALUE:
131  * Returns the number of detected touch events, otherwise 0.
132  *
133  *******************************************************************************/
134 int EwBspTouchGetEvents(XTouchEvent **aTouchEvent);
135 
136 /*******************************************************************************
137  * FUNCTION:
138  * EwBspTouchEventHandler
139  *
140  * DESCRIPTION:
141  * The function EwBspInOutEventHandler is called from the touch screen driver
142  * in case of a touch event.
143  *
144  * ARGUMENTS:
145  * aEventId - An optional target specific event ID.
146  *
147  * RETURN VALUE:
148  * None.
149  *
150  *******************************************************************************/
151 void EwBspTouchEventHandler(int aEventId);
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif /* EW_BSP_TOUCH_H */
158 
159 /* msy */
160 
XTouchEvent::YPos
int YPos
Definition: ew_bsp_touch.h:90
TouchAreaHeight
static int TouchAreaHeight
Definition: ew_bsp_touch.c:66
EwBspTouchDone
void EwBspTouchDone(void)
Terminates the touch driver.
Definition: ew_bsp_touch.c:114
EwGetTicks
unsigned long EwGetTicks(void)
Definition: ewextrte.c:251
ewrte.h
XTouchData::Ticks
unsigned long Ticks
Definition: ew_bsp_touch.c:59
TouchEvent
static XTouchEvent TouchEvent[NO_OF_FINGERS]
Definition: ew_bsp_touch.c:67
NO_OF_FINGERS
#define NO_OF_FINGERS
Definition: ew_bsp_touch.c:45
DELTA_TIME
#define DELTA_TIME
Definition: ew_bsp_touch.c:47
XTouchEvent::State
int State
Definition: ew_bsp_touch.h:92
ew_bsp_touch.h
EW_BSP_TOUCH_DOWN
#define EW_BSP_TOUCH_DOWN
Definition: ew_bsp_touch.h:50
XTouchData::XPos
int XPos
Definition: ew_bsp_touch.c:57
EwBspTouchGetEvents
int EwBspTouchGetEvents(XTouchEvent **aTouchEvent)
The function EwBspTouchGetEvents reads the current touch positions from the touch driver and returns ...
Definition: ew_bsp_touch.c:129
XTouchEvent
Definition: ew_bsp_touch.h:74
EwBspTouchEventHandler
void EwBspTouchEventHandler(int aEventId)
XTouchData::YPos
int YPos
Definition: ew_bsp_touch.c:58
XTouchData::TouchId
unsigned char TouchId
Definition: ew_bsp_touch.c:61
ew_bsp_clock.h
DELTA_TOUCH
#define DELTA_TOUCH
Definition: ew_bsp_touch.c:46
EW_BSP_TOUCH_MOVE
#define EW_BSP_TOUCH_MOVE
Definition: ew_bsp_touch.h:54
XTouchEvent::Finger
int Finger
Definition: ew_bsp_touch.h:91
EW_BSP_TOUCH_HOLD
#define EW_BSP_TOUCH_HOLD
Definition: ew_bsp_touch.c:53
CPU_LOAD_SET_ACTIVE
#define CPU_LOAD_SET_ACTIVE()
Definition: ew_bsp_clock.h:56
XTouchData
Definition: ew_bsp_touch.c:56
EwBspTouchInit
void EwBspTouchInit(int aWidth, int aHeight)
Initializes the touch driver.
Definition: ew_bsp_touch.c:79
EW_BSP_TOUCH_UP
#define EW_BSP_TOUCH_UP
Definition: ew_bsp_touch.h:57
TouchData
static XTouchData TouchData[NO_OF_FINGERS]
Definition: ew_bsp_touch.c:68
CPU_LOAD_SET_IDLE
#define CPU_LOAD_SET_IDLE()
Definition: ew_bsp_clock.h:55
XTouchEvent::XPos
int XPos
Definition: ew_bsp_touch.h:89
TS_I2C_ADDRESS
#define TS_I2C_ADDRESS
Definition: ew_bsp_touch.c:44
EW_BSP_TOUCH_IDLE
#define EW_BSP_TOUCH_IDLE
Definition: ew_bsp_touch.c:50
ewconfig.h
This file contains general configuration settings for the target system, like memory ranges and displ...
XTouchData::State
unsigned char State
Definition: ew_bsp_touch.c:62
TouchAreaWidth
static int TouchAreaWidth
Definition: ew_bsp_touch.c:65
FT6X06Obj
static FT6X06_Object_t FT6X06Obj
Definition: ew_bsp_touch.c:69