Date: Tue, 29 Oct 2002 17:08:45 +0100 From: Bernd Walter <ticso@cicely8.cicely.de> To: Joe Sunday <sunday@csh.rit.edu> Cc: David Nicholas Kayal <davek@saturn5.com>, freebsd-hackers@FreeBSD.ORG Subject: Re: i am looking for a 5 volt signal Message-ID: <20021029160844.GA16922@cicely8.cicely.de> In-Reply-To: <20021028135635.GA28293@csh.rit.edu> References: <Pine.BSF.4.44.0210270911490.329-100000@blackbox.yayproductions.com> <20021028135635.GA28293@csh.rit.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 28, 2002 at 08:56:35AM -0500, Joe Sunday wrote:
> On Sun, Oct 27, 2002 at 09:12:33AM -0800, David Nicholas Kayal wrote:
>
> > I'm looking for a 5 volt signal.
> >
> > I have wires plugged into pins 2 and 25 of the parallel port.
> >
> > I have written a small program:
> >
> > #include <stdio.h>
> > #include <dev/ppbus/ppi.h>
> > #include <dev/ppbus/ppbconf.h>
> >
> > int main()
> > {
> > int fd;
> > while(1)
> > {
> > ioctl(fd, PPISDATA, 255);
> > }
> > }
>
> PPISDATA actually takes an int* argument. (The man page may be a tad
> confusing here.)
No it takes an u_int8_t* exactly as written in the manpage.
Using an int doesn't work in all cases.
I have no idea what part of the manpage is confusing.
> Try
> int main() {
> int fd;
> int d = 255;
u_int8_t d = 255;
> fd = open( "/dev/ppi0", O_RDWR );
>
> ioctl( fd, PPISDATA, &d );
>
> return 0;
> }
--
B.Walter COSMO-Project http://www.cosmo-project.de
ticso@cicely.de Usergroup info@cosmo-project.de
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021029160844.GA16922>
