cpu/stm32l1: add flashpage support

This commit is contained in:
Alexandre Abadie 2018-03-13 11:02:07 +01:00
parent 4972f952d4
commit 4e1f2b5d38
2 changed files with 24 additions and 1 deletions

View File

@ -1 +1,4 @@
FEATURES_PROVIDED += periph_flashpage
FEATURES_PROVIDED += periph_flashpage_raw
-include $(RIOTCPU)/stm32_common/Makefile.features -include $(RIOTCPU)/stm32_common/Makefile.features

View File

@ -72,10 +72,30 @@ extern "C" {
#define CPU_FLASH_BASE FLASH_BASE #define CPU_FLASH_BASE FLASH_BASE
/** @} */ /** @} */
/**
* @name Flash page configuration
* @{
*/
#if defined(CPU_MODEL_STM32L152RE) || defined(CPU_MODEL_STM32L151RC)
#define FLASHPAGE_SIZE (256U)
#if defined(CPU_MODEL_STM32L152RE)
#define FLASHPAGE_NUMOF (2048U) /* 512KB */
#endif
#if defined(CPU_MODEL_STM32L151RC)
#define FLASHPAGE_NUMOF (1024U) /* 256KB */
#endif
#endif
/* The minimum block size which can be written is 4B. However, the erase
* block is always FLASHPAGE_SIZE.
*/
#define FLASHPAGE_RAW_BLOCKSIZE (4U)
/* Writing should be always 4 bytes aligned */
#define FLASHPAGE_RAW_ALIGNMENT (4U)
/** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* CPU_CONF_H */ #endif /* CPU_CONF_H */
/** @} */ /** @} */
/** @} */