mbed library with additional peripherals for ST F401 board

Fork of mbed-src by mbed official

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
Committer:
mbed_official
Date:
Wed Feb 26 09:45:12 2014 +0000
Revision:
106:ced8cbb51063
Parent:
76:aeb1df146756
Synchronized with git revision 4222735eff5868389433f0e9271976b39c8115cd

Full URL: https://github.com/mbedmicro/mbed/commit/4222735eff5868389433f0e9271976b39c8115cd/

[NUCLEO_xxx] Update STM32CubeF4 driver V1.0.0 + update license

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 106:ced8cbb51063 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 76:aeb1df146756 13 *
mbed_official 106:ced8cbb51063 14 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 106:ced8cbb51063 15 * are permitted provided that the following conditions are met:
mbed_official 106:ced8cbb51063 16 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 106:ced8cbb51063 17 * this list of conditions and the following disclaimer.
mbed_official 106:ced8cbb51063 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 106:ced8cbb51063 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 106:ced8cbb51063 20 * and/or other materials provided with the distribution.
mbed_official 106:ced8cbb51063 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 106:ced8cbb51063 22 * may be used to endorse or promote products derived from this software
mbed_official 106:ced8cbb51063 23 * without specific prior written permission.
mbed_official 76:aeb1df146756 24 *
mbed_official 106:ced8cbb51063 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 106:ced8cbb51063 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 106:ced8cbb51063 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 106:ced8cbb51063 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 106:ced8cbb51063 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 106:ced8cbb51063 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 106:ced8cbb51063 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 106:ced8cbb51063 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 106:ced8cbb51063 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 106:ced8cbb51063 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 76:aeb1df146756 35 *
mbed_official 76:aeb1df146756 36 ******************************************************************************
mbed_official 76:aeb1df146756 37 */
mbed_official 76:aeb1df146756 38
mbed_official 76:aeb1df146756 39 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 76:aeb1df146756 40 #ifndef __STM32F0XX_EXTI_H
mbed_official 76:aeb1df146756 41 #define __STM32F0XX_EXTI_H
mbed_official 76:aeb1df146756 42
mbed_official 76:aeb1df146756 43 #ifdef __cplusplus
mbed_official 76:aeb1df146756 44 extern "C" {
mbed_official 76:aeb1df146756 45 #endif
mbed_official 76:aeb1df146756 46
mbed_official 76:aeb1df146756 47 /* Includes ------------------------------------------------------------------*/
mbed_official 76:aeb1df146756 48 #include "stm32f0xx.h"
mbed_official 76:aeb1df146756 49
mbed_official 76:aeb1df146756 50 /** @addtogroup STM32F0xx_StdPeriph_Driver
mbed_official 76:aeb1df146756 51 * @{
mbed_official 76:aeb1df146756 52 */
mbed_official 76:aeb1df146756 53
mbed_official 76:aeb1df146756 54 /** @addtogroup EXTI
mbed_official 76:aeb1df146756 55 * @{
mbed_official 76:aeb1df146756 56 */
mbed_official 76:aeb1df146756 57 /* Exported types ------------------------------------------------------------*/
mbed_official 76:aeb1df146756 58
mbed_official 76:aeb1df146756 59 /**
mbed_official 76:aeb1df146756 60 * @brief EXTI mode enumeration
mbed_official 76:aeb1df146756 61 */
mbed_official 76:aeb1df146756 62
mbed_official 76:aeb1df146756 63 typedef enum
mbed_official 76:aeb1df146756 64 {
mbed_official 76:aeb1df146756 65 EXTI_Mode_Interrupt = 0x00,
mbed_official 76:aeb1df146756 66 EXTI_Mode_Event = 0x04
mbed_official 76:aeb1df146756 67 }EXTIMode_TypeDef;
mbed_official 76:aeb1df146756 68
mbed_official 76:aeb1df146756 69 #define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event))
mbed_official 76:aeb1df146756 70
mbed_official 76:aeb1df146756 71 /**
mbed_official 76:aeb1df146756 72 * @brief EXTI Trigger enumeration
mbed_official 76:aeb1df146756 73 */
mbed_official 76:aeb1df146756 74
mbed_official 76:aeb1df146756 75 typedef enum
mbed_official 76:aeb1df146756 76 {
mbed_official 76:aeb1df146756 77 EXTI_Trigger_Rising = 0x08,
mbed_official 76:aeb1df146756 78 EXTI_Trigger_Falling = 0x0C,
mbed_official 76:aeb1df146756 79 EXTI_Trigger_Rising_Falling = 0x10
mbed_official 76:aeb1df146756 80 }EXTITrigger_TypeDef;
mbed_official 76:aeb1df146756 81
mbed_official 76:aeb1df146756 82 #define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \
mbed_official 76:aeb1df146756 83 ((TRIGGER) == EXTI_Trigger_Falling) || \
mbed_official 76:aeb1df146756 84 ((TRIGGER) == EXTI_Trigger_Rising_Falling))
mbed_official 76:aeb1df146756 85 /**
mbed_official 76:aeb1df146756 86 * @brief EXTI Init Structure definition
mbed_official 76:aeb1df146756 87 */
mbed_official 76:aeb1df146756 88
mbed_official 76:aeb1df146756 89 typedef struct
mbed_official 76:aeb1df146756 90 {
mbed_official 76:aeb1df146756 91 uint32_t EXTI_Line; /*!< Specifies the EXTI lines to be enabled or disabled.
mbed_official 76:aeb1df146756 92 This parameter can be any combination of @ref EXTI_Lines */
mbed_official 76:aeb1df146756 93
mbed_official 76:aeb1df146756 94 EXTIMode_TypeDef EXTI_Mode; /*!< Specifies the mode for the EXTI lines.
mbed_official 76:aeb1df146756 95 This parameter can be a value of @ref EXTIMode_TypeDef */
mbed_official 76:aeb1df146756 96
mbed_official 76:aeb1df146756 97 EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines.
mbed_official 76:aeb1df146756 98 This parameter can be a value of @ref EXTIMode_TypeDef */
mbed_official 76:aeb1df146756 99
mbed_official 76:aeb1df146756 100 FunctionalState EXTI_LineCmd; /*!< Specifies the new state of the selected EXTI lines.
mbed_official 76:aeb1df146756 101 This parameter can be set either to ENABLE or DISABLE */
mbed_official 76:aeb1df146756 102 }EXTI_InitTypeDef;
mbed_official 76:aeb1df146756 103
mbed_official 76:aeb1df146756 104 /* Exported constants --------------------------------------------------------*/
mbed_official 76:aeb1df146756 105
mbed_official 76:aeb1df146756 106 /** @defgroup EXTI_Exported_Constants
mbed_official 76:aeb1df146756 107 * @{
mbed_official 76:aeb1df146756 108 */
mbed_official 76:aeb1df146756 109 /** @defgroup EXTI_Lines
mbed_official 76:aeb1df146756 110 * @{
mbed_official 76:aeb1df146756 111 */
mbed_official 76:aeb1df146756 112
mbed_official 76:aeb1df146756 113 #define EXTI_Line0 ((uint32_t)0x00000001) /*!< External interrupt line 0 */
mbed_official 76:aeb1df146756 114 #define EXTI_Line1 ((uint32_t)0x00000002) /*!< External interrupt line 1 */
mbed_official 76:aeb1df146756 115 #define EXTI_Line2 ((uint32_t)0x00000004) /*!< External interrupt line 2 */
mbed_official 76:aeb1df146756 116 #define EXTI_Line3 ((uint32_t)0x00000008) /*!< External interrupt line 3 */
mbed_official 76:aeb1df146756 117 #define EXTI_Line4 ((uint32_t)0x00000010) /*!< External interrupt line 4 */
mbed_official 76:aeb1df146756 118 #define EXTI_Line5 ((uint32_t)0x00000020) /*!< External interrupt line 5 */
mbed_official 76:aeb1df146756 119 #define EXTI_Line6 ((uint32_t)0x00000040) /*!< External interrupt line 6 */
mbed_official 76:aeb1df146756 120 #define EXTI_Line7 ((uint32_t)0x00000080) /*!< External interrupt line 7 */
mbed_official 76:aeb1df146756 121 #define EXTI_Line8 ((uint32_t)0x00000100) /*!< External interrupt line 8 */
mbed_official 76:aeb1df146756 122 #define EXTI_Line9 ((uint32_t)0x00000200) /*!< External interrupt line 9 */
mbed_official 76:aeb1df146756 123 #define EXTI_Line10 ((uint32_t)0x00000400) /*!< External interrupt line 10 */
mbed_official 76:aeb1df146756 124 #define EXTI_Line11 ((uint32_t)0x00000800) /*!< External interrupt line 11 */
mbed_official 76:aeb1df146756 125 #define EXTI_Line12 ((uint32_t)0x00001000) /*!< External interrupt line 12 */
mbed_official 76:aeb1df146756 126 #define EXTI_Line13 ((uint32_t)0x00002000) /*!< External interrupt line 13 */
mbed_official 76:aeb1df146756 127 #define EXTI_Line14 ((uint32_t)0x00004000) /*!< External interrupt line 14 */
mbed_official 76:aeb1df146756 128 #define EXTI_Line15 ((uint32_t)0x00008000) /*!< External interrupt line 15 */
mbed_official 76:aeb1df146756 129 #define EXTI_Line16 ((uint32_t)0x00010000) /*!< External interrupt line 16
mbed_official 76:aeb1df146756 130 Connected to the PVD Output,
mbed_official 76:aeb1df146756 131 not applicable for STM32F030 devices */
mbed_official 76:aeb1df146756 132 #define EXTI_Line17 ((uint32_t)0x00020000) /*!< Internal interrupt line 17
mbed_official 76:aeb1df146756 133 Connected to the RTC Alarm
mbed_official 76:aeb1df146756 134 event */
mbed_official 76:aeb1df146756 135 #define EXTI_Line18 ((uint32_t)0x00040000) /*!< Internal interrupt line 18
mbed_official 76:aeb1df146756 136 Connected to the USB
mbed_official 76:aeb1df146756 137 event, only applicable for
mbed_official 76:aeb1df146756 138 STM32F072 devices */
mbed_official 76:aeb1df146756 139 #define EXTI_Line19 ((uint32_t)0x00080000) /*!< Internal interrupt line 19
mbed_official 76:aeb1df146756 140 Connected to the RTC Tamper
mbed_official 76:aeb1df146756 141 and Time Stamp events */
mbed_official 76:aeb1df146756 142 #define EXTI_Line20 ((uint32_t)0x00100000) /*!< Internal interrupt line 20
mbed_official 76:aeb1df146756 143 Connected to the RTC wakeup
mbed_official 76:aeb1df146756 144 event, only applicable for
mbed_official 76:aeb1df146756 145 STM32F072 devices */
mbed_official 76:aeb1df146756 146 #define EXTI_Line21 ((uint32_t)0x00200000) /*!< Internal interrupt line 21
mbed_official 76:aeb1df146756 147 Connected to the Comparator 1
mbed_official 76:aeb1df146756 148 event, only applicable for STM32F051
mbed_official 76:aeb1df146756 149 ans STM32F072 devices */
mbed_official 76:aeb1df146756 150 #define EXTI_Line22 ((uint32_t)0x00400000) /*!< Internal interrupt line 22
mbed_official 76:aeb1df146756 151 Connected to the Comparator 2
mbed_official 76:aeb1df146756 152 event, only applicable for STM32F051
mbed_official 76:aeb1df146756 153 and STM32F072 devices */
mbed_official 76:aeb1df146756 154 #define EXTI_Line23 ((uint32_t)0x00800000) /*!< Internal interrupt line 23
mbed_official 76:aeb1df146756 155 Connected to the I2C1 wakeup
mbed_official 76:aeb1df146756 156 event, not applicable for STM32F030 devices */
mbed_official 76:aeb1df146756 157 #define EXTI_Line25 ((uint32_t)0x02000000) /*!< Internal interrupt line 25
mbed_official 76:aeb1df146756 158 Connected to the USART1 wakeup
mbed_official 76:aeb1df146756 159 event, not applicable for STM32F030 devices */
mbed_official 76:aeb1df146756 160 #define EXTI_Line26 ((uint32_t)0x04000000) /*!< Internal interrupt line 26
mbed_official 76:aeb1df146756 161 Connected to the USART2 wakeup
mbed_official 76:aeb1df146756 162 event, applicable only for
mbed_official 76:aeb1df146756 163 STM32F072 devices */
mbed_official 76:aeb1df146756 164 #define EXTI_Line27 ((uint32_t)0x08000000) /*!< Internal interrupt line 27
mbed_official 76:aeb1df146756 165 Connected to the CEC wakeup
mbed_official 76:aeb1df146756 166 event, applicable only for STM32F051
mbed_official 76:aeb1df146756 167 and STM32F072 devices */
mbed_official 76:aeb1df146756 168 #define EXTI_Line31 ((uint32_t)0x80000000) /*!< Internal interrupt line 31
mbed_official 76:aeb1df146756 169 Connected to the VDD USB monitor
mbed_official 76:aeb1df146756 170 event, applicable only for
mbed_official 76:aeb1df146756 171 STM32F072 devices */
mbed_official 76:aeb1df146756 172 #define IS_EXTI_LINE(LINE) ((((LINE) & (uint32_t)0x71000000) == 0x00) && ((LINE) != (uint16_t)0x00))
mbed_official 76:aeb1df146756 173
mbed_official 76:aeb1df146756 174 #define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \
mbed_official 76:aeb1df146756 175 ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \
mbed_official 76:aeb1df146756 176 ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \
mbed_official 76:aeb1df146756 177 ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \
mbed_official 76:aeb1df146756 178 ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \
mbed_official 76:aeb1df146756 179 ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \
mbed_official 76:aeb1df146756 180 ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \
mbed_official 76:aeb1df146756 181 ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \
mbed_official 76:aeb1df146756 182 ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \
mbed_official 76:aeb1df146756 183 ((LINE) == EXTI_Line18) || ((LINE) == EXTI_Line19) || \
mbed_official 76:aeb1df146756 184 ((LINE) == EXTI_Line20) || ((LINE) == EXTI_Line21) || \
mbed_official 76:aeb1df146756 185 ((LINE) == EXTI_Line22) || ((LINE) == EXTI_Line23) || \
mbed_official 76:aeb1df146756 186 ((LINE) == EXTI_Line25) || ((LINE) == EXTI_Line26) || \
mbed_official 76:aeb1df146756 187 ((LINE) == EXTI_Line27) || ((LINE) == EXTI_Line31))
mbed_official 76:aeb1df146756 188
mbed_official 76:aeb1df146756 189 /**
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 /* Exported macro ------------------------------------------------------------*/
mbed_official 76:aeb1df146756 198 /* Exported functions ------------------------------------------------------- */
mbed_official 76:aeb1df146756 199 /* Function used to set the EXTI configuration to the default reset state *****/
mbed_official 76:aeb1df146756 200 void EXTI_DeInit(void);
mbed_official 76:aeb1df146756 201
mbed_official 76:aeb1df146756 202 /* Initialization and Configuration functions *********************************/
mbed_official 76:aeb1df146756 203 void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct);
mbed_official 76:aeb1df146756 204 void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct);
mbed_official 76:aeb1df146756 205 void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line);
mbed_official 76:aeb1df146756 206
mbed_official 76:aeb1df146756 207 /* Interrupts and flags management functions **********************************/
mbed_official 76:aeb1df146756 208 FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line);
mbed_official 76:aeb1df146756 209 void EXTI_ClearFlag(uint32_t EXTI_Line);
mbed_official 76:aeb1df146756 210 ITStatus EXTI_GetITStatus(uint32_t EXTI_Line);
mbed_official 76:aeb1df146756 211 void EXTI_ClearITPendingBit(uint32_t EXTI_Line);
mbed_official 76:aeb1df146756 212
mbed_official 76:aeb1df146756 213 #ifdef __cplusplus
mbed_official 76:aeb1df146756 214 }
mbed_official 76:aeb1df146756 215 #endif
mbed_official 76:aeb1df146756 216
mbed_official 76:aeb1df146756 217 #endif /* __STM32F0XX_EXTI_H */
mbed_official 76:aeb1df146756 218 /**
mbed_official 76:aeb1df146756 219 * @}
mbed_official 76:aeb1df146756 220 */
mbed_official 76:aeb1df146756 221
mbed_official 76:aeb1df146756 222 /**
mbed_official 76:aeb1df146756 223 * @}
mbed_official 76:aeb1df146756 224 */
mbed_official 76:aeb1df146756 225
mbed_official 76:aeb1df146756 226 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/