mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri May 30 15:30:09 2014 +0100
Revision:
218:44081b78fdc2
Parent:
205:c41fc65bcfb4
Synchronized with git revision d854859072d318241476ccc5f335965444d4c1d8

Full URL: https://github.com/mbedmicro/mbed/commit/d854859072d318241476ccc5f335965444d4c1d8/

[NUCLEO_F072RB] Update CubeF0 HAL driver

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 205:c41fc65bcfb4 1 /**
mbed_official 205:c41fc65bcfb4 2 ******************************************************************************
mbed_official 205:c41fc65bcfb4 3 * @file stm32f0xx_hal.h
mbed_official 205:c41fc65bcfb4 4 * @author MCD Application Team
mbed_official 205:c41fc65bcfb4 5 * @version V1.0.0
mbed_official 218:44081b78fdc2 6 * @date 28-May-2014
mbed_official 205:c41fc65bcfb4 7 * @brief This file contains all the functions prototypes for the HAL
mbed_official 205:c41fc65bcfb4 8 * module driver.
mbed_official 205:c41fc65bcfb4 9 ******************************************************************************
mbed_official 205:c41fc65bcfb4 10 * @attention
mbed_official 205:c41fc65bcfb4 11 *
mbed_official 205:c41fc65bcfb4 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 205:c41fc65bcfb4 13 *
mbed_official 205:c41fc65bcfb4 14 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 205:c41fc65bcfb4 15 * are permitted provided that the following conditions are met:
mbed_official 205:c41fc65bcfb4 16 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 205:c41fc65bcfb4 17 * this list of conditions and the following disclaimer.
mbed_official 205:c41fc65bcfb4 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 205:c41fc65bcfb4 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 205:c41fc65bcfb4 20 * and/or other materials provided with the distribution.
mbed_official 205:c41fc65bcfb4 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 205:c41fc65bcfb4 22 * may be used to endorse or promote products derived from this software
mbed_official 205:c41fc65bcfb4 23 * without specific prior written permission.
mbed_official 205:c41fc65bcfb4 24 *
mbed_official 205:c41fc65bcfb4 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 205:c41fc65bcfb4 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 205:c41fc65bcfb4 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 205:c41fc65bcfb4 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 205:c41fc65bcfb4 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 205:c41fc65bcfb4 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 205:c41fc65bcfb4 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 205:c41fc65bcfb4 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 205:c41fc65bcfb4 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 205:c41fc65bcfb4 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 205:c41fc65bcfb4 35 *
mbed_official 205:c41fc65bcfb4 36 ******************************************************************************
mbed_official 205:c41fc65bcfb4 37 */
mbed_official 205:c41fc65bcfb4 38
mbed_official 205:c41fc65bcfb4 39 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 205:c41fc65bcfb4 40 #ifndef __STM32F0xx_HAL_H
mbed_official 205:c41fc65bcfb4 41 #define __STM32F0xx_HAL_H
mbed_official 205:c41fc65bcfb4 42
mbed_official 205:c41fc65bcfb4 43 #ifdef __cplusplus
mbed_official 205:c41fc65bcfb4 44 extern "C" {
mbed_official 205:c41fc65bcfb4 45 #endif
mbed_official 205:c41fc65bcfb4 46
mbed_official 205:c41fc65bcfb4 47 /* Includes ------------------------------------------------------------------*/
mbed_official 205:c41fc65bcfb4 48 #include "stm32f0xx_hal_conf.h"
mbed_official 205:c41fc65bcfb4 49
mbed_official 205:c41fc65bcfb4 50 /** @addtogroup STM32F0xx_HAL_Driver
mbed_official 205:c41fc65bcfb4 51 * @{
mbed_official 205:c41fc65bcfb4 52 */
mbed_official 205:c41fc65bcfb4 53
mbed_official 205:c41fc65bcfb4 54 /** @addtogroup HAL
mbed_official 205:c41fc65bcfb4 55 * @{
mbed_official 205:c41fc65bcfb4 56 */
mbed_official 205:c41fc65bcfb4 57
mbed_official 205:c41fc65bcfb4 58 /* Exported types ------------------------------------------------------------*/
mbed_official 205:c41fc65bcfb4 59 /* Exported constants --------------------------------------------------------*/
mbed_official 205:c41fc65bcfb4 60
mbed_official 205:c41fc65bcfb4 61 /** @defgroup HAL_DMA_Remapping
mbed_official 205:c41fc65bcfb4 62 * Elements values convention: 0xYYYYYYYY
mbed_official 205:c41fc65bcfb4 63 * - YYYYYYYY : Position in the SYSCFG register CFGR1
mbed_official 205:c41fc65bcfb4 64 * @{
mbed_official 205:c41fc65bcfb4 65 */
mbed_official 205:c41fc65bcfb4 66 #define HAL_REMAPDMA_ADC_DMA_CH2 ((uint32_t)SYSCFG_CFGR1_ADC_DMA_RMP) /*!< ADC DMA remap
mbed_official 205:c41fc65bcfb4 67 0: No remap (ADC DMA requests mapped on DMA channel 1
mbed_official 205:c41fc65bcfb4 68 1: Remap (ADC DMA requests mapped on DMA channel 2 */
mbed_official 205:c41fc65bcfb4 69 #define HAL_REMAPDMA_USART1_TX_DMA_CH4 ((uint32_t)SYSCFG_CFGR1_USART1TX_DMA_RMP) /*!< USART1 TX DMA remap
mbed_official 205:c41fc65bcfb4 70 0: No remap (USART1_TX DMA request mapped on DMA channel 2
mbed_official 205:c41fc65bcfb4 71 1: Remap (USART1_TX DMA request mapped on DMA channel 4 */
mbed_official 205:c41fc65bcfb4 72 #define HAL_REMAPDMA_USART1_RX_DMA_CH5 ((uint32_t)SYSCFG_CFGR1_USART1RX_DMA_RMP) /*!< USART1 RX DMA remap
mbed_official 205:c41fc65bcfb4 73 0: No remap (USART1_RX DMA request mapped on DMA channel 3
mbed_official 205:c41fc65bcfb4 74 1: Remap (USART1_RX DMA request mapped on DMA channel 5 */
mbed_official 205:c41fc65bcfb4 75 #define HAL_REMAPDMA_TIM16_DMA_CH4 ((uint32_t)SYSCFG_CFGR1_TIM16_DMA_RMP) /*!< TIM16 DMA request remap
mbed_official 205:c41fc65bcfb4 76 0: No remap (TIM16_CH1 and TIM16_UP DMA requests mapped on DMA channel 3)
mbed_official 205:c41fc65bcfb4 77 1: Remap (TIM16_CH1 and TIM16_UP DMA requests mapped on DMA channel 4) */
mbed_official 205:c41fc65bcfb4 78 #define HAL_REMAPDMA_TIM17_DMA_CH2 ((uint32_t)SYSCFG_CFGR1_TIM17_DMA_RMP) /*!< TIM17 DMA request remap
mbed_official 205:c41fc65bcfb4 79 0: No remap (TIM17_CH1 and TIM17_UP DMA requests mapped on DMA channel 1
mbed_official 205:c41fc65bcfb4 80 1: Remap (TIM17_CH1 and TIM17_UP DMA requests mapped on DMA channel 2) */
mbed_official 205:c41fc65bcfb4 81
mbed_official 205:c41fc65bcfb4 82 #if defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx)
mbed_official 205:c41fc65bcfb4 83 #define HAL_REMAPDMA_TIM16_DMA_CH6 ((uint32_t)SYSCFG_CFGR1_TIM16_DMA_RMP2) /*!< TIM16 alternate DMA request remapping bit. Available on STM32F07x devices only
mbed_official 205:c41fc65bcfb4 84 0: No alternate remap (TIM16 DMA requestsmapped according to TIM16_DMA_RMP bit)
mbed_official 205:c41fc65bcfb4 85 1: Alternate remap (TIM16_CH1 and TIM16_UP DMA requests mapped on DMA channel 6) */
mbed_official 205:c41fc65bcfb4 86 #define HAL_REMAPDMA_TIM17_DMA_CH7 ((uint32_t)SYSCFG_CFGR1_TIM17_DMA_RMP2) /*!< TIM17 alternate DMA request remapping bit. Available on STM32F07x devices only
mbed_official 205:c41fc65bcfb4 87 0: No alternate remap (TIM17 DMA requestsmapped according to TIM17_DMA_RMP bit)
mbed_official 205:c41fc65bcfb4 88 1: Alternate remap (TIM17_CH1 and TIM17_UP DMA requests mapped on DMA channel 7) */
mbed_official 205:c41fc65bcfb4 89 #define HAL_REMAPDMA_SPI2_DMA_CH67 ((uint32_t)SYSCFG_CFGR1_SPI2_DMA_RMP) /*!< SPI2 DMA request remapping bit. Available on STM32F07x devices only.
mbed_official 205:c41fc65bcfb4 90 0: No remap (SPI2_RX and SPI2_TX DMA requests mapped on DMA channel 4 and 5 respectively)
mbed_official 205:c41fc65bcfb4 91 1: 1: Remap (SPI2_RX and SPI2_TX DMA requests mapped on DMA channel 6 and 7 respectively) */
mbed_official 205:c41fc65bcfb4 92 #define HAL_REMAPDMA_USART2_DMA_CH67 ((uint32_t)SYSCFG_CFGR1_USART2_DMA_RMP) /*!< USART2 DMA request remapping bit. Available on STM32F07x devices only.
mbed_official 205:c41fc65bcfb4 93 0: No remap (USART2_RX and USART2_TX DMA requests mapped on DMA channel 5 and 4 respectively)
mbed_official 205:c41fc65bcfb4 94 1: 1: Remap (USART2_RX and USART2_TX DMA requests mapped on DMA channel 6 and 7 respectively) */
mbed_official 205:c41fc65bcfb4 95 #define HAL_REMAPDMA_USART3_DMA_CH32 ((uint32_t)SYSCFG_CFGR1_USART3_DMA_RMP) /*!< USART3 DMA request remapping bit. Available on STM32F07x devices only.
mbed_official 205:c41fc65bcfb4 96 0: No remap (USART3_RX and USART3_TX DMA requests mapped on DMA channel 6 and 7 respectively)
mbed_official 205:c41fc65bcfb4 97 1: 1: Remap (USART3_RX and USART3_TX DMA requests mapped on DMA channel 3 and 2 respectively) */
mbed_official 205:c41fc65bcfb4 98 #define HAL_REMAPDMA_I2C1_DMA_CH76 ((uint32_t)SYSCFG_CFGR1_I2C1_DMA_RMP) /*!< I2C1 DMA request remapping bit. Available on STM32F07x devices only.
mbed_official 205:c41fc65bcfb4 99 0: No remap (I2C1_RX and I2C1_TX DMA requests mapped on DMA channel 3 and 2 respectively)
mbed_official 205:c41fc65bcfb4 100 1: Remap (I2C1_RX and I2C1_TX DMA requests mapped on DMA channel 7 and 6 respectively) */
mbed_official 205:c41fc65bcfb4 101 #define HAL_REMAPDMA_TIM1_DMA_CH6 ((uint32_t)SYSCFG_CFGR1_TIM1_DMA_RMP) /*!< TIM1 DMA request remapping bit. Available on STM32F07x devices only.
mbed_official 205:c41fc65bcfb4 102 0: No remap (TIM1_CH1, TIM1_CH2 and TIM1_CH3 DMA requests mapped on DMA channel 2, 3 and 4 respectively)
mbed_official 205:c41fc65bcfb4 103 1: Remap (TIM1_CH1, TIM1_CH2 and TIM1_CH3 DMA requests mapped on DMA channel 6 */
mbed_official 205:c41fc65bcfb4 104 #define HAL_REMAPDMA_TIM2_DMA_CH7 ((uint32_t)SYSCFG_CFGR1_TIM2_DMA_RMP) /*!< TIM2 DMA request remapping bit. Available on STM32F07x devices only.
mbed_official 205:c41fc65bcfb4 105 0: No remap (TIM2_CH2 and TIM2_CH4 DMA requests mapped on DMA channel 3 and 4 respectively)
mbed_official 205:c41fc65bcfb4 106 1: Remap (TIM2_CH2 and TIM2_CH4 DMA requests mapped on DMA channel 7 */
mbed_official 205:c41fc65bcfb4 107 #define HAL_REMAPDMA_TIM3_DMA_CH6 ((uint32_t)SYSCFG_CFGR1_TIM3_DMA_RMP) /*!< TIM3 DMA request remapping bit. Available on STM32F07x devices only.
mbed_official 205:c41fc65bcfb4 108 0: No remap (TIM3_CH1 and TIM3_TRIG DMA requests mapped on DMA channel 4)
mbed_official 205:c41fc65bcfb4 109 1: Remap (TIM3_CH1 and TIM3_TRIG DMA requests mapped on DMA channel 6) */
mbed_official 205:c41fc65bcfb4 110 #endif
mbed_official 205:c41fc65bcfb4 111
mbed_official 205:c41fc65bcfb4 112 #if defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx)
mbed_official 205:c41fc65bcfb4 113 #define IS_HAL_REMAPDMA(RMP) (((RMP) == HAL_REMAPDMA_ADC_DMA_CH2) || \
mbed_official 205:c41fc65bcfb4 114 ((RMP) == HAL_REMAPDMA_USART1_TX_DMA_CH4) || \
mbed_official 205:c41fc65bcfb4 115 ((RMP) == HAL_REMAPDMA_USART1_RX_DMA_CH5) || \
mbed_official 205:c41fc65bcfb4 116 ((RMP) == HAL_REMAPDMA_TIM16_DMA_CH4) || \
mbed_official 205:c41fc65bcfb4 117 ((RMP) == HAL_REMAPDMA_TIM17_DMA_CH2) || \
mbed_official 205:c41fc65bcfb4 118 ((RMP) == HAL_REMAPDMA_TIM16_DMA_CH6) || \
mbed_official 205:c41fc65bcfb4 119 ((RMP) == HAL_REMAPDMA_TIM17_DMA_CH7) || \
mbed_official 205:c41fc65bcfb4 120 ((RMP) == HAL_REMAPDMA_SPI2_DMA_CH67) || \
mbed_official 205:c41fc65bcfb4 121 ((RMP) == HAL_REMAPDMA_USART2_DMA_CH67) || \
mbed_official 205:c41fc65bcfb4 122 ((RMP) == HAL_REMAPDMA_USART3_DMA_CH32) || \
mbed_official 205:c41fc65bcfb4 123 ((RMP) == HAL_REMAPDMA_I2C1_DMA_CH76) || \
mbed_official 205:c41fc65bcfb4 124 ((RMP) == HAL_REMAPDMA_TIM1_DMA_CH6) || \
mbed_official 205:c41fc65bcfb4 125 ((RMP) == HAL_REMAPDMA_TIM2_DMA_CH7) || \
mbed_official 205:c41fc65bcfb4 126 ((RMP) == HAL_REMAPDMA_TIM3_DMA_CH6))
mbed_official 205:c41fc65bcfb4 127 #else
mbed_official 205:c41fc65bcfb4 128 #define IS_HAL_REMAPDMA(RMP) (((RMP) == HAL_REMAPDMA_ADC_DMA_CH2) || \
mbed_official 205:c41fc65bcfb4 129 ((RMP) == HAL_REMAPDMA_USART1_TX_DMA_CH4) || \
mbed_official 205:c41fc65bcfb4 130 ((RMP) == HAL_REMAPDMA_USART1_RX_DMA_CH5) || \
mbed_official 205:c41fc65bcfb4 131 ((RMP) == HAL_REMAPDMA_TIM16_DMA_CH4) || \
mbed_official 205:c41fc65bcfb4 132 ((RMP) == HAL_REMAPDMA_TIM17_DMA_CH2))
mbed_official 205:c41fc65bcfb4 133 #endif
mbed_official 205:c41fc65bcfb4 134 /**
mbed_official 205:c41fc65bcfb4 135 * @}
mbed_official 205:c41fc65bcfb4 136 */
mbed_official 205:c41fc65bcfb4 137
mbed_official 205:c41fc65bcfb4 138 #if defined(STM32F042x6) || defined(STM32F048xx)
mbed_official 205:c41fc65bcfb4 139 /** @defgroup HAL_Pin_Remapping
mbed_official 205:c41fc65bcfb4 140 * @{
mbed_official 205:c41fc65bcfb4 141 */
mbed_official 205:c41fc65bcfb4 142 #define HAL_REMAP_PA11_PA12 (SYSCFG_CFGR1_PA11_PA12_RMP) /*!< PA11 and PA12 remapping bit for small packages (28 and 20 pins).
mbed_official 205:c41fc65bcfb4 143 0: No remap (pin pair PA9/10 mapped on the pins)
mbed_official 205:c41fc65bcfb4 144 1: Remap (pin pair PA11/12 mapped instead of PA9/10) */
mbed_official 205:c41fc65bcfb4 145
mbed_official 205:c41fc65bcfb4 146 #define IS_HAL_REMAP_PIN(RMP) ((RMP) == HAL_REMAP_PA11_PA12)
mbed_official 205:c41fc65bcfb4 147 /**
mbed_official 205:c41fc65bcfb4 148 * @}
mbed_official 205:c41fc65bcfb4 149 */
mbed_official 205:c41fc65bcfb4 150 #endif /* STM32F042x6 || STM32F048xx */
mbed_official 205:c41fc65bcfb4 151
mbed_official 205:c41fc65bcfb4 152 /** @defgroup HAL_FastModePlus_I2C
mbed_official 205:c41fc65bcfb4 153 * @{
mbed_official 205:c41fc65bcfb4 154 */
mbed_official 205:c41fc65bcfb4 155 #define HAL_SYSCFG_FASTMODEPLUS_I2C_PB6 (SYSCFG_CFGR1_I2C_FMP_PB6) /*!< Fast Mode Plus (FM+) driving capability activation on the pad
mbed_official 205:c41fc65bcfb4 156 0: PB6 pin operates in standard mode
mbed_official 205:c41fc65bcfb4 157 1: I2C FM+ mode enabled on PB6 pin, and the Speed control is bypassed */
mbed_official 205:c41fc65bcfb4 158 #define HAL_SYSCFG_FASTMODEPLUS_I2C_PB7 (SYSCFG_CFGR1_I2C_FMP_PB7) /*!< Fast Mode Plus (FM+) driving capability activation on the pad
mbed_official 205:c41fc65bcfb4 159 0: PB7 pin operates in standard mode
mbed_official 205:c41fc65bcfb4 160 1: I2C FM+ mode enabled on PB7 pin, and the Speed control is bypassed */
mbed_official 205:c41fc65bcfb4 161 #define HAL_SYSCFG_FASTMODEPLUS_I2C_PB8 (SYSCFG_CFGR1_I2C_FMP_PB8) /*!< Fast Mode Plus (FM+) driving capability activation on the pad
mbed_official 205:c41fc65bcfb4 162 0: PB8 pin operates in standard mode
mbed_official 205:c41fc65bcfb4 163 1: I2C FM+ mode enabled on PB8 pin, and the Speed control is bypassed */
mbed_official 205:c41fc65bcfb4 164 #define HAL_SYSCFG_FASTMODEPLUS_I2C_PB9 (SYSCFG_CFGR1_I2C_FMP_PB9) /*!< Fast Mode Plus (FM+) driving capability activation on the pad
mbed_official 205:c41fc65bcfb4 165 0: PB9 pin operates in standard mode
mbed_official 205:c41fc65bcfb4 166 1: I2C FM+ mode enabled on PB9 pin, and the Speed control is bypassed */
mbed_official 205:c41fc65bcfb4 167
mbed_official 205:c41fc65bcfb4 168 #if defined(STM32F030x6) || defined(STM32F031x6) || defined(STM32F038xx) || \
mbed_official 205:c41fc65bcfb4 169 defined(STM32F042x6) || defined(STM32F048xx) || \
mbed_official 205:c41fc65bcfb4 170 defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx)
mbed_official 205:c41fc65bcfb4 171 #define HAL_SYSCFG_FASTMODEPLUS_I2C1 (SYSCFG_CFGR1_I2C_FMP_I2C1) /*!< I2C1 fast mode Plus driving capability activation
mbed_official 205:c41fc65bcfb4 172 0: FM+ mode is not enabled on I2C1 pins selected through AF selection bits
mbed_official 205:c41fc65bcfb4 173 1: FM+ mode is enabled on I2C1 pins selected through AF selection bits */
mbed_official 205:c41fc65bcfb4 174 #endif
mbed_official 205:c41fc65bcfb4 175
mbed_official 205:c41fc65bcfb4 176 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx)
mbed_official 205:c41fc65bcfb4 177 #define HAL_SYSCFG_FASTMODEPLUS_I2C2 (SYSCFG_CFGR1_I2C_FMP_I2C2) /*!< I2C2 fast mode Plus driving capability activation
mbed_official 205:c41fc65bcfb4 178 0: FM+ mode is not enabled on I2C2 pins selected through AF selection bits
mbed_official 205:c41fc65bcfb4 179 1: FM+ mode is enabled on I2C2 pins selected through AF selection bits */
mbed_official 205:c41fc65bcfb4 180 #endif
mbed_official 205:c41fc65bcfb4 181
mbed_official 205:c41fc65bcfb4 182 #if defined(STM32F030x6) || defined(STM32F031x6) || defined(STM32F038xx)
mbed_official 205:c41fc65bcfb4 183 #define HAL_SYSCFG_FASTMODEPLUS_I2C2_PA9 (SYSCFG_CFGR1_I2C_FMP_PA9) /*!< Fast Mode Plus (FM+) driving capability activation on the pad
mbed_official 205:c41fc65bcfb4 184 0: PA9 pin operates in standard mode
mbed_official 205:c41fc65bcfb4 185 1: FM+ mode is enabled on PA9 pin, and the Speed control is bypassed */
mbed_official 205:c41fc65bcfb4 186 #define HAL_SYSCFG_FASTMODEPLUS_I2C2_PA10 (SYSCFG_CFGR1_I2C_FMP_PA10) /*!< Fast Mode Plus (FM+) driving capability activation on the pad
mbed_official 205:c41fc65bcfb4 187 0: PA10 pin operates in standard mode
mbed_official 205:c41fc65bcfb4 188 1: FM+ mode is enabled on PA10 pin, and the Speed control is bypassed */
mbed_official 205:c41fc65bcfb4 189 #endif
mbed_official 205:c41fc65bcfb4 190
mbed_official 205:c41fc65bcfb4 191 /**
mbed_official 205:c41fc65bcfb4 192 * @}
mbed_official 205:c41fc65bcfb4 193 */
mbed_official 205:c41fc65bcfb4 194
mbed_official 205:c41fc65bcfb4 195
mbed_official 205:c41fc65bcfb4 196 /* Exported macros -----------------------------------------------------------*/
mbed_official 205:c41fc65bcfb4 197
mbed_official 205:c41fc65bcfb4 198 /** @brief Freeze/Unfreeze Peripherals in Debug mode
mbed_official 205:c41fc65bcfb4 199 */
mbed_official 205:c41fc65bcfb4 200 #define __HAL_FREEZE_TIM3_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM3_STOP))
mbed_official 205:c41fc65bcfb4 201 #define __HAL_UNFREEZE_TIM3_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM3_STOP))
mbed_official 205:c41fc65bcfb4 202
mbed_official 205:c41fc65bcfb4 203 #define __HAL_FREEZE_TIM14_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM14_STOP))
mbed_official 205:c41fc65bcfb4 204 #define __HAL_UNFREEZE_TIM14_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM14_STOP))
mbed_official 205:c41fc65bcfb4 205
mbed_official 205:c41fc65bcfb4 206 #define __HAL_FREEZE_RTC_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_RTC_STOP))
mbed_official 205:c41fc65bcfb4 207 #define __HAL_UNFREEZE_RTC_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_RTC_STOP))
mbed_official 205:c41fc65bcfb4 208
mbed_official 205:c41fc65bcfb4 209 #define __HAL_FREEZE_WWDG_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_WWDG_STOP))
mbed_official 205:c41fc65bcfb4 210 #define __HAL_UNFREEZE_WWDG_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_WWDG_STOP))
mbed_official 205:c41fc65bcfb4 211
mbed_official 205:c41fc65bcfb4 212 #define __HAL_FREEZE_IWDG_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_IWDG_STOP))
mbed_official 205:c41fc65bcfb4 213 #define __HAL_UNFREEZE_IWDG_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_IWDG_STOP))
mbed_official 205:c41fc65bcfb4 214
mbed_official 205:c41fc65bcfb4 215 #define __HAL_FREEZE_I2C1_TIMEOUT_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT))
mbed_official 205:c41fc65bcfb4 216 #define __HAL_UNFREEZE_I2C1_TIMEOUT_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT))
mbed_official 205:c41fc65bcfb4 217
mbed_official 205:c41fc65bcfb4 218 #if defined(STM32F031x6) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F051x8) || \
mbed_official 205:c41fc65bcfb4 219 defined(STM32F071xB) || defined(STM32F072xB) || \
mbed_official 205:c41fc65bcfb4 220 defined(STM32F038xx) || defined(STM32F058xx) || defined(STM32F078xx)
mbed_official 205:c41fc65bcfb4 221 #define __HAL_FREEZE_TIM2_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM2_STOP))
mbed_official 205:c41fc65bcfb4 222 #define __HAL_UNFREEZE_TIM2_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM2_STOP))
mbed_official 205:c41fc65bcfb4 223 #endif /* STM32F031x6 || STM32F042x6 || STM32F048xx || STM32F051x8 || */
mbed_official 205:c41fc65bcfb4 224 /* STM32F071xB || STM32F072xB || */
mbed_official 205:c41fc65bcfb4 225 /* STM32F038xx || STM32F058xx || STM32F078xx */
mbed_official 205:c41fc65bcfb4 226
mbed_official 205:c41fc65bcfb4 227 #if defined(STM32F030x8) || defined(STM32F051x8) || \
mbed_official 205:c41fc65bcfb4 228 defined(STM32F071xB) || defined(STM32F072xB) || \
mbed_official 205:c41fc65bcfb4 229 defined(STM32F058xx) || defined(STM32F078xx)
mbed_official 205:c41fc65bcfb4 230 #define __HAL_FREEZE_TIM6_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM6_STOP))
mbed_official 205:c41fc65bcfb4 231 #define __HAL_UNFREEZE_TIM6_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM6_STOP))
mbed_official 205:c41fc65bcfb4 232 #endif /* STM32F030x8 || STM32F051x8 || */
mbed_official 205:c41fc65bcfb4 233 /* STM32F071xB || STM32F072xB || */
mbed_official 205:c41fc65bcfb4 234 /* STM32F058xx || STM32F078xx */
mbed_official 205:c41fc65bcfb4 235
mbed_official 205:c41fc65bcfb4 236 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx)
mbed_official 205:c41fc65bcfb4 237 #define __HAL_FREEZE_TIM7_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM7_STOP))
mbed_official 205:c41fc65bcfb4 238 #define __HAL_UNFREEZE_TIM7_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM7_STOP))
mbed_official 205:c41fc65bcfb4 239 #endif /* STM32F071xB || STM32F072xB || STM32F078xx */
mbed_official 205:c41fc65bcfb4 240
mbed_official 205:c41fc65bcfb4 241 #if defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F072xB)
mbed_official 205:c41fc65bcfb4 242 #define __HAL_FREEZE_CAN_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN1_STOP))
mbed_official 205:c41fc65bcfb4 243 #define __HAL_UNFREEZE_CAN_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN1_STOP))
mbed_official 205:c41fc65bcfb4 244 #endif /* STM32F042x6 || STM32F072xB */
mbed_official 205:c41fc65bcfb4 245
mbed_official 205:c41fc65bcfb4 246
mbed_official 205:c41fc65bcfb4 247 #define __HAL_FREEZE_TIM1_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM1_STOP))
mbed_official 205:c41fc65bcfb4 248 #define __HAL_UNFREEZE_TIM1_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM1_STOP))
mbed_official 205:c41fc65bcfb4 249
mbed_official 205:c41fc65bcfb4 250 #if defined(STM32F030x8) || defined(STM32F051x8) || \
mbed_official 205:c41fc65bcfb4 251 defined(STM32F071xB) || defined(STM32F072xB) || \
mbed_official 205:c41fc65bcfb4 252 defined(STM32F058xx) || defined(STM32F078xx)
mbed_official 205:c41fc65bcfb4 253 #define __HAL_FREEZE_TIM15_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM15_STOP))
mbed_official 205:c41fc65bcfb4 254 #define __HAL_UNFREEZE_TIM15_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM15_STOP))
mbed_official 205:c41fc65bcfb4 255 #endif /* STM32F030x8 || STM32F051x8 || */
mbed_official 205:c41fc65bcfb4 256 /* STM32F071xB || STM32F072xB || */
mbed_official 205:c41fc65bcfb4 257 /* STM32F058xx || STM32F078xx */
mbed_official 205:c41fc65bcfb4 258
mbed_official 205:c41fc65bcfb4 259 #define __HAL_FREEZE_TIM16_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM16_STOP))
mbed_official 205:c41fc65bcfb4 260 #define __HAL_UNFREEZE_TIM16_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM16_STOP))
mbed_official 205:c41fc65bcfb4 261
mbed_official 205:c41fc65bcfb4 262 #define __HAL_FREEZE_TIM17_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM17_STOP))
mbed_official 205:c41fc65bcfb4 263 #define __HAL_UNFREEZE_TIM17_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM17_STOP))
mbed_official 205:c41fc65bcfb4 264
mbed_official 205:c41fc65bcfb4 265 /** @brief Main Flash memory mapped at 0x00000000
mbed_official 205:c41fc65bcfb4 266 */
mbed_official 205:c41fc65bcfb4 267 #define __HAL_REMAPMEMORY_FLASH() (SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_MEM_MODE))
mbed_official 205:c41fc65bcfb4 268
mbed_official 205:c41fc65bcfb4 269 /** @brief System Flash memory mapped at 0x00000000
mbed_official 205:c41fc65bcfb4 270 */
mbed_official 205:c41fc65bcfb4 271 #define __HAL_REMAPMEMORY_SYSTEMFLASH() do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_MEM_MODE); \
mbed_official 205:c41fc65bcfb4 272 SYSCFG->CFGR1 |= SYSCFG_CFGR1_MEM_MODE_0; \
mbed_official 205:c41fc65bcfb4 273 }while(0)
mbed_official 205:c41fc65bcfb4 274
mbed_official 205:c41fc65bcfb4 275 /** @brief Embedded SRAM mapped at 0x00000000
mbed_official 205:c41fc65bcfb4 276 */
mbed_official 205:c41fc65bcfb4 277 #define __HAL_REMAPMEMORY_SRAM() do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_MEM_MODE); \
mbed_official 205:c41fc65bcfb4 278 SYSCFG->CFGR1 |= (SYSCFG_CFGR1_MEM_MODE_0 | SYSCFG_CFGR1_MEM_MODE_1); \
mbed_official 205:c41fc65bcfb4 279 }while(0)
mbed_official 205:c41fc65bcfb4 280
mbed_official 205:c41fc65bcfb4 281 /** @brief DMA remapping enable/disable macros
mbed_official 205:c41fc65bcfb4 282 * @param __DMA_REMAP__: This parameter can be a value of @ref HAL_DMA_Remapping
mbed_official 205:c41fc65bcfb4 283 */
mbed_official 205:c41fc65bcfb4 284 #define __HAL_REMAPDMA_CHANNEL_ENABLE(__DMA_REMAP__) do {assert_param(IS_HAL_REMAPDMA((__DMA_REMAP__))); \
mbed_official 205:c41fc65bcfb4 285 SYSCFG->CFGR1 |= (__DMA_REMAP__); \
mbed_official 205:c41fc65bcfb4 286 }while(0)
mbed_official 205:c41fc65bcfb4 287 #define __HAL_REMAPDMA_CHANNEL_DISABLE(__DMA_REMAP__) do {assert_param(IS_HAL_REMAPDMA((__DMA_REMAP__))); \
mbed_official 205:c41fc65bcfb4 288 SYSCFG->CFGR1 &= ~(__DMA_REMAP__); \
mbed_official 205:c41fc65bcfb4 289 }while(0)
mbed_official 205:c41fc65bcfb4 290
mbed_official 205:c41fc65bcfb4 291 #if defined(STM32F042x6) || defined(STM32F048xx)
mbed_official 205:c41fc65bcfb4 292 /** @brief Pin remapping enable/disable macros
mbed_official 205:c41fc65bcfb4 293 * @param __PIN_REMAP__: This parameter can be a value of @ref HAL_Pin_Remapping
mbed_official 205:c41fc65bcfb4 294 */
mbed_official 205:c41fc65bcfb4 295 #define __HAL_REMAP_PIN_ENABLE(__PIN_REMAP__) do {assert_param(IS_HAL_REMAP_PIN((__PIN_REMAP__))); \
mbed_official 205:c41fc65bcfb4 296 SYSCFG->CFGR1 |= (__PIN_REMAP__); \
mbed_official 205:c41fc65bcfb4 297 }while(0)
mbed_official 205:c41fc65bcfb4 298 #define __HAL_REMAP_PIN_DISABLE(__PIN_REMAP__) do {assert_param(IS_HAL_REMAP_PIN((__DMA_REMAP__))); \
mbed_official 205:c41fc65bcfb4 299 SYSCFG->CFGR1 &= ~(__PIN_REMAP__); \
mbed_official 205:c41fc65bcfb4 300 }while(0)
mbed_official 205:c41fc65bcfb4 301 #endif /* STM32F042x6 || STM32F048xx */
mbed_official 205:c41fc65bcfb4 302
mbed_official 205:c41fc65bcfb4 303 /** @brief Fast mode Plus driving capability enable/disable macros
mbed_official 205:c41fc65bcfb4 304 * @param __FASTMODEPLUS__: This parameter can be a value of @ref HAL_FastModePlus_I2C
mbed_official 205:c41fc65bcfb4 305 */
mbed_official 205:c41fc65bcfb4 306 #define __HAL_SYSCFG_FASTMODEPLUS_ENABLE(__FASTMODEPLUS__) do {assert_param(IS_HAL_SYSCFG_FASTMODEPLUS_CONFIG((__FASTMODEPLUS__))); \
mbed_official 205:c41fc65bcfb4 307 SYSCFG->CFGR1 |= (__FASTMODEPLUS__); \
mbed_official 205:c41fc65bcfb4 308 }while(0)
mbed_official 205:c41fc65bcfb4 309
mbed_official 205:c41fc65bcfb4 310 #define __HAL_SYSCFG_FASTMODEPLUS_DISABLE(__FASTMODEPLUS__) do {assert_param(IS_HAL_SYSCFG_FASTMODEPLUS_CONFIG((__FASTMODEPLUS__))); \
mbed_official 205:c41fc65bcfb4 311 SYSCFG->CFGR1 &= ~(__FASTMODEPLUS__); \
mbed_official 205:c41fc65bcfb4 312 }while(0)
mbed_official 205:c41fc65bcfb4 313
mbed_official 205:c41fc65bcfb4 314 /** @brief SYSCFG Break Lockup lock
mbed_official 205:c41fc65bcfb4 315 * Enables and locks the connection of Cortex-M0 LOCKUP (Hardfault) output to TIM1/15/16/17 Break input
mbed_official 205:c41fc65bcfb4 316 * @note The selected configuration is locked and can be unlocked by system reset
mbed_official 205:c41fc65bcfb4 317 */
mbed_official 205:c41fc65bcfb4 318 #define __HAL_SYSCFG_BREAK_LOCKUP_LOCK() do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_LOCKUP_LOCK); \
mbed_official 205:c41fc65bcfb4 319 SYSCFG->CFGR2 |= SYSCFG_CFGR2_LOCKUP_LOCK; \
mbed_official 205:c41fc65bcfb4 320 }while(0)
mbed_official 205:c41fc65bcfb4 321
mbed_official 205:c41fc65bcfb4 322 #if defined(STM32F031x6) || defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F051x8) || \
mbed_official 205:c41fc65bcfb4 323 defined(STM32F071xB) || defined(STM32F072xB)
mbed_official 205:c41fc65bcfb4 324 /** @brief SYSCFG Break PVD lock
mbed_official 205:c41fc65bcfb4 325 * Enables and locks the PVD connection with Timer1/8/15/16/17 Break Input, , as well as the PVDE and PLS[2:0] in the PWR_CR register
mbed_official 205:c41fc65bcfb4 326 * @note The selected configuration is locked and can be unlocked by system reset
mbed_official 205:c41fc65bcfb4 327 */
mbed_official 205:c41fc65bcfb4 328 #define __HAL_SYSCFG_BREAK_PVD_LOCK() do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_PVD_LOCK); \
mbed_official 205:c41fc65bcfb4 329 SYSCFG->CFGR2 |= SYSCFG_CFGR2_PVD_LOCK; \
mbed_official 205:c41fc65bcfb4 330 }while(0)
mbed_official 205:c41fc65bcfb4 331 #endif /* STM32F031x6 || STM32F042x6 || STM32F048xx || STM32F051x8) || */
mbed_official 205:c41fc65bcfb4 332 /* STM32F071xB || STM32F072xB */
mbed_official 205:c41fc65bcfb4 333
mbed_official 205:c41fc65bcfb4 334 /** @brief SYSCFG Break SRAM PARITY lock
mbed_official 205:c41fc65bcfb4 335 * Enables and locks the SRAM_PARITY error signal with Break Input of TIMER1/8/15/16/17
mbed_official 205:c41fc65bcfb4 336 * @note The selected configuration is locked and can be unlocked by system reset
mbed_official 205:c41fc65bcfb4 337 */
mbed_official 205:c41fc65bcfb4 338 #define __HAL_SYSCFG_BREAK_SRAMPARITY_LOCK() do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_SRAM_PARITY_LOCK); \
mbed_official 205:c41fc65bcfb4 339 SYSCFG->CFGR2 |= SYSCFG_CFGR2_SRAM_PARITY_LOCK; \
mbed_official 205:c41fc65bcfb4 340 }while(0)
mbed_official 205:c41fc65bcfb4 341
mbed_official 205:c41fc65bcfb4 342 /**
mbed_official 205:c41fc65bcfb4 343 * @brief Parity check on RAM disable macro
mbed_official 205:c41fc65bcfb4 344 * @note Disabling the parity check on RAM locks the configuration bit.
mbed_official 205:c41fc65bcfb4 345 * To re-enable the parity check on RAM perform a system reset.
mbed_official 205:c41fc65bcfb4 346 */
mbed_official 205:c41fc65bcfb4 347 #define __HAL_SYSCFG_RAM_PARITYCHECK_DISABLE() (SYSCFG->CFGR2 |= SYSCFG_CFGR2_SRAM_PEF)
mbed_official 205:c41fc65bcfb4 348
mbed_official 205:c41fc65bcfb4 349
mbed_official 205:c41fc65bcfb4 350 /* Exported functions --------------------------------------------------------*/
mbed_official 205:c41fc65bcfb4 351
mbed_official 205:c41fc65bcfb4 352 /* Initialization and de-initialization functions ****************************/
mbed_official 205:c41fc65bcfb4 353 HAL_StatusTypeDef HAL_Init(void);
mbed_official 205:c41fc65bcfb4 354 HAL_StatusTypeDef HAL_DeInit(void);
mbed_official 205:c41fc65bcfb4 355 void HAL_MspInit(void);
mbed_official 205:c41fc65bcfb4 356 void HAL_MspDeInit(void);
mbed_official 205:c41fc65bcfb4 357 HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);
mbed_official 205:c41fc65bcfb4 358
mbed_official 205:c41fc65bcfb4 359 /* Peripheral Control functions **********************************************/
mbed_official 205:c41fc65bcfb4 360 void HAL_IncTick(void);
mbed_official 205:c41fc65bcfb4 361 void HAL_Delay(__IO uint32_t Delay);
mbed_official 205:c41fc65bcfb4 362 uint32_t HAL_GetTick(void);
mbed_official 205:c41fc65bcfb4 363 void HAL_SuspendTick(void);
mbed_official 205:c41fc65bcfb4 364 void HAL_ResumeTick(void);
mbed_official 205:c41fc65bcfb4 365 uint32_t HAL_GetHalVersion(void);
mbed_official 205:c41fc65bcfb4 366 uint32_t HAL_GetREVID(void);
mbed_official 205:c41fc65bcfb4 367 uint32_t HAL_GetDEVID(void);
mbed_official 205:c41fc65bcfb4 368
mbed_official 205:c41fc65bcfb4 369 void HAL_EnableDBGStopMode(void);
mbed_official 205:c41fc65bcfb4 370 void HAL_DisableDBGStopMode(void);
mbed_official 205:c41fc65bcfb4 371 void HAL_EnableDBGStandbyMode(void);
mbed_official 205:c41fc65bcfb4 372 void HAL_DisableDBGStandbyMode(void);
mbed_official 205:c41fc65bcfb4 373
mbed_official 205:c41fc65bcfb4 374 /**
mbed_official 205:c41fc65bcfb4 375 * @}
mbed_official 205:c41fc65bcfb4 376 */
mbed_official 205:c41fc65bcfb4 377
mbed_official 205:c41fc65bcfb4 378 /**
mbed_official 205:c41fc65bcfb4 379 * @}
mbed_official 205:c41fc65bcfb4 380 */
mbed_official 205:c41fc65bcfb4 381
mbed_official 205:c41fc65bcfb4 382 #ifdef __cplusplus
mbed_official 205:c41fc65bcfb4 383 }
mbed_official 205:c41fc65bcfb4 384 #endif
mbed_official 205:c41fc65bcfb4 385
mbed_official 205:c41fc65bcfb4 386 #endif /* __STM32F0xx_HAL_H */
mbed_official 205:c41fc65bcfb4 387
mbed_official 205:c41fc65bcfb4 388 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/