mbed library with additional peripherals for ST F401 board
Fork of mbed-src by
This mbed LIB has additional peripherals for ST F401 board
- UART2 : PA_3 rx, PA_2 tx
- UART3 : PC_7 rx, PC_6 tx
- I2C2 : PB_3 SDA, PB_10 SCL
- I2C3 : PB_4 SDA, PA_8 SCL
targets/cmsis/TARGET_STM/TARGET_NUCLEO_L152RE/stm32l1xx_exti.c@106:ced8cbb51063, 2014-02-26 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Feb 26 09:45:12 2014 +0000
- Revision:
- 106:ced8cbb51063
- Parent:
- 80:66393a7b209d
Synchronized with git revision 4222735eff5868389433f0e9271976b39c8115cd
Full URL: https://github.com/mbedmicro/mbed/commit/4222735eff5868389433f0e9271976b39c8115cd/
[NUCLEO_xxx] Update STM32CubeF4 driver V1.0.0 + update license
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 stm32l1xx_exti.c |
mbed_official | 76:aeb1df146756 | 4 | * @author MCD Application Team |
mbed_official | 80:66393a7b209d | 5 | * @version V1.3.0 |
mbed_official | 80:66393a7b209d | 6 | * @date 31-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. |
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 USB Device FS wakeup event. |
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. |
mbed_official | 76:aeb1df146756 | 24 | (#) EXTI line 21 is connected to the Comparator 1 wakeup event. |
mbed_official | 76:aeb1df146756 | 25 | (#) EXTI line 22 is connected to the Comparator 2 wakeup event. |
mbed_official | 76:aeb1df146756 | 26 | (#) EXTI line 23 is connected to the Comparator channel acquisition wakeup event. |
mbed_official | 76:aeb1df146756 | 27 | |
mbed_official | 76:aeb1df146756 | 28 | |
mbed_official | 76:aeb1df146756 | 29 | ##### How to use this driver ##### |
mbed_official | 76:aeb1df146756 | 30 | ============================================================================== |
mbed_official | 76:aeb1df146756 | 31 | [..] In order to use an I/O pin as an external interrupt source, follow |
mbed_official | 76:aeb1df146756 | 32 | steps below: |
mbed_official | 76:aeb1df146756 | 33 | (#) Configure the I/O in input mode using GPIO_Init() |
mbed_official | 76:aeb1df146756 | 34 | (#) Select the input source pin for the EXTI line using |
mbed_official | 76:aeb1df146756 | 35 | SYSCFG_EXTILineConfig() |
mbed_official | 76:aeb1df146756 | 36 | (#) Select the mode(interrupt, event) and configure the trigger |
mbed_official | 76:aeb1df146756 | 37 | selection (Rising, falling or both) using EXTI_Init() |
mbed_official | 76:aeb1df146756 | 38 | (#) Configure NVIC IRQ channel mapped to the EXTI line using NVIC_Init() |
mbed_official | 76:aeb1df146756 | 39 | [..] |
mbed_official | 76:aeb1df146756 | 40 | (@) SYSCFG APB clock must be enabled to get write access to SYSCFG_EXTICRx |
mbed_official | 76:aeb1df146756 | 41 | registers using RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); |
mbed_official | 76:aeb1df146756 | 42 | |
mbed_official | 76:aeb1df146756 | 43 | * @endverbatim |
mbed_official | 76:aeb1df146756 | 44 | * |
mbed_official | 76:aeb1df146756 | 45 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 46 | * @attention |
mbed_official | 76:aeb1df146756 | 47 | * |
mbed_official | 106:ced8cbb51063 | 48 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 76:aeb1df146756 | 49 | * |
mbed_official | 106:ced8cbb51063 | 50 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 106:ced8cbb51063 | 51 | * are permitted provided that the following conditions are met: |
mbed_official | 106:ced8cbb51063 | 52 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 106:ced8cbb51063 | 53 | * this list of conditions and the following disclaimer. |
mbed_official | 106:ced8cbb51063 | 54 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 106:ced8cbb51063 | 55 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 106:ced8cbb51063 | 56 | * and/or other materials provided with the distribution. |
mbed_official | 106:ced8cbb51063 | 57 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 106:ced8cbb51063 | 58 | * may be used to endorse or promote products derived from this software |
mbed_official | 106:ced8cbb51063 | 59 | * without specific prior written permission. |
mbed_official | 76:aeb1df146756 | 60 | * |
mbed_official | 106:ced8cbb51063 | 61 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 106:ced8cbb51063 | 62 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 106:ced8cbb51063 | 63 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 106:ced8cbb51063 | 64 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 106:ced8cbb51063 | 65 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 106:ced8cbb51063 | 66 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 106:ced8cbb51063 | 67 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 106:ced8cbb51063 | 68 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 106:ced8cbb51063 | 69 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 106:ced8cbb51063 | 70 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 76:aeb1df146756 | 71 | * |
mbed_official | 76:aeb1df146756 | 72 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 73 | */ |
mbed_official | 76:aeb1df146756 | 74 | |
mbed_official | 76:aeb1df146756 | 75 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 76 | #include "stm32l1xx_exti.h" |
mbed_official | 76:aeb1df146756 | 77 | |
mbed_official | 76:aeb1df146756 | 78 | /** @addtogroup STM32L1xx_StdPeriph_Driver |
mbed_official | 76:aeb1df146756 | 79 | * @{ |
mbed_official | 76:aeb1df146756 | 80 | */ |
mbed_official | 76:aeb1df146756 | 81 | |
mbed_official | 76:aeb1df146756 | 82 | /** @defgroup EXTI |
mbed_official | 76:aeb1df146756 | 83 | * @brief EXTI driver modules |
mbed_official | 76:aeb1df146756 | 84 | * @{ |
mbed_official | 76:aeb1df146756 | 85 | */ |
mbed_official | 76:aeb1df146756 | 86 | |
mbed_official | 76:aeb1df146756 | 87 | /* Private typedef -----------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 88 | /* Private define ------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 89 | #define EXTI_LINENONE ((uint32_t)0x00000) /* No interrupt selected */ |
mbed_official | 76:aeb1df146756 | 90 | |
mbed_official | 76:aeb1df146756 | 91 | /* Private macro -------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 92 | /* Private variables ---------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 93 | /* Private function prototypes -----------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 94 | /* Private functions ---------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 95 | |
mbed_official | 76:aeb1df146756 | 96 | /** @defgroup EXTI_Private_Functions |
mbed_official | 76:aeb1df146756 | 97 | * @{ |
mbed_official | 76:aeb1df146756 | 98 | */ |
mbed_official | 76:aeb1df146756 | 99 | |
mbed_official | 76:aeb1df146756 | 100 | /** @defgroup EXTI_Group1 Initialization and Configuration functions |
mbed_official | 76:aeb1df146756 | 101 | * @brief Initialization and Configuration functions |
mbed_official | 76:aeb1df146756 | 102 | * |
mbed_official | 76:aeb1df146756 | 103 | @verbatim |
mbed_official | 76:aeb1df146756 | 104 | ============================================================================== |
mbed_official | 76:aeb1df146756 | 105 | ##### Initialization and Configuration functions ##### |
mbed_official | 76:aeb1df146756 | 106 | ============================================================================== |
mbed_official | 76:aeb1df146756 | 107 | |
mbed_official | 76:aeb1df146756 | 108 | @endverbatim |
mbed_official | 76:aeb1df146756 | 109 | * @{ |
mbed_official | 76:aeb1df146756 | 110 | */ |
mbed_official | 76:aeb1df146756 | 111 | |
mbed_official | 76:aeb1df146756 | 112 | /** |
mbed_official | 76:aeb1df146756 | 113 | * @brief Deinitializes the EXTI peripheral registers to their default reset values. |
mbed_official | 76:aeb1df146756 | 114 | * @param None |
mbed_official | 76:aeb1df146756 | 115 | * @retval None |
mbed_official | 76:aeb1df146756 | 116 | */ |
mbed_official | 76:aeb1df146756 | 117 | void EXTI_DeInit(void) |
mbed_official | 76:aeb1df146756 | 118 | { |
mbed_official | 76:aeb1df146756 | 119 | EXTI->IMR = 0x00000000; |
mbed_official | 76:aeb1df146756 | 120 | EXTI->EMR = 0x00000000; |
mbed_official | 76:aeb1df146756 | 121 | EXTI->RTSR = 0x00000000; |
mbed_official | 76:aeb1df146756 | 122 | EXTI->FTSR = 0x00000000; |
mbed_official | 76:aeb1df146756 | 123 | EXTI->PR = 0x00FFFFFF; |
mbed_official | 76:aeb1df146756 | 124 | } |
mbed_official | 76:aeb1df146756 | 125 | |
mbed_official | 76:aeb1df146756 | 126 | /** |
mbed_official | 76:aeb1df146756 | 127 | * @brief Initializes the EXTI peripheral according to the specified |
mbed_official | 76:aeb1df146756 | 128 | * parameters in the EXTI_InitStruct. |
mbed_official | 76:aeb1df146756 | 129 | * EXTI_Line specifies the EXTI line (EXTI0....EXTI23). |
mbed_official | 76:aeb1df146756 | 130 | * EXTI_Mode specifies which EXTI line is used as interrupt or an event. |
mbed_official | 76:aeb1df146756 | 131 | * EXTI_Trigger selects the trigger. When the trigger occurs, interrupt |
mbed_official | 76:aeb1df146756 | 132 | * pending bit will be set. |
mbed_official | 76:aeb1df146756 | 133 | * EXTI_LineCmd controls (Enable/Disable) the EXTI line. |
mbed_official | 76:aeb1df146756 | 134 | * @param EXTI_InitStruct: pointer to a EXTI_InitTypeDef structure |
mbed_official | 76:aeb1df146756 | 135 | * that 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 external 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..23). |
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: |
mbed_official | 76:aeb1df146756 | 237 | * EXTI_Linex: External interrupt line x where x(0..23). |
mbed_official | 76:aeb1df146756 | 238 | * @retval The new state of EXTI_Line (SET or RESET). |
mbed_official | 76:aeb1df146756 | 239 | */ |
mbed_official | 76:aeb1df146756 | 240 | FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line) |
mbed_official | 76:aeb1df146756 | 241 | { |
mbed_official | 76:aeb1df146756 | 242 | FlagStatus bitstatus = RESET; |
mbed_official | 76:aeb1df146756 | 243 | /* Check the parameters */ |
mbed_official | 76:aeb1df146756 | 244 | assert_param(IS_GET_EXTI_LINE(EXTI_Line)); |
mbed_official | 76:aeb1df146756 | 245 | |
mbed_official | 76:aeb1df146756 | 246 | if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET) |
mbed_official | 76:aeb1df146756 | 247 | { |
mbed_official | 76:aeb1df146756 | 248 | bitstatus = SET; |
mbed_official | 76:aeb1df146756 | 249 | } |
mbed_official | 76:aeb1df146756 | 250 | else |
mbed_official | 76:aeb1df146756 | 251 | { |
mbed_official | 76:aeb1df146756 | 252 | bitstatus = RESET; |
mbed_official | 76:aeb1df146756 | 253 | } |
mbed_official | 76:aeb1df146756 | 254 | return bitstatus; |
mbed_official | 76:aeb1df146756 | 255 | } |
mbed_official | 76:aeb1df146756 | 256 | |
mbed_official | 76:aeb1df146756 | 257 | /** |
mbed_official | 76:aeb1df146756 | 258 | * @brief Clears the EXTI's line pending flags. |
mbed_official | 76:aeb1df146756 | 259 | * @param EXTI_Line: specifies the EXTI lines flags to clear. |
mbed_official | 76:aeb1df146756 | 260 | * This parameter can be any combination of EXTI_Linex where x can be (0..23). |
mbed_official | 76:aeb1df146756 | 261 | * @retval None |
mbed_official | 76:aeb1df146756 | 262 | */ |
mbed_official | 76:aeb1df146756 | 263 | void EXTI_ClearFlag(uint32_t EXTI_Line) |
mbed_official | 76:aeb1df146756 | 264 | { |
mbed_official | 76:aeb1df146756 | 265 | /* Check the parameters */ |
mbed_official | 76:aeb1df146756 | 266 | assert_param(IS_EXTI_LINE(EXTI_Line)); |
mbed_official | 76:aeb1df146756 | 267 | |
mbed_official | 76:aeb1df146756 | 268 | EXTI->PR = EXTI_Line; |
mbed_official | 76:aeb1df146756 | 269 | } |
mbed_official | 76:aeb1df146756 | 270 | |
mbed_official | 76:aeb1df146756 | 271 | /** |
mbed_official | 76:aeb1df146756 | 272 | * @brief Checks whether the specified EXTI line is asserted or not. |
mbed_official | 76:aeb1df146756 | 273 | * @param EXTI_Line: specifies the EXTI line to check. |
mbed_official | 76:aeb1df146756 | 274 | * This parameter can be: |
mbed_official | 76:aeb1df146756 | 275 | * EXTI_Linex: External interrupt line x where x(0..23). |
mbed_official | 76:aeb1df146756 | 276 | * @retval The new state of EXTI_Line (SET or RESET). |
mbed_official | 76:aeb1df146756 | 277 | */ |
mbed_official | 76:aeb1df146756 | 278 | ITStatus EXTI_GetITStatus(uint32_t EXTI_Line) |
mbed_official | 76:aeb1df146756 | 279 | { |
mbed_official | 76:aeb1df146756 | 280 | FlagStatus bitstatus = RESET; |
mbed_official | 76:aeb1df146756 | 281 | /* Check the parameters */ |
mbed_official | 76:aeb1df146756 | 282 | assert_param(IS_GET_EXTI_LINE(EXTI_Line)); |
mbed_official | 76:aeb1df146756 | 283 | |
mbed_official | 76:aeb1df146756 | 284 | if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET) |
mbed_official | 76:aeb1df146756 | 285 | { |
mbed_official | 76:aeb1df146756 | 286 | bitstatus = SET; |
mbed_official | 76:aeb1df146756 | 287 | } |
mbed_official | 76:aeb1df146756 | 288 | else |
mbed_official | 76:aeb1df146756 | 289 | { |
mbed_official | 76:aeb1df146756 | 290 | bitstatus = RESET; |
mbed_official | 76:aeb1df146756 | 291 | } |
mbed_official | 76:aeb1df146756 | 292 | return bitstatus; |
mbed_official | 76:aeb1df146756 | 293 | } |
mbed_official | 76:aeb1df146756 | 294 | |
mbed_official | 76:aeb1df146756 | 295 | /** |
mbed_official | 76:aeb1df146756 | 296 | * @brief Clears the EXTI's line pending bits. |
mbed_official | 76:aeb1df146756 | 297 | * @param EXTI_Line: specifies the EXTI lines to clear. |
mbed_official | 76:aeb1df146756 | 298 | * This parameter can be any combination of EXTI_Linex where x can be (0..23). |
mbed_official | 76:aeb1df146756 | 299 | * @retval None |
mbed_official | 76:aeb1df146756 | 300 | */ |
mbed_official | 76:aeb1df146756 | 301 | void EXTI_ClearITPendingBit(uint32_t EXTI_Line) |
mbed_official | 76:aeb1df146756 | 302 | { |
mbed_official | 76:aeb1df146756 | 303 | /* Check the parameters */ |
mbed_official | 76:aeb1df146756 | 304 | assert_param(IS_EXTI_LINE(EXTI_Line)); |
mbed_official | 76:aeb1df146756 | 305 | |
mbed_official | 76:aeb1df146756 | 306 | EXTI->PR = EXTI_Line; |
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 | |
mbed_official | 76:aeb1df146756 | 325 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |