Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
106:ba1f97679dad
.

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
Kojto 106:ba1f97679dad 5 * @version V2.3.2
Kojto 106:ba1f97679dad 6 * @date 26-June-2015
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 *
Kojto 99:dbbf35b96557 21 * <h2><center>&copy; COPYRIGHT(c) 2015 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 */
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 */
emilmont 77:869cf507173a 73
emilmont 77:869cf507173a 74 /* Uncomment the line below according to the target STM32 device used in your
emilmont 77:869cf507173a 75 application
emilmont 77:869cf507173a 76 */
emilmont 77:869cf507173a 77 #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \
emilmont 77:869cf507173a 78 !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \
Kojto 99:dbbf35b96557 79 !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE) && !defined (STM32F446xx)
emilmont 77:869cf507173a 80 /* #define STM32F405xx */ /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */
emilmont 77:869cf507173a 81 /* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */
emilmont 77:869cf507173a 82 /* #define STM32F407xx */ /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */
emilmont 77:869cf507173a 83 /* #define STM32F417xx */ /*!< STM32F417VG, STM32F417VE, STM32F417ZG, STM32F417ZE, STM32F417IG and STM32F417IE Devices */
emilmont 77:869cf507173a 84 /* #define STM32F427xx */ /*!< STM32F427VG, STM32F427VI, STM32F427ZG, STM32F427ZI, STM32F427IG and STM32F427II Devices */
emilmont 77:869cf507173a 85 /* #define STM32F437xx */ /*!< STM32F437VG, STM32F437VI, STM32F437ZG, STM32F437ZI, STM32F437IG and STM32F437II Devices */
emilmont 77:869cf507173a 86 /* #define STM32F429xx */ /*!< STM32F429VG, STM32F429VI, STM32F429ZG, STM32F429ZI, STM32F429BG, STM32F429BI, STM32F429NG,
emilmont 77:869cf507173a 87 STM32F439NI, STM32F429IG and STM32F429II Devices */
emilmont 77:869cf507173a 88 /* #define STM32F439xx */ /*!< STM32F439VG, STM32F439VI, STM32F439ZG, STM32F439ZI, STM32F439BG, STM32F439BI, STM32F439NG,
emilmont 77:869cf507173a 89 STM32F439NI, STM32F439IG and STM32F439II Devices */
emilmont 77:869cf507173a 90 /* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */
Kojto 99:dbbf35b96557 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 */
emilmont 77:869cf507173a 95 #endif
emilmont 77:869cf507173a 96
emilmont 77:869cf507173a 97 /* Tip: To avoid modifying this file each time you need to switch between these
emilmont 77:869cf507173a 98 devices, you can define the device in your toolchain compiler preprocessor.
emilmont 77:869cf507173a 99 */
emilmont 77:869cf507173a 100 #if !defined (USE_HAL_DRIVER)
emilmont 77:869cf507173a 101 /**
emilmont 77:869cf507173a 102 * @brief Comment the line below if you will not use the peripherals drivers.
emilmont 77:869cf507173a 103 In this case, these drivers will not be included and the application code will
emilmont 77:869cf507173a 104 be based on direct access to peripherals registers
emilmont 77:869cf507173a 105 */
Kojto 99:dbbf35b96557 106 #define USE_HAL_DRIVER
emilmont 77:869cf507173a 107 #endif /* USE_HAL_DRIVER */
emilmont 77:869cf507173a 108
emilmont 77:869cf507173a 109 /**
Kojto 106:ba1f97679dad 110 * @brief CMSIS Device version number V2.3.2
emilmont 77:869cf507173a 111 */
emilmont 77:869cf507173a 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 */
Kojto 90:cb3d968589d8 115 #define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
Kojto 90:cb3d968589d8 116 #define __STM32F4xx_CMSIS_DEVICE_VERSION ((__STM32F4xx_CMSIS_DEVICE_VERSION_MAIN << 24)\
Kojto 90:cb3d968589d8 117 |(__STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 << 16)\
Kojto 90:cb3d968589d8 118 |(__STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 << 8 )\
Kojto 90:cb3d968589d8 119 |(__STM32F4xx_CMSIS_DEVICE_VERSION))
emilmont 77:869cf507173a 120
emilmont 77:869cf507173a 121 /**
emilmont 77:869cf507173a 122 * @}
emilmont 77:869cf507173a 123 */
emilmont 77:869cf507173a 124
emilmont 77:869cf507173a 125 /** @addtogroup Device_Included
emilmont 77:869cf507173a 126 * @{
emilmont 77:869cf507173a 127 */
emilmont 77:869cf507173a 128
emilmont 77:869cf507173a 129 #if defined(STM32F405xx)
emilmont 77:869cf507173a 130 #include "stm32f405xx.h"
emilmont 77:869cf507173a 131 #elif defined(STM32F415xx)
emilmont 77:869cf507173a 132 #include "stm32f415xx.h"
emilmont 77:869cf507173a 133 #elif defined(STM32F407xx)
emilmont 77:869cf507173a 134 #include "stm32f407xx.h"
emilmont 77:869cf507173a 135 #elif defined(STM32F417xx)
emilmont 77:869cf507173a 136 #include "stm32f417xx.h"
emilmont 77:869cf507173a 137 #elif defined(STM32F427xx)
emilmont 77:869cf507173a 138 #include "stm32f427xx.h"
emilmont 77:869cf507173a 139 #elif defined(STM32F437xx)
emilmont 77:869cf507173a 140 #include "stm32f437xx.h"
emilmont 77:869cf507173a 141 #elif defined(STM32F429xx)
emilmont 77:869cf507173a 142 #include "stm32f429xx.h"
emilmont 77:869cf507173a 143 #elif defined(STM32F439xx)
emilmont 77:869cf507173a 144 #include "stm32f439xx.h"
emilmont 77:869cf507173a 145 #elif defined(STM32F401xC)
emilmont 77:869cf507173a 146 #include "stm32f401xc.h"
emilmont 77:869cf507173a 147 #elif defined(STM32F401xE)
emilmont 77:869cf507173a 148 #include "stm32f401xe.h"
bogdanm 85:024bf7f99721 149 #elif defined(STM32F411xE)
bogdanm 85:024bf7f99721 150 #include "stm32f411xe.h"
Kojto 99:dbbf35b96557 151 #elif defined(STM32F446xx)
Kojto 99:dbbf35b96557 152 #include "stm32f446xx.h"
emilmont 77:869cf507173a 153 #else
emilmont 77:869cf507173a 154 #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
emilmont 77:869cf507173a 155 #endif
emilmont 77:869cf507173a 156
emilmont 77:869cf507173a 157 /**
emilmont 77:869cf507173a 158 * @}
emilmont 77:869cf507173a 159 */
emilmont 77:869cf507173a 160
emilmont 77:869cf507173a 161 /** @addtogroup Exported_types
emilmont 77:869cf507173a 162 * @{
emilmont 77:869cf507173a 163 */
emilmont 77:869cf507173a 164 typedef enum
emilmont 77:869cf507173a 165 {
emilmont 77:869cf507173a 166 RESET = 0,
emilmont 77:869cf507173a 167 SET = !RESET
emilmont 77:869cf507173a 168 } FlagStatus, ITStatus;
emilmont 77:869cf507173a 169
emilmont 77:869cf507173a 170 typedef enum
emilmont 77:869cf507173a 171 {
emilmont 77:869cf507173a 172 DISABLE = 0,
emilmont 77:869cf507173a 173 ENABLE = !DISABLE
emilmont 77:869cf507173a 174 } FunctionalState;
emilmont 77:869cf507173a 175 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
emilmont 77:869cf507173a 176
emilmont 77:869cf507173a 177 typedef enum
emilmont 77:869cf507173a 178 {
emilmont 77:869cf507173a 179 ERROR = 0,
emilmont 77:869cf507173a 180 SUCCESS = !ERROR
emilmont 77:869cf507173a 181 } ErrorStatus;
emilmont 77:869cf507173a 182
emilmont 77:869cf507173a 183 /**
emilmont 77:869cf507173a 184 * @}
emilmont 77:869cf507173a 185 */
emilmont 77:869cf507173a 186
emilmont 77:869cf507173a 187
emilmont 77:869cf507173a 188 /** @addtogroup Exported_macro
emilmont 77:869cf507173a 189 * @{
emilmont 77:869cf507173a 190 */
emilmont 77:869cf507173a 191 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
emilmont 77:869cf507173a 192
emilmont 77:869cf507173a 193 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
emilmont 77:869cf507173a 194
emilmont 77:869cf507173a 195 #define READ_BIT(REG, BIT) ((REG) & (BIT))
emilmont 77:869cf507173a 196
emilmont 77:869cf507173a 197 #define CLEAR_REG(REG) ((REG) = (0x0))
emilmont 77:869cf507173a 198
emilmont 77:869cf507173a 199 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
emilmont 77:869cf507173a 200
emilmont 77:869cf507173a 201 #define READ_REG(REG) ((REG))
emilmont 77:869cf507173a 202
emilmont 77:869cf507173a 203 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
emilmont 77:869cf507173a 204
emilmont 77:869cf507173a 205 #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
emilmont 77:869cf507173a 206
emilmont 77:869cf507173a 207
emilmont 77:869cf507173a 208 /**
emilmont 77:869cf507173a 209 * @}
emilmont 77:869cf507173a 210 */
emilmont 77:869cf507173a 211
bogdanm 83:8a40adfe8776 212 #if defined (USE_HAL_DRIVER)
bogdanm 83:8a40adfe8776 213 #include "stm32f4xx_hal.h"
bogdanm 83:8a40adfe8776 214 #endif /* USE_HAL_DRIVER */
bogdanm 83:8a40adfe8776 215
emilmont 77:869cf507173a 216 #ifdef __cplusplus
emilmont 77:869cf507173a 217 }
emilmont 77:869cf507173a 218 #endif /* __cplusplus */
emilmont 77:869cf507173a 219
emilmont 77:869cf507173a 220 #endif /* __STM32F4xx_H */
emilmont 77:869cf507173a 221 /**
emilmont 77:869cf507173a 222 * @}
emilmont 77:869cf507173a 223 */
emilmont 77:869cf507173a 224
emilmont 77:869cf507173a 225 /**
emilmont 77:869cf507173a 226 * @}
emilmont 77:869cf507173a 227 */
emilmont 77:869cf507173a 228
emilmont 77:869cf507173a 229
emilmont 77:869cf507173a 230
emilmont 77:869cf507173a 231
emilmont 77:869cf507173a 232 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/