EEPROM read and write Application Code

Thread Starter

electronicsLearner77

Joined May 26, 2012
127
I have written driver for EEPROM read and write using I2C. The Confusion is what is the prototype i can give to application to read and write. I mean to say the application need not be aware of the address where i am writing. How do i make sure the location i am writing to for a particular user, I am reading from the same location? Please advise.
 

Ian Rogers

Joined Dec 12, 2012
1,136
The address of the read / write is specified in the protocol..
Start
Write chip address
Write internal address
Write to location with data
Stop

OR
Start
Write chip address
Write internal address
Restart
Write chip address + 1 read
Read internal data
Stop
 

Thread Starter

electronicsLearner77

Joined May 26, 2012
127
No my clarification is something like this should i provide a prototype function like
Code:
void EEprom_write(unsigned char *data, unsigned char address, unsigned char NumberOfBytesToWrite)
or 
void EEprom_write(unsigned char *data,unsigned char NumberOfBytesToWrite) should be fine
If i provide this interface to the user. He can read and write, but how do i know a particular user is asking to read and write a particular data. I am not sure if i am asking the question properly.
 
Top