2009-11-29 08:50:13 +00:00
|
|
|
/*
|
2011-03-18 18:38:08 +00:00
|
|
|
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
|
|
|
|
2011 Giovanni Di Sirio.
|
2009-11-29 08:50:13 +00:00
|
|
|
|
|
|
|
This file is part of ChibiOS/RT.
|
|
|
|
|
|
|
|
ChibiOS/RT is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
ChibiOS/RT is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2011-09-14 18:59:52 +00:00
|
|
|
* @file STM32F1xx/hal_lld.h
|
|
|
|
* @brief STM32F1xx HAL subsystem low level driver header.
|
2010-11-14 13:29:09 +00:00
|
|
|
* @pre This module requires the following macros to be defined in the
|
|
|
|
* @p board.h file:
|
|
|
|
* - STM32_LSECLK.
|
|
|
|
* - STM32_HSECLK.
|
|
|
|
* .
|
|
|
|
* One of the following macros must also be defined:
|
2010-11-16 18:39:47 +00:00
|
|
|
* - STM32F10X_LD_VL for Value Line Low Density devices.
|
|
|
|
* - STM32F10X_MD_VL for Value Line Medium Density devices.
|
|
|
|
* - STM32F10X_LD for Performance Low Density devices.
|
|
|
|
* - STM32F10X_MD for Performance Medium Density devices.
|
|
|
|
* - STM32F10X_HD for Performance High Density devices.
|
2011-04-23 08:46:08 +00:00
|
|
|
* - STM32F10X_XL for Performance eXtra Density devices.
|
2010-11-16 18:39:47 +00:00
|
|
|
* - STM32F10X_CL for Connectivity Line devices.
|
2010-11-14 13:29:09 +00:00
|
|
|
* .
|
2010-05-10 16:23:55 +00:00
|
|
|
*
|
2010-10-25 18:48:13 +00:00
|
|
|
* @addtogroup HAL
|
2009-11-29 08:50:13 +00:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _HAL_LLD_H_
|
|
|
|
#define _HAL_LLD_H_
|
|
|
|
|
2010-11-14 13:29:09 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver constants. */
|
|
|
|
/*===========================================================================*/
|
2009-11-29 11:34:24 +00:00
|
|
|
|
2010-11-14 13:29:09 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver pre-compile time settings. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Derived constants and error checks. */
|
|
|
|
/*===========================================================================*/
|
2009-11-29 08:50:13 +00:00
|
|
|
|
2010-02-20 11:39:33 +00:00
|
|
|
/**
|
|
|
|
* @brief Platform name.
|
|
|
|
*/
|
2010-11-14 13:29:09 +00:00
|
|
|
#if defined(__DOXYGEN__)
|
|
|
|
#define PLATFORM_NAME "STM32"
|
2010-11-14 13:42:46 +00:00
|
|
|
|
2010-11-16 18:39:47 +00:00
|
|
|
#elif defined(STM32F10X_LD_VL)
|
2010-11-14 16:47:38 +00:00
|
|
|
/*
|
|
|
|
* Capability flags for Value Line Low Density devices.
|
|
|
|
*/
|
|
|
|
#define PLATFORM_NAME "STM32 Value Line Low Density"
|
|
|
|
#include "hal_lld_f100.h"
|
|
|
|
|
|
|
|
#define STM32_HAS_ADC1 TRUE
|
|
|
|
#define STM32_HAS_ADC2 FALSE
|
|
|
|
#define STM32_HAS_ADC3 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_CAN1 FALSE
|
|
|
|
#define STM32_HAS_CAN2 FALSE
|
|
|
|
|
2010-11-15 19:44:09 +00:00
|
|
|
#define STM32_HAS_DAC TRUE
|
2010-11-14 16:47:38 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_DMA1 TRUE
|
|
|
|
#define STM32_HAS_DMA2 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_ETH FALSE
|
|
|
|
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_EXTI_NUM_CHANNELS 19
|
|
|
|
|
2010-11-14 16:47:38 +00:00
|
|
|
#define STM32_HAS_GPIOA TRUE
|
|
|
|
#define STM32_HAS_GPIOB TRUE
|
|
|
|
#define STM32_HAS_GPIOC TRUE
|
|
|
|
#define STM32_HAS_GPIOD TRUE
|
|
|
|
#define STM32_HAS_GPIOE TRUE
|
|
|
|
#define STM32_HAS_GPIOF FALSE
|
|
|
|
#define STM32_HAS_GPIOG FALSE
|
2011-06-19 14:41:33 +00:00
|
|
|
#define STM32_HAS_GPIOH FALSE
|
2010-11-14 16:47:38 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_I2C1 TRUE
|
|
|
|
#define STM32_HAS_I2C2 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_RTC TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_SDIO FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_SPI1 TRUE
|
|
|
|
#define STM32_HAS_SPI2 FALSE
|
|
|
|
#define STM32_HAS_SPI3 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_TIM1 TRUE
|
|
|
|
#define STM32_HAS_TIM2 TRUE
|
|
|
|
#define STM32_HAS_TIM3 TRUE
|
|
|
|
#define STM32_HAS_TIM4 FALSE
|
|
|
|
#define STM32_HAS_TIM5 FALSE
|
|
|
|
#define STM32_HAS_TIM6 TRUE
|
|
|
|
#define STM32_HAS_TIM7 TRUE
|
|
|
|
#define STM32_HAS_TIM8 FALSE
|
|
|
|
#define STM32_HAS_TIM9 FALSE
|
|
|
|
#define STM32_HAS_TIM10 FALSE
|
|
|
|
#define STM32_HAS_TIM11 FALSE
|
|
|
|
#define STM32_HAS_TIM12 FALSE
|
|
|
|
#define STM32_HAS_TIM13 FALSE
|
|
|
|
#define STM32_HAS_TIM14 FALSE
|
|
|
|
#define STM32_HAS_TIM15 TRUE
|
|
|
|
#define STM32_HAS_TIM16 TRUE
|
|
|
|
#define STM32_HAS_TIM17 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_USART1 TRUE
|
|
|
|
#define STM32_HAS_USART2 TRUE
|
|
|
|
#define STM32_HAS_USART3 FALSE
|
|
|
|
#define STM32_HAS_UART4 FALSE
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_HAS_UART5 FALSE
|
|
|
|
#define STM32_HAS_USART6 FALSE
|
2010-11-14 16:47:38 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_USB FALSE
|
2011-01-15 08:01:07 +00:00
|
|
|
#define STM32_HAS_OTG1 FALSE
|
2010-11-14 16:47:38 +00:00
|
|
|
|
2010-11-16 18:39:47 +00:00
|
|
|
#elif defined(STM32F10X_MD_VL)
|
2010-11-14 16:47:38 +00:00
|
|
|
/*
|
|
|
|
* Capability flags for Value Line Medium Density devices.
|
|
|
|
*/
|
|
|
|
#define PLATFORM_NAME "STM32 Value Line Medium Density"
|
|
|
|
#include "hal_lld_f100.h"
|
|
|
|
|
|
|
|
#define STM32_HAS_ADC1 TRUE
|
|
|
|
#define STM32_HAS_ADC2 FALSE
|
|
|
|
#define STM32_HAS_ADC3 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_CAN1 FALSE
|
|
|
|
#define STM32_HAS_CAN2 FALSE
|
|
|
|
|
2010-11-15 19:44:09 +00:00
|
|
|
#define STM32_HAS_DAC TRUE
|
2010-11-14 16:47:38 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_DMA1 TRUE
|
|
|
|
#define STM32_HAS_DMA2 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_ETH FALSE
|
|
|
|
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_EXTI_NUM_CHANNELS 19
|
|
|
|
|
2010-11-14 16:47:38 +00:00
|
|
|
#define STM32_HAS_GPIOA TRUE
|
|
|
|
#define STM32_HAS_GPIOB TRUE
|
|
|
|
#define STM32_HAS_GPIOC TRUE
|
|
|
|
#define STM32_HAS_GPIOD TRUE
|
|
|
|
#define STM32_HAS_GPIOE TRUE
|
|
|
|
#define STM32_HAS_GPIOF FALSE
|
|
|
|
#define STM32_HAS_GPIOG FALSE
|
2011-06-19 14:41:33 +00:00
|
|
|
#define STM32_HAS_GPIOH FALSE
|
2010-11-14 16:47:38 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_I2C1 TRUE
|
|
|
|
#define STM32_HAS_I2C2 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_RTC TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_SDIO FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_SPI1 TRUE
|
|
|
|
#define STM32_HAS_SPI2 TRUE
|
|
|
|
#define STM32_HAS_SPI3 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_TIM1 TRUE
|
|
|
|
#define STM32_HAS_TIM2 TRUE
|
|
|
|
#define STM32_HAS_TIM3 TRUE
|
|
|
|
#define STM32_HAS_TIM4 TRUE
|
|
|
|
#define STM32_HAS_TIM5 FALSE
|
|
|
|
#define STM32_HAS_TIM6 TRUE
|
|
|
|
#define STM32_HAS_TIM7 TRUE
|
|
|
|
#define STM32_HAS_TIM8 FALSE
|
|
|
|
#define STM32_HAS_TIM9 FALSE
|
|
|
|
#define STM32_HAS_TIM10 FALSE
|
|
|
|
#define STM32_HAS_TIM11 FALSE
|
|
|
|
#define STM32_HAS_TIM12 FALSE
|
|
|
|
#define STM32_HAS_TIM13 FALSE
|
|
|
|
#define STM32_HAS_TIM14 FALSE
|
|
|
|
#define STM32_HAS_TIM15 TRUE
|
|
|
|
#define STM32_HAS_TIM16 TRUE
|
|
|
|
#define STM32_HAS_TIM17 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_USART1 TRUE
|
|
|
|
#define STM32_HAS_USART2 TRUE
|
|
|
|
#define STM32_HAS_USART3 TRUE
|
|
|
|
#define STM32_HAS_UART4 FALSE
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_HAS_UART5 FALSE
|
|
|
|
#define STM32_HAS_USART6 FALSE
|
2010-11-14 16:47:38 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_USB FALSE
|
2011-01-15 08:01:07 +00:00
|
|
|
#define STM32_HAS_OTG1 FALSE
|
2010-11-14 16:47:38 +00:00
|
|
|
|
2010-11-16 18:39:47 +00:00
|
|
|
#elif defined(STM32F10X_LD)
|
2010-11-14 13:29:09 +00:00
|
|
|
/*
|
2010-11-14 16:47:38 +00:00
|
|
|
* Capability flags for Performance Line Low Density devices.
|
2010-11-14 13:29:09 +00:00
|
|
|
*/
|
|
|
|
#define PLATFORM_NAME "STM32 Performance Line Low Density"
|
2010-05-18 13:36:33 +00:00
|
|
|
#include "hal_lld_f103.h"
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_ADC1 TRUE
|
|
|
|
#define STM32_HAS_ADC2 TRUE
|
|
|
|
#define STM32_HAS_ADC3 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_CAN1 TRUE
|
|
|
|
#define STM32_HAS_CAN2 FALSE
|
|
|
|
|
2010-11-15 19:44:09 +00:00
|
|
|
#define STM32_HAS_DAC FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_DMA1 TRUE
|
|
|
|
#define STM32_HAS_DMA2 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_ETH FALSE
|
|
|
|
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_EXTI_NUM_CHANNELS 19
|
|
|
|
|
2010-11-14 13:29:09 +00:00
|
|
|
#define STM32_HAS_GPIOA TRUE
|
|
|
|
#define STM32_HAS_GPIOB TRUE
|
|
|
|
#define STM32_HAS_GPIOC TRUE
|
|
|
|
#define STM32_HAS_GPIOD TRUE
|
|
|
|
#define STM32_HAS_GPIOE FALSE
|
|
|
|
#define STM32_HAS_GPIOF FALSE
|
|
|
|
#define STM32_HAS_GPIOG FALSE
|
2011-06-19 14:41:33 +00:00
|
|
|
#define STM32_HAS_GPIOH FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_I2C1 TRUE
|
|
|
|
#define STM32_HAS_I2C2 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_RTC TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_SDIO FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_SPI1 TRUE
|
|
|
|
#define STM32_HAS_SPI2 FALSE
|
|
|
|
#define STM32_HAS_SPI3 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_TIM1 TRUE
|
|
|
|
#define STM32_HAS_TIM2 TRUE
|
|
|
|
#define STM32_HAS_TIM3 TRUE
|
|
|
|
#define STM32_HAS_TIM4 FALSE
|
|
|
|
#define STM32_HAS_TIM5 FALSE
|
|
|
|
#define STM32_HAS_TIM6 FALSE
|
|
|
|
#define STM32_HAS_TIM7 FALSE
|
|
|
|
#define STM32_HAS_TIM8 FALSE
|
|
|
|
#define STM32_HAS_TIM9 FALSE
|
|
|
|
#define STM32_HAS_TIM10 FALSE
|
|
|
|
#define STM32_HAS_TIM11 FALSE
|
|
|
|
#define STM32_HAS_TIM12 FALSE
|
|
|
|
#define STM32_HAS_TIM13 FALSE
|
|
|
|
#define STM32_HAS_TIM14 FALSE
|
|
|
|
#define STM32_HAS_TIM15 FALSE
|
|
|
|
#define STM32_HAS_TIM16 FALSE
|
|
|
|
#define STM32_HAS_TIM17 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_USART1 TRUE
|
|
|
|
#define STM32_HAS_USART2 TRUE
|
|
|
|
#define STM32_HAS_USART3 FALSE
|
|
|
|
#define STM32_HAS_UART4 FALSE
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_HAS_UART5 FALSE
|
|
|
|
#define STM32_HAS_USART6 FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_USB FALSE
|
2011-01-15 08:01:07 +00:00
|
|
|
#define STM32_HAS_OTG1 FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
2010-11-16 18:39:47 +00:00
|
|
|
#elif defined(STM32F10X_MD)
|
2010-11-14 13:29:09 +00:00
|
|
|
/*
|
2010-11-14 16:47:38 +00:00
|
|
|
* Capability flags for Performance Line Medium Density devices.
|
2010-11-14 13:29:09 +00:00
|
|
|
*/
|
|
|
|
#define PLATFORM_NAME "STM32 Performance Line Medium Density"
|
2010-05-18 13:36:33 +00:00
|
|
|
#include "hal_lld_f103.h"
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_ADC1 TRUE
|
|
|
|
#define STM32_HAS_ADC2 TRUE
|
|
|
|
#define STM32_HAS_ADC3 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_CAN1 TRUE
|
|
|
|
#define STM32_HAS_CAN2 FALSE
|
|
|
|
|
2010-11-15 19:44:09 +00:00
|
|
|
#define STM32_HAS_DAC FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_DMA1 TRUE
|
|
|
|
#define STM32_HAS_DMA2 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_ETH FALSE
|
|
|
|
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_EXTI_NUM_CHANNELS 19
|
|
|
|
|
2010-11-14 13:29:09 +00:00
|
|
|
#define STM32_HAS_GPIOA TRUE
|
|
|
|
#define STM32_HAS_GPIOB TRUE
|
|
|
|
#define STM32_HAS_GPIOC TRUE
|
|
|
|
#define STM32_HAS_GPIOD TRUE
|
|
|
|
#define STM32_HAS_GPIOE TRUE
|
|
|
|
#define STM32_HAS_GPIOF FALSE
|
|
|
|
#define STM32_HAS_GPIOG FALSE
|
2011-06-19 14:41:33 +00:00
|
|
|
#define STM32_HAS_GPIOH FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_I2C1 TRUE
|
|
|
|
#define STM32_HAS_I2C2 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_RTC TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_SDIO FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_SPI1 TRUE
|
|
|
|
#define STM32_HAS_SPI2 TRUE
|
|
|
|
#define STM32_HAS_SPI3 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_TIM1 TRUE
|
|
|
|
#define STM32_HAS_TIM2 TRUE
|
|
|
|
#define STM32_HAS_TIM3 TRUE
|
|
|
|
#define STM32_HAS_TIM4 TRUE
|
|
|
|
#define STM32_HAS_TIM5 FALSE
|
|
|
|
#define STM32_HAS_TIM6 FALSE
|
|
|
|
#define STM32_HAS_TIM7 FALSE
|
|
|
|
#define STM32_HAS_TIM8 FALSE
|
|
|
|
#define STM32_HAS_TIM9 FALSE
|
|
|
|
#define STM32_HAS_TIM10 FALSE
|
|
|
|
#define STM32_HAS_TIM11 FALSE
|
|
|
|
#define STM32_HAS_TIM12 FALSE
|
|
|
|
#define STM32_HAS_TIM13 FALSE
|
|
|
|
#define STM32_HAS_TIM14 FALSE
|
|
|
|
#define STM32_HAS_TIM15 FALSE
|
|
|
|
#define STM32_HAS_TIM16 FALSE
|
|
|
|
#define STM32_HAS_TIM17 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_USART1 TRUE
|
|
|
|
#define STM32_HAS_USART2 TRUE
|
|
|
|
#define STM32_HAS_USART3 TRUE
|
|
|
|
#define STM32_HAS_UART4 FALSE
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_HAS_UART5 FALSE
|
|
|
|
#define STM32_HAS_USART6 FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_USB TRUE
|
2011-01-15 08:01:07 +00:00
|
|
|
#define STM32_HAS_OTG1 FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
2010-11-16 18:39:47 +00:00
|
|
|
#elif defined(STM32F10X_HD)
|
2010-11-14 13:29:09 +00:00
|
|
|
/*
|
2010-11-14 16:47:38 +00:00
|
|
|
* Capability flags for Performance Line High Density devices.
|
2010-11-14 13:29:09 +00:00
|
|
|
*/
|
|
|
|
#define PLATFORM_NAME "STM32 Performance Line High Density"
|
2010-05-18 13:36:33 +00:00
|
|
|
#include "hal_lld_f103.h"
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_ADC1 TRUE
|
|
|
|
#define STM32_HAS_ADC2 TRUE
|
|
|
|
#define STM32_HAS_ADC3 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_CAN1 TRUE
|
|
|
|
#define STM32_HAS_CAN2 FALSE
|
|
|
|
|
2010-11-15 19:44:09 +00:00
|
|
|
#define STM32_HAS_DAC TRUE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_DMA1 TRUE
|
|
|
|
#define STM32_HAS_DMA2 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_ETH FALSE
|
|
|
|
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_EXTI_NUM_CHANNELS 19
|
|
|
|
|
2010-11-14 13:29:09 +00:00
|
|
|
#define STM32_HAS_GPIOA TRUE
|
|
|
|
#define STM32_HAS_GPIOB TRUE
|
|
|
|
#define STM32_HAS_GPIOC TRUE
|
|
|
|
#define STM32_HAS_GPIOD TRUE
|
|
|
|
#define STM32_HAS_GPIOE TRUE
|
|
|
|
#define STM32_HAS_GPIOF TRUE
|
|
|
|
#define STM32_HAS_GPIOG TRUE
|
2011-06-19 14:41:33 +00:00
|
|
|
#define STM32_HAS_GPIOH FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_I2C1 TRUE
|
|
|
|
#define STM32_HAS_I2C2 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_RTC TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_SDIO TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_SPI1 TRUE
|
|
|
|
#define STM32_HAS_SPI2 TRUE
|
|
|
|
#define STM32_HAS_SPI3 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_TIM1 TRUE
|
|
|
|
#define STM32_HAS_TIM2 TRUE
|
|
|
|
#define STM32_HAS_TIM3 TRUE
|
|
|
|
#define STM32_HAS_TIM4 TRUE
|
|
|
|
#define STM32_HAS_TIM5 TRUE
|
|
|
|
#define STM32_HAS_TIM6 TRUE
|
|
|
|
#define STM32_HAS_TIM7 TRUE
|
|
|
|
#define STM32_HAS_TIM8 TRUE
|
2011-06-29 11:59:15 +00:00
|
|
|
#define STM32_HAS_TIM9 TRUE
|
|
|
|
#define STM32_HAS_TIM10 TRUE
|
|
|
|
#define STM32_HAS_TIM11 TRUE
|
|
|
|
#define STM32_HAS_TIM12 TRUE
|
|
|
|
#define STM32_HAS_TIM13 TRUE
|
|
|
|
#define STM32_HAS_TIM14 TRUE
|
2010-11-14 13:29:09 +00:00
|
|
|
#define STM32_HAS_TIM15 FALSE
|
|
|
|
#define STM32_HAS_TIM16 FALSE
|
|
|
|
#define STM32_HAS_TIM17 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_USART1 TRUE
|
|
|
|
#define STM32_HAS_USART2 TRUE
|
|
|
|
#define STM32_HAS_USART3 TRUE
|
|
|
|
#define STM32_HAS_UART4 TRUE
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_HAS_UART5 TRUE
|
|
|
|
#define STM32_HAS_USART6 FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_USB TRUE
|
2011-01-15 08:01:07 +00:00
|
|
|
#define STM32_HAS_OTG1 FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
2011-04-23 08:41:42 +00:00
|
|
|
#elif defined(STM32F10X_XL)
|
2010-11-14 13:29:09 +00:00
|
|
|
/*
|
2010-11-16 18:39:47 +00:00
|
|
|
* Capability flags for Performance Line eXtra Density devices.
|
2010-11-14 13:29:09 +00:00
|
|
|
*/
|
2010-11-16 18:39:47 +00:00
|
|
|
#define PLATFORM_NAME "STM32 Performance Line eXtra Density"
|
|
|
|
#include "hal_lld_f103.h"
|
2010-05-09 17:52:30 +00:00
|
|
|
|
2010-11-14 13:29:09 +00:00
|
|
|
#define STM32_HAS_ADC1 TRUE
|
|
|
|
#define STM32_HAS_ADC2 TRUE
|
2010-11-16 18:39:47 +00:00
|
|
|
#define STM32_HAS_ADC3 TRUE
|
2010-07-31 07:02:45 +00:00
|
|
|
|
2010-11-14 13:29:09 +00:00
|
|
|
#define STM32_HAS_CAN1 TRUE
|
2010-11-16 18:39:47 +00:00
|
|
|
#define STM32_HAS_CAN2 FALSE
|
2010-07-31 07:02:45 +00:00
|
|
|
|
2010-11-15 19:44:09 +00:00
|
|
|
#define STM32_HAS_DAC TRUE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_DMA1 TRUE
|
|
|
|
#define STM32_HAS_DMA2 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_ETH FALSE
|
|
|
|
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_EXTI_NUM_CHANNELS 19
|
|
|
|
|
2010-11-14 13:29:09 +00:00
|
|
|
#define STM32_HAS_GPIOA TRUE
|
|
|
|
#define STM32_HAS_GPIOB TRUE
|
|
|
|
#define STM32_HAS_GPIOC TRUE
|
|
|
|
#define STM32_HAS_GPIOD TRUE
|
|
|
|
#define STM32_HAS_GPIOE TRUE
|
2010-11-16 18:39:47 +00:00
|
|
|
#define STM32_HAS_GPIOF TRUE
|
|
|
|
#define STM32_HAS_GPIOG TRUE
|
2011-06-19 14:41:33 +00:00
|
|
|
#define STM32_HAS_GPIOH FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_I2C1 TRUE
|
|
|
|
#define STM32_HAS_I2C2 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_RTC TRUE
|
|
|
|
|
2010-11-16 18:39:47 +00:00
|
|
|
#define STM32_HAS_SDIO TRUE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_SPI1 TRUE
|
|
|
|
#define STM32_HAS_SPI2 TRUE
|
|
|
|
#define STM32_HAS_SPI3 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_TIM1 TRUE
|
|
|
|
#define STM32_HAS_TIM2 TRUE
|
|
|
|
#define STM32_HAS_TIM3 TRUE
|
|
|
|
#define STM32_HAS_TIM4 TRUE
|
|
|
|
#define STM32_HAS_TIM5 TRUE
|
|
|
|
#define STM32_HAS_TIM6 TRUE
|
|
|
|
#define STM32_HAS_TIM7 TRUE
|
2010-11-16 18:39:47 +00:00
|
|
|
#define STM32_HAS_TIM8 TRUE
|
2010-11-14 13:29:09 +00:00
|
|
|
#define STM32_HAS_TIM9 FALSE
|
|
|
|
#define STM32_HAS_TIM10 FALSE
|
|
|
|
#define STM32_HAS_TIM11 FALSE
|
|
|
|
#define STM32_HAS_TIM12 FALSE
|
|
|
|
#define STM32_HAS_TIM13 FALSE
|
|
|
|
#define STM32_HAS_TIM14 FALSE
|
|
|
|
#define STM32_HAS_TIM15 FALSE
|
|
|
|
#define STM32_HAS_TIM16 FALSE
|
|
|
|
#define STM32_HAS_TIM17 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_USART1 TRUE
|
|
|
|
#define STM32_HAS_USART2 TRUE
|
|
|
|
#define STM32_HAS_USART3 TRUE
|
|
|
|
#define STM32_HAS_UART4 TRUE
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_HAS_UART5 TRUE
|
|
|
|
#define STM32_HAS_USART6 FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
2010-11-16 18:39:47 +00:00
|
|
|
#define STM32_HAS_USB TRUE
|
2011-01-15 08:01:07 +00:00
|
|
|
#define STM32_HAS_OTG1 FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
2010-11-16 18:39:47 +00:00
|
|
|
#elif defined(STM32F10X_CL)
|
2010-11-14 13:29:09 +00:00
|
|
|
/*
|
2010-11-16 18:39:47 +00:00
|
|
|
* Capability flags for Connectivity Line devices.
|
2010-11-14 13:29:09 +00:00
|
|
|
*/
|
2010-11-16 18:39:47 +00:00
|
|
|
#define PLATFORM_NAME "STM32 Connectivity Line"
|
2010-11-14 13:29:09 +00:00
|
|
|
#include "hal_lld_f105_f107.h"
|
|
|
|
|
|
|
|
#define STM32_HAS_ADC1 TRUE
|
|
|
|
#define STM32_HAS_ADC2 TRUE
|
|
|
|
#define STM32_HAS_ADC3 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_CAN1 TRUE
|
|
|
|
#define STM32_HAS_CAN2 TRUE
|
|
|
|
|
2010-11-15 19:44:09 +00:00
|
|
|
#define STM32_HAS_DAC TRUE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_DMA1 TRUE
|
|
|
|
#define STM32_HAS_DMA2 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_ETH TRUE
|
|
|
|
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_EXTI_NUM_CHANNELS 20
|
|
|
|
|
2010-11-14 13:29:09 +00:00
|
|
|
#define STM32_HAS_GPIOA TRUE
|
|
|
|
#define STM32_HAS_GPIOB TRUE
|
|
|
|
#define STM32_HAS_GPIOC TRUE
|
|
|
|
#define STM32_HAS_GPIOD TRUE
|
|
|
|
#define STM32_HAS_GPIOE TRUE
|
|
|
|
#define STM32_HAS_GPIOF FALSE
|
|
|
|
#define STM32_HAS_GPIOG FALSE
|
2011-06-19 14:41:33 +00:00
|
|
|
#define STM32_HAS_GPIOH FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_I2C1 TRUE
|
|
|
|
#define STM32_HAS_I2C2 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_RTC TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_SDIO FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_SPI1 TRUE
|
|
|
|
#define STM32_HAS_SPI2 TRUE
|
|
|
|
#define STM32_HAS_SPI3 TRUE
|
|
|
|
|
|
|
|
#define STM32_HAS_TIM1 TRUE
|
|
|
|
#define STM32_HAS_TIM2 TRUE
|
|
|
|
#define STM32_HAS_TIM3 TRUE
|
|
|
|
#define STM32_HAS_TIM4 TRUE
|
|
|
|
#define STM32_HAS_TIM5 TRUE
|
|
|
|
#define STM32_HAS_TIM6 TRUE
|
|
|
|
#define STM32_HAS_TIM7 TRUE
|
|
|
|
#define STM32_HAS_TIM8 FALSE
|
|
|
|
#define STM32_HAS_TIM9 FALSE
|
|
|
|
#define STM32_HAS_TIM10 FALSE
|
|
|
|
#define STM32_HAS_TIM11 FALSE
|
|
|
|
#define STM32_HAS_TIM12 FALSE
|
|
|
|
#define STM32_HAS_TIM13 FALSE
|
|
|
|
#define STM32_HAS_TIM14 FALSE
|
|
|
|
#define STM32_HAS_TIM15 FALSE
|
|
|
|
#define STM32_HAS_TIM16 FALSE
|
|
|
|
#define STM32_HAS_TIM17 FALSE
|
|
|
|
|
|
|
|
#define STM32_HAS_USART1 TRUE
|
|
|
|
#define STM32_HAS_USART2 TRUE
|
|
|
|
#define STM32_HAS_USART3 TRUE
|
|
|
|
#define STM32_HAS_UART4 TRUE
|
2011-09-20 17:33:38 +00:00
|
|
|
#define STM32_HAS_UART5 TRUE
|
|
|
|
#define STM32_HAS_USART6 FALSE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#define STM32_HAS_USB FALSE
|
2011-01-15 08:01:07 +00:00
|
|
|
#define STM32_HAS_OTG1 TRUE
|
2010-11-14 13:29:09 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
#error "unspecified, unsupported or invalid STM32 platform"
|
|
|
|
#endif
|
2010-07-31 07:02:45 +00:00
|
|
|
|
2011-06-29 11:59:15 +00:00
|
|
|
/* There are differences in vector names in the various sub-families,
|
|
|
|
normalizing.*/
|
|
|
|
#if defined(STM32F10X_XL)
|
|
|
|
#define TIM1_BRK_IRQn TIM1_BRK_TIM9_IRQn
|
|
|
|
#define TIM1_UP_IRQn TIM1_UP_TIM10_IRQn
|
|
|
|
#define TIM1_TRG_COM_IRQn TIM1_TRG_COM_TIM11_IRQn
|
|
|
|
#define TIM8_BRK_IRQn TIM8_BRK_TIM12_IRQn
|
|
|
|
#define TIM8_UP_IRQn TIM8_UP_TIM13_IRQn
|
|
|
|
#define TIM8_TRG_COM_IRQn TIM8_TRG_COM_TIM14_IRQn
|
|
|
|
|
|
|
|
#elif defined(STM32F10X_LD_VL)|| defined(STM32F10X_MD_VL) || \
|
|
|
|
defined(STM32F10X_HD_VL)
|
|
|
|
#define TIM1_BRK_IRQn TIM1_BRK_TIM15_IRQn
|
|
|
|
#define TIM1_UP_IRQn TIM1_UP_TIM16_IRQn
|
|
|
|
#define TIM1_TRG_COM_IRQn TIM1_TRG_COM_TIM17_IRQn
|
|
|
|
#endif
|
|
|
|
|
2010-07-31 07:02:45 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver data structures and types. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver macros. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
2009-11-29 08:50:13 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
/* External declarations. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
2010-11-14 13:29:09 +00:00
|
|
|
/* Tricks required to make the TRUE/FALSE declaration inside the library
|
|
|
|
compatible.*/
|
|
|
|
#undef FALSE
|
|
|
|
#undef TRUE
|
|
|
|
#include "stm32f10x.h"
|
|
|
|
#define FALSE 0
|
|
|
|
#define TRUE (!FALSE)
|
|
|
|
|
2011-09-16 17:38:22 +00:00
|
|
|
/* STM32 DMA and RCC helpers.*/
|
2010-11-14 13:29:09 +00:00
|
|
|
#include "stm32_dma.h"
|
2011-09-16 17:38:22 +00:00
|
|
|
#include "stm32_rcc.h"
|
2010-11-14 13:29:09 +00:00
|
|
|
|
2009-11-29 08:50:13 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
void hal_lld_init(void);
|
|
|
|
void stm32_clock_init(void);
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _HAL_LLD_H_ */
|
|
|
|
|
|
|
|
/** @} */
|