mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Mar 21 11:45:09 2014 +0000
Revision:
130:1dec54e4aec3
Synchronized with git revision e5c9ff6781a4e277a5a454e5a0b037f76e31739d

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

STM32F0-Discovery (STM32F051R8) initial port

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 130:1dec54e4aec3 1 /**
mbed_official 130:1dec54e4aec3 2 ******************************************************************************
mbed_official 130:1dec54e4aec3 3 * @file stm32f0xx_exti.c
mbed_official 130:1dec54e4aec3 4 * @author MCD Application Team
mbed_official 130:1dec54e4aec3 5 * @version V1.3.0
mbed_official 130:1dec54e4aec3 6 * @date 16-January-2014
mbed_official 130:1dec54e4aec3 7 * @brief This file provides firmware functions to manage the following
mbed_official 130:1dec54e4aec3 8 * functionalities of the EXTI peripheral:
mbed_official 130:1dec54e4aec3 9 * + Initialization and Configuration
mbed_official 130:1dec54e4aec3 10 * + Interrupts and flags management
mbed_official 130:1dec54e4aec3 11 *
mbed_official 130:1dec54e4aec3 12 * @verbatim
mbed_official 130:1dec54e4aec3 13 ==============================================================================
mbed_official 130:1dec54e4aec3 14 ##### EXTI features #####
mbed_official 130:1dec54e4aec3 15 ==============================================================================
mbed_official 130:1dec54e4aec3 16 [..] External interrupt/event lines are mapped as following:
mbed_official 130:1dec54e4aec3 17 (#) All available GPIO pins are connected to the 16 external
mbed_official 130:1dec54e4aec3 18 interrupt/event lines from EXTI0 to EXTI15.
mbed_official 130:1dec54e4aec3 19 (#) EXTI line 16 is connected to the PVD output, not applicable for STM32F030 devices.
mbed_official 130:1dec54e4aec3 20 (#) EXTI line 17 is connected to the RTC Alarm event.
mbed_official 130:1dec54e4aec3 21 (#) EXTI line 18 is connected to the RTC Alarm event, applicable only for STM32F072 devices.
mbed_official 130:1dec54e4aec3 22 (#) EXTI line 19 is connected to the RTC Tamper and TimeStamp events.
mbed_official 130:1dec54e4aec3 23 (#) EXTI line 20 is connected to the RTC wakeup event, applicable only for STM32F072 devices.
mbed_official 130:1dec54e4aec3 24 (#) EXTI line 21 is connected to the Comparator 1 wakeup event, applicable only for STM32F051 and STM32F072 devices.
mbed_official 130:1dec54e4aec3 25 (#) EXTI line 22 is connected to the Comparator 2 wakeup event, applicable only for STM32F051 and STM32F072 devices.
mbed_official 130:1dec54e4aec3 26 (#) EXTI line 23 is connected to the I2C1 wakeup event, not applicable for STM32F030 devices.
mbed_official 130:1dec54e4aec3 27 (#) EXTI line 25 is connected to the USART1 wakeup event, not applicable for STM32F030 devices.
mbed_official 130:1dec54e4aec3 28 (#) EXTI line 26 is connected to the USART2 wakeup event, applicable only for STM32F072 devices.
mbed_official 130:1dec54e4aec3 29 (#) EXTI line 27 is connected to the CEC wakeup event, applicable only for STM32F051 and STM32F072 devices.
mbed_official 130:1dec54e4aec3 30 (#) EXTI line 31 is connected to the VDD USB monitor event, applicable only for STM32F072 devices.
mbed_official 130:1dec54e4aec3 31
mbed_official 130:1dec54e4aec3 32 ##### How to use this driver #####
mbed_official 130:1dec54e4aec3 33 ==============================================================================
mbed_official 130:1dec54e4aec3 34 [..] In order to use an I/O pin as an external interrupt source, follow
mbed_official 130:1dec54e4aec3 35 steps below:
mbed_official 130:1dec54e4aec3 36 (#) Configure the I/O in input mode using GPIO_Init()
mbed_official 130:1dec54e4aec3 37 (#) Select the input source pin for the EXTI line using
mbed_official 130:1dec54e4aec3 38 SYSCFG_EXTILineConfig().
mbed_official 130:1dec54e4aec3 39 (#) Select the mode(interrupt, event) and configure the trigger selection
mbed_official 130:1dec54e4aec3 40 (Rising, falling or both) using EXTI_Init(). For the internal interrupt,
mbed_official 130:1dec54e4aec3 41 the trigger selection is not needed( the active edge is always the rising one).
mbed_official 130:1dec54e4aec3 42 (#) Configure NVIC IRQ channel mapped to the EXTI line using NVIC_Init().
mbed_official 130:1dec54e4aec3 43 (#) Optionally, you can generate a software interrupt using the function EXTI_GenerateSWInterrupt().
mbed_official 130:1dec54e4aec3 44 [..]
mbed_official 130:1dec54e4aec3 45 (@) SYSCFG APB clock must be enabled to get write access to SYSCFG_EXTICRx
mbed_official 130:1dec54e4aec3 46 registers using RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
mbed_official 130:1dec54e4aec3 47 @endverbatim
mbed_official 130:1dec54e4aec3 48 *
mbed_official 130:1dec54e4aec3 49 ******************************************************************************
mbed_official 130:1dec54e4aec3 50 * @attention
mbed_official 130:1dec54e4aec3 51 *
mbed_official 130:1dec54e4aec3 52 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 130:1dec54e4aec3 53 *
mbed_official 130:1dec54e4aec3 54 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 130:1dec54e4aec3 55 * are permitted provided that the following conditions are met:
mbed_official 130:1dec54e4aec3 56 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 130:1dec54e4aec3 57 * this list of conditions and the following disclaimer.
mbed_official 130:1dec54e4aec3 58 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 130:1dec54e4aec3 59 * this list of conditions and the following disclaimer in the documentation
mbed_official 130:1dec54e4aec3 60 * and/or other materials provided with the distribution.
mbed_official 130:1dec54e4aec3 61 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 130:1dec54e4aec3 62 * may be used to endorse or promote products derived from this software
mbed_official 130:1dec54e4aec3 63 * without specific prior written permission.
mbed_official 130:1dec54e4aec3 64 *
mbed_official 130:1dec54e4aec3 65 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 130:1dec54e4aec3 66 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 130:1dec54e4aec3 67 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 130:1dec54e4aec3 68 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 130:1dec54e4aec3 69 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 130:1dec54e4aec3 70 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 130:1dec54e4aec3 71 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 130:1dec54e4aec3 72 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 130:1dec54e4aec3 73 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 130:1dec54e4aec3 74 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 130:1dec54e4aec3 75 *
mbed_official 130:1dec54e4aec3 76 ******************************************************************************
mbed_official 130:1dec54e4aec3 77 */
mbed_official 130:1dec54e4aec3 78
mbed_official 130:1dec54e4aec3 79 /* Includes ------------------------------------------------------------------*/
mbed_official 130:1dec54e4aec3 80 #include "stm32f0xx_exti.h"
mbed_official 130:1dec54e4aec3 81
mbed_official 130:1dec54e4aec3 82 /** @addtogroup STM32F0xx_StdPeriph_Driver
mbed_official 130:1dec54e4aec3 83 * @{
mbed_official 130:1dec54e4aec3 84 */
mbed_official 130:1dec54e4aec3 85
mbed_official 130:1dec54e4aec3 86 /** @defgroup EXTI
mbed_official 130:1dec54e4aec3 87 * @brief EXTI driver modules
mbed_official 130:1dec54e4aec3 88 * @{
mbed_official 130:1dec54e4aec3 89 */
mbed_official 130:1dec54e4aec3 90
mbed_official 130:1dec54e4aec3 91 /* Private typedef -----------------------------------------------------------*/
mbed_official 130:1dec54e4aec3 92 /* Private define ------------------------------------------------------------*/
mbed_official 130:1dec54e4aec3 93 #define EXTI_LINENONE ((uint32_t)0x00000) /* No interrupt selected */
mbed_official 130:1dec54e4aec3 94
mbed_official 130:1dec54e4aec3 95 /* Private macro -------------------------------------------------------------*/
mbed_official 130:1dec54e4aec3 96 /* Private variables ---------------------------------------------------------*/
mbed_official 130:1dec54e4aec3 97 /* Private function prototypes -----------------------------------------------*/
mbed_official 130:1dec54e4aec3 98 /* Private functions ---------------------------------------------------------*/
mbed_official 130:1dec54e4aec3 99
mbed_official 130:1dec54e4aec3 100 /** @defgroup EXTI_Private_Functions
mbed_official 130:1dec54e4aec3 101 * @{
mbed_official 130:1dec54e4aec3 102 */
mbed_official 130:1dec54e4aec3 103
mbed_official 130:1dec54e4aec3 104 /** @defgroup EXTI_Group1 Initialization and Configuration functions
mbed_official 130:1dec54e4aec3 105 * @brief Initialization and Configuration functions
mbed_official 130:1dec54e4aec3 106 *
mbed_official 130:1dec54e4aec3 107 @verbatim
mbed_official 130:1dec54e4aec3 108 ==============================================================================
mbed_official 130:1dec54e4aec3 109 ##### Initialization and Configuration functions #####
mbed_official 130:1dec54e4aec3 110 ==============================================================================
mbed_official 130:1dec54e4aec3 111
mbed_official 130:1dec54e4aec3 112 @endverbatim
mbed_official 130:1dec54e4aec3 113 * @{
mbed_official 130:1dec54e4aec3 114 */
mbed_official 130:1dec54e4aec3 115
mbed_official 130:1dec54e4aec3 116 /**
mbed_official 130:1dec54e4aec3 117 * @brief Deinitializes the EXTI peripheral registers to their default reset
mbed_official 130:1dec54e4aec3 118 * values.
mbed_official 130:1dec54e4aec3 119 * @param None
mbed_official 130:1dec54e4aec3 120 * @retval None
mbed_official 130:1dec54e4aec3 121 */
mbed_official 130:1dec54e4aec3 122 void EXTI_DeInit(void)
mbed_official 130:1dec54e4aec3 123 {
mbed_official 130:1dec54e4aec3 124 EXTI->IMR = 0x0F940000;
mbed_official 130:1dec54e4aec3 125 EXTI->EMR = 0x00000000;
mbed_official 130:1dec54e4aec3 126 EXTI->RTSR = 0x00000000;
mbed_official 130:1dec54e4aec3 127 EXTI->FTSR = 0x00000000;
mbed_official 130:1dec54e4aec3 128 EXTI->PR = 0x006BFFFF;
mbed_official 130:1dec54e4aec3 129 }
mbed_official 130:1dec54e4aec3 130
mbed_official 130:1dec54e4aec3 131 /**
mbed_official 130:1dec54e4aec3 132 * @brief Initializes the EXTI peripheral according to the specified
mbed_official 130:1dec54e4aec3 133 * parameters in the EXTI_InitStruct.
mbed_official 130:1dec54e4aec3 134 * @param EXTI_InitStruct: pointer to a EXTI_InitTypeDef structure that
mbed_official 130:1dec54e4aec3 135 * contains the configuration information for the EXTI peripheral.
mbed_official 130:1dec54e4aec3 136 * @retval None
mbed_official 130:1dec54e4aec3 137 */
mbed_official 130:1dec54e4aec3 138 void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct)
mbed_official 130:1dec54e4aec3 139 {
mbed_official 130:1dec54e4aec3 140 uint32_t tmp = 0;
mbed_official 130:1dec54e4aec3 141
mbed_official 130:1dec54e4aec3 142 /* Check the parameters */
mbed_official 130:1dec54e4aec3 143 assert_param(IS_EXTI_MODE(EXTI_InitStruct->EXTI_Mode));
mbed_official 130:1dec54e4aec3 144 assert_param(IS_EXTI_TRIGGER(EXTI_InitStruct->EXTI_Trigger));
mbed_official 130:1dec54e4aec3 145 assert_param(IS_EXTI_LINE(EXTI_InitStruct->EXTI_Line));
mbed_official 130:1dec54e4aec3 146 assert_param(IS_FUNCTIONAL_STATE(EXTI_InitStruct->EXTI_LineCmd));
mbed_official 130:1dec54e4aec3 147
mbed_official 130:1dec54e4aec3 148 tmp = (uint32_t)EXTI_BASE;
mbed_official 130:1dec54e4aec3 149
mbed_official 130:1dec54e4aec3 150 if (EXTI_InitStruct->EXTI_LineCmd != DISABLE)
mbed_official 130:1dec54e4aec3 151 {
mbed_official 130:1dec54e4aec3 152 /* Clear EXTI line configuration */
mbed_official 130:1dec54e4aec3 153 EXTI->IMR &= ~EXTI_InitStruct->EXTI_Line;
mbed_official 130:1dec54e4aec3 154 EXTI->EMR &= ~EXTI_InitStruct->EXTI_Line;
mbed_official 130:1dec54e4aec3 155
mbed_official 130:1dec54e4aec3 156 tmp += EXTI_InitStruct->EXTI_Mode;
mbed_official 130:1dec54e4aec3 157
mbed_official 130:1dec54e4aec3 158 *(__IO uint32_t *) tmp |= EXTI_InitStruct->EXTI_Line;
mbed_official 130:1dec54e4aec3 159
mbed_official 130:1dec54e4aec3 160 /* Clear Rising Falling edge configuration */
mbed_official 130:1dec54e4aec3 161 EXTI->RTSR &= ~EXTI_InitStruct->EXTI_Line;
mbed_official 130:1dec54e4aec3 162 EXTI->FTSR &= ~EXTI_InitStruct->EXTI_Line;
mbed_official 130:1dec54e4aec3 163
mbed_official 130:1dec54e4aec3 164 /* Select the trigger for the selected interrupts */
mbed_official 130:1dec54e4aec3 165 if (EXTI_InitStruct->EXTI_Trigger == EXTI_Trigger_Rising_Falling)
mbed_official 130:1dec54e4aec3 166 {
mbed_official 130:1dec54e4aec3 167 /* Rising Falling edge */
mbed_official 130:1dec54e4aec3 168 EXTI->RTSR |= EXTI_InitStruct->EXTI_Line;
mbed_official 130:1dec54e4aec3 169 EXTI->FTSR |= EXTI_InitStruct->EXTI_Line;
mbed_official 130:1dec54e4aec3 170 }
mbed_official 130:1dec54e4aec3 171 else
mbed_official 130:1dec54e4aec3 172 {
mbed_official 130:1dec54e4aec3 173 tmp = (uint32_t)EXTI_BASE;
mbed_official 130:1dec54e4aec3 174 tmp += EXTI_InitStruct->EXTI_Trigger;
mbed_official 130:1dec54e4aec3 175
mbed_official 130:1dec54e4aec3 176 *(__IO uint32_t *) tmp |= EXTI_InitStruct->EXTI_Line;
mbed_official 130:1dec54e4aec3 177 }
mbed_official 130:1dec54e4aec3 178 }
mbed_official 130:1dec54e4aec3 179 else
mbed_official 130:1dec54e4aec3 180 {
mbed_official 130:1dec54e4aec3 181 tmp += EXTI_InitStruct->EXTI_Mode;
mbed_official 130:1dec54e4aec3 182
mbed_official 130:1dec54e4aec3 183 /* Disable the selected external lines */
mbed_official 130:1dec54e4aec3 184 *(__IO uint32_t *) tmp &= ~EXTI_InitStruct->EXTI_Line;
mbed_official 130:1dec54e4aec3 185 }
mbed_official 130:1dec54e4aec3 186 }
mbed_official 130:1dec54e4aec3 187
mbed_official 130:1dec54e4aec3 188 /**
mbed_official 130:1dec54e4aec3 189 * @brief Fills each EXTI_InitStruct member with its reset value.
mbed_official 130:1dec54e4aec3 190 * @param EXTI_InitStruct: pointer to a EXTI_InitTypeDef structure which will
mbed_official 130:1dec54e4aec3 191 * be initialized.
mbed_official 130:1dec54e4aec3 192 * @retval None
mbed_official 130:1dec54e4aec3 193 */
mbed_official 130:1dec54e4aec3 194 void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct)
mbed_official 130:1dec54e4aec3 195 {
mbed_official 130:1dec54e4aec3 196 EXTI_InitStruct->EXTI_Line = EXTI_LINENONE;
mbed_official 130:1dec54e4aec3 197 EXTI_InitStruct->EXTI_Mode = EXTI_Mode_Interrupt;
mbed_official 130:1dec54e4aec3 198 EXTI_InitStruct->EXTI_Trigger = EXTI_Trigger_Falling;
mbed_official 130:1dec54e4aec3 199 EXTI_InitStruct->EXTI_LineCmd = DISABLE;
mbed_official 130:1dec54e4aec3 200 }
mbed_official 130:1dec54e4aec3 201
mbed_official 130:1dec54e4aec3 202 /**
mbed_official 130:1dec54e4aec3 203 * @brief Generates a Software interrupt on selected EXTI line.
mbed_official 130:1dec54e4aec3 204 * @param EXTI_Line: specifies the EXTI line on which the software interrupt
mbed_official 130:1dec54e4aec3 205 * will be generated.
mbed_official 130:1dec54e4aec3 206 * This parameter can be any combination of EXTI_Linex where x can be (0..27).
mbed_official 130:1dec54e4aec3 207 * @retval None
mbed_official 130:1dec54e4aec3 208 */
mbed_official 130:1dec54e4aec3 209 void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line)
mbed_official 130:1dec54e4aec3 210 {
mbed_official 130:1dec54e4aec3 211 /* Check the parameters */
mbed_official 130:1dec54e4aec3 212 assert_param(IS_EXTI_LINE(EXTI_Line));
mbed_official 130:1dec54e4aec3 213
mbed_official 130:1dec54e4aec3 214 EXTI->SWIER |= EXTI_Line;
mbed_official 130:1dec54e4aec3 215 }
mbed_official 130:1dec54e4aec3 216
mbed_official 130:1dec54e4aec3 217 /**
mbed_official 130:1dec54e4aec3 218 * @}
mbed_official 130:1dec54e4aec3 219 */
mbed_official 130:1dec54e4aec3 220
mbed_official 130:1dec54e4aec3 221 /** @defgroup EXTI_Group2 Interrupts and flags management functions
mbed_official 130:1dec54e4aec3 222 * @brief Interrupts and flags management functions
mbed_official 130:1dec54e4aec3 223 *
mbed_official 130:1dec54e4aec3 224 @verbatim
mbed_official 130:1dec54e4aec3 225 ==============================================================================
mbed_official 130:1dec54e4aec3 226 ##### Interrupts and flags management functions #####
mbed_official 130:1dec54e4aec3 227 ==============================================================================
mbed_official 130:1dec54e4aec3 228
mbed_official 130:1dec54e4aec3 229 @endverbatim
mbed_official 130:1dec54e4aec3 230 * @{
mbed_official 130:1dec54e4aec3 231 */
mbed_official 130:1dec54e4aec3 232
mbed_official 130:1dec54e4aec3 233 /**
mbed_official 130:1dec54e4aec3 234 * @brief Checks whether the specified EXTI line flag is set or not.
mbed_official 130:1dec54e4aec3 235 * @param EXTI_Line: specifies the EXTI line flag to check.
mbed_official 130:1dec54e4aec3 236 * This parameter can be EXTI_Linex where x can be (0..27).
mbed_official 130:1dec54e4aec3 237 * @retval The new state of EXTI_Line (SET or RESET).
mbed_official 130:1dec54e4aec3 238 */
mbed_official 130:1dec54e4aec3 239 FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line)
mbed_official 130:1dec54e4aec3 240 {
mbed_official 130:1dec54e4aec3 241 FlagStatus bitstatus = RESET;
mbed_official 130:1dec54e4aec3 242 /* Check the parameters */
mbed_official 130:1dec54e4aec3 243 assert_param(IS_GET_EXTI_LINE(EXTI_Line));
mbed_official 130:1dec54e4aec3 244
mbed_official 130:1dec54e4aec3 245 if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET)
mbed_official 130:1dec54e4aec3 246 {
mbed_official 130:1dec54e4aec3 247 bitstatus = SET;
mbed_official 130:1dec54e4aec3 248 }
mbed_official 130:1dec54e4aec3 249 else
mbed_official 130:1dec54e4aec3 250 {
mbed_official 130:1dec54e4aec3 251 bitstatus = RESET;
mbed_official 130:1dec54e4aec3 252 }
mbed_official 130:1dec54e4aec3 253 return bitstatus;
mbed_official 130:1dec54e4aec3 254 }
mbed_official 130:1dec54e4aec3 255
mbed_official 130:1dec54e4aec3 256 /**
mbed_official 130:1dec54e4aec3 257 * @brief Clears the EXTI's line pending flags.
mbed_official 130:1dec54e4aec3 258 * @param EXTI_Line: specifies the EXTI lines flags to clear.
mbed_official 130:1dec54e4aec3 259 * This parameter can be any combination of EXTI_Linex where x can be (0..27).
mbed_official 130:1dec54e4aec3 260 * @retval None
mbed_official 130:1dec54e4aec3 261 */
mbed_official 130:1dec54e4aec3 262 void EXTI_ClearFlag(uint32_t EXTI_Line)
mbed_official 130:1dec54e4aec3 263 {
mbed_official 130:1dec54e4aec3 264 /* Check the parameters */
mbed_official 130:1dec54e4aec3 265 assert_param(IS_EXTI_LINE(EXTI_Line));
mbed_official 130:1dec54e4aec3 266
mbed_official 130:1dec54e4aec3 267 EXTI->PR = EXTI_Line;
mbed_official 130:1dec54e4aec3 268 }
mbed_official 130:1dec54e4aec3 269
mbed_official 130:1dec54e4aec3 270 /**
mbed_official 130:1dec54e4aec3 271 * @brief Checks whether the specified EXTI line is asserted or not.
mbed_official 130:1dec54e4aec3 272 * @param EXTI_Line: specifies the EXTI line to check.
mbed_official 130:1dec54e4aec3 273 * This parameter can be EXTI_Linex where x can be (0..27).
mbed_official 130:1dec54e4aec3 274 * @retval The new state of EXTI_Line (SET or RESET).
mbed_official 130:1dec54e4aec3 275 */
mbed_official 130:1dec54e4aec3 276 ITStatus EXTI_GetITStatus(uint32_t EXTI_Line)
mbed_official 130:1dec54e4aec3 277 {
mbed_official 130:1dec54e4aec3 278 ITStatus bitstatus = RESET;
mbed_official 130:1dec54e4aec3 279
mbed_official 130:1dec54e4aec3 280 /* Check the parameters */
mbed_official 130:1dec54e4aec3 281 assert_param(IS_GET_EXTI_LINE(EXTI_Line));
mbed_official 130:1dec54e4aec3 282
mbed_official 130:1dec54e4aec3 283 if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET)
mbed_official 130:1dec54e4aec3 284 {
mbed_official 130:1dec54e4aec3 285 bitstatus = SET;
mbed_official 130:1dec54e4aec3 286 }
mbed_official 130:1dec54e4aec3 287 else
mbed_official 130:1dec54e4aec3 288 {
mbed_official 130:1dec54e4aec3 289 bitstatus = RESET;
mbed_official 130:1dec54e4aec3 290 }
mbed_official 130:1dec54e4aec3 291 return bitstatus;
mbed_official 130:1dec54e4aec3 292 }
mbed_official 130:1dec54e4aec3 293
mbed_official 130:1dec54e4aec3 294 /**
mbed_official 130:1dec54e4aec3 295 * @brief Clears the EXTI's line pending bits.
mbed_official 130:1dec54e4aec3 296 * @param EXTI_Line: specifies the EXTI lines to clear.
mbed_official 130:1dec54e4aec3 297 * This parameter can be any combination of EXTI_Linex where x can be (0..27).
mbed_official 130:1dec54e4aec3 298 * @retval None
mbed_official 130:1dec54e4aec3 299 */
mbed_official 130:1dec54e4aec3 300 void EXTI_ClearITPendingBit(uint32_t EXTI_Line)
mbed_official 130:1dec54e4aec3 301 {
mbed_official 130:1dec54e4aec3 302 /* Check the parameters */
mbed_official 130:1dec54e4aec3 303 assert_param(IS_EXTI_LINE(EXTI_Line));
mbed_official 130:1dec54e4aec3 304
mbed_official 130:1dec54e4aec3 305 EXTI->PR = EXTI_Line;
mbed_official 130:1dec54e4aec3 306 }
mbed_official 130:1dec54e4aec3 307
mbed_official 130:1dec54e4aec3 308 /**
mbed_official 130:1dec54e4aec3 309 * @}
mbed_official 130:1dec54e4aec3 310 */
mbed_official 130:1dec54e4aec3 311
mbed_official 130:1dec54e4aec3 312 /**
mbed_official 130:1dec54e4aec3 313 * @}
mbed_official 130:1dec54e4aec3 314 */
mbed_official 130:1dec54e4aec3 315
mbed_official 130:1dec54e4aec3 316 /**
mbed_official 130:1dec54e4aec3 317 * @}
mbed_official 130:1dec54e4aec3 318 */
mbed_official 130:1dec54e4aec3 319
mbed_official 130:1dec54e4aec3 320 /**
mbed_official 130:1dec54e4aec3 321 * @}
mbed_official 130:1dec54e4aec3 322 */
mbed_official 130:1dec54e4aec3 323
mbed_official 130:1dec54e4aec3 324 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/