PreviousNext
eeReadByte
Help > OS functions > MCU EEPROM > eeReadByte

Function

 

Read one byte from a specified location in EEPROM

Purpose

 

Access to EEPROM

Syntax

 

uns8 eeReadByte(uns8 address)

Parameters

 

address: address in EEPROM (0 to 0xBF). See IQRF OS User’s guide, EEPROM map.

Return value

 

     Value (0 to 255) read from specified EEPROM location

     0 when attempted to read from address 0xC0 or higher

Output values

 

  –

Preconditions

 

  –

Remarks

 

     Direct user access to EEPROM (using registers EECONx etc.) is not allowed for security reasons, specialized OS functions are intended for this.

     EEPROM area dedicated to OS (locations 0xC0 or higher) is not accessible.

     See Example E04-EEPROM.

Side effects

 

  –

See also

 

eeReadData, eeWriteByte, eeWriteData

Example 1

 

i = eeReadByte(0);  // Copy 1 byte from EEPROM from address 0 to i

Example 2

 

   // Illegal access: Avoid access to EEPROM locations 0xC0 or higher

i = eeReadByte(0xC8);       // Reading from protected area is redirected to 0xA0