Date: Sat, 15 Sep 2007 02:59:27 +1000 From: Ian Smith <smithi@nimnet.asn.au> To: freebsd-questions@freebsd.org Subject: how to use iic(4) Message-ID: <46EABDEF.9080403@nimnet.asn.au>
next in thread | raw e-mail | index | archive | help
I don't know where else to post this, so I'm hoping someone here can spare me a clue. We're building a small board with two AVR Tiny MCUs chatting to each other over an opto-isolated I2C-compatible bus, hopefully at 400kHz. I hope to use the iicbb(4) on lpbb(4) parallel port interface to talk with either of these MCUs for debugging, control and data acquisition. iic(4) says: ======= The iic character device driver provides generic i/o to any iicbus(4) instance. In order to control I2C devices, use /dev/iic? with the fol- lowing ioctls: Ioctl Description I2CSTART send start condition to the specified device (with 7-bit address) on the bus I2CSTOP send stop condition to the bus I2CRSTCARD reset the bus You may also use read/write routines, then I2C start/stop handshake is managed by the iicbus system. ======= Does the latter statement suggest that ordinary reads from or writes to /dev/iic? could be performed by redirection of say echo and read from a script? Or is the device only accessible by ioctl from eg a C program? Also, iicbb(4) is a master-only interface. I can work with that, but if anyone knows of any iicbus slave-mode code I'm all eyes .. Cheers, Ian (please cc me)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46EABDEF.9080403>