Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Installation - Getting started with Red Hat Linux
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
I want to drive SRF08 using I2C Philips ' Style Adapter

I want to drive SRF08 using I2C Philips ' Style Adapter

2005-02-26       - By vohuynhvu kernelnewbie

 Back
I made an I2C Philips' Style Adapter. I want to use it to drive a
SRF08. After insert 2 module i2c-dev and i2c-philips-par by commands:
      modprobe i2c-dev
      modprobe i2c-philips-par

I found 2 files in the /proc/bus folder: i2c and i2c-0. In the i2c
file I see this line:
      i2c-0     i2c      Philips' Style Adapter      Bit-shift Algorithm

But in i2c-0 file, I see nothing. I know that just because there is no
device register to this adapter. So I wrote a C program to open
/dev/i2c-0 file and want to register a SRF08 have address 0xE4 to the
adapter, this is the code:

#include <fcntl.h>
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
#include <stdio.h>
int main(int argc, char *argv){
int file;
int adapter_nr = 2;
char filename[20];
sprintf(filename,"/dev/i2c-0",adapter_nr);
if ((file = open(filename,O_RDWR)) < 0) {
 printf("1_ERROR HANDLING; you can check errno to see what went wrong\n");
 exit(1); }

int addr = 0xE4;
if (ioctl(file,I2C_SLAVE,addr) < 0) {
 printf("2_ERROR HANDLING; you can check errno to see what went wrong\n");
 exit(1); }
}


Openning i2c-0 file is OK. But i got the error message in the second
if clause. Please help me how to register a device to adapter, any
inserting module needed by this task? I'm waiting advises from all of
you. Thanks....

PS: My English is not good enough. Forgive me...

--
Shrike-list mailing list
Shrike-list@(protected)
https://www.redhat.com/mailman/listinfo/shrike-list