From: Dave H. <dhy...@gm...> - 2008-01-31 23:02:41
|
Hi Marq, > I am using the i2c-io program with good success so far but would like to take > over the the I2C_IO_READ_REG_16 function. I have been looking at the various > functions that call this and am not sure if I understand what > I2C_IO_READ_REG_16 returns. It seems to me that it is returning the size of > the information in bytes that it will sent via the i2c bus???? Also > according to i2c.h it says that 32 bytes is the max data transfer, does this > apply to I2C_IO_READ_REG_16? If not how much data can be sent during one > transaction? Yes - I2C_MAX_DATA_LEN (32) bytes is the max that can be returned for any transaction. This is because there is an internal buffer allocated of that length. I2C_IO_READ_REG_16 uses what's know as a "Block Write - Block Read Process Call with PEC" transaction. See page 32 of the SMBus specification: <http://smbus.org/specs/smbus20.pdf> The write data bytes consists of the contents of the I2C_IO_ReadReg16_t structure, which is a single uint8_t containing the address of the register to read. The reply consists of a uint16_t (so a 2 byte reply). > What I am trying to do is merge the RC-Test program into i2c-io. I have > added the variables and functions that are required to calculate the > incoming pulse. I have also included "RCInput.h" and added RCinput.o to my > makefile. In the main functions I am executing the following lines of code: > ---- > RCI_SetPulseCallback( PulseDetected ); > RCI_SetMissingPulseCallback( MissingPulse ); > RCI_Init(); > ----- > My problem is that that when I compile I get the following error: > ---- > Compiling i2c-io.c ... > cc1: warnings being treated as errors > i2c-io.c:449: warning: 'PulseDetected' defined but not used > i2c-io.c:483: warning: 'MissingPulse' defined but not used > make: *** [i2c-io.o] Error 1 > ---- > Any ideas on what I might be missing that should be calling these functions? I'd have to see your source file. The errors seem to imply that you've defined a static function called PulseDetected but haven't actually referenced it, which means that it thinks that you didn't actually call RCI_SetPulseCallback( PulseDetected ); -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |