Subject: Re: A/Ds (device drivers)
To: Christian Kuhtz <ck@gnu.org>
From: Jasper Wallace <jasper@pointless.net>
List: port-i386
Date: 06/19/2001 18:43:21
-----BEGIN PGP SIGNED MESSAGE-----

On Tue, 19 Jun 2001, Christian Kuhtz wrote:

>
> Hey gang,
>
> I'm looking at writing a device driver for an A/D on a PC/104 board.  Can
> somebody point me towards where I can find
> 	a) info on how to do this?
> 	b) other drivers which work similiarly? (*)
> 	c) people willing to help with the implementation ;-)
>
> (*) most A/D boards seem to have a set of I/O addresses to control the A/D and
> retrieve data from it.  Some also provide an additional IRQ to retrieve data
> from the A/D when the conversion or a batch of conversions is finished.  It
> seems a char device would be the best way to handle this.  It would be nice if
> an app can write to a control device to set up the A/D and then retrieve
> individual samples or batches of samples thru the char device.

How concerned are you about timeing?

If you just want to read from an IO address every second or so and you don't
care about interrupts you can do this from userland - see i386_iopl(2) and
/usr/include/machine/pio.h for inb().

> There are a bunch of questions on my part on what's the best way to design
> this.  What are good or bad ways to design this?  Should the device be
> blocking or non-blocking on reads? (say, a read occurs, the sample isn't
> ready, the read returns a zero length vs blocking).
>
> Any help would be greatly appreciated...  If this isn't the appropriate forum,
> please let me know where I should seek help and advice on this.
>
> Thanks in advance..
>
> Cheers,
> Chris
>
> PS: Has anyone here messed with A/D's connected to serial ports on NetBSD
> boxes?
>
>

- -- 
     "The aurochs was the great, black bull that was painted on cave
walls  alongside bison and mammoths  by tacky prehistoric minimalist
artists  who  had no  sense whatsoever of  modeling or perspective."
[see: http://www.aristotle.net/~swarmack/aurochs.html]  [0x2ECA0975]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (NetBSD)
Comment: For info see http://www.gnupg.org

iQEVAwUBOy+PPACB+Qwuygl1AQEpXQgAjX+en08SSG/KGtrCANTmPQ9iEBzSoTz/
K78oYyGifq10rxHx77wuZwxlv6YSInNZhNc9H7aL3uvLeuGpSdqMx57eL9ks2jNy
sxZbZ2+Kvzn1THf71ARtWttgK7zdzwhdGYDKFAEj3fHu9vpcsj97uuzTvJe4bsDo
sJgYDh3Mu5t/HI+7vEuQl2CkvurdVy+nzl/VrWD3EazQ60PJgSXovpRVfpd2ClTt
M2TYMDz6oAkBtSVLJcZDU7qFx+YytCukUEtrw4TMtfr7pac0HU8pb7p5NVQPXQq/
GPIaI1N/SEAwlhJaJ4r8kO5jyuqZei2TuLE/QHEv0F5FcfoLJEEhTA==
=Elu8
-----END PGP SIGNATURE-----