mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Tue Jun 24 14:45:08 2014 +0100
Revision:
237:f3da66175598
Synchronized with git revision 8ef659bca81f12dfc896b5a7af7c2abbd1a1b8b7

Full URL: https://github.com/mbedmicro/mbed/commit/8ef659bca81f12dfc896b5a7af7c2abbd1a1b8b7/

[NUCLEO_F334R8] Add platform files

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 237:f3da66175598 1 /**
mbed_official 237:f3da66175598 2 ******************************************************************************
mbed_official 237:f3da66175598 3 * @file stm32f3xx_hal_pwr_ex.h
mbed_official 237:f3da66175598 4 * @author MCD Application Team
mbed_official 237:f3da66175598 5 * @version V1.0.1
mbed_official 237:f3da66175598 6 * @date 18-June-2014
mbed_official 237:f3da66175598 7 * @brief Header file of PWR HAL Extension module.
mbed_official 237:f3da66175598 8 ******************************************************************************
mbed_official 237:f3da66175598 9 * @attention
mbed_official 237:f3da66175598 10 *
mbed_official 237:f3da66175598 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 237:f3da66175598 12 *
mbed_official 237:f3da66175598 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 237:f3da66175598 14 * are permitted provided that the following conditions are met:
mbed_official 237:f3da66175598 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 237:f3da66175598 16 * this list of conditions and the following disclaimer.
mbed_official 237:f3da66175598 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 237:f3da66175598 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 237:f3da66175598 19 * and/or other materials provided with the distribution.
mbed_official 237:f3da66175598 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 237:f3da66175598 21 * may be used to endorse or promote products derived from this software
mbed_official 237:f3da66175598 22 * without specific prior written permission.
mbed_official 237:f3da66175598 23 *
mbed_official 237:f3da66175598 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 237:f3da66175598 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 237:f3da66175598 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 237:f3da66175598 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 237:f3da66175598 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 237:f3da66175598 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 237:f3da66175598 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 237:f3da66175598 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 237:f3da66175598 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 237:f3da66175598 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 237:f3da66175598 34 *
mbed_official 237:f3da66175598 35 ******************************************************************************
mbed_official 237:f3da66175598 36 */
mbed_official 237:f3da66175598 37
mbed_official 237:f3da66175598 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 237:f3da66175598 39 #ifndef __STM32F3xx_HAL_PWR_EX_H
mbed_official 237:f3da66175598 40 #define __STM32F3xx_HAL_PWR_EX_H
mbed_official 237:f3da66175598 41
mbed_official 237:f3da66175598 42 #ifdef __cplusplus
mbed_official 237:f3da66175598 43 extern "C" {
mbed_official 237:f3da66175598 44 #endif
mbed_official 237:f3da66175598 45
mbed_official 237:f3da66175598 46 /* Includes ------------------------------------------------------------------*/
mbed_official 237:f3da66175598 47 #include "stm32f3xx_hal_def.h"
mbed_official 237:f3da66175598 48
mbed_official 237:f3da66175598 49 /** @addtogroup STM32F3xx_HAL_Driver
mbed_official 237:f3da66175598 50 * @{
mbed_official 237:f3da66175598 51 */
mbed_official 237:f3da66175598 52
mbed_official 237:f3da66175598 53 /** @addtogroup PWREx
mbed_official 237:f3da66175598 54 * @{
mbed_official 237:f3da66175598 55 */
mbed_official 237:f3da66175598 56
mbed_official 237:f3da66175598 57 /* Exported types ------------------------------------------------------------*/
mbed_official 237:f3da66175598 58 #if defined(STM32F301x8) || \
mbed_official 237:f3da66175598 59 defined(STM32F302x8) || defined(STM32F302xC) || \
mbed_official 237:f3da66175598 60 defined(STM32F303x8) || defined(STM32F303xC) || defined(STM32F373xC) || \
mbed_official 237:f3da66175598 61 defined(STM32F334x8)
mbed_official 237:f3da66175598 62 /**
mbed_official 237:f3da66175598 63 * @brief PWR PVD configuration structure definition
mbed_official 237:f3da66175598 64 */
mbed_official 237:f3da66175598 65 typedef struct
mbed_official 237:f3da66175598 66 {
mbed_official 237:f3da66175598 67 uint32_t PVDLevel; /*!< PVDLevel: Specifies the PVD detection level
mbed_official 237:f3da66175598 68 This parameter can be a value of @ref PWREx_PVD_detection_level */
mbed_official 237:f3da66175598 69
mbed_official 237:f3da66175598 70 uint32_t Mode; /*!< Mode: Specifies the operating mode for the selected pins.
mbed_official 237:f3da66175598 71 This parameter can be a value of @ref PWREx_PVD_Mode */
mbed_official 237:f3da66175598 72 }PWR_PVDTypeDef;
mbed_official 237:f3da66175598 73 #endif /* STM32F301x8 || STM32F302x8 || STM32F302xC || */
mbed_official 237:f3da66175598 74 /* STM32F303x8 || STM32F303xC */
mbed_official 237:f3da66175598 75 /* STM32F373xC || STM32F334x8 */
mbed_official 237:f3da66175598 76
mbed_official 237:f3da66175598 77 /* Exported constants --------------------------------------------------------*/
mbed_official 237:f3da66175598 78
mbed_official 237:f3da66175598 79 /** @defgroup PWREx_Exported_Constants
mbed_official 237:f3da66175598 80 * @{
mbed_official 237:f3da66175598 81 */
mbed_official 237:f3da66175598 82
mbed_official 237:f3da66175598 83 #if defined(STM32F301x8) || \
mbed_official 237:f3da66175598 84 defined(STM32F302x8) || defined(STM32F302xC) || \
mbed_official 237:f3da66175598 85 defined(STM32F303x8) || defined(STM32F303xC) || defined(STM32F373xC) || \
mbed_official 237:f3da66175598 86 defined(STM32F334x8)
mbed_official 237:f3da66175598 87 /** @defgroup PWREx_PVD_detection_level
mbed_official 237:f3da66175598 88 * @{
mbed_official 237:f3da66175598 89 */
mbed_official 237:f3da66175598 90 #define PWR_PVDLEVEL_0 PWR_CR_PLS_LEV0
mbed_official 237:f3da66175598 91 #define PWR_PVDLEVEL_1 PWR_CR_PLS_LEV1
mbed_official 237:f3da66175598 92 #define PWR_PVDLEVEL_2 PWR_CR_PLS_LEV2
mbed_official 237:f3da66175598 93 #define PWR_PVDLEVEL_3 PWR_CR_PLS_LEV3
mbed_official 237:f3da66175598 94 #define PWR_PVDLEVEL_4 PWR_CR_PLS_LEV4
mbed_official 237:f3da66175598 95 #define PWR_PVDLEVEL_5 PWR_CR_PLS_LEV5
mbed_official 237:f3da66175598 96 #define PWR_PVDLEVEL_6 PWR_CR_PLS_LEV6
mbed_official 237:f3da66175598 97 #define PWR_PVDLEVEL_7 PWR_CR_PLS_LEV7
mbed_official 237:f3da66175598 98 #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1)|| \
mbed_official 237:f3da66175598 99 ((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3)|| \
mbed_official 237:f3da66175598 100 ((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5)|| \
mbed_official 237:f3da66175598 101 ((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7))
mbed_official 237:f3da66175598 102 /**
mbed_official 237:f3da66175598 103 * @}
mbed_official 237:f3da66175598 104 */
mbed_official 237:f3da66175598 105
mbed_official 237:f3da66175598 106 /** @defgroup PWREx_PVD_Mode
mbed_official 237:f3da66175598 107 * @{
mbed_official 237:f3da66175598 108 */
mbed_official 237:f3da66175598 109 #define PWR_MODE_EVT ((uint32_t)0x00000000) /*!< No Interrupt */
mbed_official 237:f3da66175598 110 #define PWR_MODE_IT_RISING ((uint32_t)0x00000001) /*!< External Interrupt Mode with Rising edge trigger detection */
mbed_official 237:f3da66175598 111 #define PWR_MODE_IT_FALLING ((uint32_t)0x00000002) /*!< External Interrupt Mode with Falling edge trigger detection */
mbed_official 237:f3da66175598 112 #define PWR_MODE_IT_RISING_FALLING ((uint32_t)0x00000003) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
mbed_official 237:f3da66175598 113 #define IS_PWR_PVD_MODE(MODE) (((MODE) == PWR_MODE_EVT) || ((MODE) == PWR_MODE_IT_RISING)|| \
mbed_official 237:f3da66175598 114 ((MODE) == PWR_MODE_IT_FALLING) || ((MODE) == PWR_MODE_IT_RISING_FALLING))
mbed_official 237:f3da66175598 115 /**
mbed_official 237:f3da66175598 116 * @}
mbed_official 237:f3da66175598 117 */
mbed_official 237:f3da66175598 118
mbed_official 237:f3da66175598 119 #define PWR_EXTI_LINE_PVD ((uint32_t)0x00010000) /*!< External interrupt line 16 Connected to the PVD EXTI Line */
mbed_official 237:f3da66175598 120
mbed_official 237:f3da66175598 121 #endif /* STM32F301x8 || STM32F302x8 || STM32F302xC || */
mbed_official 237:f3da66175598 122 /* STM32F303x8 || STM32F303xC */
mbed_official 237:f3da66175598 123 /* STM32F373xC || STM32F334x8 */
mbed_official 237:f3da66175598 124
mbed_official 237:f3da66175598 125 #if defined(STM32F373xC) || defined(STM32F378xx)
mbed_official 237:f3da66175598 126 /** @defgroup PWREx_SDADC_ANALOGx
mbed_official 237:f3da66175598 127 * @{
mbed_official 237:f3da66175598 128 */
mbed_official 237:f3da66175598 129 #define PWR_SDADC_ANALOG1 ((uint32_t)PWR_CR_SDADC1EN)
mbed_official 237:f3da66175598 130 #define PWR_SDADC_ANALOG2 ((uint32_t)PWR_CR_SDADC2EN)
mbed_official 237:f3da66175598 131 #define PWR_SDADC_ANALOG3 ((uint32_t)PWR_CR_SDADC3EN)
mbed_official 237:f3da66175598 132 #define IS_PWR_SDADC_ANALOG(SDADC) (((SDADC) == PWR_SDADC_ANALOG1) || \
mbed_official 237:f3da66175598 133 ((SDADC) == PWR_SDADC_ANALOG2) || \
mbed_official 237:f3da66175598 134 ((SDADC) == PWR_SDADC_ANALOG3))
mbed_official 237:f3da66175598 135 /**
mbed_official 237:f3da66175598 136 * @}
mbed_official 237:f3da66175598 137 */
mbed_official 237:f3da66175598 138 #endif /* STM32F373xC || STM32F378xx */
mbed_official 237:f3da66175598 139
mbed_official 237:f3da66175598 140 /**
mbed_official 237:f3da66175598 141 * @}
mbed_official 237:f3da66175598 142 */
mbed_official 237:f3da66175598 143
mbed_official 237:f3da66175598 144 /* Exported macro ------------------------------------------------------------*/
mbed_official 237:f3da66175598 145 /** @defgroup PWREx_Exported_Macros
mbed_official 237:f3da66175598 146 * @{
mbed_official 237:f3da66175598 147 */
mbed_official 237:f3da66175598 148
mbed_official 237:f3da66175598 149 #if defined(STM32F301x8) || \
mbed_official 237:f3da66175598 150 defined(STM32F302x8) || defined(STM32F302xC) || \
mbed_official 237:f3da66175598 151 defined(STM32F303x8) || defined(STM32F303xC) || defined(STM32F373xC) || \
mbed_official 237:f3da66175598 152 defined(STM32F334x8)
mbed_official 237:f3da66175598 153 /**
mbed_official 237:f3da66175598 154 * @brief Enable the PVD Exti Line.
mbed_official 237:f3da66175598 155 * @param __EXTILINE__: specifies the PVD EXTI sources to be enabled.
mbed_official 237:f3da66175598 156 * This parameter can be:
mbed_official 237:f3da66175598 157 * @arg PWR_EXTI_LINE_PVD
mbed_official 237:f3da66175598 158 * @retval None.
mbed_official 237:f3da66175598 159 */
mbed_official 237:f3da66175598 160 #define __HAL_PVD_EXTI_ENABLE_IT(__EXTILINE__) (EXTI->IMR |= (__EXTILINE__))
mbed_official 237:f3da66175598 161
mbed_official 237:f3da66175598 162 /**
mbed_official 237:f3da66175598 163 * @brief Disable the PVD EXTI Line.
mbed_official 237:f3da66175598 164 * @param __EXTILINE__: specifies the PVD EXTI sources to be disabled.
mbed_official 237:f3da66175598 165 * This parameter can be:
mbed_official 237:f3da66175598 166 * @arg PWR_EXTI_LINE_PVD
mbed_official 237:f3da66175598 167 * @retval None.
mbed_official 237:f3da66175598 168 */
mbed_official 237:f3da66175598 169 #define __HAL_PVD_EXTI_DISABLE_IT(__EXTILINE__) (EXTI->IMR &= ~(__EXTILINE__))
mbed_official 237:f3da66175598 170
mbed_official 237:f3da66175598 171 /**
mbed_official 237:f3da66175598 172 * @brief Generate a Software interrupt on selected EXTI line.
mbed_official 237:f3da66175598 173 * @param __EXTILINE__: specifies the PVD EXTI sources to be disabled.
mbed_official 237:f3da66175598 174 * This parameter can be:
mbed_official 237:f3da66175598 175 * @arg PWR_EXTI_LINE_PVD
mbed_official 237:f3da66175598 176 * @retval None
mbed_official 237:f3da66175598 177 */
mbed_official 237:f3da66175598 178 #define __HAL_PVD_EXTI_GENERATE_SWIT(__EXTILINE__) (EXTI->SWIER |= (__EXTILINE__))
mbed_official 237:f3da66175598 179
mbed_official 237:f3da66175598 180 /**
mbed_official 237:f3da66175598 181 * @brief Check whether the specified PVD EXTI interrupt flag is set or not.
mbed_official 237:f3da66175598 182 * @param __EXTILINE__: specifies the PVD EXTI sources to be cleared.
mbed_official 237:f3da66175598 183 * This parameter can be:
mbed_official 237:f3da66175598 184 * @arg PWR_EXTI_LINE_PVD
mbed_official 237:f3da66175598 185 * @retval EXTI PVD Line Status.
mbed_official 237:f3da66175598 186 */
mbed_official 237:f3da66175598 187 #define __HAL_PVD_EXTI_GET_FLAG(__EXTILINE__) (EXTI->PR & (__EXTILINE__))
mbed_official 237:f3da66175598 188
mbed_official 237:f3da66175598 189 /**
mbed_official 237:f3da66175598 190 * @brief Clear the PVD EXTI flag.
mbed_official 237:f3da66175598 191 * @param __EXTILINE__: specifies the PVD EXTI sources to be cleared.
mbed_official 237:f3da66175598 192 * This parameter can be:
mbed_official 237:f3da66175598 193 * @arg PWR_EXTI_LINE_PVD
mbed_official 237:f3da66175598 194 * @retval None.
mbed_official 237:f3da66175598 195 */
mbed_official 237:f3da66175598 196 #define __HAL_PVD_EXTI_CLEAR_FLAG(__EXTILINE__) (EXTI->PR = (__EXTILINE__))
mbed_official 237:f3da66175598 197 #endif /* STM32F301x8 || STM32F302x8 || STM32F302xC || */
mbed_official 237:f3da66175598 198 /* STM32F303x8 || STM32F303xC */
mbed_official 237:f3da66175598 199 /* STM32F373xC || STM32F334x8 */
mbed_official 237:f3da66175598 200
mbed_official 237:f3da66175598 201 /**
mbed_official 237:f3da66175598 202 * @}
mbed_official 237:f3da66175598 203 */
mbed_official 237:f3da66175598 204
mbed_official 237:f3da66175598 205 /* Exported functions --------------------------------------------------------*/
mbed_official 237:f3da66175598 206
mbed_official 237:f3da66175598 207 /* Peripheral Control functions ***********************************************/
mbed_official 237:f3da66175598 208 #if defined(STM32F301x8) || \
mbed_official 237:f3da66175598 209 defined(STM32F302x8) || defined(STM32F302xC) || \
mbed_official 237:f3da66175598 210 defined(STM32F303x8) || defined(STM32F303xC) || defined(STM32F373xC) || \
mbed_official 237:f3da66175598 211 defined(STM32F334x8)
mbed_official 237:f3da66175598 212 void HAL_PWR_PVDConfig(PWR_PVDTypeDef *sConfigPVD);
mbed_official 237:f3da66175598 213 void HAL_PWR_EnablePVD(void);
mbed_official 237:f3da66175598 214 void HAL_PWR_DisablePVD(void);
mbed_official 237:f3da66175598 215 void HAL_PWR_PVD_IRQHandler(void);
mbed_official 237:f3da66175598 216 void HAL_PWR_PVDCallback(void);
mbed_official 237:f3da66175598 217 #endif /* STM32F301x8 || STM32F302x8 || STM32F302xC || */
mbed_official 237:f3da66175598 218 /* STM32F303x8 || STM32F303xC */
mbed_official 237:f3da66175598 219 /* STM32F373xC || STM32F334x8 */
mbed_official 237:f3da66175598 220
mbed_official 237:f3da66175598 221 #if defined(STM32F373xC) || defined(STM32F378xx)
mbed_official 237:f3da66175598 222 void HAL_PWREx_EnableSDADCAnalog(uint32_t Analogx);
mbed_official 237:f3da66175598 223 void HAL_PWREx_DisableSDADCAnalog(uint32_t Analogx);
mbed_official 237:f3da66175598 224 #endif /* STM32F373xC || STM32F378xx */
mbed_official 237:f3da66175598 225
mbed_official 237:f3da66175598 226 /**
mbed_official 237:f3da66175598 227 * @}
mbed_official 237:f3da66175598 228 */
mbed_official 237:f3da66175598 229
mbed_official 237:f3da66175598 230 /**
mbed_official 237:f3da66175598 231 * @}
mbed_official 237:f3da66175598 232 */
mbed_official 237:f3da66175598 233
mbed_official 237:f3da66175598 234 #ifdef __cplusplus
mbed_official 237:f3da66175598 235 }
mbed_official 237:f3da66175598 236 #endif
mbed_official 237:f3da66175598 237
mbed_official 237:f3da66175598 238 #endif /* __STM32F3xx_HAL_PWR_EX_H */
mbed_official 237:f3da66175598 239
mbed_official 237:f3da66175598 240 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/