PDA

View Full Version : regarding a touch screen driver for qt-embedded



sar_van81
2nd March 2007, 11:23
hi,

i have a doubt about the usage of touch screen driver in qt/embedded. i had connected a serial touch screen to the com port (/dev/ttyS1) of my board(blackfin processor -BF537 EZKIT). i had also compiled qt-embedded-3.3.5 with the option "-qt-mouse-linuxtp" and altered the file qmouselinuxtp_qws.cpp as follows:


QWSLinuxTPMouseHandlerPrivate::QWSLinuxTPMouseHand lerPrivate( QWSLinuxTPMouseHandler *h )
: mouseFD(-1), samples(QT_QWS_TP_SAMPLE_SIZE), currSample(0), lastSample(0),
numSamples(0), skipCount(0), handler(h)
{
printf("\n inside ltp handler private \n");
#if defined(QT_QWS_IPAQ)
# ifdef QT_QWS_IPAQ_RAW
if ((mouseFD = open( "/dev/h3600_tsraw", O_RDONLY | O_NDELAY)) < 0) {
# else
if ((mouseFD = open( "/dev/h3600_ts", O_RDONLY | O_NDELAY)) < 0) {
# endif
qWarning( "Cannot open /dev/h3600_ts (%s)", strerror(errno));
return;
}
#elif defined(QT_QWS_EBX)
//# ifdef QT_QWS_EBX_TSRAW
# if 0
if ((mouseFD = open( "/dev/tsraw", O_RDONLY | O_NDELAY)) < 0) {
qWarning( "Cannot open /dev/tsraw (%s)", strerror(errno));
return;
}
# else
if ((mouseFD = open( "/dev/ts", O_RDONLY | O_NDELAY)) < 0) {
qWarning( "Cannot open /dev/ts (%s)", strerror(errno));
return;
}
# endif
#endif

mouseFD = open( "/dev/ttyS1", O_RDONLY | O_NDELAY);
printf("\n MOUSEFD :%d",mouseFD);

if(mouseFD==0)
printf("\n device openned \n");
else printf("\n cannot open touch screen \n");

QSocketNotifier *mouseNotifier;
mouseNotifier = new QSocketNotifier( mouseFD, QSocketNotifier::Read, this );

printf("\n after socket notifier \n");
connect(mouseNotifier, SIGNAL(activated(int)),this, SLOT(readMouseData()));
waspressed=FALSE;
mouseIdx = 0;
printf("\n after mouseidx \n");

}

so that when i export the mouse variable as:

export QWS_MOUSE_PROTO=linuxtp:/dev/ttyS1.

it will surely open the device. the flow of this file is that, it first opens the device, creates a socket notifier to the device and whenever any data comes it calls the readMouseData function. in that , the datas are read directly from the port as they come(if my understanding is correct).

my question is during this process is there any role for device driver ?i mean the driver present in the OS(uClinux)? will the open call in the above function, call the device driver open function present in the uClinux?

if this query is concerned with the OS(uClinux)? and not the with qt application ,then i apologize for posting in this forum.