49 #define d4dtch_resistive_mqx_ID 1
51 #if (D4D_MK_STR(D4D_LLD_TCH) == d4dtch_resistive_mqx_ID)
67 static unsigned char D4DTCH_Init_Tchres_Mqx(
void);
68 static unsigned char D4DTCH_DeInit_Tchres_Mqx(
void);
70 static unsigned char D4DTCH_GetPositionRaw_Tchres_Mqx (
unsigned short *TouchPositionX,
71 unsigned short *TouchPositionY);
80 D4DTCH_Init_Tchres_Mqx,
81 D4DTCH_GetPositionRaw_Tchres_Mqx,
82 D4DTCH_GetRawLimits_Tchres_Mqx,
83 D4DTCH_DeInit_Tchres_Mqx
91 static FILE_PTR tchscr_dev;
98 static unsigned char D4DTCH_Init_Tchres_Mqx(
void)
100 tchscr_dev = fopen(
"tchscr:",
NULL);
101 if( tchscr_dev ==
NULL )
112 static unsigned char D4DTCH_DeInit_Tchres_Mqx(
void)
116 fclose( tchscr_dev );
130 TCHRES_ADC_LIMITS_STRUCT limit_struct;
134 _io_ioctl(tchscr_dev, IO_IOCTL_TCHSCR_GET_RAW_LIMITS, &limit_struct);
138 touchscreen_limits.
rawDataScale = (
unsigned short)limit_struct.FULL_SCALE;
139 touchscreen_limits.
touchMinX = (
unsigned short)limit_struct.X_TOUCH_MIN;
140 touchscreen_limits.
touchMinY = (
unsigned short)limit_struct.Y_TOUCH_MIN;
141 touchscreen_limits.
touchOffMaxX = (
unsigned short)limit_struct.X_TOUCH_MAX;
142 touchscreen_limits.
touchOffMaxY = (
unsigned short)limit_struct.Y_TOUCH_MAX;
144 return( &touchscreen_limits );
161 static unsigned char D4DTCH_GetPositionRaw_Tchres_Mqx (
unsigned short *TouchPositionX,
162 unsigned short *TouchPositionY)
164 TCHRES_POSITION_STRUCT position;
166 if( tchscr_dev ==
NULL )
170 if (ioctl(tchscr_dev, IO_IOCTL_TCHSCR_GET_POSITION_RAW, &position ) == TCHRES_OK)
172 *TouchPositionX = (
unsigned short)position.X;
173 *TouchPositionY = (
unsigned short)position.Y;
unsigned short touchOffMaxX
Maximal valid raw value of axis X.
D4D low level touch screen interface API structure.
D4D Driver main header file.
unsigned short touchMinX
Minimal valid raw value of axis X.
D4D Driver private header file.
unsigned short touchMinY
Minimal valid raw value of axis Y.
D4D driver - resistive touch screen driver function header file.
D4D low level touch screen limitation structure.
#define NULL
Type definition of null pointer.
unsigned short rawDataScale
The scale mask of ADC convertor.
unsigned short touchOffMaxY
Maximal valid raw value of axis Y.
D4D driver - resistive touch screen driver function header file.