Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2001 13:32:52 +0400
From:      "Sergey V. Efimoff" <risky@stabilis.ru>
To:        freebsd-questions@FreeBSD.ORG
Subject:   tried to use I2C via lpbb... failed :(
Message-ID:  <200110120913.NAA62880@mephi.ru>

next in thread | raw e-mail | index | archive | help
Hello, All!

I recently tried to use iicbus on lpbb. I have assembled the device described in lpbb(4) and connected it;
the kernel configuration contains 

device iic
device iicbb
device lpbb
device iicbus

So dmesg reports that iic0 is detected. Then I started to develop application with

fd=open("/dev/iic0", O_RDWR);

where `open` is called successfuly and returns file descriptor 3 (the first free descriptor in
case we are not using, for example, GDB). Use of `open` on "/dev/iic1" returns 
"Device not configured", which is right.

So, device is configured, up and opened successfully. Then I tried to call

result = ioctl(fd,I2CRSTCARD);

result is -1 and errno is EBADF (Bad file descriptor) as on any other random descriptor which 
was not bind to "/dev/iic0".

And, finally,

result = ioctl(fd,I2CSTART);

returns -1 with errno EINVAL (Invalid argument) or traps the kernel (Page Not Present).

I have found no documentation about IICBUS except man's which give almost no information 
about programming it. 

Please, help me to solve this problem.

Best Regards, Thank You In Advance
Sergey V. Efimoff

Stabilis Systems, Inc. General Director
142100 Komsomolskaja 81-169 Podolsk Moscow Region Russia
Tel./Fax +7-095-3245586
E-Mail: stabilis@stabilis.ru



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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