public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] synth framebuffer and touchscreen emulation
       [not found] ` <4C420F15.1050508@cs.vu.nl>
@ 2010-07-23  9:16   ` Rutger Hofman
  0 siblings, 0 replies; only message in thread
From: Rutger Hofman @ 2010-07-23  9:16 UTC (permalink / raw)
  To: eCos Developer list

[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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-23  9:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4C41A6D3.5000305@cs.vu.nl>
     [not found] ` <4C420F15.1050508@cs.vu.nl>
2010-07-23  9:16   ` [ECOS] synth framebuffer and touchscreen emulation Rutger Hofman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).