From owner-freebsd-questions@FreeBSD.ORG Mon Jun 9 13:39:38 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CAD537B401 for ; Mon, 9 Jun 2003 13:39:38 -0700 (PDT) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 1C5F743FBD for ; Mon, 9 Jun 2003 13:39:37 -0700 (PDT) (envelope-from andreas.kohn@gmx.net) Received: (qmail 9382 invoked by uid 65534); 9 Jun 2003 20:39:35 -0000 Received: from unknown (EHLO [172.16.32.190]) (212.204.32.190) by mail.gmx.net (mp003) with SMTP; 09 Jun 2003 22:39:35 +0200 From: Andreas Kohn To: Dan Malaby In-Reply-To: <5.1.0.14.2.20030609093752.00a69d20@pop3.peritek.com> References: <5.1.0.14.2.20030609093752.00a69d20@pop3.peritek.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-laOzhjWo1dyHm4WR5L7H" Message-Id: <1055191169.2177.8.camel@klamath.ankon.homeip.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.3.92 (Preview Release) Date: 09 Jun 2003 22:39:30 +0200 cc: freebsd-questions@freebsd.org Subject: Re: how to talk to the serial and parallel ports through a C program X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2003 20:39:38 -0000 --=-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 --=-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--