1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-30 00:41:17 +01:00

cpu/stm32l0: add flashpage support

This commit is contained in:
Alexandre Abadie 2018-03-11 20:34:07 +01:00
parent 67190a31ef
commit 4972f952d4
2 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,5 @@
FEATURES_PROVIDED += periph_flashpage
FEATURES_PROVIDED += periph_flashpage_raw
FEATURES_PROVIDED += periph_hwrng
BOARDS_WITHOUT_HWRNG += nucleo32-l031

View File

@ -54,6 +54,31 @@ extern "C" {
#endif
/** @} */
/**
* @name Flash page configuration
* @{
*/
#if defined(CPU_MODEL_STM32L073RZ) || defined(CPU_MODEL_STM32L072CZ) || \
defined(CPU_MODEL_STM32L053R8) || defined(CPU_MODEL_STM32L031K6)
#define FLASHPAGE_SIZE (128U)
#endif
#if defined(CPU_MODEL_STM32L073RZ) || defined(CPU_MODEL_STM32L072CZ)
#define FLASHPAGE_NUMOF (1536U)
#elif defined(CPU_MODEL_STM32L053R8)
#define FLASHPAGE_NUMOF (512U)
#elif defined(CPU_MODEL_STM32L031K6)
#define FLASHPAGE_NUMOF (256U)
#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 byte aligned */
#define FLASHPAGE_RAW_ALIGNMENT (4U)
/** @} */
#ifdef __cplusplus
}
#endif