Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Touch panel driver !!!
icon5.gif  Touch panel driver !!! [message #22107] Thu, 18 June 2009 04:49 Go to next message
shg234 is currently offline  shg234
Messages: 8
Registered: June 2009
Location: Tokyo
Promising Member
Hi all,

As a newbie to this forum I like to thanks all of you to make this open source community as big as this....

I'm doing one of my academic projects, which is assigned by my professor. He gave me a touch input panel/device with some demo application and driver for windows. Now, my task is to make a clone of the same application and driver for linux(UBUNTU).

So, after searching a while I decided to start with Ultimate++. May be its possible for me to develop an simple application with my little bit knowledge of C/C++....but how to make this application work with my embedded touch panel? I don't know...what I know is this thing has been done by a driver? But how and where to start for developing a driver for my application to take touch input from my touch panel?? Can anyone enlight some way for me pleeeeeease ...

Thanking in advance,
Siddiquee
Tokyo,Japan
Re: Touch panel driver !!! [message #22108 is a reply to message #22107] Thu, 18 June 2009 08:51 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Maybe you can search for similar touch devices which are already supported in linux with open source driver (either directly in kernel source, or with external driver) and see how they work.
(expect some C with lot of linux kernel macros, i.e. not something casual C programmer will read easily, but it still may give you plenty of hints)

Maybe, if you find quite similar device, you will need just to tweak couple of values here and there and it will work?
I hope you have enough documentation about the device to create the driver, or at least sources of windows driver.

Isn't your device already supported, or it is too special and unknown?
Re: Touch panel driver !!! [message #22109 is a reply to message #22107] Thu, 18 June 2009 08:55 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
And if you don't have to provide full linux driver, just the working application, maybe it will be easier to hack just some nasty code to read values from panel without driver, but I never did direct access to HW under linux, so I can't help with that either.

Anyway, once you will know how to read values from the panel in C++ (either nice driver or some quick hack), the U++ should help a lot then with the application alone.
If you manage to create same/similar driver interface like in windows, you can use U++ to create the same application for both linux and windows then.
Re: Touch panel driver !!! [message #22110 is a reply to message #22108] Thu, 18 June 2009 10:33 Go to previous messageGo to next message
shg234 is currently offline  shg234
Messages: 8
Registered: June 2009
Location: Tokyo
Promising Member
mr_ped

Maybe you can search for similar touch devices which are already supported in linux with open source driver (either directly in kernel source, or with external driver) and see how they work.

Thanx for your reply.
I'm sorry to say, after googling Smile a lot I didn't find any open source touch device driver. Do you know any links? please...

mr_ped

(expect some C with lot of linux kernel macros, i.e. not something casual C programmer will read easily, but it still may give you plenty of hints)
Maybe, if you find quite similar device, you will need just to tweak couple of values here and there and it will work?

This is what I'm searching.... but yet not getting!!

mr_ped

I hope you have enough documentation about the device to create the driver, or at least sources of windows driver.

Yes, I do have the sources of Windows driver.

Siddiquee

Re: Touch panel driver !!! [message #22111 is a reply to message #22109] Thu, 18 June 2009 10:38 Go to previous messageGo to next message
shg234 is currently offline  shg234
Messages: 8
Registered: June 2009
Location: Tokyo
Promising Member
mr_ped

And if you don't have to provide full linux driver, just the working application, maybe it will be easier to hack just some nasty code to read values from panel without driver, but I never did direct access to HW under linux, so I can't help with that either.

I can't go for this option because I have to provide the full driver.

Siddiquee
Re: Touch panel driver !!! [message #22113 is a reply to message #22107] Thu, 18 June 2009 11:18 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Can you at least write what kind of device is that? Some manufacturer, chips used, etc?

Here is for example some open source driver for touch screen controller chip (just chip, if I understand it correctly, you can attach to it any ordinary 4-wire touch... I'm not expert in this so I may misunderstood something):
http://opensource.wolfsonmicro.com/content/wm97xx-touchscree n

Or get kernel source from http://www.kernel.org/ and search trough the source a bit for some "touch". Don't blame me if you get lost, I would too. Smile
Re: Touch panel driver !!! [message #22200 is a reply to message #22113] Wed, 24 June 2009 02:25 Go to previous messageGo to next message
shg234 is currently offline  shg234
Messages: 8
Registered: June 2009
Location: Tokyo
Promising Member
mr_ped wrote on Thu, 18 June 2009 11:18

Can you at least write what kind of device is that? Some manufacturer, chips used, etc?

Here is for example some open source driver for touch screen controller chip (just chip, if I understand it correctly, you can attach to it any ordinary 4-wire touch... I'm not expert in this so I may misunderstood something):
http://opensource.wolfsonmicro.com/content/wm97xx-touchscree n

Or get kernel source from http://www.kernel.org/ and search trough the source a bit for some "touch". Don't blame me if you get lost, I would too. Smile

Thanx.....
I will check the link and let you know ...
Re: Touch panel driver !!! [message #22246 is a reply to message #22200] Sat, 27 June 2009 00:17 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi,

It happens to be, I just wrote such a driver for a specific touchpad.

Its very EASY, really Cool

1- get the source of the X server from Xorg (not the kernel sources)

2- go to the Driver/Input directory
==> here is the code of many input devices (touchpads included)
Copy one that seems closest to your driver and adapt it
to your HW.
Since you have the windows driver, this should be very
easy.

3- build the driver using: './configure' ,'make', 'make install'
NB: the binaries may not be installed in the right place
On fedora they have to be in:
/usr/lib/xorg/modules/input/

4- Configure the /etc/X11/xorg.conf file with you're driver

That's it Surprised

Re: Touch panel driver !!! [message #22310 is a reply to message #22246] Fri, 03 July 2009 05:00 Go to previous messageGo to next message
shg234 is currently offline  shg234
Messages: 8
Registered: June 2009
Location: Tokyo
Promising Member
Didier wrote on Sat, 27 June 2009 00:17


...
3- build the driver using: './configure' ,'make', 'make install'
NB: the binaries may not be installed in the right place
On fedora they have to be in:
/usr/lib/xorg/modules/input/

4- Configure the /etc/X11/xorg.conf file with you're driver

That's it Surprised



Thanx for your kind reply.

As I'm not very familiar with Linux driver development, would you please explain a little bit more on those step 3 and 4. It will be very much helpful for me...

Anyone else can also guide me a bit..

Siddiquee
Re: Touch panel driver !!! [message #22325 is a reply to message #22310] Fri, 03 July 2009 18:15 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi,


On linux, or any other unix system, a common way to build a project is to use the following steps:
./configure ==> it manages make configuration in order to
enable correct compilation on you're target

make ==> builds the project

make install ==> install the project binaries and other config
files if there are any


In the copy of the source code you made ( step 2 ), you should have a file called 'configure' ==> it is the script that you must launch with ' ./configure '

NB: you will have to update ther makefile in order for it to properly
name you're binary (or you can rename it by hand afterwards)



Configuration:
--------------

On linux all the graphical stuff is usually managed by the X server. It's configuration is written in '/etc/X11/xorg.conf' file.

All the devices used be the server are also configured inside this file and the server loads all the linux modules indicated:
For each device there is a driver module (binary if you prefer), it's name is included in the 'xorg.conf' file and it is therefor automatically loaded by the X server.


Here is an example config file for a Penmount touchpad (I only put the sections where the touchpad is involved):

Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Keyboard0" "CoreKeyboard"
	InputDevice    "PenMount" "AlwaysCore"            ==> has to be the same name as the Identifier
EndSection                                                   in section "InputDevice"


Section "InputDevice"
	Identifier	"PenMount"
	Driver		"penmount"                         ==> The module name: - penmount_drv.so
                                                                                - penmount_drv.la
	Option		"Protocol"		"PM9000"
	Option		"Device"		"/dev/ttyS3"
	Option		"PMode"			"1"
	Option		"MinX"			"10"
	Option		"MaxX"			"1000"
	Option		"MinY"			"10"
	Option		"MaxY"			"1000"
	Option		"ADBit"			"10"
	Option		"Baudrate"		"19200"
	Option		"Beep"			"0"		#  0 = no beep, 1 = beep enabled
	Option		"PressVol"		"100"	#  volume of beep (press event)
	Option		"PressPitch"	"880"	#  pitch of beep (press event)
	Option		"PressDur"		"15"	#  length of beep in 10ms (press event)
	Option		"ReleaseVol"	"0"		#  volume of beep (release event)
	Option		"ReleasePitch"	"1200"	#  pitch of beep (release event)
	Option		"ReleaseDur"	"10"	#  len of beep in 10ms (release event)
	Option		"RightButton"	"0"	#  right button active in ms
	Option		"RightButtonStart"	"500"	#  right button active in ms
	Option		"RightButtonEnd"	"900"	#  right button inactive in ms
	Option		"PenDownMode"	"1"	#  0=stream mode, 1=point mode
EndSection





NB: all the code written for the Xorg server is GPL since it works at kernel level
So you're driver will also be GPL.

If it is for a commercial touchpad, publish it. sommebody else might be glad to find it latter.


I hope this will help you.

icon14.gif  Re: Touch panel driver !!! [message #22343 is a reply to message #22107] Mon, 06 July 2009 09:32 Go to previous messageGo to next message
shg234 is currently offline  shg234
Messages: 8
Registered: June 2009
Location: Tokyo
Promising Member
Hi Didier,

Its a greeeeeeeaaaaaaaaaaat help from you. Smile

Now, I exactly understood the step 3 and 4. And also I hope I can proceed now. But I'm sorry to say that, after understanding these steps, I guess, previously I misunderstood the step 2.
Quote:

2- go to the Driver/Input directory
==> here is the code of many input devices (touchpads included)
Copy one that seems closest to your driver and adapt it
to your HW.


Would you please throw some light on that step too....... !!! Basically, on the above lines, please.

Quote:

NB: all the code written for the Xorg server is GPL since it works at kernel level
So you're driver will also be GPL.

If it is for a commercial touchpad, publish it. sommebody else might be glad to find it latter.


I hope someday this driver may be used for commercial use. Right now its just a project for me! Whatever it is, I'm sure, I will publish it for everybody.


I really appreciate you for lending me a hand.

Best regards,

Siddiquee
Tokyo, Japan
Re: Touch panel driver !!! [message #22346 is a reply to message #22107] Mon, 06 July 2009 21:06 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi,

here are some useful links:

linux touchscreen configuration:


linux driver sources (all types):


I made a mistake, the source code of linux drivers can be found along with the kernel sources, but the link I gave you works as well.

Anyway I joined a zip file with some example drivers including the one I modified which is as simple as it can get.

In order to be able to compile the drivers you must have the xorg headers installed. Usualy the 'dev' packages contain it.
Install it by using something linke yum (on fedora).


You have every thing you need now.
Links, example sources, headers, and build scripts.

Its all up to you now Cool
Re: Touch panel driver !!! [message #22347 is a reply to message #22107] Mon, 06 July 2009 21:10 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Uhhhh, where did my links go ??

Here they are:


touchscreen driver sources


touchscreen configuration


Re: Touch panel driver !!! [message #22360 is a reply to message #22347] Wed, 08 July 2009 03:16 Go to previous messageGo to next message
shg234 is currently offline  shg234
Messages: 8
Registered: June 2009
Location: Tokyo
Promising Member
Thanks Didier again.
Really its unbelievable help for me.

I will try your guide line and obviously let you know the outcome.
Give me couple of days please...

Siddiquee Shocked
Re: Touch panel driver !!! [message #22528 is a reply to message #22360] Thu, 23 July 2009 09:55 Go to previous message
shg234 is currently offline  shg234
Messages: 8
Registered: June 2009
Location: Tokyo
Promising Member
Last week I engaged my full time for this project but still there are a bundle of errors with me ( Shocked ).

I will try to send one-by-one of those. First thing is in the following configuration:

Section "InputDevice"
	Identifier	"PenMount"
	Driver		"penmount"                         ==> The module name: - penmount_drv.so
                                                                                - penmount_drv.la
	Option		"Protocol"		"PM9000"
	Option		"Device"		"/dev/ttyS3"
         ........
         ........  



In the device option what should be in my case? my device is an USB device and how to pick which event?? Event0 to 6 is there.

Siddiquee
Previous Topic: CeGCC
Next Topic: Warning: RichText
Goto Forum:
  


Current Time: Sun Apr 28 21:15:30 CEST 2024

Total time taken to generate the page: 2.02365 seconds