nanogui: Thread: Interfacing problem: How do I connect my touchscreen driver to nano-X?


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Interfacing problem: How do I connect my touchscreen driver to nano-X?
From: "Wein, Peter \(ext\)" ####@####.####
Date: 2 Jul 2007 14:03:55 +0100
Message-Id: <0C9BD57BDE7F5947B6E8AF9C655EBD99BF19C9@khes0e1a.ww001.siemens.net>

Hi all,
 
I am new here and I need your help! I have recently written my SPI driver for connecting my touch panel controller ADS7846n to the kernel on my ARM9-Board (NS 9360). Because printing of x and y coordinates  on my debug screen is very boring and does not help on, I am now looking for the interface to connect it to the (nano)-X-Server. Actually I did not find enough useful info on the www. Can anybody of you give me a hint where to look? In which form do I have to present my open, read and write functionality for the server? Which are the arguments? And in which way do I have to modify what config file...
 
I appreciate any hints. 
 

Mit freundlichen Grüßen

Peter Wein

 

SIEMENS AG

Electronic Design and Manufacturing Services 

I&S EDM E STG

Dipl.-Ing. (FH) Peter Wein

Entwicklung Software

Postfach 10 60 26

Weissacher Str. 11

 D-70499 Stuttgart

Tel.:  +49 (0) 711 /-137-6991

Fax:  +49 (0) 711 /-137-6071

####@####.####

 

Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Gerhard Cromme; 

Vorstand: Klaus Kleinfeld, Vorsitzender; Johannes Feldmayer, 

Joe Kaeser, Rudi Lamprecht, Eduardo Montes, Jürgen Radomski, Erich R. Reinhardt, 

Hermann Requardt, Uriel J. Sharef, Klaus Wucherer; 

Sitz der Gesellschaft: Berlin und München; 

Registergericht: Berlin Charlottenburg, HRB 12300, München, HRB 6684; 

WEEE-Reg.-Nr. DE 23691322

 

Wichtiger Hinweis: Diese E-Mail und etwaige Anlagen enthält firmenvertrauliche Informationen. 

Sollten Sie diese E-Mail irrtümlich erhalten haben, benachrichtigen Sie uns bitte durch Antwort-Mail 

und löschen Sie diese E-Mail nebst Anlagen von Ihrem System. 

Vielen Dank.
 
Subject: Re: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X?
From: Laine Walker-Avina ####@####.####
Date: 3 Jul 2007 17:35:51 +0100
Message-Id: <3F152D50-533A-46FC-A872-448701EF0E4B@chem.ucdavis.edu>

On Jul 02, 2007, at 06:02, Wein, Peter ((ext)) wrote:

> Hi all,
>
> I am new here and I need your help! I have recently written my SPI  
> driver for connecting my touch panel controller ADS7846n to the  
> kernel on my ARM9-Board (NS 9360). Because printing of x and y  
> coordinates  on my debug screen is very boring and does not help  
> on, I am now looking for the interface to connect it to the (nano)- 
> X-Server. Actually I did not find enough useful info on the www.  
> Can anybody of you give me a hint where to look? In which form do I  
> have to present my open, read and write functionality for the  
> server? Which are the arguments? And in which way do I have to  
> modify what config file...
>
> I appreciate any hints.
>
>
> Mit freundlichen Grüßen
>
> Peter Wein

The generic touch screen driver in drivers/mou_touchscreen.c will  
probably work for you. If your kernel driver uses the /dev/ts device  
file, then you may just be able to use one of the available  
touchscreen modes. Look at the headers in devices/touchscreen_*.h to  
see how they work.

-Laine
Subject: Re: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X?
From: Robin Clark ####@####.####
Date: 4 Jul 2007 09:26:53 +0100
Message-Id: <20070704082620.74027.qmail@web25503.mail.ukl.yahoo.com>

Look for where the mouse driver is read from in the gui you are using.
Then use your driver to send the 'C' stucture for X,Y and P (pressure)
back up to nano-X.

You may have to decide when an end of press has occurred, and send back a P==0
packet to indicate a 'release' event (which most nano-X widgets respond to anyway).

And dont forget to allow the touch screen to settle. The first few milliseconds will always
be wrong in a press because of capacitive effects in the touchscreen and wiring to it.

