#include "stm32l_eeprom.h" #include #include static int32_t * const data_eeprom = (int32_t * const)0x08080000; void write_eeprom(int index, int value) { FLASH->PEKEYR = 0x89ABCDEF; FLASH->PEKEYR = 0x02030405; data_eeprom[index] = value; FLASH->PECR |= FLASH_PECR_PELOCK; } int read_eeprom(int index) { return data_eeprom[index]; }