Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

C2000 Launchpad help with i2c

$
0
0

Hello,

I'm trying to modify i2c_eeprom example to read and write something on slave device but i dont understand where i have to put data which i want to write and where i get data which i read on that device...

Here are this two structs and I dont understand where i put data to write on i2c and in which variable is data which i read from i2c...

struct I2CMSG I2cMsgOut1={I2C_MSGSTAT_SEND_WITHSTOP,
I2C_SLAVE_ADDR,
I2C_NUMBYTES,
I2C_EEPROM_HIGH_ADDR,
I2C_EEPROM_LOW_ADDR,
0x12, // Msg Byte 1
0x34}; // Msg Byte 2


struct I2CMSG I2cMsgIn1={ I2C_MSGSTAT_SEND_NOSTOP,
I2C_SLAVE_ADDR,
I2C_NUMBYTES,
I2C_EEPROM_HIGH_ADDR,
I2C_EEPROM_LOW_ADDR};

Can someone please explain how this example works and what I have to do to modify it to write to i2c device and read data from that device...

Thanks...

Ivan


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>