The readings are pretty noisy anyway and you need to average what you consider to be 'good' or consistent 
presses (perhaps 10 to every one sent up). This averaging should be done in the driver.
Nano X does some of its own averaging on what it gets too.

Also the raw adc readings from the 7846 need to be translated into screen coordinates. Look at
nxcal (it also irons out distortions to a certain extent). This builds a simultaneous equation
solver matrix and applies it to the raw ADC readings to give you screen coordinates. Nano-X
does this so your driver only needs to send the raw readings.
nxcal can also 'flip' the screen for you.

Robin


----- Original Message ----
From: Laine Walker-Avina ####@####.####
To: "Wein, Peter ((ext))" ####@####.####
Cc: ####@####.####
Sent: Tuesday, 3 July, 2007 5:35:18 PM
Subject: Re: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X? 


On Jul 02, 2007, at 06:02, Wein, Peter ((ext)) wrote:

> Hi all,
>
> I am new here and I need your help! I have recently written my SPI  
> driver for connecting my touch panel controller ADS7846n to the  
> kernel on my ARM9-Board (NS 9360). Because printing of x and y  
> coordinates  on my debug screen is very boring and does not help  
> on, I am now looking for the interface to connect it to the (nano)- 
> X-Server. Actually I did not find enough useful info on the www.  
> Can anybody of you give me a hint where to look? In which form do I  
> have to present my open, read and write functionality for the  
> server? Which are the arguments? And in which way do I have to  
> modify what config file...
>
> I appreciate any hints.
>
>
> Mit freundlichen Grüßen
>
> Peter Wein

The generic touch screen driver in drivers/mou_touchscreen.c will  
probably work for you. If your kernel driver uses the /dev/ts device  
file, then you may just be able to use one of the available  
touchscreen modes. Look at the headers in devices/touchscreen_*.h to  
see how they work.

-Laine
---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####






      ___________________________________________________________ 
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html 
Subject: AW: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X?
From: "Wein, Peter \(ext\)" ####@####.####
Date: 18 Jul 2007 08:18:31 +0100
Message-Id: <0C9BD57BDE7F5947B6E8AF9C655EBD99CAD945@khes0e1a.ww001.siemens.net>

Thank you both and to all the others who gave me tips! It did work very well for me.

But how can I turn on/off the mouse pointer if I use mou_toucscreen.c?
And how can I optionally compile Nano-X, so that I can use a USB-Mouse as well.
If I turn on the option GPMOUSE the makefile starts to complain about too much mice in the system (my touch and my USB!). How can I handle this?

Calibration with nxcal:
I do not see where nxcal.dat is handled by nano-X! I am using the latest Nano-X full tar ball v0.91. 

