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