SLAAEN2A February   2025  – August 2025 MSPM0C1103 , MSPM0C1103-Q1 , MSPM0C1104 , MSPM0C1104-Q1 , MSPM0C1105 , MSPM0C1106 , MSPM0C1106-Q1 , MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G1518 , MSPM0G1519 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1 , MSPM0G3518 , MSPM0G3518-Q1 , MSPM0G3519 , MSPM0G3519-Q1 , MSPM0H3216 , MSPM0H3216-Q1 , MSPM0L1105 , MSPM0L1106 , MSPM0L1116 , MSPM0L1117 , MSPM0L1227 , MSPM0L1227-Q1 , MSPM0L1228 , MSPM0L1228-Q1 , MSPM0L1303 , MSPM0L1304 , MSPM0L1304-Q1 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1 , MSPM0L1343 , MSPM0L1344 , MSPM0L1345 , MSPM0L1346 , MSPM0L2227 , MSPM0L2227-Q1 , MSPM0L2228 , MSPM0L2228-Q1

 

  1.   1
  2. 1Description
  3. 2Required Peripherals
  4. 3Design Steps
  5. 4Design Considerations
  6. 5Software Flow Chart
  7. 6Application Code
  8. 7Additional Resources
  9. 8Revision History
  10.   Trademarks

Application Code

To implement this functionality, six functions are required. In addition to the three functions mentioned in Section 5, the remaining three functions are called primarily by EEPROM_TypeA_init.

  • EEPROM_TypeA_init
  • EEPROM_TypeA_writeData
  • EEPROM_TypeA_eraseLastSector
  • EEPROM_TypeA_readData
  • EEPROM_TypeA_searchCheck
  • EEPROM_TypeA_repairFormat

Additionally, seven global variables are used to record the status of the EEPROM emulation. Four global variables are used to trace the active record.

  • uint32_t gActiveRecordAddress
  • uint32_t gNextRecordAddress;
  • uint16_t gActiveRecordNum;
  • uint16_t gActiveSectorNum;

gActiveRecordAddress and gNextRecordAddress are used to store the address about active record.

gActiveRecordNum and gActiveSectorNum are used to trace the position of active record.

Three global variables are used for flags.

  • bool gEEPROMTypeASearchFlag;
  • bool gEEPROMTypeAEraseFlag;
  • bool gEEPROMTypeAFormatErrorFlag;

gEEPROMTypeASearchFlag is set when the active record exists.

gEEPROMTypeAEraseFlag is set when the sector is full and needs to be erased.

gEEPROMTypeAFormatErrorFlag is set When format error is found.