version_2.0

Dependents:   cc3000_ping_demo_try_2

Fork of mbed by mbed official

Committer:
emilmont
Date:
Fri Feb 14 14:36:43 2014 +0000
Revision:
77:869cf507173a
Child:
81:7d30d6019079
Release 77 of the mbed library

Main changes:
* Add target NUCLEO_F030R8
* Add target NUCLEO_F401RE
* Add target NUCLEO_F103RB
* Add target NUCLEO_L152RE

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 *
emilmont 77:869cf507173a 12 * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
emilmont 77:869cf507173a 13 *
emilmont 77:869cf507173a 14 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
emilmont 77:869cf507173a 15 * You may not use this file except in compliance with the License.
emilmont 77:869cf507173a 16 * You may obtain a copy of the License at:
emilmont 77:869cf507173a 17 *
emilmont 77:869cf507173a 18 * http://www.st.com/software_license_agreement_liberty_v2
emilmont 77:869cf507173a 19 *
emilmont 77:869cf507173a 20 * Unless required by applicable law or agreed to in writing, software
emilmont 77:869cf507173a 21 * distributed under the License is distributed on an "AS IS" BASIS,
emilmont 77:869cf507173a 22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
emilmont 77:869cf507173a 23 * See the License for the specific language governing permissions and
emilmont 77:869cf507173a 24 * limitations under the License.
emilmont 77:869cf507173a 25 *
emilmont 77:869cf507173a 26 ******************************************************************************
emilmont 77:869cf507173a 27 */
emilmont 77:869cf507173a 28
emilmont 77:869cf507173a 29 /* Define to prevent recursive inclusion -------------------------------------*/
emilmont 77:869cf507173a 30 #ifndef __STM32F0XX_EXTI_H
emilmont 77:869cf507173a 31 #define __STM32F0XX_EXTI_H
emilmont 77:869cf507173a 32
emilmont 77:869cf507173a 33 #ifdef __cplusplus
emilmont 77:869cf507173a 34 extern "C" {
emilmont 77:869cf507173a 35 #endif
emilmont 77:869cf507173a 36
emilmont 77:869cf507173a 37 /* Includes ------------------------------------------------------------------*/
emilmont 77:869cf507173a 38 #include "stm32f0xx.h"
emilmont 77:869cf507173a 39
emilmont 77:869cf507173a 40 /** @addtogroup STM32F0xx_StdPeriph_Driver
emilmont 77:869cf507173a 41 * @{
emilmont 77:869cf507173a 42 */
emilmont 77:869cf507173a 43
emilmont 77:869cf507173a 44 /** @addtogroup EXTI
emilmont 77:869cf507173a 45 * @{
emilmont 77:869cf507173a 46 */
emilmont 77:869cf507173a 47 /* Exported types ------------------------------------------------------------*/
emilmont 77:869cf507173a 48
emilmont 77:869cf507173a 49 /**
emilmont 77:869cf507173a 50 * @brief EXTI mode enumeration
emilmont 77:869cf507173a 51 */
emilmont 77:869cf507173a 52
emilmont 77:869cf507173a 53 typedef enum
emilmont 77:869cf507173a 54 {
emilmont 77:869cf507173a 55 EXTI_Mode_Interrupt = 0x00,
emilmont 77:869cf507173a 56 EXTI_Mode_Event = 0x04
emilmont 77:869cf507173a 57 }EXTIMode_TypeDef;
emilmont 77:869cf507173a 58
emilmont 77:869cf507173a 59 #define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event))
emilmont 77:869cf507173a 60
emilmont 77:869cf507173a 61 /**
emilmont 77:869cf507173a 62 * @brief EXTI Trigger enumeration
emilmont 77:869cf507173a 63 */
emilmont 77:869cf507173a 64
emilmont 77:869cf507173a 65 typedef enum
emilmont 77:869cf507173a 66 {
emilmont 77:869cf507173a 67 EXTI_Trigger_Rising = 0x08,
emilmont 77:869cf507173a 68 EXTI_Trigger_Falling = 0x0C,
emilmont 77:869cf507173a 69 EXTI_Trigger_Rising_Falling = 0x10
emilmont 77:869cf507173a 70 }EXTITrigger_TypeDef;
emilmont 77:869cf507173a 71
emilmont 77:869cf507173a 72 #define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \
emilmont 77:869cf507173a 73 ((TRIGGER) == EXTI_Trigger_Falling) || \
emilmont 77:869cf507173a 74 ((TRIGGER) == EXTI_Trigger_Rising_Falling))
emilmont 77:869cf507173a 75 /**
emilmont 77:869cf507173a 76 * @brief EXTI Init Structure definition
emilmont 77:869cf507173a 77 */
emilmont 77:869cf507173a 78
emilmont 77:869cf507173a 79 typedef struct
emilmont 77:869cf507173a 80 {
emilmont 77:869cf507173a 81 uint32_t EXTI_Line; /*!< Specifies the EXTI lines to be enabled or disabled.
emilmont 77:869cf507173a 82 This parameter can be any combination of @ref EXTI_Lines */
emilmont 77:869cf507173a 83
emilmont 77:869cf507173a 84 EXTIMode_TypeDef EXTI_Mode; /*!< Specifies the mode for the EXTI lines.
emilmont 77:869cf507173a 85 This parameter can be a value of @ref EXTIMode_TypeDef */
emilmont 77:869cf507173a 86
emilmont 77:869cf507173a 87 EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines.
emilmont 77:869cf507173a 88 This parameter can be a value of @ref EXTIMode_TypeDef */
emilmont 77:869cf507173a 89
emilmont 77:869cf507173a 90 FunctionalState EXTI_LineCmd; /*!< Specifies the new state of the selected EXTI lines.
emilmont 77:869cf507173a 91 This parameter can be set either to ENABLE or DISABLE */
emilmont 77:869cf507173a 92 }EXTI_InitTypeDef;
emilmont 77:869cf507173a 93
emilmont 77:869cf507173a 94 /* Exported constants --------------------------------------------------------*/
emilmont 77:869cf507173a 95
emilmont 77:869cf507173a 96 /** @defgroup EXTI_Exported_Constants
emilmont 77:869cf507173a 97 * @{
emilmont 77:869cf507173a 98 */
emilmont 77:869cf507173a 99 /** @defgroup EXTI_Lines
emilmont 77:869cf507173a 100 * @{
emilmont 77:869cf507173a 101 */
emilmont 77:869cf507173a 102
emilmont 77:869cf507173a 103 #define EXTI_Line0 ((uint32_t)0x00000001) /*!< External interrupt line 0 */
emilmont 77:869cf507173a 104 #define EXTI_Line1 ((uint32_t)0x00000002) /*!< External interrupt line 1 */
emilmont 77:869cf507173a 105 #define EXTI_Line2 ((uint32_t)0x00000004) /*!< External interrupt line 2 */
emilmont 77:869cf507173a 106 #define EXTI_Line3 ((uint32_t)0x00000008) /*!< External interrupt line 3 */
emilmont 77:869cf507173a 107 #define EXTI_Line4 ((uint32_t)0x00000010) /*!< External interrupt line 4 */
emilmont 77:869cf507173a 108 #define EXTI_Line5 ((uint32_t)0x00000020) /*!< External interrupt line 5 */
emilmont 77:869cf507173a 109 #define EXTI_Line6 ((uint32_t)0x00000040) /*!< External interrupt line 6 */
emilmont 77:869cf507173a 110 #define EXTI_Line7 ((uint32_t)0x00000080) /*!< External interrupt line 7 */
emilmont 77:869cf507173a 111 #define EXTI_Line8 ((uint32_t)0x00000100) /*!< External interrupt line 8 */
emilmont 77:869cf507173a 112 #define EXTI_Line9 ((uint32_t)0x00000200) /*!< External interrupt line 9 */
emilmont 77:869cf507173a 113 #define EXTI_Line10 ((uint32_t)0x00000400) /*!< External interrupt line 10 */
emilmont 77:869cf507173a 114 #define EXTI_Line11 ((uint32_t)0x00000800) /*!< External interrupt line 11 */
emilmont 77:869cf507173a 115 #define EXTI_Line12 ((uint32_t)0x00001000) /*!< External interrupt line 12 */
emilmont 77:869cf507173a 116 #define EXTI_Line13 ((uint32_t)0x00002000) /*!< External interrupt line 13 */
emilmont 77:869cf507173a 117 #define EXTI_Line14 ((uint32_t)0x00004000) /*!< External interrupt line 14 */
emilmont 77:869cf507173a 118 #define EXTI_Line15 ((uint32_t)0x00008000) /*!< External interrupt line 15 */
emilmont 77:869cf507173a 119 #define EXTI_Line16 ((uint32_t)0x00010000) /*!< External interrupt line 16
emilmont 77:869cf507173a 120 Connected to the PVD Output,
emilmont 77:869cf507173a 121 not applicable for STM32F030 devices */
emilmont 77:869cf507173a 122 #define EXTI_Line17 ((uint32_t)0x00020000) /*!< Internal interrupt line 17
emilmont 77:869cf507173a 123 Connected to the RTC Alarm
emilmont 77:869cf507173a 124 event */
emilmont 77:869cf507173a 125 #define EXTI_Line18 ((uint32_t)0x00040000) /*!< Internal interrupt line 18
emilmont 77:869cf507173a 126 Connected to the USB
emilmont 77:869cf507173a 127 event, only applicable for
emilmont 77:869cf507173a 128 STM32F072 devices */
emilmont 77:869cf507173a 129 #define EXTI_Line19 ((uint32_t)0x00080000) /*!< Internal interrupt line 19
emilmont 77:869cf507173a 130 Connected to the RTC Tamper
emilmont 77:869cf507173a 131 and Time Stamp events */
emilmont 77:869cf507173a 132 #define EXTI_Line20 ((uint32_t)0x00100000) /*!< Internal interrupt line 20
emilmont 77:869cf507173a 133 Connected to the RTC wakeup
emilmont 77:869cf507173a 134 event, only applicable for
emilmont 77:869cf507173a 135 STM32F072 devices */
emilmont 77:869cf507173a 136 #define EXTI_Line21 ((uint32_t)0x00200000) /*!< Internal interrupt line 21
emilmont 77:869cf507173a 137 Connected to the Comparator 1
emilmont 77:869cf507173a 138 event, only applicable for STM32F051
emilmont 77:869cf507173a 139 ans STM32F072 devices */
emilmont 77:869cf507173a 140 #define EXTI_Line22 ((uint32_t)0x00400000) /*!< Internal interrupt line 22
emilmont 77:869cf507173a 141 Connected to the Comparator 2
emilmont 77:869cf507173a 142 event, only applicable for STM32F051
emilmont 77:869cf507173a 143 and STM32F072 devices */
emilmont 77:869cf507173a 144 #define EXTI_Line23 ((uint32_t)0x00800000) /*!< Internal interrupt line 23
emilmont 77:869cf507173a 145 Connected to the I2C1 wakeup
emilmont 77:869cf507173a 146 event, not applicable for STM32F030 devices */
emilmont 77:869cf507173a 147 #define EXTI_Line25 ((uint32_t)0x02000000) /*!< Internal interrupt line 25
emilmont 77:869cf507173a 148 Connected to the USART1 wakeup
emilmont 77:869cf507173a 149 event, not applicable for STM32F030 devices */
emilmont 77:869cf507173a 150 #define EXTI_Line26 ((uint32_t)0x04000000) /*!< Internal interrupt line 26
emilmont 77:869cf507173a 151 Connected to the USART2 wakeup
emilmont 77:869cf507173a 152 event, applicable only for
emilmont 77:869cf507173a 153 STM32F072 devices */
emilmont 77:869cf507173a 154 #define EXTI_Line27 ((uint32_t)0x08000000) /*!< Internal interrupt line 27
emilmont 77:869cf507173a 155 Connected to the CEC wakeup
emilmont 77:869cf507173a 156 event, applicable only for STM32F051
emilmont 77:869cf507173a 157 and STM32F072 devices */
emilmont 77:869cf507173a 158 #define EXTI_Line31 ((uint32_t)0x80000000) /*!< Internal interrupt line 31
emilmont 77:869cf507173a 159 Connected to the VDD USB monitor
emilmont 77:869cf507173a 160 event, applicable only for
emilmont 77:869cf507173a 161 STM32F072 devices */
emilmont 77:869cf507173a 162 #define IS_EXTI_LINE(LINE) ((((LINE) & (uint32_t)0x71000000) == 0x00) && ((LINE) != (uint16_t)0x00))
emilmont 77:869cf507173a 163
emilmont 77:869cf507173a 164 #define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \
emilmont 77:869cf507173a 165 ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \
emilmont 77:869cf507173a 166 ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \
emilmont 77:869cf507173a 167 ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \
emilmont 77:869cf507173a 168 ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \
emilmont 77:869cf507173a 169 ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \
emilmont 77:869cf507173a 170 ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \
emilmont 77:869cf507173a 171 ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \
emilmont 77:869cf507173a 172 ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \
emilmont 77:869cf507173a 173 ((LINE) == EXTI_Line18) || ((LINE) == EXTI_Line19) || \
emilmont 77:869cf507173a 174 ((LINE) == EXTI_Line20) || ((LINE) == EXTI_Line21) || \
emilmont 77:869cf507173a 175 ((LINE) == EXTI_Line22) || ((LINE) == EXTI_Line23) || \
emilmont 77:869cf507173a 176 ((LINE) == EXTI_Line25) || ((LINE) == EXTI_Line26) || \
emilmont 77:869cf507173a 177 ((LINE) == EXTI_Line27) || ((LINE) == EXTI_Line31))
emilmont 77:869cf507173a 178
emilmont 77:869cf507173a 179 /**
emilmont 77:869cf507173a 180 * @}
emilmont 77:869cf507173a 181 */
emilmont 77:869cf507173a 182
emilmont 77:869cf507173a 183 /**
emilmont 77:869cf507173a 184 * @}
emilmont 77:869cf507173a 185 */
emilmont 77:869cf507173a 186
emilmont 77:869cf507173a 187 /* Exported macro ------------------------------------------------------------*/
emilmont 77:869cf507173a 188 /* Exported functions ------------------------------------------------------- */
emilmont 77:869cf507173a 189 /* Function used to set the EXTI configuration to the default reset state *****/
emilmont 77:869cf507173a 190 void EXTI_DeInit(void);
emilmont 77:869cf507173a 191
emilmont 77:869cf507173a 192 /* Initialization and Configuration functions *********************************/
emilmont 77:869cf507173a 193 void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct);
emilmont 77:869cf507173a 194 void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct);
emilmont 77:869cf507173a 195 void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line);
emilmont 77:869cf507173a 196
emilmont 77:869cf507173a 197 /* Interrupts and flags management functions **********************************/
emilmont 77:869cf507173a 198 FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line);
emilmont 77:869cf507173a 199 void EXTI_ClearFlag(uint32_t EXTI_Line);
emilmont 77:869cf507173a 200 ITStatus EXTI_GetITStatus(uint32_t EXTI_Line);
emilmont 77:869cf507173a 201 void EXTI_ClearITPendingBit(uint32_t EXTI_Line);
emilmont 77:869cf507173a 202
emilmont 77:869cf507173a 203 #ifdef __cplusplus
emilmont 77:869cf507173a 204 }
emilmont 77:869cf507173a 205 #endif
emilmont 77:869cf507173a 206
emilmont 77:869cf507173a 207 #endif /* __STM32F0XX_EXTI_H */
emilmont 77:869cf507173a 208 /**
emilmont 77:869cf507173a 209 * @}
emilmont 77:869cf507173a 210 */
emilmont 77:869cf507173a 211
emilmont 77:869cf507173a 212 /**
emilmont 77:869cf507173a 213 * @}
emilmont 77:869cf507173a 214 */
emilmont 77:869cf507173a 215
emilmont 77:869cf507173a 216 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/