2014-04-17 19:41:48 +02:00
|
|
|
/*
|
2016-08-29 10:55:46 +02:00
|
|
|
* Copyright (C) 2016 Freie Universität Berlin
|
|
|
|
* 2016 Inria
|
2014-04-17 19:41:48 +02:00
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
|
|
|
* Public License v2.1. See the file LICENSE in the top level directory for more
|
|
|
|
* details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup cpu_stm32f0 STM32F0
|
|
|
|
* @brief STM32F0 specific code
|
|
|
|
* @ingroup cpu
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Implementation specific CPU configuration options
|
|
|
|
*
|
2017-01-19 21:45:23 +01:00
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
2016-08-29 10:55:46 +02:00
|
|
|
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
|
|
|
|
*/
|
2014-04-17 19:41:48 +02:00
|
|
|
|
2017-05-23 18:19:52 +02:00
|
|
|
#ifndef CPU_CONF_H
|
|
|
|
#define CPU_CONF_H
|
2014-04-17 19:41:48 +02:00
|
|
|
|
2016-01-14 23:21:49 +01:00
|
|
|
#include "cpu_conf_common.h"
|
|
|
|
|
2018-06-18 19:19:08 +02:00
|
|
|
#include "vendor/stm32f0xx.h"
|
|
|
|
|
2014-10-13 10:53:20 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2014-04-17 19:41:48 +02:00
|
|
|
|
|
|
|
/**
|
2015-05-27 23:07:43 +02:00
|
|
|
* @brief ARM Cortex-M specific CPU configuration
|
2014-04-17 19:41:48 +02:00
|
|
|
* @{
|
|
|
|
*/
|
2015-05-27 23:07:43 +02:00
|
|
|
#define CPU_DEFAULT_IRQ_PRIO (1U)
|
2018-06-18 19:19:08 +02:00
|
|
|
#if defined(CPU_LINE_STM32F030x8)
|
2017-08-19 23:57:17 +02:00
|
|
|
#define CPU_IRQ_NUMOF (29U)
|
2018-06-18 19:19:08 +02:00
|
|
|
#elif defined(CPU_LINE_STM32F031x6)
|
2017-08-19 23:57:17 +02:00
|
|
|
#define CPU_IRQ_NUMOF (28U)
|
2018-06-18 19:19:08 +02:00
|
|
|
#elif defined(CPU_LINE_STM32F051x8) || defined(CPU_LINE_STM32F091xC)
|
2015-05-27 23:07:43 +02:00
|
|
|
#define CPU_IRQ_NUMOF (31U)
|
2018-06-18 19:19:08 +02:00
|
|
|
#else
|
2017-08-19 23:57:17 +02:00
|
|
|
#define CPU_IRQ_NUMOF (32U)
|
|
|
|
#endif
|
2014-04-17 19:41:48 +02:00
|
|
|
/** @} */
|
|
|
|
|
2017-01-24 14:53:46 +01:00
|
|
|
/**
|
|
|
|
* @brief Flash page configuration
|
|
|
|
*
|
|
|
|
* STM32F03x, STM32F04x, STM32F05x: up to 64 pages of 1K
|
|
|
|
* STM32F07x, STM32F09x: up to 128 pages of 2K
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
2018-06-18 19:19:08 +02:00
|
|
|
#if defined(CPU_LINE_STM32F091xC) || defined(CPU_LINE_STM32F072xB)
|
2017-01-24 14:53:46 +01:00
|
|
|
#define FLASHPAGE_SIZE (2048U)
|
2018-06-18 19:19:08 +02:00
|
|
|
#elif defined(CPU_LINE_STM32F051x8) || defined(CPU_LINE_STM32F042x6) \
|
|
|
|
|| defined(CPU_LINE_STM32F070xB) || defined(CPU_LINE_STM32F030x8)
|
2017-01-24 14:53:46 +01:00
|
|
|
#define FLASHPAGE_SIZE (1024U)
|
|
|
|
#endif
|
|
|
|
|
2018-06-18 19:19:08 +02:00
|
|
|
#define FLASHPAGE_NUMOF (STM32_FLASHSIZE / FLASHPAGE_SIZE)
|
2018-03-13 11:02:19 +01:00
|
|
|
|
|
|
|
/* The minimum block size which can be written is 2B. However, the erase
|
|
|
|
* block is always FLASHPAGE_SIZE.
|
|
|
|
*/
|
|
|
|
#define FLASHPAGE_RAW_BLOCKSIZE (2U)
|
|
|
|
/* Writing should be always 4 bytes aligned */
|
|
|
|
#define FLASHPAGE_RAW_ALIGNMENT (4U)
|
2017-01-24 14:53:46 +01:00
|
|
|
/** @} */
|
|
|
|
|
2014-10-13 10:53:20 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-05-23 18:19:52 +02:00
|
|
|
#endif /* CPU_CONF_H */
|
2014-04-17 19:41:48 +02:00
|
|
|
/** @} */
|