l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2004 Mar 17 13:13

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Receiving an interrupt from a parallel port usingxlib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Receiving an interrupt from a parallel port usingxlib

On Tue, 16 Mar 2004, Bill Kendrick wrote:

> On Tue, Mar 16, 2004 at 02:58:29PM +1100, Julie Russell wrote:
> > Hi everyone,
> > 
> > I have written an application in xlib that currently takes an xevent and
> > processes it from the keyboard. Due to changes in hardware constraints I now
> > have to take that event from a parallel port by receiving an interrupt. Does
> > anyone know how if you can receive this signal using x libraries, or the
> > best way to talk to the port via x?
> This is beyond the scope of Xlib itself.  X doesn't go much further than
> your mouse/keyboard/videocard.  :^)
> Of course, that's not stopping you from using some /other/ libraries to
> talk to the parallel port within the same (Xlib-based) application. :^)
> Unfortunately, I've never done parallel port code, so I wouldn't know where
> to begin, except I guess you want to talk to "/dev/lp0" or "/dev/lp1".

I have never used it, but freshmeat.net showed a library called
"parapin" to simplify parallel port interfacing.

> > I would like to implement this without
> > making too many changes to the event handler and the architecture of the
> > application.
> Been a while since I did straight Xlib, but I suppose it could be possible
> to have your own 'user-specified' events come in (and get handled by your
> main event loop, just like the keyboard events that X gives you directly),
> and have some code that 'pushes' events into the queue when parallel port
> action happens.
> I'm sure someone else here can explain all this better than I. ;^)

I am _not_ an X programmer, but I do know about interrupt programming...
be sure you understand that direct handling of a hardware interrupt should
in most normal Linux programs (including X programs) be handled by the
kernel, and the activation of the interrupt should be propagated through a
driver to userspace code that could concievably react to it by injecting a
message into your X message queue.  This is a _long_ way away from
"real-time" but you would have to change your architecture significantly
to get "real-time" response.

Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.