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
|
2014-10-19 22:07:36 +02:00
|
|
|
* @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>
|
|
|
|
*/
|
|
|
|
|
2016-01-25 11:32:08 +01:00
|
|
|
#ifndef CPU_CONF_H
|
|
|
|
#define CPU_CONF_H
|
2014-06-11 14:59:24 +02:00
|
|
|
|
2016-01-14 23:21:49 +01:00
|
|
|
#include "cpu_conf_common.h"
|
|
|
|
|
2016-01-25 11:32:08 +01:00
|
|
|
#if defined(CPU_MODEL_STM32F103CB) || defined(CPU_MODEL_STM32F103RB)
|
|
|
|
#include "stm32f103xb.h"
|
|
|
|
#elif defined(CPU_MODEL_STM32F103RE)
|
|
|
|
#include "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
|
|
|
/**
|
2015-05-27 23:08:25 +02:00
|
|
|
* @brief ARM Cortex-M specific CPU configuration
|
2014-06-11 14:59:24 +02:00
|
|
|
* @{
|
|
|
|
*/
|
2015-05-27 23:08:25 +02:00
|
|
|
#define CPU_DEFAULT_IRQ_PRIO (1U)
|
|
|
|
#define CPU_IRQ_NUMOF (60U)
|
|
|
|
#define CPU_FLASH_BASE FLASH_BASE
|
2014-06-11 14:59:24 +02:00
|
|
|
/** @} */
|
|
|
|
|
2016-04-20 10:27:26 +02:00
|
|
|
/**
|
|
|
|
* @brief Flash page configuration
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define FLASHPAGE_SIZE (2048U)
|
|
|
|
|
|
|
|
#if defined(CPU_MODEL_STM32F103C8)
|
|
|
|
#define FLASHPAGE_NUMOF (32U)
|
|
|
|
#elif defined(CPU_MODEL_STM32F103CB) || defined(CPU_MODEL_STM32F103RB)
|
|
|
|
#define FLASHPAGE_NUMOF (64U)
|
|
|
|
#elif defined(CPU_MODEL_STM32F103RE)
|
|
|
|
#define FLASHPAGE_NUMOF (256U)
|
|
|
|
#endif
|
|
|
|
/** @} */
|
|
|
|
|
2015-05-26 16:45:34 +02:00
|
|
|
/**
|
|
|
|
* @brief Configure the CPU's clock system
|
|
|
|
*
|
|
|
|
* @param[in] source source clock frequency
|
|
|
|
* @param[in] target target clock frequency
|
|
|
|
* @param[in] prescale prescaler to use
|
|
|
|
*/
|
|
|
|
void cpu_clock_scale(uint32_t source, uint32_t target, uint32_t *prescale);
|
|
|
|
|
2014-10-13 10:53:20 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-01-25 11:32:08 +01:00
|
|
|
#endif /* CPU_CONF_H */
|
2014-06-11 14:59:24 +02:00
|
|
|
/** @} */
|