Lines Matching refs:touch
106 static struct rtgui_touch_device *touch = RT_NULL; variable
131 if ((touch->calibrating == RT_TRUE) && (touch->calibration_func != RT_NULL)) in report_touch_input()
133 touch->x = ts.xp; in report_touch_input()
134 touch->y = ts.yp; in report_touch_input()
138 if (touch->max_x > touch->min_x) in report_touch_input()
140 touch->x = touch->width * (ts.xp-touch->min_x)/(touch->max_x-touch->min_x); in report_touch_input()
144 touch->x = touch->width * ( touch->min_x - ts.xp ) / (touch->min_x-touch->max_x); in report_touch_input()
147 if (touch->max_y > touch->min_y) in report_touch_input()
149 touch->y = touch->height * ( ts.yp - touch->min_y ) / (touch->max_y-touch->min_y); in report_touch_input()
153 touch->y = touch->height * ( touch->min_y - ts.yp ) / (touch->min_y-touch->max_y); in report_touch_input()
157 emouse.x = touch->x; in report_touch_input()
158 emouse.y = touch->y; in report_touch_input()
159 if (touch->first_down_report == RT_TRUE) in report_touch_input()
172 emouse.x = touch->x; in report_touch_input()
173 emouse.y = touch->y; in report_touch_input()
176 if ((touch->calibrating == RT_TRUE) && (touch->calibration_func != RT_NULL)) in report_touch_input()
179 touch->calibration_func(emouse.x, emouse.y); in report_touch_input()
187 if (touch->calibrating != RT_TRUE) in report_touch_input()
202 if ((touch->calibrating == RT_TRUE) && (touch->calibration_func != RT_NULL)) in report_touch_input()
204 touch->x = ts.xp; in report_touch_input()
205 touch->y = ts.yp; in report_touch_input()
209 if (touch->max_x > touch->min_x) in report_touch_input()
211 touch->x = touch->width * ( ts.xp - touch->min_x ) / (touch->max_x-touch->min_x); in report_touch_input()
215 touch->x = touch->width * ( touch->min_x - ts.xp ) / (touch->min_x-touch->max_x); in report_touch_input()
218 if (touch->max_y > touch->min_y) in report_touch_input()
220 touch->y = touch->height * ( ts.yp - touch->min_y ) / (touch->max_y-touch->min_y); in report_touch_input()
224 touch->y = touch->height * ( touch->min_y - ts.yp ) / (touch->min_y-touch->max_y); in report_touch_input()
228 touch_event.x = touch->x; in report_touch_input()
229 touch_event.y = touch->y; in report_touch_input()
232 if (touch->first_down_report == RT_TRUE) in report_touch_input()
234 if (touch->calibrating != RT_TRUE && touch->eventpost_func) in report_touch_input()
236 touch->eventpost_func(touch->eventpost_param, &touch_event); in report_touch_input()
242 touch_event.x = touch->x; in report_touch_input()
243 touch_event.y = touch->y; in report_touch_input()
246 if ((touch->calibrating == RT_TRUE) && (touch->calibration_func != RT_NULL)) in report_touch_input()
249 touch->calibration_func(touch_event.x, touch_event.y); in report_touch_input()
252 if (touch->calibrating != RT_TRUE && touch->eventpost_func) in report_touch_input()
254 touch->eventpost_func(touch->eventpost_param, &touch_event); in report_touch_input()
306 if (touch->first_down_report) in s3c2410_adc_stylus_action()
312 touch->first_down_report = 0; in s3c2410_adc_stylus_action()
315 rt_timer_start(touch->poll_timer); in s3c2410_adc_stylus_action()
342 rt_timer_stop(touch->poll_timer); in s3c2410_intc_stylus_updown()
343 touch->first_down_report = RT_TRUE; in s3c2410_intc_stylus_updown()
403 touch->first_down_report = RT_TRUE; in rtgui_touch_init()
413 touch->calibrating = RT_TRUE; in rtgui_touch_control()
414 touch->calibration_func = (rt_touch_calibration_func_t)args; in rtgui_touch_control()
418 touch->calibrating = RT_FALSE; in rtgui_touch_control()
428 touch->min_x = data->min_x; in rtgui_touch_control()
429 touch->max_x = data->max_x; in rtgui_touch_control()
430 touch->min_y = data->min_y; in rtgui_touch_control()
431 touch->max_y = data->max_y; in rtgui_touch_control()
441 touch->eventpost_func = (rt_touch_eventpost_func_t)args; in rtgui_touch_control()
445 touch->eventpost_param = args; in rtgui_touch_control()
458 touch = (struct rtgui_touch_device *)rt_malloc(sizeof(struct rtgui_touch_device)); in rtgui_touch_hw_init()
459 if (touch == RT_NULL) in rtgui_touch_hw_init()
463 rt_memset(&(touch->parent), 0, sizeof(struct rt_device)); in rtgui_touch_hw_init()
464 touch->calibrating = RT_FALSE; in rtgui_touch_hw_init()
465 touch->min_x = X_MIN; in rtgui_touch_hw_init()
466 touch->max_x = X_MAX; in rtgui_touch_hw_init()
467 touch->min_y = Y_MIN; in rtgui_touch_hw_init()
468 touch->max_y = Y_MAX; in rtgui_touch_hw_init()
469 touch->eventpost_func = RT_NULL; in rtgui_touch_hw_init()
470 touch->eventpost_param = RT_NULL; in rtgui_touch_hw_init()
473 touch->parent.type = RT_Device_Class_Unknown; in rtgui_touch_hw_init()
474 touch->parent.init = rtgui_touch_init; in rtgui_touch_hw_init()
475 touch->parent.control = rtgui_touch_control; in rtgui_touch_hw_init()
476 touch->parent.user_data = RT_NULL; in rtgui_touch_hw_init()
494 touch->width = info.width; in rtgui_touch_hw_init()
495 touch->height = info.height; in rtgui_touch_hw_init()
498 touch->poll_timer = rt_timer_create("touch", touch_timer_fire, RT_NULL, in rtgui_touch_hw_init()
502 rt_device_register(&(touch->parent), "touch", RT_DEVICE_FLAG_RDWR); in rtgui_touch_hw_init()