mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
shaoziyang
Date:
Sat Sep 13 14:25:46 2014 +0000
Revision:
323:9e901b0a5aa1
Parent:
125:23cc3068a9e4
test with CLOCK_SETUP = 0

Who changed what in which revision?

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