From aa6cf07390d79f1d9763ca324f728c6791a330e9 Mon Sep 17 00:00:00 2001
From: Alexandre Abadie <alexandre.abadie@inria.fr>
Date: Sun, 1 Apr 2018 17:41:41 +0200
Subject: [PATCH] cpu/stm32l1: add definitions for internal eeprom

---
 cpu/stm32l1/Makefile.features  |  1 +
 cpu/stm32l1/include/cpu_conf.h | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/cpu/stm32l1/Makefile.features b/cpu/stm32l1/Makefile.features
index e5e8c0f6d8..a49d398260 100644
--- a/cpu/stm32l1/Makefile.features
+++ b/cpu/stm32l1/Makefile.features
@@ -1,5 +1,6 @@
 FEATURES_PROVIDED += periph_flash_common
 FEATURES_PROVIDED += periph_flashpage
 FEATURES_PROVIDED += periph_flashpage_raw
+FEATURES_PROVIDED += periph_eeprom
 
 -include $(RIOTCPU)/stm32_common/Makefile.features
diff --git a/cpu/stm32l1/include/cpu_conf.h b/cpu/stm32l1/include/cpu_conf.h
index cb86a3bf53..af78bf0516 100644
--- a/cpu/stm32l1/include/cpu_conf.h
+++ b/cpu/stm32l1/include/cpu_conf.h
@@ -93,6 +93,18 @@ extern "C" {
 #define FLASHPAGE_RAW_ALIGNMENT    (4U)
 /** @} */
 
+/**
+ * @name    EEPROM configuration
+ * @{
+ */
+#define EEPROM_START_ADDR          (0x08080000)
+#if defined(CPU_MODEL_STM32L152RE)
+#define EEPROM_SIZE                (16384UL)  /* 16kB */
+#elif defined(CPU_MODEL_STM32L151RC)
+#define EEPROM_SIZE                (8192U)    /* 8kB */
+#endif
+/** @} */
+
 #ifdef __cplusplus
 }
 #endif
-- 
GitLab