This is the mail archive of the ecos-devel@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ECOS] synth framebuffer and touchscreen emulation


[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]