PreviousNext
eeWriteByte
Help > OS functions > MCU EEPROM > eeWriteByte

Function

 

Write one byte to a specified location in EEPROM

Purpose

 

Access to EEPROM

Syntax

 

void eeWriteByte(uns8 address, uns8 data)

Parameters

 

     address: address in EEPROM  (0x80 to 0xBF for Coordinator and 0 to 0xBF for other devices). See IQRF OS User’s guide, EEPROM map.

     data: value to be written (0 to 255)

Return value

 

  –

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.

     Any attempt to write to the protected area above 0xBF leads to no operation.

Side effects

 

  –

See also

 

eeReadByte, eeReadData, eeWriteData

Example 1

 

eeWriteByte(0xBF, 0x75)          // store 0x75 to EEPROM to address 0xBF

eeWriteByte(0x80, myVar)         // copy myVar to EEPROM to address 0x80

Example 2

 

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

eeWriteByte(0xC6, 0x75);         // Attempt to write to protected area – nothing is                                   // written.