mbed library sources for GR-PEACH rev.B.

Fork of mbed-src by mbed official

Committer:
RyoheiHagimoto
Date:
Wed Apr 15 01:34:29 2015 +0000
Revision:
514:cf59050bad8e
Parent:
155:8435094ec241
mbed library sources for GR-PEACH rev.B.

Who changed what in which revision?

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