1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/stm32f1/include/cpu_conf.h

83 lines
2.2 KiB
C
Raw Normal View History

2014-06-11 14:59:24 +02:00
/*
* Copyright (C) 2013 INRIA
* Copyright (C) 2014 Freie Universität Berlin
*
* 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_stm32f1 STM32F1
* @ingroup cpu
2014-06-11 14:59:24 +02:00
* @brief CPU specific implementations for the STM32F1
* @{
*
* @file
* @brief Implementation specific CPU configuration options
*
* @author Alaeddine Weslati <alaeddine.weslati@intia.fr>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef CPU_CONF_H
#define CPU_CONF_H
2014-06-11 14:59:24 +02:00
#include "cpu_conf_common.h"
2017-10-12 19:09:53 +02:00
#if defined(CPU_MODEL_STM32F103C8) || defined(CPU_MODEL_STM32F103CB) || defined(CPU_MODEL_STM32F103RB)
#include "vendor/stm32f103xb.h"
#elif defined(CPU_MODEL_STM32F103RE) || defined(CPU_MODEL_STM32F103ZE)
#include "vendor/stm32f103xe.h"
#endif
2014-06-11 14:59:24 +02:00
2014-10-13 10:53:20 +02:00
#ifdef __cplusplus
extern "C" {
#endif
2014-06-11 14:59:24 +02:00
/**
* @brief ARM Cortex-M specific CPU configuration
2014-06-11 14:59:24 +02:00
* @{
*/
#define CPU_DEFAULT_IRQ_PRIO (1U)
#if defined(CPU_MODEL_STM32F103RE) || defined(CPU_MODEL_STM32F103ZE)
#define CPU_IRQ_NUMOF (60U)
#else
#define CPU_IRQ_NUMOF (43U)
#endif
#define CPU_FLASH_BASE FLASH_BASE
2014-06-11 14:59:24 +02:00
/** @} */
/**
* @brief Flash page configuration
* @{
*/
2018-01-07 16:14:34 +01:00
#if defined(CPU_MODEL_STM32F103C8) || defined(CPU_MODEL_STM32F103CB) || defined(CPU_MODEL_STM32F103RB)
#define FLASHPAGE_SIZE (1024U)
#elif defined(CPU_MODEL_STM32F103RE) || defined(CPU_MODEL_STM32F103ZE)
#define FLASHPAGE_SIZE (2048U)
2018-01-07 16:14:34 +01:00
#endif
#if defined(CPU_MODEL_STM32F103C8)
#define FLASHPAGE_NUMOF (64U)
2018-01-07 16:14:34 +01:00
#elif defined(CPU_MODEL_STM32F103CB) || defined(CPU_MODEL_STM32F103RB)
#define FLASHPAGE_NUMOF (128U)
#elif defined(CPU_MODEL_STM32F103RE) || defined(CPU_MODEL_STM32F103ZE)
#define FLASHPAGE_NUMOF (256U)
#endif
2018-03-13 11:02:28 +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)
/** @} */
2014-10-13 10:53:20 +02:00
#ifdef __cplusplus
}
#endif
#endif /* CPU_CONF_H */
2014-06-11 14:59:24 +02:00
/** @} */