i2CReadBuf trouble
Posted: Tue Oct 27, 2009 5:46 pm
Hi,
I have a Netburner Mod5282. How do I use the i2CReadBuf and i2CSendBuf routines with the CX24116 chip? Basically, The I CX24116 has 256 registers, and I need to be able to read and write to one or more registers on the device.
I am using Multi-master mode, and I understand that I need to call i2CInit with a slave address and frequency divider. After that, here's the prototype for I2CReadBuf:
BYTE I2CReadBuf( BYTE addr, PBYTE buf, int num, bool stop = true );
addr BYTE The 7-bit address you wish to read the buffer from.
buf PBYTE A pointer to the BYTE buffer you wish to read to.
num int The number of bytes to read.
stop bool If true (default): Terminate communication with stop. If false: Do not terminate transmission. (This is useful if the user wishes to send a restart instead of a stop.)
There are one too few parameters for this to work. It's my understanding I need to send out both the device address for the CX24116 (0x55) and send out an address for which register I want to read. There's only one address parameter listed here. Which address is the "addr" parameter referring to? The device address or the register address on the device? How do I send the other address? Please clear up this confusion.
Thanks,
Dan
I have a Netburner Mod5282. How do I use the i2CReadBuf and i2CSendBuf routines with the CX24116 chip? Basically, The I CX24116 has 256 registers, and I need to be able to read and write to one or more registers on the device.
I am using Multi-master mode, and I understand that I need to call i2CInit with a slave address and frequency divider. After that, here's the prototype for I2CReadBuf:
BYTE I2CReadBuf( BYTE addr, PBYTE buf, int num, bool stop = true );
addr BYTE The 7-bit address you wish to read the buffer from.
buf PBYTE A pointer to the BYTE buffer you wish to read to.
num int The number of bytes to read.
stop bool If true (default): Terminate communication with stop. If false: Do not terminate transmission. (This is useful if the user wishes to send a restart instead of a stop.)
There are one too few parameters for this to work. It's my understanding I need to send out both the device address for the CX24116 (0x55) and send out an address for which register I want to read. There's only one address parameter listed here. Which address is the "addr" parameter referring to? The device address or the register address on the device? How do I send the other address? Please clear up this confusion.
Thanks,
Dan