mbed library with additional peripherals for ST F401 board
Fork of mbed-src by
This mbed LIB has additional peripherals for ST F401 board
- UART2 : PA_3 rx, PA_2 tx
- UART3 : PC_7 rx, PC_6 tx
- I2C2 : PB_3 SDA, PB_10 SCL
- I2C3 : PB_4 SDA, PA_8 SCL
targets/cmsis/TARGET_STM/TARGET_NUCLEO_L152RE/stm32l1xx_exti.h@76:aeb1df146756, 2014-01-27 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Jan 27 14:30:07 2014 +0000
- Revision:
- 76:aeb1df146756
- Child:
- 80:66393a7b209d
Synchronized with git revision a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd
Full URL: https://github.com/mbedmicro/mbed/commit/a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd/
Add NUCLEO_L152RE
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 76:aeb1df146756 | 1 | /** |
mbed_official | 76:aeb1df146756 | 2 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 3 | * @file stm32l1xx_exti.h |
mbed_official | 76:aeb1df146756 | 4 | * @author MCD Application Team |
mbed_official | 76:aeb1df146756 | 5 | * @version V1.2.0 |
mbed_official | 76:aeb1df146756 | 6 | * @date 22-February-2013 |
mbed_official | 76:aeb1df146756 | 7 | * @brief This file contains all the functions prototypes for the EXTI firmware |
mbed_official | 76:aeb1df146756 | 8 | * library. |
mbed_official | 76:aeb1df146756 | 9 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 10 | * @attention |
mbed_official | 76:aeb1df146756 | 11 | * |
mbed_official | 76:aeb1df146756 | 12 | * <h2><center>© COPYRIGHT 2013 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 __STM32L1xx_EXTI_H |
mbed_official | 76:aeb1df146756 | 31 | #define __STM32L1xx_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 "stm32l1xx.h" |
mbed_official | 76:aeb1df146756 | 39 | |
mbed_official | 76:aeb1df146756 | 40 | /** @addtogroup STM32L1xx_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 | |
mbed_official | 76:aeb1df146756 | 48 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 49 | |
mbed_official | 76:aeb1df146756 | 50 | /** |
mbed_official | 76:aeb1df146756 | 51 | * @brief EXTI mode enumeration |
mbed_official | 76:aeb1df146756 | 52 | */ |
mbed_official | 76:aeb1df146756 | 53 | |
mbed_official | 76:aeb1df146756 | 54 | typedef enum |
mbed_official | 76:aeb1df146756 | 55 | { |
mbed_official | 76:aeb1df146756 | 56 | EXTI_Mode_Interrupt = 0x00, |
mbed_official | 76:aeb1df146756 | 57 | EXTI_Mode_Event = 0x04 |
mbed_official | 76:aeb1df146756 | 58 | }EXTIMode_TypeDef; |
mbed_official | 76:aeb1df146756 | 59 | |
mbed_official | 76:aeb1df146756 | 60 | #define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event)) |
mbed_official | 76:aeb1df146756 | 61 | |
mbed_official | 76:aeb1df146756 | 62 | /** |
mbed_official | 76:aeb1df146756 | 63 | * @brief EXTI Trigger enumeration |
mbed_official | 76:aeb1df146756 | 64 | */ |
mbed_official | 76:aeb1df146756 | 65 | |
mbed_official | 76:aeb1df146756 | 66 | typedef enum |
mbed_official | 76:aeb1df146756 | 67 | { |
mbed_official | 76:aeb1df146756 | 68 | EXTI_Trigger_Rising = 0x08, |
mbed_official | 76:aeb1df146756 | 69 | EXTI_Trigger_Falling = 0x0C, |
mbed_official | 76:aeb1df146756 | 70 | EXTI_Trigger_Rising_Falling = 0x10 |
mbed_official | 76:aeb1df146756 | 71 | }EXTITrigger_TypeDef; |
mbed_official | 76:aeb1df146756 | 72 | |
mbed_official | 76:aeb1df146756 | 73 | #define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \ |
mbed_official | 76:aeb1df146756 | 74 | ((TRIGGER) == EXTI_Trigger_Falling) || \ |
mbed_official | 76:aeb1df146756 | 75 | ((TRIGGER) == EXTI_Trigger_Rising_Falling)) |
mbed_official | 76:aeb1df146756 | 76 | /** |
mbed_official | 76:aeb1df146756 | 77 | * @brief EXTI Init Structure definition |
mbed_official | 76:aeb1df146756 | 78 | */ |
mbed_official | 76:aeb1df146756 | 79 | |
mbed_official | 76:aeb1df146756 | 80 | typedef struct |
mbed_official | 76:aeb1df146756 | 81 | { |
mbed_official | 76:aeb1df146756 | 82 | uint32_t EXTI_Line; /*!< Specifies the EXTI lines to be enabled or disabled. |
mbed_official | 76:aeb1df146756 | 83 | This parameter can be any combination of @ref EXTI_Lines */ |
mbed_official | 76:aeb1df146756 | 84 | |
mbed_official | 76:aeb1df146756 | 85 | EXTIMode_TypeDef EXTI_Mode; /*!< Specifies the mode for the EXTI lines. |
mbed_official | 76:aeb1df146756 | 86 | This parameter can be a value of @ref EXTIMode_TypeDef */ |
mbed_official | 76:aeb1df146756 | 87 | |
mbed_official | 76:aeb1df146756 | 88 | EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines. |
mbed_official | 76:aeb1df146756 | 89 | This parameter can be a value of @ref EXTITrigger_TypeDef */ |
mbed_official | 76:aeb1df146756 | 90 | |
mbed_official | 76:aeb1df146756 | 91 | FunctionalState EXTI_LineCmd; /*!< Specifies the new state of the selected EXTI lines. |
mbed_official | 76:aeb1df146756 | 92 | This parameter can be set either to ENABLE or DISABLE */ |
mbed_official | 76:aeb1df146756 | 93 | }EXTI_InitTypeDef; |
mbed_official | 76:aeb1df146756 | 94 | |
mbed_official | 76:aeb1df146756 | 95 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 96 | |
mbed_official | 76:aeb1df146756 | 97 | /** @defgroup EXTI_Exported_Constants |
mbed_official | 76:aeb1df146756 | 98 | * @{ |
mbed_official | 76:aeb1df146756 | 99 | */ |
mbed_official | 76:aeb1df146756 | 100 | |
mbed_official | 76:aeb1df146756 | 101 | /** @defgroup EXTI_Lines |
mbed_official | 76:aeb1df146756 | 102 | * @{ |
mbed_official | 76:aeb1df146756 | 103 | */ |
mbed_official | 76:aeb1df146756 | 104 | |
mbed_official | 76:aeb1df146756 | 105 | #define EXTI_Line0 ((uint32_t)0x00000001) /*!< External interrupt line 0 */ |
mbed_official | 76:aeb1df146756 | 106 | #define EXTI_Line1 ((uint32_t)0x00000002) /*!< External interrupt line 1 */ |
mbed_official | 76:aeb1df146756 | 107 | #define EXTI_Line2 ((uint32_t)0x00000004) /*!< External interrupt line 2 */ |
mbed_official | 76:aeb1df146756 | 108 | #define EXTI_Line3 ((uint32_t)0x00000008) /*!< External interrupt line 3 */ |
mbed_official | 76:aeb1df146756 | 109 | #define EXTI_Line4 ((uint32_t)0x00000010) /*!< External interrupt line 4 */ |
mbed_official | 76:aeb1df146756 | 110 | #define EXTI_Line5 ((uint32_t)0x00000020) /*!< External interrupt line 5 */ |
mbed_official | 76:aeb1df146756 | 111 | #define EXTI_Line6 ((uint32_t)0x00000040) /*!< External interrupt line 6 */ |
mbed_official | 76:aeb1df146756 | 112 | #define EXTI_Line7 ((uint32_t)0x00000080) /*!< External interrupt line 7 */ |
mbed_official | 76:aeb1df146756 | 113 | #define EXTI_Line8 ((uint32_t)0x00000100) /*!< External interrupt line 8 */ |
mbed_official | 76:aeb1df146756 | 114 | #define EXTI_Line9 ((uint32_t)0x00000200) /*!< External interrupt line 9 */ |
mbed_official | 76:aeb1df146756 | 115 | #define EXTI_Line10 ((uint32_t)0x00000400) /*!< External interrupt line 10 */ |
mbed_official | 76:aeb1df146756 | 116 | #define EXTI_Line11 ((uint32_t)0x00000800) /*!< External interrupt line 11 */ |
mbed_official | 76:aeb1df146756 | 117 | #define EXTI_Line12 ((uint32_t)0x00001000) /*!< External interrupt line 12 */ |
mbed_official | 76:aeb1df146756 | 118 | #define EXTI_Line13 ((uint32_t)0x00002000) /*!< External interrupt line 13 */ |
mbed_official | 76:aeb1df146756 | 119 | #define EXTI_Line14 ((uint32_t)0x00004000) /*!< External interrupt line 14 */ |
mbed_official | 76:aeb1df146756 | 120 | #define EXTI_Line15 ((uint32_t)0x00008000) /*!< External interrupt line 15 */ |
mbed_official | 76:aeb1df146756 | 121 | #define EXTI_Line16 ((uint32_t)0x00010000) /*!< External interrupt line 16 |
mbed_official | 76:aeb1df146756 | 122 | Connected to the PVD Output */ |
mbed_official | 76:aeb1df146756 | 123 | #define EXTI_Line17 ((uint32_t)0x00020000) /*!< External interrupt line 17 |
mbed_official | 76:aeb1df146756 | 124 | Connected to the RTC Alarm |
mbed_official | 76:aeb1df146756 | 125 | event */ |
mbed_official | 76:aeb1df146756 | 126 | #define EXTI_Line18 ((uint32_t)0x00040000) /*!< External interrupt line 18 |
mbed_official | 76:aeb1df146756 | 127 | Connected to the USB Device |
mbed_official | 76:aeb1df146756 | 128 | FS Wakeup from suspend event */ |
mbed_official | 76:aeb1df146756 | 129 | #define EXTI_Line19 ((uint32_t)0x00080000) /*!< External 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) /*!< External interrupt line 20 |
mbed_official | 76:aeb1df146756 | 133 | Connected to the RTC Wakeup |
mbed_official | 76:aeb1df146756 | 134 | event */ |
mbed_official | 76:aeb1df146756 | 135 | #define EXTI_Line21 ((uint32_t)0x00200000) /*!< External interrupt line 21 |
mbed_official | 76:aeb1df146756 | 136 | Connected to the Comparator 1 |
mbed_official | 76:aeb1df146756 | 137 | event */ |
mbed_official | 76:aeb1df146756 | 138 | |
mbed_official | 76:aeb1df146756 | 139 | #define EXTI_Line22 ((uint32_t)0x00400000) /*!< External interrupt line 22 |
mbed_official | 76:aeb1df146756 | 140 | Connected to the Comparator 2 |
mbed_official | 76:aeb1df146756 | 141 | event */ |
mbed_official | 76:aeb1df146756 | 142 | |
mbed_official | 76:aeb1df146756 | 143 | #define EXTI_Line23 ((uint32_t)0x00800000) /*!< External interrupt line 23 |
mbed_official | 76:aeb1df146756 | 144 | Comparator channel acquisition event */ |
mbed_official | 76:aeb1df146756 | 145 | |
mbed_official | 76:aeb1df146756 | 146 | #define IS_EXTI_LINE(LINE) ((((LINE) & (uint32_t)0xFF000000) == 0x00) && ((LINE) != (uint16_t)0x00)) |
mbed_official | 76:aeb1df146756 | 147 | |
mbed_official | 76:aeb1df146756 | 148 | #define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \ |
mbed_official | 76:aeb1df146756 | 149 | ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \ |
mbed_official | 76:aeb1df146756 | 150 | ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \ |
mbed_official | 76:aeb1df146756 | 151 | ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \ |
mbed_official | 76:aeb1df146756 | 152 | ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \ |
mbed_official | 76:aeb1df146756 | 153 | ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \ |
mbed_official | 76:aeb1df146756 | 154 | ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \ |
mbed_official | 76:aeb1df146756 | 155 | ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \ |
mbed_official | 76:aeb1df146756 | 156 | ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \ |
mbed_official | 76:aeb1df146756 | 157 | ((LINE) == EXTI_Line18) || ((LINE) == EXTI_Line19) || \ |
mbed_official | 76:aeb1df146756 | 158 | ((LINE) == EXTI_Line20) || ((LINE) == EXTI_Line21) || \ |
mbed_official | 76:aeb1df146756 | 159 | ((LINE) == EXTI_Line22) || ((LINE) == EXTI_Line23)) |
mbed_official | 76:aeb1df146756 | 160 | |
mbed_official | 76:aeb1df146756 | 161 | /** |
mbed_official | 76:aeb1df146756 | 162 | * @} |
mbed_official | 76:aeb1df146756 | 163 | */ |
mbed_official | 76:aeb1df146756 | 164 | |
mbed_official | 76:aeb1df146756 | 165 | /** |
mbed_official | 76:aeb1df146756 | 166 | * @} |
mbed_official | 76:aeb1df146756 | 167 | */ |
mbed_official | 76:aeb1df146756 | 168 | |
mbed_official | 76:aeb1df146756 | 169 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 170 | /* Exported functions ------------------------------------------------------- */ |
mbed_official | 76:aeb1df146756 | 171 | /* Function used to set the EXTI configuration to the default reset state *****/ |
mbed_official | 76:aeb1df146756 | 172 | void EXTI_DeInit(void); |
mbed_official | 76:aeb1df146756 | 173 | |
mbed_official | 76:aeb1df146756 | 174 | /* Initialization and Configuration functions *********************************/ |
mbed_official | 76:aeb1df146756 | 175 | void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct); |
mbed_official | 76:aeb1df146756 | 176 | void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct); |
mbed_official | 76:aeb1df146756 | 177 | void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line); |
mbed_official | 76:aeb1df146756 | 178 | |
mbed_official | 76:aeb1df146756 | 179 | /* Interrupts and flags management functions **********************************/ |
mbed_official | 76:aeb1df146756 | 180 | FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line); |
mbed_official | 76:aeb1df146756 | 181 | void EXTI_ClearFlag(uint32_t EXTI_Line); |
mbed_official | 76:aeb1df146756 | 182 | ITStatus EXTI_GetITStatus(uint32_t EXTI_Line); |
mbed_official | 76:aeb1df146756 | 183 | void EXTI_ClearITPendingBit(uint32_t EXTI_Line); |
mbed_official | 76:aeb1df146756 | 184 | |
mbed_official | 76:aeb1df146756 | 185 | #ifdef __cplusplus |
mbed_official | 76:aeb1df146756 | 186 | } |
mbed_official | 76:aeb1df146756 | 187 | #endif |
mbed_official | 76:aeb1df146756 | 188 | |
mbed_official | 76:aeb1df146756 | 189 | #endif /* __STM32L1xx_EXTI_H */ |
mbed_official | 76:aeb1df146756 | 190 | |
mbed_official | 76:aeb1df146756 | 191 | /** |
mbed_official | 76:aeb1df146756 | 192 | * @} |
mbed_official | 76:aeb1df146756 | 193 | */ |
mbed_official | 76:aeb1df146756 | 194 | |
mbed_official | 76:aeb1df146756 | 195 | /** |
mbed_official | 76:aeb1df146756 | 196 | * @} |
mbed_official | 76:aeb1df146756 | 197 | */ |
mbed_official | 76:aeb1df146756 | 198 | |
mbed_official | 76:aeb1df146756 | 199 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |