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_F030R8/stm32f0xx_exti.c@76:aeb1df146756, 2014-01-27 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Jan 27 14:30:07 2014 +0000
- Revision:
- 76:aeb1df146756
- Child:
- 106:ced8cbb51063
Synchronized with git revision a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd
Full URL: https://github.com/mbedmicro/mbed/commit/a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd/
Add NUCLEO_L152RE
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 | 76:aeb1df146756 | 52 | * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2> |
mbed_official | 76:aeb1df146756 | 53 | * |
mbed_official | 76:aeb1df146756 | 54 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); |
mbed_official | 76:aeb1df146756 | 55 | * You may not use this file except in compliance with the License. |
mbed_official | 76:aeb1df146756 | 56 | * You may obtain a copy of the License at: |
mbed_official | 76:aeb1df146756 | 57 | * |
mbed_official | 76:aeb1df146756 | 58 | * http://www.st.com/software_license_agreement_liberty_v2 |
mbed_official | 76:aeb1df146756 | 59 | * |
mbed_official | 76:aeb1df146756 | 60 | * Unless required by applicable law or agreed to in writing, software |
mbed_official | 76:aeb1df146756 | 61 | * distributed under the License is distributed on an "AS IS" BASIS, |
mbed_official | 76:aeb1df146756 | 62 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbed_official | 76:aeb1df146756 | 63 | * See the License for the specific language governing permissions and |
mbed_official | 76:aeb1df146756 | 64 | * limitations under the License. |
mbed_official | 76:aeb1df146756 | 65 | * |
mbed_official | 76:aeb1df146756 | 66 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 67 | */ |
mbed_official | 76:aeb1df146756 | 68 | |
mbed_official | 76:aeb1df146756 | 69 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 70 | #include "stm32f0xx_exti.h" |
mbed_official | 76:aeb1df146756 | 71 | |
mbed_official | 76:aeb1df146756 | 72 | /** @addtogroup STM32F0xx_StdPeriph_Driver |
mbed_official | 76:aeb1df146756 | 73 | * @{ |
mbed_official | 76:aeb1df146756 | 74 | */ |
mbed_official | 76:aeb1df146756 | 75 | |
mbed_official | 76:aeb1df146756 | 76 | /** @defgroup EXTI |
mbed_official | 76:aeb1df146756 | 77 | * @brief EXTI driver modules |
mbed_official | 76:aeb1df146756 | 78 | * @{ |
mbed_official | 76:aeb1df146756 | 79 | */ |
mbed_official | 76:aeb1df146756 | 80 | |
mbed_official | 76:aeb1df146756 | 81 | /* Private typedef -----------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 82 | /* Private define ------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 83 | #define EXTI_LINENONE ((uint32_t)0x00000) /* No interrupt selected */ |
mbed_official | 76:aeb1df146756 | 84 | |
mbed_official | 76:aeb1df146756 | 85 | /* Private macro -------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 86 | /* Private variables ---------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 87 | /* Private function prototypes -----------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 88 | /* Private functions ---------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 89 | |
mbed_official | 76:aeb1df146756 | 90 | /** @defgroup EXTI_Private_Functions |
mbed_official | 76:aeb1df146756 | 91 | * @{ |
mbed_official | 76:aeb1df146756 | 92 | */ |
mbed_official | 76:aeb1df146756 | 93 | |
mbed_official | 76:aeb1df146756 | 94 | /** @defgroup EXTI_Group1 Initialization and Configuration functions |
mbed_official | 76:aeb1df146756 | 95 | * @brief Initialization and Configuration functions |
mbed_official | 76:aeb1df146756 | 96 | * |
mbed_official | 76:aeb1df146756 | 97 | @verbatim |
mbed_official | 76:aeb1df146756 | 98 | ============================================================================== |
mbed_official | 76:aeb1df146756 | 99 | ##### Initialization and Configuration functions ##### |
mbed_official | 76:aeb1df146756 | 100 | ============================================================================== |
mbed_official | 76:aeb1df146756 | 101 | |
mbed_official | 76:aeb1df146756 | 102 | @endverbatim |
mbed_official | 76:aeb1df146756 | 103 | * @{ |
mbed_official | 76:aeb1df146756 | 104 | */ |
mbed_official | 76:aeb1df146756 | 105 | |
mbed_official | 76:aeb1df146756 | 106 | /** |
mbed_official | 76:aeb1df146756 | 107 | * @brief Deinitializes the EXTI peripheral registers to their default reset |
mbed_official | 76:aeb1df146756 | 108 | * values. |
mbed_official | 76:aeb1df146756 | 109 | * @param None |
mbed_official | 76:aeb1df146756 | 110 | * @retval None |
mbed_official | 76:aeb1df146756 | 111 | */ |
mbed_official | 76:aeb1df146756 | 112 | void EXTI_DeInit(void) |
mbed_official | 76:aeb1df146756 | 113 | { |
mbed_official | 76:aeb1df146756 | 114 | EXTI->IMR = 0x0F940000; |
mbed_official | 76:aeb1df146756 | 115 | EXTI->EMR = 0x00000000; |
mbed_official | 76:aeb1df146756 | 116 | EXTI->RTSR = 0x00000000; |
mbed_official | 76:aeb1df146756 | 117 | EXTI->FTSR = 0x00000000; |
mbed_official | 76:aeb1df146756 | 118 | EXTI->PR = 0x006BFFFF; |
mbed_official | 76:aeb1df146756 | 119 | } |
mbed_official | 76:aeb1df146756 | 120 | |
mbed_official | 76:aeb1df146756 | 121 | /** |
mbed_official | 76:aeb1df146756 | 122 | * @brief Initializes the EXTI peripheral according to the specified |
mbed_official | 76:aeb1df146756 | 123 | * parameters in the EXTI_InitStruct. |
mbed_official | 76:aeb1df146756 | 124 | * @param EXTI_InitStruct: pointer to a EXTI_InitTypeDef structure that |
mbed_official | 76:aeb1df146756 | 125 | * contains the configuration information for the EXTI peripheral. |
mbed_official | 76:aeb1df146756 | 126 | * @retval None |
mbed_official | 76:aeb1df146756 | 127 | */ |
mbed_official | 76:aeb1df146756 | 128 | void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct) |
mbed_official | 76:aeb1df146756 | 129 | { |
mbed_official | 76:aeb1df146756 | 130 | uint32_t tmp = 0; |
mbed_official | 76:aeb1df146756 | 131 | |
mbed_official | 76:aeb1df146756 | 132 | /* Check the parameters */ |
mbed_official | 76:aeb1df146756 | 133 | assert_param(IS_EXTI_MODE(EXTI_InitStruct->EXTI_Mode)); |
mbed_official | 76:aeb1df146756 | 134 | assert_param(IS_EXTI_TRIGGER(EXTI_InitStruct->EXTI_Trigger)); |
mbed_official | 76:aeb1df146756 | 135 | assert_param(IS_EXTI_LINE(EXTI_InitStruct->EXTI_Line)); |
mbed_official | 76:aeb1df146756 | 136 | assert_param(IS_FUNCTIONAL_STATE(EXTI_InitStruct->EXTI_LineCmd)); |
mbed_official | 76:aeb1df146756 | 137 | |
mbed_official | 76:aeb1df146756 | 138 | tmp = (uint32_t)EXTI_BASE; |
mbed_official | 76:aeb1df146756 | 139 | |
mbed_official | 76:aeb1df146756 | 140 | if (EXTI_InitStruct->EXTI_LineCmd != DISABLE) |
mbed_official | 76:aeb1df146756 | 141 | { |
mbed_official | 76:aeb1df146756 | 142 | /* Clear EXTI line configuration */ |
mbed_official | 76:aeb1df146756 | 143 | EXTI->IMR &= ~EXTI_InitStruct->EXTI_Line; |
mbed_official | 76:aeb1df146756 | 144 | EXTI->EMR &= ~EXTI_InitStruct->EXTI_Line; |
mbed_official | 76:aeb1df146756 | 145 | |
mbed_official | 76:aeb1df146756 | 146 | tmp += EXTI_InitStruct->EXTI_Mode; |
mbed_official | 76:aeb1df146756 | 147 | |
mbed_official | 76:aeb1df146756 | 148 | *(__IO uint32_t *) tmp |= EXTI_InitStruct->EXTI_Line; |
mbed_official | 76:aeb1df146756 | 149 | |
mbed_official | 76:aeb1df146756 | 150 | /* Clear Rising Falling edge configuration */ |
mbed_official | 76:aeb1df146756 | 151 | EXTI->RTSR &= ~EXTI_InitStruct->EXTI_Line; |
mbed_official | 76:aeb1df146756 | 152 | EXTI->FTSR &= ~EXTI_InitStruct->EXTI_Line; |
mbed_official | 76:aeb1df146756 | 153 | |
mbed_official | 76:aeb1df146756 | 154 | /* Select the trigger for the selected interrupts */ |
mbed_official | 76:aeb1df146756 | 155 | if (EXTI_InitStruct->EXTI_Trigger == EXTI_Trigger_Rising_Falling) |
mbed_official | 76:aeb1df146756 | 156 | { |
mbed_official | 76:aeb1df146756 | 157 | /* Rising Falling edge */ |
mbed_official | 76:aeb1df146756 | 158 | EXTI->RTSR |= EXTI_InitStruct->EXTI_Line; |
mbed_official | 76:aeb1df146756 | 159 | EXTI->FTSR |= EXTI_InitStruct->EXTI_Line; |
mbed_official | 76:aeb1df146756 | 160 | } |
mbed_official | 76:aeb1df146756 | 161 | else |
mbed_official | 76:aeb1df146756 | 162 | { |
mbed_official | 76:aeb1df146756 | 163 | tmp = (uint32_t)EXTI_BASE; |
mbed_official | 76:aeb1df146756 | 164 | tmp += EXTI_InitStruct->EXTI_Trigger; |
mbed_official | 76:aeb1df146756 | 165 | |
mbed_official | 76:aeb1df146756 | 166 | *(__IO uint32_t *) tmp |= EXTI_InitStruct->EXTI_Line; |
mbed_official | 76:aeb1df146756 | 167 | } |
mbed_official | 76:aeb1df146756 | 168 | } |
mbed_official | 76:aeb1df146756 | 169 | else |
mbed_official | 76:aeb1df146756 | 170 | { |
mbed_official | 76:aeb1df146756 | 171 | tmp += EXTI_InitStruct->EXTI_Mode; |
mbed_official | 76:aeb1df146756 | 172 | |
mbed_official | 76:aeb1df146756 | 173 | /* Disable the selected external lines */ |
mbed_official | 76:aeb1df146756 | 174 | *(__IO uint32_t *) tmp &= ~EXTI_InitStruct->EXTI_Line; |
mbed_official | 76:aeb1df146756 | 175 | } |
mbed_official | 76:aeb1df146756 | 176 | } |
mbed_official | 76:aeb1df146756 | 177 | |
mbed_official | 76:aeb1df146756 | 178 | /** |
mbed_official | 76:aeb1df146756 | 179 | * @brief Fills each EXTI_InitStruct member with its reset value. |
mbed_official | 76:aeb1df146756 | 180 | * @param EXTI_InitStruct: pointer to a EXTI_InitTypeDef structure which will |
mbed_official | 76:aeb1df146756 | 181 | * be initialized. |
mbed_official | 76:aeb1df146756 | 182 | * @retval None |
mbed_official | 76:aeb1df146756 | 183 | */ |
mbed_official | 76:aeb1df146756 | 184 | void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct) |
mbed_official | 76:aeb1df146756 | 185 | { |
mbed_official | 76:aeb1df146756 | 186 | EXTI_InitStruct->EXTI_Line = EXTI_LINENONE; |
mbed_official | 76:aeb1df146756 | 187 | EXTI_InitStruct->EXTI_Mode = EXTI_Mode_Interrupt; |
mbed_official | 76:aeb1df146756 | 188 | EXTI_InitStruct->EXTI_Trigger = EXTI_Trigger_Falling; |
mbed_official | 76:aeb1df146756 | 189 | EXTI_InitStruct->EXTI_LineCmd = DISABLE; |
mbed_official | 76:aeb1df146756 | 190 | } |
mbed_official | 76:aeb1df146756 | 191 | |
mbed_official | 76:aeb1df146756 | 192 | /** |
mbed_official | 76:aeb1df146756 | 193 | * @brief Generates a Software interrupt on selected EXTI line. |
mbed_official | 76:aeb1df146756 | 194 | * @param EXTI_Line: specifies the EXTI line on which the software interrupt |
mbed_official | 76:aeb1df146756 | 195 | * will be generated. |
mbed_official | 76:aeb1df146756 | 196 | * This parameter can be any combination of EXTI_Linex where x can be (0..27). |
mbed_official | 76:aeb1df146756 | 197 | * @retval None |
mbed_official | 76:aeb1df146756 | 198 | */ |
mbed_official | 76:aeb1df146756 | 199 | void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line) |
mbed_official | 76:aeb1df146756 | 200 | { |
mbed_official | 76:aeb1df146756 | 201 | /* Check the parameters */ |
mbed_official | 76:aeb1df146756 | 202 | assert_param(IS_EXTI_LINE(EXTI_Line)); |
mbed_official | 76:aeb1df146756 | 203 | |
mbed_official | 76:aeb1df146756 | 204 | EXTI->SWIER |= EXTI_Line; |
mbed_official | 76:aeb1df146756 | 205 | } |
mbed_official | 76:aeb1df146756 | 206 | |
mbed_official | 76:aeb1df146756 | 207 | /** |
mbed_official | 76:aeb1df146756 | 208 | * @} |
mbed_official | 76:aeb1df146756 | 209 | */ |
mbed_official | 76:aeb1df146756 | 210 | |
mbed_official | 76:aeb1df146756 | 211 | /** @defgroup EXTI_Group2 Interrupts and flags management functions |
mbed_official | 76:aeb1df146756 | 212 | * @brief Interrupts and flags management functions |
mbed_official | 76:aeb1df146756 | 213 | * |
mbed_official | 76:aeb1df146756 | 214 | @verbatim |
mbed_official | 76:aeb1df146756 | 215 | ============================================================================== |
mbed_official | 76:aeb1df146756 | 216 | ##### Interrupts and flags management functions ##### |
mbed_official | 76:aeb1df146756 | 217 | ============================================================================== |
mbed_official | 76:aeb1df146756 | 218 | |
mbed_official | 76:aeb1df146756 | 219 | @endverbatim |
mbed_official | 76:aeb1df146756 | 220 | * @{ |
mbed_official | 76:aeb1df146756 | 221 | */ |
mbed_official | 76:aeb1df146756 | 222 | |
mbed_official | 76:aeb1df146756 | 223 | /** |
mbed_official | 76:aeb1df146756 | 224 | * @brief Checks whether the specified EXTI line flag is set or not. |
mbed_official | 76:aeb1df146756 | 225 | * @param EXTI_Line: specifies the EXTI line flag to check. |
mbed_official | 76:aeb1df146756 | 226 | * This parameter can be EXTI_Linex where x can be (0..27). |
mbed_official | 76:aeb1df146756 | 227 | * @retval The new state of EXTI_Line (SET or RESET). |
mbed_official | 76:aeb1df146756 | 228 | */ |
mbed_official | 76:aeb1df146756 | 229 | FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line) |
mbed_official | 76:aeb1df146756 | 230 | { |
mbed_official | 76:aeb1df146756 | 231 | FlagStatus bitstatus = RESET; |
mbed_official | 76:aeb1df146756 | 232 | /* Check the parameters */ |
mbed_official | 76:aeb1df146756 | 233 | assert_param(IS_GET_EXTI_LINE(EXTI_Line)); |
mbed_official | 76:aeb1df146756 | 234 | |
mbed_official | 76:aeb1df146756 | 235 | if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET) |
mbed_official | 76:aeb1df146756 | 236 | { |
mbed_official | 76:aeb1df146756 | 237 | bitstatus = SET; |
mbed_official | 76:aeb1df146756 | 238 | } |
mbed_official | 76:aeb1df146756 | 239 | else |
mbed_official | 76:aeb1df146756 | 240 | { |
mbed_official | 76:aeb1df146756 | 241 | bitstatus = RESET; |
mbed_official | 76:aeb1df146756 | 242 | } |
mbed_official | 76:aeb1df146756 | 243 | return bitstatus; |
mbed_official | 76:aeb1df146756 | 244 | } |
mbed_official | 76:aeb1df146756 | 245 | |
mbed_official | 76:aeb1df146756 | 246 | /** |
mbed_official | 76:aeb1df146756 | 247 | * @brief Clears the EXTI's line pending flags. |
mbed_official | 76:aeb1df146756 | 248 | * @param EXTI_Line: specifies the EXTI lines flags to clear. |
mbed_official | 76:aeb1df146756 | 249 | * This parameter can be any combination of EXTI_Linex where x can be (0..27). |
mbed_official | 76:aeb1df146756 | 250 | * @retval None |
mbed_official | 76:aeb1df146756 | 251 | */ |
mbed_official | 76:aeb1df146756 | 252 | void EXTI_ClearFlag(uint32_t EXTI_Line) |
mbed_official | 76:aeb1df146756 | 253 | { |
mbed_official | 76:aeb1df146756 | 254 | /* Check the parameters */ |
mbed_official | 76:aeb1df146756 | 255 | assert_param(IS_EXTI_LINE(EXTI_Line)); |
mbed_official | 76:aeb1df146756 | 256 | |
mbed_official | 76:aeb1df146756 | 257 | EXTI->PR = EXTI_Line; |
mbed_official | 76:aeb1df146756 | 258 | } |
mbed_official | 76:aeb1df146756 | 259 | |
mbed_official | 76:aeb1df146756 | 260 | /** |
mbed_official | 76:aeb1df146756 | 261 | * @brief Checks whether the specified EXTI line is asserted or not. |
mbed_official | 76:aeb1df146756 | 262 | * @param EXTI_Line: specifies the EXTI line to check. |
mbed_official | 76:aeb1df146756 | 263 | * This parameter can be EXTI_Linex where x can be (0..27). |
mbed_official | 76:aeb1df146756 | 264 | * @retval The new state of EXTI_Line (SET or RESET). |
mbed_official | 76:aeb1df146756 | 265 | */ |
mbed_official | 76:aeb1df146756 | 266 | ITStatus EXTI_GetITStatus(uint32_t EXTI_Line) |
mbed_official | 76:aeb1df146756 | 267 | { |
mbed_official | 76:aeb1df146756 | 268 | ITStatus bitstatus = RESET; |
mbed_official | 76:aeb1df146756 | 269 | |
mbed_official | 76:aeb1df146756 | 270 | /* Check the parameters */ |
mbed_official | 76:aeb1df146756 | 271 | assert_param(IS_GET_EXTI_LINE(EXTI_Line)); |
mbed_official | 76:aeb1df146756 | 272 | |
mbed_official | 76:aeb1df146756 | 273 | if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET) |
mbed_official | 76:aeb1df146756 | 274 | { |
mbed_official | 76:aeb1df146756 | 275 | bitstatus = SET; |
mbed_official | 76:aeb1df146756 | 276 | } |
mbed_official | 76:aeb1df146756 | 277 | else |
mbed_official | 76:aeb1df146756 | 278 | { |
mbed_official | 76:aeb1df146756 | 279 | bitstatus = RESET; |
mbed_official | 76:aeb1df146756 | 280 | } |
mbed_official | 76:aeb1df146756 | 281 | return bitstatus; |
mbed_official | 76:aeb1df146756 | 282 | } |
mbed_official | 76:aeb1df146756 | 283 | |
mbed_official | 76:aeb1df146756 | 284 | /** |
mbed_official | 76:aeb1df146756 | 285 | * @brief Clears the EXTI's line pending bits. |
mbed_official | 76:aeb1df146756 | 286 | * @param EXTI_Line: specifies the EXTI lines to clear. |
mbed_official | 76:aeb1df146756 | 287 | * This parameter can be any combination of EXTI_Linex where x can be (0..27). |
mbed_official | 76:aeb1df146756 | 288 | * @retval None |
mbed_official | 76:aeb1df146756 | 289 | */ |
mbed_official | 76:aeb1df146756 | 290 | void EXTI_ClearITPendingBit(uint32_t EXTI_Line) |
mbed_official | 76:aeb1df146756 | 291 | { |
mbed_official | 76:aeb1df146756 | 292 | /* Check the parameters */ |
mbed_official | 76:aeb1df146756 | 293 | assert_param(IS_EXTI_LINE(EXTI_Line)); |
mbed_official | 76:aeb1df146756 | 294 | |
mbed_official | 76:aeb1df146756 | 295 | EXTI->PR = EXTI_Line; |
mbed_official | 76:aeb1df146756 | 296 | } |
mbed_official | 76:aeb1df146756 | 297 | |
mbed_official | 76:aeb1df146756 | 298 | /** |
mbed_official | 76:aeb1df146756 | 299 | * @} |
mbed_official | 76:aeb1df146756 | 300 | */ |
mbed_official | 76:aeb1df146756 | 301 | |
mbed_official | 76:aeb1df146756 | 302 | /** |
mbed_official | 76:aeb1df146756 | 303 | * @} |
mbed_official | 76:aeb1df146756 | 304 | */ |
mbed_official | 76:aeb1df146756 | 305 | |
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 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |