[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: general purpose driver

----- Original Message -----
From: "Sam Silverstein" <silver@xxxxxxx.se>
To: <dev-etrax@xxxxxxx.com>
Cc: <u9900545@xxxxxxx.fi>
Sent: den 30 oktober 2002 15:17
Subject: Re: general purpose driver

> On Wednesday 30 October 2002 02:39 pm, johan.adolfsson@xxxxxxx.com wrote:
> > ----- Original Message -----
> > From: <u9900545@xxxxxxx.fi>
> > To: <dev-etrax@xxxxxxx.com>
> > Sent: den 30 oktober 2002 14:03
> > Subject: general purpose driver
> >
> > > Hello!
> > > We are planning to use ETRAX LX100 PCB for general purpose DAQ. The
> > > now is to connect 16-bit I/O interface to LPT port. Has anybody
> > > general purpose driver for I/O to achieve better performance in speed?
> > > do you have better ideas?
> > >
> > > Sami Vuolab
> >
> > What functionality do you need?
> > What are your speed requirements?
> > Is it individual bits or do you want to send
> >
> > The gpio driver supports port G so if you need access to individual bits
> > that could be used.
> > The new version in our 2.4.19 patch support setting "alarms" using
> > to tell the driver to check when some bits go high or low,
> > the usermode application can do select() on the gpio fd and wake up
> > when something has happened instead of polling the kernel.
> >
> > The gpio driver also supports clocking data out, although it currently
> > only supports that on PA and PB I think.
> > You first do a ioctl() to configure what bits to use for what
> > and can then do a write() to send data - we used that to program a FPGA.
> I am trying to do exactly the same thing. I want to use the data pins on
> two LP ports to achieve a 16-bit interface to control a muon air shower
> detector system implemented on an FPGA. While the gpio sounds
> simple, it seems to me that most pins from the gpio ports are not actually
> brought to headers on the devboard_lx. The lp data pins are.

The lp data pins are accessable as general I/O on /dev/gpiog
if they are not assigned to another interface.
gpiog support is added rather recently - it used to be just gpioa and gpiob,
a new set of ioctl() to properly handle bit 31 is added as well,
but as long as you don't use bit 31 the old ones are ok.

The current gpio driver can currently set and clear individual bits,
but you might want something to write complete words as well?

> My driver (based on  the lcd example on the development pages) is
> getting closer to working, although I still get some errors I don't
> yet understand how to fix. I am new to writing device drivers, and
> any sample code that does similar things would be really useful.
> Is a version of the LCD driver code available anywhere for the
> latest kernel release? I am using 2.4.14, and version 2_1_0 of the
> devboard_lx distribution.

You can try fetching 2.4.19 from www.kernel.org and the 2.4.19
patch from http://developer.axis.com/
but as I said, the gpio driver does not write parallel data to
the pins, you can currently only set and clear individual bits.

> Sam Silverstein
> silver@xxxxxxx.se