And last but not least:
Does anybody know if I have to lock my data while processing in my workqueue task?
I am asking, cause the read function of the mouse is using some ring structure data from my touch device, which is processed in my workqueue task , sheduled by my interrupt handler. And by coincidence: could it be, that my read function is trying to copy some data to the user space while the workqueue task is still processing (it sleeps after writing every meausurement to the ring structure for 10 ms. It works and measures as long as the pressure is big enough)? Or is the workqueue task capable of sleeping but works its instruction atomically without being interrupted, for example by my read function (both functions are situated in the same driver( process, task, thread(?))?


Here is the locking algorithm which probably could work  very well with only one integer value instead of a structure (cause i++ should work in atomic mode).

In the workqueue task of my touch driver:
...
while(atomic_read(&lock)){
	msleep(10);
}
atomic_inc(&lock);
tp_ev_ring[inwert].x = tp_ev.x;
tp_ev_ring[inwert].y = tp_ev.y;   
tp_ev_ring[inwert++].pressure = 1;
inwert &= 0x3f;
atomic_dec(&lock);
msleep(10);
...

In the read function of my touch driver

...
if(inwert!=outwert&&!atomic_read(&lock)){
	atomic_inc(&lock);
	memcpy(&tp_last,&tp_ev_ring[outwert],sizeof(struct tp_event));
	outwert++;
	outwert &= 0x3F;
	atomic_dec(&lock);
	if(!copy_to_user (tpstruct,&tp_last,sizeof(struct tp_event))){
		return sizeof(struct tp_event);
	}
}
...

It would be very nice if you could help me out once more, cause I am late on my schedule.
Thanks in advance

Regards
Peter


-----Ursprüngliche Nachricht-----
Von: Robin Clark ####@####.#### 
Gesendet: Mittwoch, 4. Juli 2007 10:26
An: Laine Walker-Avina; Wein, Peter (ext)
Cc: ####@####.####
Betreff: Re: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X?

Look for where the mouse driver is read from in the gui you are using.
Then use your driver to send the 'C' stucture for X,Y and P (pressure)
back up to nano-X.

You may have to decide when an end of press has occurred, and send back a P==0
packet to indicate a 'release' event (which most nano-X widgets respond to anyway).

And dont forget to allow the touch screen to settle. The first few milliseconds will always
be wrong in a press because of capacitive effects in the touchscreen and wiring to it.

The readings are pretty noisy anyway and you need to average what you consider to be 'good' or consistent 
presses (perhaps 10 to every one sent up). This averaging should be done in the driver.
Nano X does some of its own averaging on what it gets too.

Also the raw adc readings from the 7846 need to be translated into screen coordinates. Look at
nxcal (it also irons out distortions to a certain extent). This builds a simultaneous equation
solver matrix and applies it to the raw ADC readings to give you screen coordinates. Nano-X
does this so your driver only needs to send the raw readings.
nxcal can also 'flip' the screen for you.

Robin


----- Original Message ----
From: Laine Walker-Avina ####@####.####
To: "Wein, Peter ((ext))" ####@####.####
Cc: ####@####.####
Sent: Tuesday, 3 July, 2007 5:35:18 PM
Subject: Re: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X? 


On Jul 02, 2007, at 06:02, Wein, Peter ((ext)) wrote:

> Hi all,
>
> I am new here and I need your help! I have recently written my SPI  
> driver for connecting my touch panel controller ADS7846n to the  
> kernel on my ARM9-Board (NS 9360). Because printing of x and y  
> coordinates  on my debug screen is very boring and does not help  
> on, I am now looking for the interface to connect it to the (nano)- 
> X-Server. Actually I did not find enough useful info on the www.  
> Can anybody of you give me a hint where to look? In which form do I  
> have to present my open, read and write functionality for the  
> server? Which are the arguments? And in which way do I have to  
> modify what config file...
>
> I appreciate any hints.
>
>
> Mit freundlichen Grüßen
>
> Peter Wein

The generic touch screen driver in drivers/mou_touchscreen.c will  
probably work for you. If your kernel driver uses the /dev/ts device  
file, then you may just be able to use one of the available  
touchscreen modes. Look at the headers in devices/touchscreen_*.h to  
see how they work.

-Laine
---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####






      ___________________________________________________________ 
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html 
Subject: Re: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X?
From: "Greg Haerr" ####@####.####
Date: 18 Jul 2007 22:56:06 +0100
Message-Id: <1f9b01c7c986$5e613ce0$0300a8c0@RDP>

> But how can I turn on/off the mouse pointer if I use mou_toucscreen.c?

The mouse driver doesn't change the need for a GrHideCursor at
the end of nanox/srvmain.c::GsInitialize().

> Calibration with nxcal:
I do not see where nxcal.dat is handled by nano-X! I am using the latest 
Nano-X full tar ball v0.91.

Use the CVS sources, I need to release them as 0.92.  Nxcal was run
before nano-X by a script, IIRC.  I think this is all handled in the
pixil.org source for our PDA operating environment, and the
revised and enhanced window manager.  See www.pixil.org for
more details.

Regards,

Greg 

Subject: AW: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X?
From: "Wein, Peter \(ext\)" ####@####.####
Date: 20 Jul 2007 12:46:08 +0100
Message-Id: <0C9BD57BDE7F5947B6E8AF9C655EBD99CE1C4B@khes0e1a.ww001.siemens.net>

Ok, thanks, there was a problem in connecting with the cvs.windows.org, cause our intranet does not allow cvs-protocol (only http!) connections, but I did download it at home.
I have rewritten the code of mou_touchscreen.c so that it loads every time the nxcal.dat from the file system.
Also I have rewritten the code of nxcal transformation with the code of 

http://www.embedded.com/shared/printableArticle.jhtml?articleID=164303539 (how to write a touch driver)

And 

http://www.embedded.com/story/OEG20020529S0046 (calibration algorithm, which works very well for me)

And now it (almost) works, like it should.


Another interesting question: 
Is there any support of nano-X for working parallel with touch and USB mouse, with priority for the mouse, if connected?
As I wanted to compile the GPM (and does GPM support USB mice) together with ADS7846 it was not possible.
How can I work around this?

Regards
Peter

-----Ursprüngliche Nachricht-----
Von: Greg Haerr ####@####.#### 
Gesendet: Mittwoch, 18. Juli 2007 23:56
An: Wein, Peter (ext); Robin Clark; Laine Walker-Avina
Cc: ####@####.####
Betreff: Re: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X?

> But how can I turn on/off the mouse pointer if I use mou_toucscreen.c?

The mouse driver doesn't change the need for a GrHideCursor at
the end of nanox/srvmain.c::GsInitialize().

> Calibration with nxcal:
I do not see where nxcal.dat is handled by nano-X! I am using the latest 
Nano-X full tar ball v0.91.

Use the CVS sources, I need to release them as 0.92.  Nxcal was run
before nano-X by a script, IIRC.  I think this is all handled in the
pixil.org source for our PDA operating environment, and the
revised and enhanced window manager.  See www.pixil.org for
more details.

Regards,

Greg 

Subject: AW: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X?
From: "Wein, Peter \(ext\)" ####@####.####
Date: 20 Jul 2007 16:37:09 +0100
Message-Id: <0C9BD57BDE7F5947B6E8AF9C655EBD99CE1D5E@khes0e1a.ww001.siemens.net>

Ok,ok, so there is only one mouse device at a time! I see the reference to the mousedev Device only once.
Cause I am new to programming drivers and to programming nano-X, does anybody know a nice (small changes) solution for my problem? 
Or is there no nice solution?
Do I really need to program a driver which is capable either to transmit data from the mouse or the touch?

I am sorry for questioning so much.

Nice Weekend anyway!

Peter


-----Ursprüngliche Nachricht-----
Von: Wein, Peter (ext) 
Gesendet: Freitag, 20. Juli 2007 13:46
An: Greg Haerr
Cc: ####@####.####
Betreff: AW: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X?

Ok, thanks, there was a problem in connecting with the cvs.windows.org, cause our intranet does not allow cvs-protocol (only http!) connections, but I did download it at home.
I have rewritten the code of mou_touchscreen.c so that it loads every time the nxcal.dat from the file system.
Also I have rewritten the code of nxcal transformation with the code of 

http://www.embedded.com/shared/printableArticle.jhtml?articleID=164303539 (how to write a touch driver)

And 

http://www.embedded.com/story/OEG20020529S0046 (calibration algorithm, which works very well for me)

And now it (almost) works, like it should.


Another interesting question: 
Is there any support of nano-X for working parallel with touch and USB mouse, with priority for the mouse, if connected?
As I wanted to compile the GPM (and does GPM support USB mice) together with ADS7846 it was not possible.
How can I work around this?

Regards
Peter

-----Ursprüngliche Nachricht-----
Von: Greg Haerr ####@####.#### 
Gesendet: Mittwoch, 18. Juli 2007 23:56
An: Wein, Peter (ext); Robin Clark; Laine Walker-Avina
Cc: ####@####.####
Betreff: Re: [nanogui] Interfacing problem: How do I connect my touchscreen driver to nano-X?

> But how can I turn on/off the mouse pointer if I use mou_toucscreen.c?

The mouse driver doesn't change the need for a GrHideCursor at
the end of nanox/srvmain.c::GsInitialize().

> Calibration with nxcal:
I do not see where nxcal.dat is handled by nano-X! I am using the latest 
Nano-X full tar ball v0.91.

Use the CVS sources, I need to release them as 0.92.  Nxcal was run
before nano-X by a script, IIRC.  I think this is all handled in the
pixil.org source for our PDA operating environment, and the
revised and enhanced window manager.  See www.pixil.org for
more details.

Regards,

Greg 


---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.