Date: 09 Jun 2003 22:39:30 +0200 From: Andreas Kohn <andreas.kohn@gmx.net> To: Dan Malaby <dan@peritek.com> Cc: freebsd-questions@freebsd.org Subject: Re: how to talk to the serial and parallel ports through a C program Message-ID: <1055191169.2177.8.camel@klamath.ankon.homeip.net> In-Reply-To: <5.1.0.14.2.20030609093752.00a69d20@pop3.peritek.com> References: <5.1.0.14.2.20030609093752.00a69d20@pop3.peritek.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Am Mon, 2003-06-09 um 18.44 schrieb Dan Malaby:
> I was wondering if there was a good place to go to get programing examples
> on how to
> talk to the serial and parallel ports. I have looked in the developers
> handbook but have not
> any luck finding what I want.
>
> Any pointers would be appreciated
>
> Thanks
Hello,
at least for parallel ports, ppi might help you. There is a short
example in the ppi(4) man page:
To present the value 0x5a to the data port, drive STROBE low and
then
high again, the following code fragment can be used:
int fd;
u_int8_t val;
val = 0x5a;
ioctl(fd, PPISDATA, &val);
ioctl(fd, PPIGCTRL, &val);
val |= STROBE;
ioctl(fd, PPISCTRL, &val);
val &= ~STROBE;
ioctl(fd, PPISCTRL, &val);
HTH,
--
Andreas Kohn <andreas.kohn@gmx.net>
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)
iD8DBQA+5PCBYucd7Ow1ygwRAmi1AJ0RAe7lquuUNE5C3BtKqGTzaarg9ACeLNqs
JsMAvQJKQ7icJDT09ih3Yf0=
=ubIw
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1055191169.2177.8.camel>
