version_2.0
Dependents: cc3000_ping_demo_try_2
Fork of mbed by
TARGET_NUCLEO_L152RE/stm32l1xx_exti.h@86:4f9a848d74c7, 2014-06-25 (annotated)
- Committer:
- erezi
- Date:
- Wed Jun 25 06:08:49 2014 +0000
- Revision:
- 86:4f9a848d74c7
- Parent:
- 81:7d30d6019079
version_2.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 77:869cf507173a | 1 | /** |
emilmont | 77:869cf507173a | 2 | ****************************************************************************** |
emilmont | 77:869cf507173a | 3 | * @file stm32l1xx_exti.h |
emilmont | 77:869cf507173a | 4 | * @author MCD Application Team |
emilmont | 77:869cf507173a | 5 | * @version V1.3.0 |
emilmont | 77:869cf507173a | 6 | * @date 31-January-2014 |
emilmont | 77:869cf507173a | 7 | * @brief This file contains all the functions prototypes for the EXTI firmware |
emilmont | 77:869cf507173a | 8 | * library. |
emilmont | 77:869cf507173a | 9 | ****************************************************************************** |
emilmont | 77:869cf507173a | 10 | * @attention |
emilmont | 77:869cf507173a | 11 | * |
bogdanm | 81:7d30d6019079 | 12 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
emilmont | 77:869cf507173a | 13 | * |
bogdanm | 81:7d30d6019079 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 81:7d30d6019079 | 15 | * are permitted provided that the following conditions are met: |
bogdanm | 81:7d30d6019079 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 81:7d30d6019079 | 17 | * this list of conditions and the following disclaimer. |
bogdanm | 81:7d30d6019079 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 81:7d30d6019079 | 19 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 81:7d30d6019079 | 20 | * and/or other materials provided with the distribution. |
bogdanm | 81:7d30d6019079 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 81:7d30d6019079 | 22 | * may be used to endorse or promote products derived from this software |
bogdanm | 81:7d30d6019079 | 23 | * without specific prior written permission. |
emilmont | 77:869cf507173a | 24 | * |
bogdanm | 81:7d30d6019079 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 81:7d30d6019079 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 81:7d30d6019079 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 81:7d30d6019079 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 81:7d30d6019079 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 81:7d30d6019079 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 81:7d30d6019079 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 81:7d30d6019079 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 81:7d30d6019079 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 81:7d30d6019079 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
emilmont | 77:869cf507173a | 35 | * |
emilmont | 77:869cf507173a | 36 | ****************************************************************************** |
emilmont | 77:869cf507173a | 37 | */ |
emilmont | 77:869cf507173a | 38 | |
emilmont | 77:869cf507173a | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
emilmont | 77:869cf507173a | 40 | #ifndef __STM32L1xx_EXTI_H |
emilmont | 77:869cf507173a | 41 | #define __STM32L1xx_EXTI_H |
emilmont | 77:869cf507173a | 42 | |
emilmont | 77:869cf507173a | 43 | #ifdef __cplusplus |
emilmont | 77:869cf507173a | 44 | extern "C" { |
emilmont | 77:869cf507173a | 45 | #endif |
emilmont | 77:869cf507173a | 46 | |
emilmont | 77:869cf507173a | 47 | /* Includes ------------------------------------------------------------------*/ |
emilmont | 77:869cf507173a | 48 | #include "stm32l1xx.h" |
emilmont | 77:869cf507173a | 49 | |
emilmont | 77:869cf507173a | 50 | /** @addtogroup STM32L1xx_StdPeriph_Driver |
emilmont | 77:869cf507173a | 51 | * @{ |
emilmont | 77:869cf507173a | 52 | */ |
emilmont | 77:869cf507173a | 53 | |
emilmont | 77:869cf507173a | 54 | /** @addtogroup EXTI |
emilmont | 77:869cf507173a | 55 | * @{ |
emilmont | 77:869cf507173a | 56 | */ |
emilmont | 77:869cf507173a | 57 | |
emilmont | 77:869cf507173a | 58 | /* Exported types ------------------------------------------------------------*/ |
emilmont | 77:869cf507173a | 59 | |
emilmont | 77:869cf507173a | 60 | /** |
emilmont | 77:869cf507173a | 61 | * @brief EXTI mode enumeration |
emilmont | 77:869cf507173a | 62 | */ |
emilmont | 77:869cf507173a | 63 | |
emilmont | 77:869cf507173a | 64 | typedef enum |
emilmont | 77:869cf507173a | 65 | { |
emilmont | 77:869cf507173a | 66 | EXTI_Mode_Interrupt = 0x00, |
emilmont | 77:869cf507173a | 67 | EXTI_Mode_Event = 0x04 |
emilmont | 77:869cf507173a | 68 | }EXTIMode_TypeDef; |
emilmont | 77:869cf507173a | 69 | |
emilmont | 77:869cf507173a | 70 | #define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event)) |
emilmont | 77:869cf507173a | 71 | |
emilmont | 77:869cf507173a | 72 | /** |
emilmont | 77:869cf507173a | 73 | * @brief EXTI Trigger enumeration |
emilmont | 77:869cf507173a | 74 | */ |
emilmont | 77:869cf507173a | 75 | |
emilmont | 77:869cf507173a | 76 | typedef enum |
emilmont | 77:869cf507173a | 77 | { |
emilmont | 77:869cf507173a | 78 | EXTI_Trigger_Rising = 0x08, |
emilmont | 77:869cf507173a | 79 | EXTI_Trigger_Falling = 0x0C, |
emilmont | 77:869cf507173a | 80 | EXTI_Trigger_Rising_Falling = 0x10 |
emilmont | 77:869cf507173a | 81 | }EXTITrigger_TypeDef; |
emilmont | 77:869cf507173a | 82 | |
emilmont | 77:869cf507173a | 83 | #define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \ |
emilmont | 77:869cf507173a | 84 | ((TRIGGER) == EXTI_Trigger_Falling) || \ |
emilmont | 77:869cf507173a | 85 | ((TRIGGER) == EXTI_Trigger_Rising_Falling)) |
emilmont | 77:869cf507173a | 86 | /** |
emilmont | 77:869cf507173a | 87 | * @brief EXTI Init Structure definition |
emilmont | 77:869cf507173a | 88 | */ |
emilmont | 77:869cf507173a | 89 | |
emilmont | 77:869cf507173a | 90 | typedef struct |
emilmont | 77:869cf507173a | 91 | { |
emilmont | 77:869cf507173a | 92 | uint32_t EXTI_Line; /*!< Specifies the EXTI lines to be enabled or disabled. |
emilmont | 77:869cf507173a | 93 | This parameter can be any combination of @ref EXTI_Lines */ |
emilmont | 77:869cf507173a | 94 | |
emilmont | 77:869cf507173a | 95 | EXTIMode_TypeDef EXTI_Mode; /*!< Specifies the mode for the EXTI lines. |
emilmont | 77:869cf507173a | 96 | This parameter can be a value of @ref EXTIMode_TypeDef */ |
emilmont | 77:869cf507173a | 97 | |
emilmont | 77:869cf507173a | 98 | EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines. |
emilmont | 77:869cf507173a | 99 | This parameter can be a value of @ref EXTITrigger_TypeDef */ |
emilmont | 77:869cf507173a | 100 | |
emilmont | 77:869cf507173a | 101 | FunctionalState EXTI_LineCmd; /*!< Specifies the new state of the selected EXTI lines. |
emilmont | 77:869cf507173a | 102 | This parameter can be set either to ENABLE or DISABLE */ |
emilmont | 77:869cf507173a | 103 | }EXTI_InitTypeDef; |
emilmont | 77:869cf507173a | 104 | |
emilmont | 77:869cf507173a | 105 | /* Exported constants --------------------------------------------------------*/ |
emilmont | 77:869cf507173a | 106 | |
emilmont | 77:869cf507173a | 107 | /** @defgroup EXTI_Exported_Constants |
emilmont | 77:869cf507173a | 108 | * @{ |
emilmont | 77:869cf507173a | 109 | */ |
emilmont | 77:869cf507173a | 110 | |
emilmont | 77:869cf507173a | 111 | /** @defgroup EXTI_Lines |
emilmont | 77:869cf507173a | 112 | * @{ |
emilmont | 77:869cf507173a | 113 | */ |
emilmont | 77:869cf507173a | 114 | |
emilmont | 77:869cf507173a | 115 | #define EXTI_Line0 ((uint32_t)0x00000001) /*!< External interrupt line 0 */ |
emilmont | 77:869cf507173a | 116 | #define EXTI_Line1 ((uint32_t)0x00000002) /*!< External interrupt line 1 */ |
emilmont | 77:869cf507173a | 117 | #define EXTI_Line2 ((uint32_t)0x00000004) /*!< External interrupt line 2 */ |
emilmont | 77:869cf507173a | 118 | #define EXTI_Line3 ((uint32_t)0x00000008) /*!< External interrupt line 3 */ |
emilmont | 77:869cf507173a | 119 | #define EXTI_Line4 ((uint32_t)0x00000010) /*!< External interrupt line 4 */ |
emilmont | 77:869cf507173a | 120 | #define EXTI_Line5 ((uint32_t)0x00000020) /*!< External interrupt line 5 */ |
emilmont | 77:869cf507173a | 121 | #define EXTI_Line6 ((uint32_t)0x00000040) /*!< External interrupt line 6 */ |
emilmont | 77:869cf507173a | 122 | #define EXTI_Line7 ((uint32_t)0x00000080) /*!< External interrupt line 7 */ |
emilmont | 77:869cf507173a | 123 | #define EXTI_Line8 ((uint32_t)0x00000100) /*!< External interrupt line 8 */ |
emilmont | 77:869cf507173a | 124 | #define EXTI_Line9 ((uint32_t)0x00000200) /*!< External interrupt line 9 */ |
emilmont | 77:869cf507173a | 125 | #define EXTI_Line10 ((uint32_t)0x00000400) /*!< External interrupt line 10 */ |
emilmont | 77:869cf507173a | 126 | #define EXTI_Line11 ((uint32_t)0x00000800) /*!< External interrupt line 11 */ |
emilmont | 77:869cf507173a | 127 | #define EXTI_Line12 ((uint32_t)0x00001000) /*!< External interrupt line 12 */ |
emilmont | 77:869cf507173a | 128 | #define EXTI_Line13 ((uint32_t)0x00002000) /*!< External interrupt line 13 */ |
emilmont | 77:869cf507173a | 129 | #define EXTI_Line14 ((uint32_t)0x00004000) /*!< External interrupt line 14 */ |
emilmont | 77:869cf507173a | 130 | #define EXTI_Line15 ((uint32_t)0x00008000) /*!< External interrupt line 15 */ |
emilmont | 77:869cf507173a | 131 | #define EXTI_Line16 ((uint32_t)0x00010000) /*!< External interrupt line 16 |
emilmont | 77:869cf507173a | 132 | Connected to the PVD Output */ |
emilmont | 77:869cf507173a | 133 | #define EXTI_Line17 ((uint32_t)0x00020000) /*!< External interrupt line 17 |
emilmont | 77:869cf507173a | 134 | Connected to the RTC Alarm |
emilmont | 77:869cf507173a | 135 | event */ |
emilmont | 77:869cf507173a | 136 | #define EXTI_Line18 ((uint32_t)0x00040000) /*!< External interrupt line 18 |
emilmont | 77:869cf507173a | 137 | Connected to the USB Device |
emilmont | 77:869cf507173a | 138 | FS Wakeup from suspend event */ |
emilmont | 77:869cf507173a | 139 | #define EXTI_Line19 ((uint32_t)0x00080000) /*!< External interrupt line 19 |
emilmont | 77:869cf507173a | 140 | Connected to the RTC Tamper |
emilmont | 77:869cf507173a | 141 | and Time Stamp events */ |
emilmont | 77:869cf507173a | 142 | #define EXTI_Line20 ((uint32_t)0x00100000) /*!< External interrupt line 20 |
emilmont | 77:869cf507173a | 143 | Connected to the RTC Wakeup |
emilmont | 77:869cf507173a | 144 | event */ |
emilmont | 77:869cf507173a | 145 | #define EXTI_Line21 ((uint32_t)0x00200000) /*!< External interrupt line 21 |
emilmont | 77:869cf507173a | 146 | Connected to the Comparator 1 |
emilmont | 77:869cf507173a | 147 | event */ |
emilmont | 77:869cf507173a | 148 | |
emilmont | 77:869cf507173a | 149 | #define EXTI_Line22 ((uint32_t)0x00400000) /*!< External interrupt line 22 |
emilmont | 77:869cf507173a | 150 | Connected to the Comparator 2 |
emilmont | 77:869cf507173a | 151 | event */ |
emilmont | 77:869cf507173a | 152 | |
emilmont | 77:869cf507173a | 153 | #define EXTI_Line23 ((uint32_t)0x00800000) /*!< External interrupt line 23 |
emilmont | 77:869cf507173a | 154 | Comparator channel acquisition event */ |
emilmont | 77:869cf507173a | 155 | |
emilmont | 77:869cf507173a | 156 | #define IS_EXTI_LINE(LINE) ((((LINE) & (uint32_t)0xFF000000) == 0x00) && ((LINE) != (uint16_t)0x00)) |
emilmont | 77:869cf507173a | 157 | |
emilmont | 77:869cf507173a | 158 | #define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \ |
emilmont | 77:869cf507173a | 159 | ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \ |
emilmont | 77:869cf507173a | 160 | ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \ |
emilmont | 77:869cf507173a | 161 | ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \ |
emilmont | 77:869cf507173a | 162 | ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \ |
emilmont | 77:869cf507173a | 163 | ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \ |
emilmont | 77:869cf507173a | 164 | ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \ |
emilmont | 77:869cf507173a | 165 | ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \ |
emilmont | 77:869cf507173a | 166 | ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \ |
emilmont | 77:869cf507173a | 167 | ((LINE) == EXTI_Line18) || ((LINE) == EXTI_Line19) || \ |
emilmont | 77:869cf507173a | 168 | ((LINE) == EXTI_Line20) || ((LINE) == EXTI_Line21) || \ |
emilmont | 77:869cf507173a | 169 | ((LINE) == EXTI_Line22) || ((LINE) == EXTI_Line23)) |
emilmont | 77:869cf507173a | 170 | |
emilmont | 77:869cf507173a | 171 | /** |
emilmont | 77:869cf507173a | 172 | * @} |
emilmont | 77:869cf507173a | 173 | */ |
emilmont | 77:869cf507173a | 174 | |
emilmont | 77:869cf507173a | 175 | /** |
emilmont | 77:869cf507173a | 176 | * @} |
emilmont | 77:869cf507173a | 177 | */ |
emilmont | 77:869cf507173a | 178 | |
emilmont | 77:869cf507173a | 179 | /* Exported macro ------------------------------------------------------------*/ |
emilmont | 77:869cf507173a | 180 | /* Exported functions ------------------------------------------------------- */ |
emilmont | 77:869cf507173a | 181 | /* Function used to set the EXTI configuration to the default reset state *****/ |
emilmont | 77:869cf507173a | 182 | void EXTI_DeInit(void); |
emilmont | 77:869cf507173a | 183 | |
emilmont | 77:869cf507173a | 184 | /* Initialization and Configuration functions *********************************/ |
emilmont | 77:869cf507173a | 185 | void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct); |
emilmont | 77:869cf507173a | 186 | void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct); |
emilmont | 77:869cf507173a | 187 | void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line); |
emilmont | 77:869cf507173a | 188 | |
emilmont | 77:869cf507173a | 189 | /* Interrupts and flags management functions **********************************/ |
emilmont | 77:869cf507173a | 190 | FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line); |
emilmont | 77:869cf507173a | 191 | void EXTI_ClearFlag(uint32_t EXTI_Line); |
emilmont | 77:869cf507173a | 192 | ITStatus EXTI_GetITStatus(uint32_t EXTI_Line); |
emilmont | 77:869cf507173a | 193 | void EXTI_ClearITPendingBit(uint32_t EXTI_Line); |
emilmont | 77:869cf507173a | 194 | |
emilmont | 77:869cf507173a | 195 | #ifdef __cplusplus |
emilmont | 77:869cf507173a | 196 | } |
emilmont | 77:869cf507173a | 197 | #endif |
emilmont | 77:869cf507173a | 198 | |
emilmont | 77:869cf507173a | 199 | #endif /* __STM32L1xx_EXTI_H */ |
emilmont | 77:869cf507173a | 200 | |
emilmont | 77:869cf507173a | 201 | /** |
emilmont | 77:869cf507173a | 202 | * @} |
emilmont | 77:869cf507173a | 203 | */ |
emilmont | 77:869cf507173a | 204 | |
emilmont | 77:869cf507173a | 205 | /** |
emilmont | 77:869cf507173a | 206 | * @} |
emilmont | 77:869cf507173a | 207 | */ |
emilmont | 77:869cf507173a | 208 | |
emilmont | 77:869cf507173a | 209 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |