Yes, they support clock-stretching, this is pretty normal. They also support multi-master (I am 99% sure). Really, tho, it's the adapter driver that determines the clock-stretching support (ability to read status of clk line). My custom adapter using a CPLD supported it.
What is really nice about the linux i2c support is that it is well laid out and simple to extend. For example, you can (in a sense) sub-class an existing driver if the parent provides the bulk of the functionality. For example, the parallel port i2c driver references the bit-banging driver and only needs code to toggle the clk/dta lines on or off; so 4 1 line functions + 1 register + 1 unregister function (short too). The par port sets the clock line using an output pin, and reads the status of the clk line on a separate par port input pin. Each client (i2c device) has a simple driver. The linux i2c base implementation does a bus scan, then queries every client driver for every found device to have the client driver return yes or no if it recoqnizes the device. There is a lot of functionality already done so all we have to do is handle the most basic hardware details. I have sample i2c linux code for both an adapter and client device. The client device in this case was a digital hobby servo as seen on my website. http://www.colinmackenzie.net/ If you want it let me know, I will send as attachment to anyone. C -----Original Message----- From: Stephen Wille Padnos [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 01, 2008 9:14 PM To: Enhanced Machine Controller (EMC) Subject: Re: [Emc-users] Additional I/O Modbus card. Colin F. MacKenzie wrote: >Linux has great i2c bus support, I have made i2c adapter and client (i2c >device drivers), they are only a page or so of code. This is a two wire >protocol. They are great for non-realtime sensors or controls. > > Do the Linux drivers deal with slaves that do clock-pulse stretching? Technically, the clock line can be driven (low) by the slaves if they are slower than the master. So theoretically, you'd need bidirectional control of both the SDA and SCL lines. Of course, if it works, then "practically" trumps both "technically" and "theoretically" :) - Steve ------------------------------------------------------------------------ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users