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