From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19989 invoked by alias); 23 Jul 2010 09:16:15 -0000 Received: (qmail 19975 invoked by uid 22791); 23 Jul 2010 09:16:13 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,TW_TD X-Spam-Check-By: sourceware.org Received: from smtp-vbr5.xs4all.nl (HELO smtp-vbr5.xs4all.nl) (194.109.24.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Jul 2010 09:16:07 +0000 Received: from [192.168.1.65] (cust.7.108.adsl.cistron.nl [82.95.157.21]) by smtp-vbr5.xs4all.nl (8.13.8/8.13.8) with ESMTP id o6N9G3Ym046568; Fri, 23 Jul 2010 11:16:04 +0200 (CEST) (envelope-from rutger@cs.vu.nl) Message-ID: <4C495F5C.7020405@cs.vu.nl> Date: Fri, 23 Jul 2010 09:16:00 -0000 From: Rutger Hofman User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: eCos Developer list Subject: Re: [ECOS] synth framebuffer and touchscreen emulation References: <4C41A6D3.5000305@cs.vu.nl> <4C420F15.1050508@cs.vu.nl> In-Reply-To: <4C420F15.1050508@cs.vu.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2010-07/txt/msg00002.txt.bz2 [moved this from 'discuss' to 'devel'] Rutger Hofman wrote: > Rutger Hofman wrote: >> our board will have a TFT screen with touchscreen. I want to develop >> higher-level software using the synthetic target, and I succeeded in >> drawing images on the synthetic frame buffer window. So far so good. >> >> However, I also want to add touchscreen emulation: the mouse should >> generate synthetic touchscreen events. Two questions: >> >> 1) When I try to enable mouse awareness I handle mouse events in framebuf.tcl by registering mouse event callbacks. >> 2) What is the preferred way to create a synthetic touchscreen >> driver? It must necessarily be integrated into the framebuffer >> driver, because that one owns the X stuff. I wonder about >> integration in the synthetic communication between target, >> framebuffer and auxiliary. I made a separate package dev/touch/synth for the synthetic target (implemented as a char device driver). It is necessarily tightly integrated with the synthetic framebuffer, because the framebuffer host-side catches the X mouse events. So, framebuf.tcl now installs mouse action handlers, queries its tdf file for option ("framebuffer" "touchscreen") == "on", and if so, installs an interrupt for the touchscreen device. framebuf.tcl mouse event callbacks generate an interrupt in the target; the target touchscreen driver then synth_auxiliary_xchgmsg()s with framebuf.tcl to get the mouse event parameters. The target .ecc must include+enable the synthetic touchscreen package, and the framebuffer that wishes to use a touchscreen must set a .cdl value CYGPKG_DEVS_FRAMEBUF_SYNTH_FBx_TOUCHSCREEN in the target .ecc. Two questions: 1) Is there a way around this two-step configuration? If one wants a touchscreen, one must tell so in the .tdf file to notify host-side framebuffer.tcl, and one must tell so in the target .ecc to notify the framebuffer driver. E.g., it would be nice if the host side could detect CYGPKG_DEVS_FRAMEBUF_SYNTH_FBx_TOUCHSCREEN in the target configuration. 2) There are just two (now three) touchscreen device drivers in eCos, and they all define the same device driver API: a touchscreen event is described by a struct with 4 shorts (type, x, y, _unused). Isn't it time to lift this into a package io/touchscreen that actually prescribes this API? Then touchscreen code would become portable across touchscreen devices. Rutger