English
Language : 

AN3209 Datasheet, PDF (10/42 Pages) STMicroelectronics – Developing your M24LR64-R datalogger application for temperature acquisition
Component overview
AN3209
Read operations
Table 2.
I2C page write function
Function description
Function name I2C_EE_PageWrite(uint8_t* pBuffer, uint16_t WriteAddr,
uint8_t NumByteToWrite)
Parameters
pBuffer: pointer to the buffer containing the data to be written to the EEPROM.
WriteAddr: internal address of the EEPROM where the data must be written.
NumByteToWrite: number of bytes to be written into the EEPROM.
Return value
ErrorStatus:
SUCCEEDED
FAILED
Example
I2C_EE_PageWrite(s_data, 0x0002, 0x01) writes the content of the
buffer pointed by sedate at address 0x01.
To read from the memory, the I2C master can send read commands to the M24LR64-R. The
command frame must be compliant with the format described in Figure 8.
The M24LR64-R_Datalogger_application_firmware calls the I2C_EE_BufferRead
function which reads a set of bytes from the EEPROM (see Table 3 for a description and an
example).
Figure 8.
3EQUENTIAL
2ANDOM
2EAD
Read I2C frame format
!#+
!#+
!#+
!#+
!#+
$EVSELECT
"YTEADDRESS "YTEADDRESS
$EVSELECT
$ATAOUT
27
27
!#+
./!#+
$ATAOUT.
Table 3.
I2C buffer read function
Function description
!)D
Function I2C_EE_BufferRead(uint8_t* pBuffer, uint16_t ReadAddr, uint8_t
name NumByteToRead)
pBuffer: pointer to the buffer where the data read from the EEPROM are stored.
Parameters ReadAddr:internal EEPROM address from which the read operation is performed.
NumByteToRead: number of bytes to read from the EEPROM.
ErrorStatus:
Return value SUCCEEDED
FAILED
Example
I2C_EE_BufferRead (s_data, 0x0002, 0x01) reads one byte from memory
address 0x01, and stores the value in the buffer pointed by s_data points.
10/42
Doc ID 17419 Rev 2