mbed library sources

Dependents:   bare

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Jan 27 14:30:07 2014 +0000
Revision:
76:aeb1df146756
Child:
106:ced8cbb51063
Synchronized with git revision a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd

Full URL: https://github.com/mbedmicro/mbed/commit/a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd/

Add NUCLEO_L152RE

Who changed what in which revision?

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