version_2.0

Dependents:   cc3000_ping_demo_try_2

Fork of mbed by mbed official

Committer:
bogdanm
Date:
Wed Mar 19 18:28:32 2014 +0000
Revision:
81:7d30d6019079
Parent:
77:869cf507173a
Release 81 of the mbed library

Main changes:

- Updates and fixes for many targets
- LPC1768: serial interface code fixes
- nRF51822 targets now output a .hex file
- More exporters
- More flexible GPIO API

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 77:869cf507173a 1 /**
emilmont 77:869cf507173a 2 ******************************************************************************
emilmont 77:869cf507173a 3 * @file stm32f0xx_exti.h
emilmont 77:869cf507173a 4 * @author MCD Application Team
emilmont 77:869cf507173a 5 * @version V1.3.0
emilmont 77:869cf507173a 6 * @date 16-January-2014
emilmont 77:869cf507173a 7 * @brief This file contains all the functions prototypes for the EXTI
emilmont 77:869cf507173a 8 * firmware library
emilmont 77:869cf507173a 9 ******************************************************************************
emilmont 77:869cf507173a 10 * @attention
emilmont 77:869cf507173a 11 *
bogdanm 81:7d30d6019079 12 * <h2><center>&copy; 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 __STM32F0XX_EXTI_H
emilmont 77:869cf507173a 41 #define __STM32F0XX_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 "stm32f0xx.h"
emilmont 77:869cf507173a 49
emilmont 77:869cf507173a 50 /** @addtogroup STM32F0xx_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 /* Exported types ------------------------------------------------------------*/
emilmont 77:869cf507173a 58
emilmont 77:869cf507173a 59 /**
emilmont 77:869cf507173a 60 * @brief EXTI mode enumeration
emilmont 77:869cf507173a 61 */
emilmont 77:869cf507173a 62
emilmont 77:869cf507173a 63 typedef enum
emilmont 77:869cf507173a 64 {
emilmont 77:869cf507173a 65 EXTI_Mode_Interrupt = 0x00,
emilmont 77:869cf507173a 66 EXTI_Mode_Event = 0x04
emilmont 77:869cf507173a 67 }EXTIMode_TypeDef;
emilmont 77:869cf507173a 68
emilmont 77:869cf507173a 69 #define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event))
emilmont 77:869cf507173a 70
emilmont 77:869cf507173a 71 /**
emilmont 77:869cf507173a 72 * @brief EXTI Trigger enumeration
emilmont 77:869cf507173a 73 */
emilmont 77:869cf507173a 74
emilmont 77:869cf507173a 75 typedef enum
emilmont 77:869cf507173a 76 {
emilmont 77:869cf507173a 77 EXTI_Trigger_Rising = 0x08,
emilmont 77:869cf507173a 78 EXTI_Trigger_Falling = 0x0C,
emilmont 77:869cf507173a 79 EXTI_Trigger_Rising_Falling = 0x10
emilmont 77:869cf507173a 80 }EXTITrigger_TypeDef;
emilmont 77:869cf507173a 81
emilmont 77:869cf507173a 82 #define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \
emilmont 77:869cf507173a 83 ((TRIGGER) == EXTI_Trigger_Falling) || \
emilmont 77:869cf507173a 84 ((TRIGGER) == EXTI_Trigger_Rising_Falling))
emilmont 77:869cf507173a 85 /**
emilmont 77:869cf507173a 86 * @brief EXTI Init Structure definition
emilmont 77:869cf507173a 87 */
emilmont 77:869cf507173a 88
emilmont 77:869cf507173a 89 typedef struct
emilmont 77:869cf507173a 90 {
emilmont 77:869cf507173a 91 uint32_t EXTI_Line; /*!< Specifies the EXTI lines to be enabled or disabled.
emilmont 77:869cf507173a 92 This parameter can be any combination of @ref EXTI_Lines */
emilmont 77:869cf507173a 93
emilmont 77:869cf507173a 94 EXTIMode_TypeDef EXTI_Mode; /*!< Specifies the mode for the EXTI lines.
emilmont 77:869cf507173a 95 This parameter can be a value of @ref EXTIMode_TypeDef */
emilmont 77:869cf507173a 96
emilmont 77:869cf507173a 97 EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines.
emilmont 77:869cf507173a 98 This parameter can be a value of @ref EXTIMode_TypeDef */
emilmont 77:869cf507173a 99
emilmont 77:869cf507173a 100 FunctionalState EXTI_LineCmd; /*!< Specifies the new state of the selected EXTI lines.
emilmont 77:869cf507173a 101 This parameter can be set either to ENABLE or DISABLE */
emilmont 77:869cf507173a 102 }EXTI_InitTypeDef;
emilmont 77:869cf507173a 103
emilmont 77:869cf507173a 104 /* Exported constants --------------------------------------------------------*/
emilmont 77:869cf507173a 105
emilmont 77:869cf507173a 106 /** @defgroup EXTI_Exported_Constants
emilmont 77:869cf507173a 107 * @{
emilmont 77:869cf507173a 108 */
emilmont 77:869cf507173a 109 /** @defgroup EXTI_Lines
emilmont 77:869cf507173a 110 * @{
emilmont 77:869cf507173a 111 */
emilmont 77:869cf507173a 112
emilmont 77:869cf507173a 113 #define EXTI_Line0 ((uint32_t)0x00000001) /*!< External interrupt line 0 */
emilmont 77:869cf507173a 114 #define EXTI_Line1 ((uint32_t)0x00000002) /*!< External interrupt line 1 */
emilmont 77:869cf507173a 115 #define EXTI_Line2 ((uint32_t)0x00000004) /*!< External interrupt line 2 */
emilmont 77:869cf507173a 116 #define EXTI_Line3 ((uint32_t)0x00000008) /*!< External interrupt line 3 */
emilmont 77:869cf507173a 117 #define EXTI_Line4 ((uint32_t)0x00000010) /*!< External interrupt line 4 */
emilmont 77:869cf507173a 118 #define EXTI_Line5 ((uint32_t)0x00000020) /*!< External interrupt line 5 */
emilmont 77:869cf507173a 119 #define EXTI_Line6 ((uint32_t)0x00000040) /*!< External interrupt line 6 */
emilmont 77:869cf507173a 120 #define EXTI_Line7 ((uint32_t)0x00000080) /*!< External interrupt line 7 */
emilmont 77:869cf507173a 121 #define EXTI_Line8 ((uint32_t)0x00000100) /*!< External interrupt line 8 */
emilmont 77:869cf507173a 122 #define EXTI_Line9 ((uint32_t)0x00000200) /*!< External interrupt line 9 */
emilmont 77:869cf507173a 123 #define EXTI_Line10 ((uint32_t)0x00000400) /*!< External interrupt line 10 */
emilmont 77:869cf507173a 124 #define EXTI_Line11 ((uint32_t)0x00000800) /*!< External interrupt line 11 */
emilmont 77:869cf507173a 125 #define EXTI_Line12 ((uint32_t)0x00001000) /*!< External interrupt line 12 */
emilmont 77:869cf507173a 126 #define EXTI_Line13 ((uint32_t)0x00002000) /*!< External interrupt line 13 */
emilmont 77:869cf507173a 127 #define EXTI_Line14 ((uint32_t)0x00004000) /*!< External interrupt line 14 */
emilmont 77:869cf507173a 128 #define EXTI_Line15 ((uint32_t)0x00008000) /*!< External interrupt line 15 */
emilmont 77:869cf507173a 129 #define EXTI_Line16 ((uint32_t)0x00010000) /*!< External interrupt line 16
emilmont 77:869cf507173a 130 Connected to the PVD Output,
emilmont 77:869cf507173a 131 not applicable for STM32F030 devices */
emilmont 77:869cf507173a 132 #define EXTI_Line17 ((uint32_t)0x00020000) /*!< Internal interrupt line 17
emilmont 77:869cf507173a 133 Connected to the RTC Alarm
emilmont 77:869cf507173a 134 event */
emilmont 77:869cf507173a 135 #define EXTI_Line18 ((uint32_t)0x00040000) /*!< Internal interrupt line 18
emilmont 77:869cf507173a 136 Connected to the USB
emilmont 77:869cf507173a 137 event, only applicable for
emilmont 77:869cf507173a 138 STM32F072 devices */
emilmont 77:869cf507173a 139 #define EXTI_Line19 ((uint32_t)0x00080000) /*!< Internal 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) /*!< Internal interrupt line 20
emilmont 77:869cf507173a 143 Connected to the RTC wakeup
emilmont 77:869cf507173a 144 event, only applicable for
emilmont 77:869cf507173a 145 STM32F072 devices */
emilmont 77:869cf507173a 146 #define EXTI_Line21 ((uint32_t)0x00200000) /*!< Internal interrupt line 21
emilmont 77:869cf507173a 147 Connected to the Comparator 1
emilmont 77:869cf507173a 148 event, only applicable for STM32F051
emilmont 77:869cf507173a 149 ans STM32F072 devices */
emilmont 77:869cf507173a 150 #define EXTI_Line22 ((uint32_t)0x00400000) /*!< Internal interrupt line 22
emilmont 77:869cf507173a 151 Connected to the Comparator 2
emilmont 77:869cf507173a 152 event, only applicable for STM32F051
emilmont 77:869cf507173a 153 and STM32F072 devices */
emilmont 77:869cf507173a 154 #define EXTI_Line23 ((uint32_t)0x00800000) /*!< Internal interrupt line 23
emilmont 77:869cf507173a 155 Connected to the I2C1 wakeup
emilmont 77:869cf507173a 156 event, not applicable for STM32F030 devices */
emilmont 77:869cf507173a 157 #define EXTI_Line25 ((uint32_t)0x02000000) /*!< Internal interrupt line 25
emilmont 77:869cf507173a 158 Connected to the USART1 wakeup
emilmont 77:869cf507173a 159 event, not applicable for STM32F030 devices */
emilmont 77:869cf507173a 160 #define EXTI_Line26 ((uint32_t)0x04000000) /*!< Internal interrupt line 26
emilmont 77:869cf507173a 161 Connected to the USART2 wakeup
emilmont 77:869cf507173a 162 event, applicable only for
emilmont 77:869cf507173a 163 STM32F072 devices */
emilmont 77:869cf507173a 164 #define EXTI_Line27 ((uint32_t)0x08000000) /*!< Internal interrupt line 27
emilmont 77:869cf507173a 165 Connected to the CEC wakeup
emilmont 77:869cf507173a 166 event, applicable only for STM32F051
emilmont 77:869cf507173a 167 and STM32F072 devices */
emilmont 77:869cf507173a 168 #define EXTI_Line31 ((uint32_t)0x80000000) /*!< Internal interrupt line 31
emilmont 77:869cf507173a 169 Connected to the VDD USB monitor
emilmont 77:869cf507173a 170 event, applicable only for
emilmont 77:869cf507173a 171 STM32F072 devices */
emilmont 77:869cf507173a 172 #define IS_EXTI_LINE(LINE) ((((LINE) & (uint32_t)0x71000000) == 0x00) && ((LINE) != (uint16_t)0x00))
emilmont 77:869cf507173a 173
emilmont 77:869cf507173a 174 #define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \
emilmont 77:869cf507173a 175 ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \
emilmont 77:869cf507173a 176 ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \
emilmont 77:869cf507173a 177 ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \
emilmont 77:869cf507173a 178 ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \
emilmont 77:869cf507173a 179 ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \
emilmont 77:869cf507173a 180 ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \
emilmont 77:869cf507173a 181 ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \
emilmont 77:869cf507173a 182 ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \
emilmont 77:869cf507173a 183 ((LINE) == EXTI_Line18) || ((LINE) == EXTI_Line19) || \
emilmont 77:869cf507173a 184 ((LINE) == EXTI_Line20) || ((LINE) == EXTI_Line21) || \
emilmont 77:869cf507173a 185 ((LINE) == EXTI_Line22) || ((LINE) == EXTI_Line23) || \
emilmont 77:869cf507173a 186 ((LINE) == EXTI_Line25) || ((LINE) == EXTI_Line26) || \
emilmont 77:869cf507173a 187 ((LINE) == EXTI_Line27) || ((LINE) == EXTI_Line31))
emilmont 77:869cf507173a 188
emilmont 77:869cf507173a 189 /**
emilmont 77:869cf507173a 190 * @}
emilmont 77:869cf507173a 191 */
emilmont 77:869cf507173a 192
emilmont 77:869cf507173a 193 /**
emilmont 77:869cf507173a 194 * @}
emilmont 77:869cf507173a 195 */
emilmont 77:869cf507173a 196
emilmont 77:869cf507173a 197 /* Exported macro ------------------------------------------------------------*/
emilmont 77:869cf507173a 198 /* Exported functions ------------------------------------------------------- */
emilmont 77:869cf507173a 199 /* Function used to set the EXTI configuration to the default reset state *****/
emilmont 77:869cf507173a 200 void EXTI_DeInit(void);
emilmont 77:869cf507173a 201
emilmont 77:869cf507173a 202 /* Initialization and Configuration functions *********************************/
emilmont 77:869cf507173a 203 void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct);
emilmont 77:869cf507173a 204 void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct);
emilmont 77:869cf507173a 205 void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line);
emilmont 77:869cf507173a 206
emilmont 77:869cf507173a 207 /* Interrupts and flags management functions **********************************/
emilmont 77:869cf507173a 208 FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line);
emilmont 77:869cf507173a 209 void EXTI_ClearFlag(uint32_t EXTI_Line);
emilmont 77:869cf507173a 210 ITStatus EXTI_GetITStatus(uint32_t EXTI_Line);
emilmont 77:869cf507173a 211 void EXTI_ClearITPendingBit(uint32_t EXTI_Line);
emilmont 77:869cf507173a 212
emilmont 77:869cf507173a 213 #ifdef __cplusplus
emilmont 77:869cf507173a 214 }
emilmont 77:869cf507173a 215 #endif
emilmont 77:869cf507173a 216
emilmont 77:869cf507173a 217 #endif /* __STM32F0XX_EXTI_H */
emilmont 77:869cf507173a 218 /**
emilmont 77:869cf507173a 219 * @}
emilmont 77:869cf507173a 220 */
emilmont 77:869cf507173a 221
emilmont 77:869cf507173a 222 /**
emilmont 77:869cf507173a 223 * @}
emilmont 77:869cf507173a 224 */
emilmont 77:869cf507173a 225
emilmont 77:869cf507173a 226 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/