PreviousNext
eeeReadData
Help > OS functions > Serial EEPROM > eeeReadData

Function

 

Read a data block of a specified length from a specified location in serial EEPROM to bufferINFO

Purpose

 

Read from serial EEPROM

Syntax

 

bit eeeReadData(uns16 address)

Parameters

 

address: initial address in serial EEPROM  (0 to 0x7FFF).

Input values

 

     memoryLimit specifies the number of bytes (1 to 64) to be read. It must be set before every eeeReadData call. If memoryLimit == 0, 64 B is read.

     To respect accessible range, the following rule must be observed:

address + memoryLimit < 0x8000. See Examples 2 and 3.

Return value

 

     1:      Read successful

     0:      Read unsuccessful  (e.g. due to damaged, not supplied or not populated memory device). Additionally, the _eeeError flag is set. Subsequent clearing of this flag is up to the user.

Output values

 

bufferINFO[0 to 63]

Preconditions

 

The power supply of serial EEPROM must not be disconnected. See macros eEEPROM_TempSensorOn and  eEEPROM_TempSensorOff.

Remarks

 

     Memory range 0 to 0x7FFF is accessible.

     memoryLimit is automatically cleared after every eeeReadData call.

Side effects

 

  –

See also

 

eeeWriteData

Example 1

 

       // Copy 64 B from serial EEPROM from address 0x3C to bufferINFO

       // When memoryLimit is kept cleared from previous operations

eeeReadData(0x3C);  // bufferINFO[0] = serial EEPROM[0x3C]

                    //              ...

                    // bufferINFO[63] = serial EEPROM[0x7B]

Example 2

 

       // Copy 40 B from serial EEPROM from address 0x3C to bufferINFO

memoryLimit = 40;   // To read 40 B

eeeReadData(0x3C);  // bufferINFO[0] = serial EEPROM[0x3C]

                    //              ...

                    // bufferINFO[39] = serial EEPROM[0x63]

                    // memoryLimit is automatically cleared here

Example 3

 

       // Attempt to read 40 B from address 0x7EEE

memoryLimit = 40;    

eeeReadData(0x7FEE);  // Illegal usage, out of 0x7FFF boundary

Example 4

 

if (eeeReadData(0x0A))

  X = bufferINFO[0]

else

  {

     ...            // Error handling

  }