version_2.0
Dependents: cc3000_ping_demo_try_2
Fork of mbed by
TARGET_NUCLEO_F302R8/stm32f30x_exti.h@86:4f9a848d74c7, 2014-06-25 (annotated)
- Committer:
- erezi
- Date:
- Wed Jun 25 06:08:49 2014 +0000
- Revision:
- 86:4f9a848d74c7
- Parent:
- 82:6473597d706e
version_2.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 82:6473597d706e | 1 | /** |
bogdanm | 82:6473597d706e | 2 | ****************************************************************************** |
bogdanm | 82:6473597d706e | 3 | * @file stm32f30x_exti.h |
bogdanm | 82:6473597d706e | 4 | * @author MCD Application Team |
bogdanm | 82:6473597d706e | 5 | * @version V1.1.0 |
bogdanm | 82:6473597d706e | 6 | * @date 27-February-2014 |
bogdanm | 82:6473597d706e | 7 | * @brief This file contains all the functions prototypes for the EXTI |
bogdanm | 82:6473597d706e | 8 | * firmware library. |
bogdanm | 82:6473597d706e | 9 | ****************************************************************************** |
bogdanm | 82:6473597d706e | 10 | * @attention |
bogdanm | 82:6473597d706e | 11 | * |
bogdanm | 82:6473597d706e | 12 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
bogdanm | 82:6473597d706e | 13 | * |
bogdanm | 82:6473597d706e | 14 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 82:6473597d706e | 15 | * are permitted provided that the following conditions are met: |
bogdanm | 82:6473597d706e | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 82:6473597d706e | 17 | * this list of conditions and the following disclaimer. |
bogdanm | 82:6473597d706e | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 82:6473597d706e | 19 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 82:6473597d706e | 20 | * and/or other materials provided with the distribution. |
bogdanm | 82:6473597d706e | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 82:6473597d706e | 22 | * may be used to endorse or promote products derived from this software |
bogdanm | 82:6473597d706e | 23 | * without specific prior written permission. |
bogdanm | 82:6473597d706e | 24 | * |
bogdanm | 82:6473597d706e | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 82:6473597d706e | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 82:6473597d706e | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 82:6473597d706e | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 82:6473597d706e | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 82:6473597d706e | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 82:6473597d706e | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 82:6473597d706e | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 82:6473597d706e | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 82:6473597d706e | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 82:6473597d706e | 35 | * |
bogdanm | 82:6473597d706e | 36 | ****************************************************************************** |
bogdanm | 82:6473597d706e | 37 | */ |
bogdanm | 82:6473597d706e | 38 | |
bogdanm | 82:6473597d706e | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bogdanm | 82:6473597d706e | 40 | #ifndef __STM32F30x_EXTI_H |
bogdanm | 82:6473597d706e | 41 | #define __STM32F30x_EXTI_H |
bogdanm | 82:6473597d706e | 42 | |
bogdanm | 82:6473597d706e | 43 | #ifdef __cplusplus |
bogdanm | 82:6473597d706e | 44 | extern "C" { |
bogdanm | 82:6473597d706e | 45 | #endif |
bogdanm | 82:6473597d706e | 46 | |
bogdanm | 82:6473597d706e | 47 | /* Includes ------------------------------------------------------------------*/ |
bogdanm | 82:6473597d706e | 48 | #include "stm32f30x.h" |
bogdanm | 82:6473597d706e | 49 | |
bogdanm | 82:6473597d706e | 50 | /** @addtogroup STM32F30x_StdPeriph_Driver |
bogdanm | 82:6473597d706e | 51 | * @{ |
bogdanm | 82:6473597d706e | 52 | */ |
bogdanm | 82:6473597d706e | 53 | |
bogdanm | 82:6473597d706e | 54 | /** @addtogroup EXTI |
bogdanm | 82:6473597d706e | 55 | * @{ |
bogdanm | 82:6473597d706e | 56 | */ |
bogdanm | 82:6473597d706e | 57 | |
bogdanm | 82:6473597d706e | 58 | /* Exported types ------------------------------------------------------------*/ |
bogdanm | 82:6473597d706e | 59 | |
bogdanm | 82:6473597d706e | 60 | /** |
bogdanm | 82:6473597d706e | 61 | * @brief EXTI mode enumeration |
bogdanm | 82:6473597d706e | 62 | */ |
bogdanm | 82:6473597d706e | 63 | |
bogdanm | 82:6473597d706e | 64 | typedef enum |
bogdanm | 82:6473597d706e | 65 | { |
bogdanm | 82:6473597d706e | 66 | EXTI_Mode_Interrupt = 0x00, |
bogdanm | 82:6473597d706e | 67 | EXTI_Mode_Event = 0x04 |
bogdanm | 82:6473597d706e | 68 | }EXTIMode_TypeDef; |
bogdanm | 82:6473597d706e | 69 | |
bogdanm | 82:6473597d706e | 70 | #define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event)) |
bogdanm | 82:6473597d706e | 71 | |
bogdanm | 82:6473597d706e | 72 | /** |
bogdanm | 82:6473597d706e | 73 | * @brief EXTI Trigger enumeration |
bogdanm | 82:6473597d706e | 74 | */ |
bogdanm | 82:6473597d706e | 75 | |
bogdanm | 82:6473597d706e | 76 | typedef enum |
bogdanm | 82:6473597d706e | 77 | { |
bogdanm | 82:6473597d706e | 78 | EXTI_Trigger_Rising = 0x08, |
bogdanm | 82:6473597d706e | 79 | EXTI_Trigger_Falling = 0x0C, |
bogdanm | 82:6473597d706e | 80 | EXTI_Trigger_Rising_Falling = 0x10 |
bogdanm | 82:6473597d706e | 81 | }EXTITrigger_TypeDef; |
bogdanm | 82:6473597d706e | 82 | |
bogdanm | 82:6473597d706e | 83 | #define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \ |
bogdanm | 82:6473597d706e | 84 | ((TRIGGER) == EXTI_Trigger_Falling) || \ |
bogdanm | 82:6473597d706e | 85 | ((TRIGGER) == EXTI_Trigger_Rising_Falling)) |
bogdanm | 82:6473597d706e | 86 | /** |
bogdanm | 82:6473597d706e | 87 | * @brief EXTI Init Structure definition |
bogdanm | 82:6473597d706e | 88 | */ |
bogdanm | 82:6473597d706e | 89 | |
bogdanm | 82:6473597d706e | 90 | typedef struct |
bogdanm | 82:6473597d706e | 91 | { |
bogdanm | 82:6473597d706e | 92 | uint32_t EXTI_Line; /*!< Specifies the EXTI lines to be enabled or disabled. |
bogdanm | 82:6473597d706e | 93 | This parameter can be any combination of @ref EXTI_Lines */ |
bogdanm | 82:6473597d706e | 94 | |
bogdanm | 82:6473597d706e | 95 | EXTIMode_TypeDef EXTI_Mode; /*!< Specifies the mode for the EXTI lines. |
bogdanm | 82:6473597d706e | 96 | This parameter can be a value of @ref EXTIMode_TypeDef */ |
bogdanm | 82:6473597d706e | 97 | |
bogdanm | 82:6473597d706e | 98 | EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines. |
bogdanm | 82:6473597d706e | 99 | This parameter can be a value of @ref EXTITrigger_TypeDef */ |
bogdanm | 82:6473597d706e | 100 | |
bogdanm | 82:6473597d706e | 101 | FunctionalState EXTI_LineCmd; /*!< Specifies the new state of the selected EXTI lines. |
bogdanm | 82:6473597d706e | 102 | This parameter can be set either to ENABLE or DISABLE */ |
bogdanm | 82:6473597d706e | 103 | }EXTI_InitTypeDef; |
bogdanm | 82:6473597d706e | 104 | |
bogdanm | 82:6473597d706e | 105 | /* Exported constants --------------------------------------------------------*/ |
bogdanm | 82:6473597d706e | 106 | |
bogdanm | 82:6473597d706e | 107 | /** @defgroup EXTI_Exported_Constants |
bogdanm | 82:6473597d706e | 108 | * @{ |
bogdanm | 82:6473597d706e | 109 | */ |
bogdanm | 82:6473597d706e | 110 | /** @defgroup EXTI_Lines |
bogdanm | 82:6473597d706e | 111 | * @{ |
bogdanm | 82:6473597d706e | 112 | */ |
bogdanm | 82:6473597d706e | 113 | |
bogdanm | 82:6473597d706e | 114 | #define EXTI_Line0 ((uint32_t)0x00) /*!< External interrupt line 0 */ |
bogdanm | 82:6473597d706e | 115 | #define EXTI_Line1 ((uint32_t)0x01) /*!< External interrupt line 1 */ |
bogdanm | 82:6473597d706e | 116 | #define EXTI_Line2 ((uint32_t)0x02) /*!< External interrupt line 2 */ |
bogdanm | 82:6473597d706e | 117 | #define EXTI_Line3 ((uint32_t)0x03) /*!< External interrupt line 3 */ |
bogdanm | 82:6473597d706e | 118 | #define EXTI_Line4 ((uint32_t)0x04) /*!< External interrupt line 4 */ |
bogdanm | 82:6473597d706e | 119 | #define EXTI_Line5 ((uint32_t)0x05) /*!< External interrupt line 5 */ |
bogdanm | 82:6473597d706e | 120 | #define EXTI_Line6 ((uint32_t)0x06) /*!< External interrupt line 6 */ |
bogdanm | 82:6473597d706e | 121 | #define EXTI_Line7 ((uint32_t)0x07) /*!< External interrupt line 7 */ |
bogdanm | 82:6473597d706e | 122 | #define EXTI_Line8 ((uint32_t)0x08) /*!< External interrupt line 8 */ |
bogdanm | 82:6473597d706e | 123 | #define EXTI_Line9 ((uint32_t)0x09) /*!< External interrupt line 9 */ |
bogdanm | 82:6473597d706e | 124 | #define EXTI_Line10 ((uint32_t)0x0A) /*!< External interrupt line 10 */ |
bogdanm | 82:6473597d706e | 125 | #define EXTI_Line11 ((uint32_t)0x0B) /*!< External interrupt line 11 */ |
bogdanm | 82:6473597d706e | 126 | #define EXTI_Line12 ((uint32_t)0x0C) /*!< External interrupt line 12 */ |
bogdanm | 82:6473597d706e | 127 | #define EXTI_Line13 ((uint32_t)0x0D) /*!< External interrupt line 13 */ |
bogdanm | 82:6473597d706e | 128 | #define EXTI_Line14 ((uint32_t)0x0E) /*!< External interrupt line 14 */ |
bogdanm | 82:6473597d706e | 129 | #define EXTI_Line15 ((uint32_t)0x0F) /*!< External interrupt line 15 */ |
bogdanm | 82:6473597d706e | 130 | #define EXTI_Line16 ((uint32_t)0x10) /*!< External interrupt line 16 |
bogdanm | 82:6473597d706e | 131 | Connected to the PVD Output */ |
bogdanm | 82:6473597d706e | 132 | #define EXTI_Line17 ((uint32_t)0x11) /*!< Internal interrupt line 17 |
bogdanm | 82:6473597d706e | 133 | Connected to the RTC Alarm |
bogdanm | 82:6473597d706e | 134 | event */ |
bogdanm | 82:6473597d706e | 135 | #define EXTI_Line18 ((uint32_t)0x12) /*!< Internal interrupt line 18 |
bogdanm | 82:6473597d706e | 136 | Connected to the USB Device |
bogdanm | 82:6473597d706e | 137 | Wakeup from suspend event */ |
bogdanm | 82:6473597d706e | 138 | #define EXTI_Line19 ((uint32_t)0x13) /*!< Internal interrupt line 19 |
bogdanm | 82:6473597d706e | 139 | Connected to the RTC Tamper |
bogdanm | 82:6473597d706e | 140 | and Time Stamp events */ |
bogdanm | 82:6473597d706e | 141 | #define EXTI_Line20 ((uint32_t)0x14) /*!< Internal interrupt line 20 |
bogdanm | 82:6473597d706e | 142 | Connected to the RTC wakeup |
bogdanm | 82:6473597d706e | 143 | event */ |
bogdanm | 82:6473597d706e | 144 | #define EXTI_Line21 ((uint32_t)0x15) /*!< Internal interrupt line 21 |
bogdanm | 82:6473597d706e | 145 | Connected to the Comparator 1 |
bogdanm | 82:6473597d706e | 146 | event */ |
bogdanm | 82:6473597d706e | 147 | #define EXTI_Line22 ((uint32_t)0x16) /*!< Internal interrupt line 22 |
bogdanm | 82:6473597d706e | 148 | Connected to the Comparator 2 |
bogdanm | 82:6473597d706e | 149 | event */ |
bogdanm | 82:6473597d706e | 150 | #define EXTI_Line23 ((uint32_t)0x17) /*!< Internal interrupt line 23 |
bogdanm | 82:6473597d706e | 151 | Connected to the I2C1 wakeup |
bogdanm | 82:6473597d706e | 152 | event */ |
bogdanm | 82:6473597d706e | 153 | #define EXTI_Line24 ((uint32_t)0x18) /*!< Internal interrupt line 24 |
bogdanm | 82:6473597d706e | 154 | Connected to the I2C2 wakeup |
bogdanm | 82:6473597d706e | 155 | event */ |
bogdanm | 82:6473597d706e | 156 | #define EXTI_Line25 ((uint32_t)0x19) /*!< Internal interrupt line 25 |
bogdanm | 82:6473597d706e | 157 | Connected to the USART1 wakeup |
bogdanm | 82:6473597d706e | 158 | event */ |
bogdanm | 82:6473597d706e | 159 | #define EXTI_Line26 ((uint32_t)0x1A) /*!< Internal interrupt line 26 |
bogdanm | 82:6473597d706e | 160 | Connected to the USART2 wakeup |
bogdanm | 82:6473597d706e | 161 | event */ |
bogdanm | 82:6473597d706e | 162 | #define EXTI_Line27 ((uint32_t)0x1B) /*!< Internal interrupt line 27 |
bogdanm | 82:6473597d706e | 163 | reserved */ |
bogdanm | 82:6473597d706e | 164 | #define EXTI_Line28 ((uint32_t)0x1C) /*!< Internal interrupt line 28 |
bogdanm | 82:6473597d706e | 165 | Connected to the USART3 wakeup |
bogdanm | 82:6473597d706e | 166 | event */ |
bogdanm | 82:6473597d706e | 167 | #define EXTI_Line29 ((uint32_t)0x1D) /*!< Internal interrupt line 29 |
bogdanm | 82:6473597d706e | 168 | Connected to the Comparator 3 |
bogdanm | 82:6473597d706e | 169 | event */ |
bogdanm | 82:6473597d706e | 170 | #define EXTI_Line30 ((uint32_t)0x1E) /*!< Internal interrupt line 30 |
bogdanm | 82:6473597d706e | 171 | Connected to the Comparator 4 |
bogdanm | 82:6473597d706e | 172 | event */ |
bogdanm | 82:6473597d706e | 173 | #define EXTI_Line31 ((uint32_t)0x1F) /*!< Internal interrupt line 31 |
bogdanm | 82:6473597d706e | 174 | Connected to the Comparator 5 |
bogdanm | 82:6473597d706e | 175 | event */ |
bogdanm | 82:6473597d706e | 176 | #define EXTI_Line32 ((uint32_t)0x20) /*!< Internal interrupt line 32 |
bogdanm | 82:6473597d706e | 177 | Connected to the Comparator 6 |
bogdanm | 82:6473597d706e | 178 | event */ |
bogdanm | 82:6473597d706e | 179 | #define EXTI_Line33 ((uint32_t)0x21) /*!< Internal interrupt line 33 |
bogdanm | 82:6473597d706e | 180 | Connected to the Comparator 7 |
bogdanm | 82:6473597d706e | 181 | event */ |
bogdanm | 82:6473597d706e | 182 | #define EXTI_Line34 ((uint32_t)0x22) /*!< Internal interrupt line 34 |
bogdanm | 82:6473597d706e | 183 | Connected to the USART4 wakeup |
bogdanm | 82:6473597d706e | 184 | event */ |
bogdanm | 82:6473597d706e | 185 | #define EXTI_Line35 ((uint32_t)0x23) /*!< Internal interrupt line 35 |
bogdanm | 82:6473597d706e | 186 | Connected to the USART5 wakeup |
bogdanm | 82:6473597d706e | 187 | event */ |
bogdanm | 82:6473597d706e | 188 | |
bogdanm | 82:6473597d706e | 189 | #define IS_EXTI_LINE_ALL(LINE) ((LINE) <= 0x23) |
bogdanm | 82:6473597d706e | 190 | #define IS_EXTI_LINE_EXT(LINE) (((LINE) <= 0x16) || (((LINE) == EXTI_Line29) || ((LINE) == EXTI_Line30) || \ |
bogdanm | 82:6473597d706e | 191 | ((LINE) == EXTI_Line31) || ((LINE) == EXTI_Line32) || ((LINE) == EXTI_Line33))) |
bogdanm | 82:6473597d706e | 192 | |
bogdanm | 82:6473597d706e | 193 | #define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \ |
bogdanm | 82:6473597d706e | 194 | ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \ |
bogdanm | 82:6473597d706e | 195 | ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \ |
bogdanm | 82:6473597d706e | 196 | ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \ |
bogdanm | 82:6473597d706e | 197 | ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \ |
bogdanm | 82:6473597d706e | 198 | ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \ |
bogdanm | 82:6473597d706e | 199 | ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \ |
bogdanm | 82:6473597d706e | 200 | ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \ |
bogdanm | 82:6473597d706e | 201 | ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \ |
bogdanm | 82:6473597d706e | 202 | ((LINE) == EXTI_Line18) || ((LINE) == EXTI_Line19) || \ |
bogdanm | 82:6473597d706e | 203 | ((LINE) == EXTI_Line20) || ((LINE) == EXTI_Line21) || \ |
bogdanm | 82:6473597d706e | 204 | ((LINE) == EXTI_Line22) || ((LINE) == EXTI_Line29) || \ |
bogdanm | 82:6473597d706e | 205 | ((LINE) == EXTI_Line30) || ((LINE) == EXTI_Line31) || \ |
bogdanm | 82:6473597d706e | 206 | ((LINE) == EXTI_Line32) || ((LINE) == EXTI_Line33)) |
bogdanm | 82:6473597d706e | 207 | /** |
bogdanm | 82:6473597d706e | 208 | * @} |
bogdanm | 82:6473597d706e | 209 | */ |
bogdanm | 82:6473597d706e | 210 | |
bogdanm | 82:6473597d706e | 211 | /** |
bogdanm | 82:6473597d706e | 212 | * @} |
bogdanm | 82:6473597d706e | 213 | */ |
bogdanm | 82:6473597d706e | 214 | |
bogdanm | 82:6473597d706e | 215 | /* Exported macro ------------------------------------------------------------*/ |
bogdanm | 82:6473597d706e | 216 | /* Exported functions ------------------------------------------------------- */ |
bogdanm | 82:6473597d706e | 217 | /* Function used to set the EXTI configuration to the default reset state *****/ |
bogdanm | 82:6473597d706e | 218 | void EXTI_DeInit(void); |
bogdanm | 82:6473597d706e | 219 | |
bogdanm | 82:6473597d706e | 220 | /* Initialization and Configuration functions *********************************/ |
bogdanm | 82:6473597d706e | 221 | void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct); |
bogdanm | 82:6473597d706e | 222 | void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct); |
bogdanm | 82:6473597d706e | 223 | void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line); |
bogdanm | 82:6473597d706e | 224 | |
bogdanm | 82:6473597d706e | 225 | /* Interrupts and flags management functions **********************************/ |
bogdanm | 82:6473597d706e | 226 | FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line); |
bogdanm | 82:6473597d706e | 227 | void EXTI_ClearFlag(uint32_t EXTI_Line); |
bogdanm | 82:6473597d706e | 228 | ITStatus EXTI_GetITStatus(uint32_t EXTI_Line); |
bogdanm | 82:6473597d706e | 229 | void EXTI_ClearITPendingBit(uint32_t EXTI_Line); |
bogdanm | 82:6473597d706e | 230 | |
bogdanm | 82:6473597d706e | 231 | #ifdef __cplusplus |
bogdanm | 82:6473597d706e | 232 | } |
bogdanm | 82:6473597d706e | 233 | #endif |
bogdanm | 82:6473597d706e | 234 | |
bogdanm | 82:6473597d706e | 235 | #endif /* __STM32F30x_EXTI_H */ |
bogdanm | 82:6473597d706e | 236 | /** |
bogdanm | 82:6473597d706e | 237 | * @} |
bogdanm | 82:6473597d706e | 238 | */ |
bogdanm | 82:6473597d706e | 239 | |
bogdanm | 82:6473597d706e | 240 | /** |
bogdanm | 82:6473597d706e | 241 | * @} |
bogdanm | 82:6473597d706e | 242 | */ |
bogdanm | 82:6473597d706e | 243 | |
bogdanm | 82:6473597d706e | 244 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |