Skip site navigation (1)Skip section navigation (2)
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

--=-laOzhjWo1dyHm4WR5L7H
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

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 example=
s=20
> on how to
> talk to the serial and parallel ports. I have looked in the developers=20
> handbook but have not
> any luck finding what I want.
>=20
> Any pointers would be appreciated
>
> Thanks

Hello,=20

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:
=20
             int             fd;
             u_int8_t        val;
=20
             val =3D 0x5a;
             ioctl(fd, PPISDATA, &val);
             ioctl(fd, PPIGCTRL, &val);
             val |=3D STROBE;
             ioctl(fd, PPISCTRL, &val);
             val &=3D ~STROBE;
             ioctl(fd, PPISCTRL, &val);

HTH,=20
--=20
Andreas Kohn <andreas.kohn@gmx.net>

--=-laOzhjWo1dyHm4WR5L7H
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Dies ist ein digital signierter Nachrichtenteil

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQA+5PCBYucd7Ow1ygwRAmi1AJ0RAe7lquuUNE5C3BtKqGTzaarg9ACeLNqs
JsMAvQJKQ7icJDT09ih3Yf0=
=ubIw
-----END PGP SIGNATURE-----

--=-laOzhjWo1dyHm4WR5L7H--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1055191169.2177.8.camel>