SPRADL4 January 2025 F29H850TU , F29H859TU-Q1
The EEPROM_Write_64_Bits() function provides functionality for programming 64 bits (8 bytes) to memory. The first parameter, Num_Bytes, allows the user to specify how many valid bytes will be written. A 64-bit minimum write is required by ECC. If less than 8 bytes, the data will be padded with 0xFF until a 64 bit buffer is achieved. The data bytes should be assigned to the first 8 locations of the Write_Buffer to be used by the Fapi_issueProgrammingCommand() function.
First, a full EEPROM unit is tested for.
EEPROM_64_Bit_Mode_Check_EOS();Next, the Write Buffer is filled with 1s if less than 8 bytes are specified.
uint8_t i;
for (i = Num_Bytes; i < WRITE_SIZE_BYTES; i++)
{
Write_Buffer[i] = 0xFF;
}Next, data is programmed and the pointer is incremented to the next location to program data.
EEPROM_Write_Buffer(Bank_Pointer, Write_Buffer);
Empty_EEPROM = 0;
Bank_Pointer += WRITE_SIZE_BYTES;Once programming is complete, the Erase_Inactive_Unit flag is checked. If set, the inactive unit is erased and the flag reset.
if (Erase_Inactive_Unit)
{
EEPROM_Erase_Inactive_Unit();
Erase_Inactive_Unit = 0;
}