Hi Jin,
I am looking at this post for information and would like to ask you how to
read using i2c in c++.
I have the following code for write which works fine.
txBuffer[0] = 0x2a; // location to write data
txBuffer[1] = 0xfe ; //data
opResult = write(i2cFD, txBuffer, 2); //write statement.
if (opResult !=2) printf("No ACK bit!\n");
I am having issues with read. I have the following code
opResult = read(i2cFD, (char*)rxBuffer, 6);
printf("Part ID rx0: %x, %x\n", (int)rxBuffer[0], 0x00);
printf("Part ID rx1: %x, %x\n", (int)rxBuffer[1], 0x01);
printf("Part ID rx2: %x, %x\n", (int)rxBuffer[2], 0x02);
printf("Part ID rx3: %x, %x\n", (int)rxBuffer[3], 0x03);
printf("Part ID rx4: %x, %x\n", (int)rxBuffer[4], 0x04);
printf("Part ID rx5: %x, %x\n", (int)rxBuffer[5], 0x05);
It prints out different values then what I expect using i2cdump
Can you shed some light on my problem?
Thanks big time.
On Tuesday, November 6, 2012 at 6:26:54 PM UTC-5, Jin wrote:
>
> Hi all,
>
> I am trying to change some register settings for TPS6217 (power management
> chip) through i2c on linux userspace.
>
> My hope is to configure the settings using c++. I am using the kernel
> 3.2.33, and the i2c slave address is already binded to the driver. (seems
> TPS65217 specific)
>
> I know how to use i2c drivers for general i2c, But I don know how to
> include and use TPS65217 driver on my code. Any ideas?
>
> Best regards,
>
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.