The official mbed C/C SDK provides the software platform and libraries to build your applications.

Fork of mbed by mbed official

Committer:
bogdanm
Date:
Wed Jun 11 15:14:05 2014 +0100
Revision:
85:024bf7f99721
Parent:
83:8a40adfe8776
Child:
90:cb3d968589d8
Release 85 of the mbed library

Main changes:

- K64F Ethernet fixes
- Updated tests
- Fixes for various mbed targets
- Code cleanup: fixed warnings, more consistent code style
- GCC support for K64F

There is a known issue with the I2C interface on some ST targets. If you
find the I2C interface problematic on your ST board, please log a bug
against this on mbed.org.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 77:869cf507173a 1 /**
emilmont 77:869cf507173a 2 ******************************************************************************
emilmont 77:869cf507173a 3 * @file stm32f4xx.h
emilmont 77:869cf507173a 4 * @author MCD Application Team
bogdanm 85:024bf7f99721 5 * @version V2.1.0RC2
bogdanm 85:024bf7f99721 6 * @date 14-May-2014
emilmont 77:869cf507173a 7 * @brief CMSIS STM32F4xx Device Peripheral Access Layer Header File.
emilmont 77:869cf507173a 8 *
emilmont 77:869cf507173a 9 * The file is the unique include file that the application programmer
emilmont 77:869cf507173a 10 * is using in the C source code, usually in main.c. This file contains:
emilmont 77:869cf507173a 11 * - Configuration section that allows to select:
emilmont 77:869cf507173a 12 * - The STM32F4xx device used in the target application
emilmont 77:869cf507173a 13 * - To use or not the peripheral’s drivers in application code(i.e.
emilmont 77:869cf507173a 14 * code will be based on direct access to peripheral’s registers
emilmont 77:869cf507173a 15 * rather than drivers API), this option is controlled by
emilmont 77:869cf507173a 16 * "#define USE_HAL_DRIVER"
emilmont 77:869cf507173a 17 *
emilmont 77:869cf507173a 18 ******************************************************************************
emilmont 77:869cf507173a 19 * @attention
emilmont 77:869cf507173a 20 *
emilmont 77:869cf507173a 21 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
emilmont 77:869cf507173a 22 *
emilmont 77:869cf507173a 23 * Redistribution and use in source and binary forms, with or without modification,
emilmont 77:869cf507173a 24 * are permitted provided that the following conditions are met:
emilmont 77:869cf507173a 25 * 1. Redistributions of source code must retain the above copyright notice,
emilmont 77:869cf507173a 26 * this list of conditions and the following disclaimer.
emilmont 77:869cf507173a 27 * 2. Redistributions in binary form must reproduce the above copyright notice,
emilmont 77:869cf507173a 28 * this list of conditions and the following disclaimer in the documentation
emilmont 77:869cf507173a 29 * and/or other materials provided with the distribution.
emilmont 77:869cf507173a 30 * 3. Neither the name of STMicroelectronics nor the names of its contributors
emilmont 77:869cf507173a 31 * may be used to endorse or promote products derived from this software
emilmont 77:869cf507173a 32 * without specific prior written permission.
emilmont 77:869cf507173a 33 *
emilmont 77:869cf507173a 34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
emilmont 77:869cf507173a 35 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
emilmont 77:869cf507173a 36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
emilmont 77:869cf507173a 37 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
emilmont 77:869cf507173a 38 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
emilmont 77:869cf507173a 39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
emilmont 77:869cf507173a 40 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
emilmont 77:869cf507173a 41 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
emilmont 77:869cf507173a 42 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
emilmont 77:869cf507173a 43 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
emilmont 77:869cf507173a 44 *
emilmont 77:869cf507173a 45 ******************************************************************************
emilmont 77:869cf507173a 46 */
emilmont 77:869cf507173a 47
emilmont 77:869cf507173a 48 /** @addtogroup CMSIS
emilmont 77:869cf507173a 49 * @{
emilmont 77:869cf507173a 50 */
emilmont 77:869cf507173a 51
emilmont 77:869cf507173a 52 /** @addtogroup stm32f4xx
emilmont 77:869cf507173a 53 * @{
emilmont 77:869cf507173a 54 */
emilmont 77:869cf507173a 55
emilmont 77:869cf507173a 56 #ifndef __STM32F4xx_H
emilmont 77:869cf507173a 57 #define __STM32F4xx_H
emilmont 77:869cf507173a 58
emilmont 77:869cf507173a 59 #ifdef __cplusplus
emilmont 77:869cf507173a 60 extern "C" {
emilmont 77:869cf507173a 61 #endif /* __cplusplus */
emilmont 77:869cf507173a 62
emilmont 77:869cf507173a 63 /** @addtogroup Library_configuration_section
emilmont 77:869cf507173a 64 * @{
emilmont 77:869cf507173a 65 */
emilmont 77:869cf507173a 66
emilmont 77:869cf507173a 67 /* Uncomment the line below according to the target STM32 device used in your
emilmont 77:869cf507173a 68 application
emilmont 77:869cf507173a 69 */
emilmont 77:869cf507173a 70
emilmont 77:869cf507173a 71 #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \
emilmont 77:869cf507173a 72 !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \
bogdanm 85:024bf7f99721 73 !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE)
emilmont 77:869cf507173a 74 /* #define STM32F405xx */ /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */
emilmont 77:869cf507173a 75 /* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */
emilmont 77:869cf507173a 76 /* #define STM32F407xx */ /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */
emilmont 77:869cf507173a 77 /* #define STM32F417xx */ /*!< STM32F417VG, STM32F417VE, STM32F417ZG, STM32F417ZE, STM32F417IG and STM32F417IE Devices */
emilmont 77:869cf507173a 78 /* #define STM32F427xx */ /*!< STM32F427VG, STM32F427VI, STM32F427ZG, STM32F427ZI, STM32F427IG and STM32F427II Devices */
emilmont 77:869cf507173a 79 /* #define STM32F437xx */ /*!< STM32F437VG, STM32F437VI, STM32F437ZG, STM32F437ZI, STM32F437IG and STM32F437II Devices */
emilmont 77:869cf507173a 80 /* #define STM32F429xx */ /*!< STM32F429VG, STM32F429VI, STM32F429ZG, STM32F429ZI, STM32F429BG, STM32F429BI, STM32F429NG,
emilmont 77:869cf507173a 81 STM32F439NI, STM32F429IG and STM32F429II Devices */
emilmont 77:869cf507173a 82 /* #define STM32F439xx */ /*!< STM32F439VG, STM32F439VI, STM32F439ZG, STM32F439ZI, STM32F439BG, STM32F439BI, STM32F439NG,
emilmont 77:869cf507173a 83 STM32F439NI, STM32F439IG and STM32F439II Devices */
emilmont 77:869cf507173a 84 /* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */
bogdanm 85:024bf7f99721 85 #define STM32F401xE /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */
bogdanm 85:024bf7f99721 86 /* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */
emilmont 77:869cf507173a 87 #endif
emilmont 77:869cf507173a 88
emilmont 77:869cf507173a 89 /* Tip: To avoid modifying this file each time you need to switch between these
emilmont 77:869cf507173a 90 devices, you can define the device in your toolchain compiler preprocessor.
emilmont 77:869cf507173a 91 */
emilmont 77:869cf507173a 92 #if !defined (USE_HAL_DRIVER)
emilmont 77:869cf507173a 93 /**
emilmont 77:869cf507173a 94 * @brief Comment the line below if you will not use the peripherals drivers.
emilmont 77:869cf507173a 95 In this case, these drivers will not be included and the application code will
emilmont 77:869cf507173a 96 be based on direct access to peripherals registers
emilmont 77:869cf507173a 97 */
bogdanm 81:7d30d6019079 98 #define USE_HAL_DRIVER
emilmont 77:869cf507173a 99 #endif /* USE_HAL_DRIVER */
emilmont 77:869cf507173a 100
emilmont 77:869cf507173a 101 /**
bogdanm 85:024bf7f99721 102 * @brief CMSIS Device version number V2.1.0RC2
emilmont 77:869cf507173a 103 */
emilmont 77:869cf507173a 104 #define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */
bogdanm 85:024bf7f99721 105 #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */
emilmont 77:869cf507173a 106 #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
bogdanm 85:024bf7f99721 107 #define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x02) /*!< [7:0] release candidate */
emilmont 77:869cf507173a 108 #define __STM32F4xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
emilmont 77:869cf507173a 109 |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
emilmont 77:869cf507173a 110 |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
emilmont 77:869cf507173a 111 |(__CMSIS_DEVICE_HAL_VERSION_RC))
emilmont 77:869cf507173a 112
emilmont 77:869cf507173a 113 /**
emilmont 77:869cf507173a 114 * @}
emilmont 77:869cf507173a 115 */
emilmont 77:869cf507173a 116
emilmont 77:869cf507173a 117 /** @addtogroup Device_Included
emilmont 77:869cf507173a 118 * @{
emilmont 77:869cf507173a 119 */
emilmont 77:869cf507173a 120
emilmont 77:869cf507173a 121 #if defined(STM32F405xx)
emilmont 77:869cf507173a 122 #include "stm32f405xx.h"
emilmont 77:869cf507173a 123 #elif defined(STM32F415xx)
emilmont 77:869cf507173a 124 #include "stm32f415xx.h"
emilmont 77:869cf507173a 125 #elif defined(STM32F407xx)
emilmont 77:869cf507173a 126 #include "stm32f407xx.h"
emilmont 77:869cf507173a 127 #elif defined(STM32F417xx)
emilmont 77:869cf507173a 128 #include "stm32f417xx.h"
emilmont 77:869cf507173a 129 #elif defined(STM32F427xx)
emilmont 77:869cf507173a 130 #include "stm32f427xx.h"
emilmont 77:869cf507173a 131 #elif defined(STM32F437xx)
emilmont 77:869cf507173a 132 #include "stm32f437xx.h"
emilmont 77:869cf507173a 133 #elif defined(STM32F429xx)
emilmont 77:869cf507173a 134 #include "stm32f429xx.h"
emilmont 77:869cf507173a 135 #elif defined(STM32F439xx)
emilmont 77:869cf507173a 136 #include "stm32f439xx.h"
emilmont 77:869cf507173a 137 #elif defined(STM32F401xC)
emilmont 77:869cf507173a 138 #include "stm32f401xc.h"
emilmont 77:869cf507173a 139 #elif defined(STM32F401xE)
emilmont 77:869cf507173a 140 #include "stm32f401xe.h"
bogdanm 85:024bf7f99721 141 #elif defined(STM32F411xE)
bogdanm 85:024bf7f99721 142 #include "stm32f411xe.h"
emilmont 77:869cf507173a 143 #else
emilmont 77:869cf507173a 144 #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
emilmont 77:869cf507173a 145 #endif
emilmont 77:869cf507173a 146
emilmont 77:869cf507173a 147 /**
emilmont 77:869cf507173a 148 * @}
emilmont 77:869cf507173a 149 */
emilmont 77:869cf507173a 150
emilmont 77:869cf507173a 151 /** @addtogroup Exported_types
emilmont 77:869cf507173a 152 * @{
emilmont 77:869cf507173a 153 */
emilmont 77:869cf507173a 154 typedef enum
emilmont 77:869cf507173a 155 {
emilmont 77:869cf507173a 156 RESET = 0,
emilmont 77:869cf507173a 157 SET = !RESET
emilmont 77:869cf507173a 158 } FlagStatus, ITStatus;
emilmont 77:869cf507173a 159
emilmont 77:869cf507173a 160 typedef enum
emilmont 77:869cf507173a 161 {
emilmont 77:869cf507173a 162 DISABLE = 0,
emilmont 77:869cf507173a 163 ENABLE = !DISABLE
emilmont 77:869cf507173a 164 } FunctionalState;
emilmont 77:869cf507173a 165 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
emilmont 77:869cf507173a 166
emilmont 77:869cf507173a 167 typedef enum
emilmont 77:869cf507173a 168 {
emilmont 77:869cf507173a 169 ERROR = 0,
emilmont 77:869cf507173a 170 SUCCESS = !ERROR
emilmont 77:869cf507173a 171 } ErrorStatus;
emilmont 77:869cf507173a 172
emilmont 77:869cf507173a 173 /**
emilmont 77:869cf507173a 174 * @}
emilmont 77:869cf507173a 175 */
emilmont 77:869cf507173a 176
emilmont 77:869cf507173a 177
emilmont 77:869cf507173a 178 /** @addtogroup Exported_macro
emilmont 77:869cf507173a 179 * @{
emilmont 77:869cf507173a 180 */
emilmont 77:869cf507173a 181 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
emilmont 77:869cf507173a 182
emilmont 77:869cf507173a 183 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
emilmont 77:869cf507173a 184
emilmont 77:869cf507173a 185 #define READ_BIT(REG, BIT) ((REG) & (BIT))
emilmont 77:869cf507173a 186
emilmont 77:869cf507173a 187 #define CLEAR_REG(REG) ((REG) = (0x0))
emilmont 77:869cf507173a 188
emilmont 77:869cf507173a 189 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
emilmont 77:869cf507173a 190
emilmont 77:869cf507173a 191 #define READ_REG(REG) ((REG))
emilmont 77:869cf507173a 192
emilmont 77:869cf507173a 193 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
emilmont 77:869cf507173a 194
emilmont 77:869cf507173a 195 #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
emilmont 77:869cf507173a 196
emilmont 77:869cf507173a 197
emilmont 77:869cf507173a 198 /**
emilmont 77:869cf507173a 199 * @}
emilmont 77:869cf507173a 200 */
emilmont 77:869cf507173a 201
bogdanm 83:8a40adfe8776 202 #if defined (USE_HAL_DRIVER)
bogdanm 83:8a40adfe8776 203 #include "stm32f4xx_hal.h"
bogdanm 83:8a40adfe8776 204 #endif /* USE_HAL_DRIVER */
bogdanm 83:8a40adfe8776 205
emilmont 77:869cf507173a 206 #ifdef __cplusplus
emilmont 77:869cf507173a 207 }
emilmont 77:869cf507173a 208 #endif /* __cplusplus */
emilmont 77:869cf507173a 209
emilmont 77:869cf507173a 210 #endif /* __STM32F4xx_H */
emilmont 77:869cf507173a 211 /**
emilmont 77:869cf507173a 212 * @}
emilmont 77:869cf507173a 213 */
emilmont 77:869cf507173a 214
emilmont 77:869cf507173a 215 /**
emilmont 77:869cf507173a 216 * @}
emilmont 77:869cf507173a 217 */
emilmont 77:869cf507173a 218
emilmont 77:869cf507173a 219
emilmont 77:869cf507173a 220
emilmont 77:869cf507173a 221
emilmont 77:869cf507173a 222 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/