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:
Kojto
Date:
Fri Oct 02 07:35:07 2015 +0200
Revision:
108:34e6b704fe68
Parent:
93:e188a91d3eaa
Release 108  of the mbed library

Changes:
- new platforms - ELMO_F411RE, WIZNET_7500P, ARM_MPS2_BEID
- EFM32 - bugfixes in rtc, serial
- Cortex A cmsis - update files
- STML4 - RAM fixes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 85:024bf7f99721 1 /**
bogdanm 85:024bf7f99721 2 ******************************************************************************
bogdanm 85:024bf7f99721 3 * @file stm32f0xx.h
bogdanm 85:024bf7f99721 4 * @author MCD Application Team
Kojto 108:34e6b704fe68 5 * @version V2.2.2
Kojto 108:34e6b704fe68 6 * @date 26-June-2015
bogdanm 85:024bf7f99721 7 * @brief CMSIS STM32F0xx Device Peripheral Access Layer Header File.
bogdanm 85:024bf7f99721 8 *
bogdanm 85:024bf7f99721 9 * The file is the unique include file that the application programmer
bogdanm 85:024bf7f99721 10 * is using in the C source code, usually in main.c. This file contains:
bogdanm 85:024bf7f99721 11 * - Configuration section that allows to select:
bogdanm 85:024bf7f99721 12 * - The STM32F0xx device used in the target application
bogdanm 85:024bf7f99721 13 * - To use or not the peripheral’s drivers in application code(i.e.
bogdanm 85:024bf7f99721 14 * code will be based on direct access to peripheral’s registers
bogdanm 85:024bf7f99721 15 * rather than drivers API), this option is controlled by
bogdanm 85:024bf7f99721 16 * "#define USE_HAL_DRIVER"
bogdanm 85:024bf7f99721 17 *
bogdanm 85:024bf7f99721 18 ******************************************************************************
bogdanm 85:024bf7f99721 19 * @attention
bogdanm 85:024bf7f99721 20 *
Kojto 108:34e6b704fe68 21 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bogdanm 85:024bf7f99721 22 *
bogdanm 85:024bf7f99721 23 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 85:024bf7f99721 24 * are permitted provided that the following conditions are met:
bogdanm 85:024bf7f99721 25 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 85:024bf7f99721 26 * this list of conditions and the following disclaimer.
bogdanm 85:024bf7f99721 27 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 85:024bf7f99721 28 * this list of conditions and the following disclaimer in the documentation
bogdanm 85:024bf7f99721 29 * and/or other materials provided with the distribution.
bogdanm 85:024bf7f99721 30 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 85:024bf7f99721 31 * may be used to endorse or promote products derived from this software
bogdanm 85:024bf7f99721 32 * without specific prior written permission.
bogdanm 85:024bf7f99721 33 *
bogdanm 85:024bf7f99721 34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 85:024bf7f99721 35 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 85:024bf7f99721 36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 85:024bf7f99721 37 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 85:024bf7f99721 38 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 85:024bf7f99721 39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 85:024bf7f99721 40 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 85:024bf7f99721 41 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 85:024bf7f99721 42 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 85:024bf7f99721 43 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 85:024bf7f99721 44 *
bogdanm 85:024bf7f99721 45 ******************************************************************************
bogdanm 85:024bf7f99721 46 */
bogdanm 85:024bf7f99721 47
bogdanm 85:024bf7f99721 48 /** @addtogroup CMSIS
bogdanm 85:024bf7f99721 49 * @{
bogdanm 85:024bf7f99721 50 */
bogdanm 85:024bf7f99721 51
bogdanm 85:024bf7f99721 52 /** @addtogroup stm32f0xx
bogdanm 85:024bf7f99721 53 * @{
bogdanm 85:024bf7f99721 54 */
bogdanm 85:024bf7f99721 55
bogdanm 85:024bf7f99721 56 #ifndef __STM32F0xx_H
bogdanm 85:024bf7f99721 57 #define __STM32F0xx_H
bogdanm 85:024bf7f99721 58
bogdanm 85:024bf7f99721 59 #ifdef __cplusplus
bogdanm 85:024bf7f99721 60 extern "C" {
bogdanm 85:024bf7f99721 61 #endif /* __cplusplus */
bogdanm 85:024bf7f99721 62
bogdanm 85:024bf7f99721 63 /** @addtogroup Library_configuration_section
bogdanm 85:024bf7f99721 64 * @{
bogdanm 85:024bf7f99721 65 */
Kojto 108:34e6b704fe68 66
Kojto 108:34e6b704fe68 67 /**
Kojto 108:34e6b704fe68 68 * @brief STM32 Family
Kojto 108:34e6b704fe68 69 */
Kojto 108:34e6b704fe68 70 #if !defined (STM32F0)
Kojto 108:34e6b704fe68 71 #define STM32F0
Kojto 108:34e6b704fe68 72 #endif /* STM32F0 */
bogdanm 85:024bf7f99721 73
bogdanm 85:024bf7f99721 74 /* Uncomment the line below according to the target STM32 device used in your
bogdanm 85:024bf7f99721 75 application
bogdanm 85:024bf7f99721 76 */
bogdanm 85:024bf7f99721 77
bogdanm 85:024bf7f99721 78 #if !defined (STM32F030x6) && !defined (STM32F030x8) && \
bogdanm 85:024bf7f99721 79 !defined (STM32F031x6) && !defined (STM32F038xx) && \
Kojto 93:e188a91d3eaa 80 !defined (STM32F042x6) && !defined (STM32F048xx) && !defined (STM32F070x6) && \
bogdanm 85:024bf7f99721 81 !defined (STM32F051x8) && !defined (STM32F058xx) && \
Kojto 93:e188a91d3eaa 82 !defined (STM32F071xB) && !defined (STM32F072xB) && !defined (STM32F078xx) && !defined (STM32F070xB) && \
Kojto 93:e188a91d3eaa 83 !defined (STM32F091xC) && !defined (STM32F098xx) && !defined (STM32F030xC)
bogdanm 85:024bf7f99721 84 /* #define STM32F030x6 */ /*!< STM32F030x4, STM32F030x6 Devices (STM32F030xx microcontrollers where the Flash memory ranges between 16 and 32 Kbytes) */
bogdanm 85:024bf7f99721 85 /* #define STM32F030x8 */ /*!< STM32F030x8 Devices (STM32F030xx microcontrollers where the Flash memory is 64 Kbytes) */
bogdanm 85:024bf7f99721 86 /* #define STM32F031x6 */ /*!< STM32F031x4, STM32F031x6 Devices (STM32F031xx microcontrollers where the Flash memory ranges between 16 and 32 Kbytes) */
bogdanm 85:024bf7f99721 87 /* #define STM32F038xx */ /*!< STM32F038xx Devices (STM32F038xx microcontrollers where the Flash memory is 32 Kbytes) */
bogdanm 85:024bf7f99721 88 /* #define STM32F042x6 */ /*!< STM32F042x4, STM32F042x6 Devices (STM32F042xx microcontrollers where the Flash memory ranges between 16 and 32 Kbytes) */
bogdanm 85:024bf7f99721 89 /* #define STM32F048x6 */ /*!< STM32F048xx Devices (STM32F042xx microcontrollers where the Flash memory is 32 Kbytes) */
bogdanm 85:024bf7f99721 90 /* #define STM32F051x8 */ /*!< STM32F051x4, STM32F051x6, STM32F051x8 Devices (STM32F051xx microcontrollers where the Flash memory ranges between 16 and 64 Kbytes) */
bogdanm 85:024bf7f99721 91 /* #define STM32F058xx */ /*!< STM32F058xx Devices (STM32F058xx microcontrollers where the Flash memory is 64 Kbytes) */
Kojto 93:e188a91d3eaa 92 /* #define STM32F070x6 */ /*!< STM32F070x6 Devices (STM32F070x6 microcontrollers where the Flash memory ranges between 16 and 32 Kbytes) */
Kojto 93:e188a91d3eaa 93 /* #define STM32F070xB */ /*!< STM32F070xB Devices (STM32F070xB microcontrollers where the Flash memory ranges between 64 and 128 Kbytes) */
bogdanm 85:024bf7f99721 94 /* #define STM32F071xB */ /*!< STM32F071x8, STM32F071xB Devices (STM32F071xx microcontrollers where the Flash memory ranges between 64 and 128 Kbytes) */
bogdanm 85:024bf7f99721 95 #define STM32F072xB /*!< STM32F072x8, STM32F072xB Devices (STM32F072xx microcontrollers where the Flash memory ranges between 64 and 128 Kbytes) */
bogdanm 85:024bf7f99721 96 /* #define STM32F078xx */ /*!< STM32F078xx Devices (STM32F078xx microcontrollers where the Flash memory is 128 Kbytes) */
Kojto 93:e188a91d3eaa 97 /* #define STM32F030xC */ /*!< STM32F030xC Devices (STM32F030xC microcontrollers where the Flash memory is 256 Kbytes) */
bogdanm 92:4fc01daae5a5 98 /* #define STM32F091xC */ /*!< STM32F091xC Devices (STM32F091xx microcontrollers where the Flash memory is 256 Kbytes) */
bogdanm 92:4fc01daae5a5 99 /* #define STM32F098xx */ /*!< STM32F098xx Devices (STM32F098xx microcontrollers where the Flash memory is 256 Kbytes) */
bogdanm 85:024bf7f99721 100 #endif
bogdanm 85:024bf7f99721 101
bogdanm 85:024bf7f99721 102 /* Tip: To avoid modifying this file each time you need to switch between these
bogdanm 85:024bf7f99721 103 devices, you can define the device in your toolchain compiler preprocessor.
bogdanm 85:024bf7f99721 104 */
bogdanm 85:024bf7f99721 105 #if !defined (USE_HAL_DRIVER)
bogdanm 85:024bf7f99721 106 /**
bogdanm 85:024bf7f99721 107 * @brief Comment the line below if you will not use the peripherals drivers.
bogdanm 85:024bf7f99721 108 In this case, these drivers will not be included and the application code will
bogdanm 85:024bf7f99721 109 be based on direct access to peripherals registers
bogdanm 85:024bf7f99721 110 */
bogdanm 85:024bf7f99721 111 #define USE_HAL_DRIVER
bogdanm 85:024bf7f99721 112 #endif /* USE_HAL_DRIVER */
bogdanm 85:024bf7f99721 113
bogdanm 85:024bf7f99721 114 /**
Kojto 108:34e6b704fe68 115 * @brief CMSIS Device version number V2.2.2
bogdanm 85:024bf7f99721 116 */
bogdanm 85:024bf7f99721 117 #define __STM32F0xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */
Kojto 93:e188a91d3eaa 118 #define __STM32F0xx_CMSIS_DEVICE_VERSION_SUB1 (0x02) /*!< [23:16] sub1 version */
Kojto 108:34e6b704fe68 119 #define __STM32F0xx_CMSIS_DEVICE_VERSION_SUB2 (0x02) /*!< [15:8] sub2 version */
bogdanm 85:024bf7f99721 120 #define __STM32F0xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
bogdanm 85:024bf7f99721 121 #define __STM32F0xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
bogdanm 85:024bf7f99721 122 |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
bogdanm 85:024bf7f99721 123 |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
bogdanm 85:024bf7f99721 124 |(__CMSIS_DEVICE_HAL_VERSION_RC))
bogdanm 85:024bf7f99721 125
bogdanm 85:024bf7f99721 126 /**
bogdanm 85:024bf7f99721 127 * @}
bogdanm 85:024bf7f99721 128 */
bogdanm 85:024bf7f99721 129
bogdanm 85:024bf7f99721 130 /** @addtogroup Device_Included
bogdanm 85:024bf7f99721 131 * @{
bogdanm 85:024bf7f99721 132 */
bogdanm 85:024bf7f99721 133
bogdanm 85:024bf7f99721 134 #if defined(STM32F030x6)
bogdanm 85:024bf7f99721 135 #include "stm32f030x6.h"
bogdanm 85:024bf7f99721 136 #elif defined(STM32F030x8)
bogdanm 85:024bf7f99721 137 #include "stm32f030x8.h"
bogdanm 85:024bf7f99721 138 #elif defined(STM32F031x6)
bogdanm 85:024bf7f99721 139 #include "stm32f031x6.h"
bogdanm 85:024bf7f99721 140 #elif defined(STM32F038xx)
bogdanm 85:024bf7f99721 141 #include "stm32f038xx.h"
bogdanm 85:024bf7f99721 142 #elif defined(STM32F042x6)
bogdanm 85:024bf7f99721 143 #include "stm32f042x6.h"
bogdanm 85:024bf7f99721 144 #elif defined(STM32F048xx)
bogdanm 85:024bf7f99721 145 #include "stm32f048xx.h"
bogdanm 85:024bf7f99721 146 #elif defined(STM32F051x8)
bogdanm 85:024bf7f99721 147 #include "stm32f051x8.h"
bogdanm 85:024bf7f99721 148 #elif defined(STM32F058xx)
bogdanm 85:024bf7f99721 149 #include "stm32f058xx.h"
Kojto 93:e188a91d3eaa 150 #elif defined(STM32F070x6)
Kojto 93:e188a91d3eaa 151 #include "stm32f070x6.h"
Kojto 93:e188a91d3eaa 152 #elif defined(STM32F070xB)
Kojto 93:e188a91d3eaa 153 #include "stm32f070xb.h"
bogdanm 85:024bf7f99721 154 #elif defined(STM32F071xB)
bogdanm 85:024bf7f99721 155 #include "stm32f071xb.h"
bogdanm 85:024bf7f99721 156 #elif defined(STM32F072xB)
bogdanm 85:024bf7f99721 157 #include "stm32f072xb.h"
bogdanm 85:024bf7f99721 158 #elif defined(STM32F078xx)
bogdanm 85:024bf7f99721 159 #include "stm32f078xx.h"
bogdanm 92:4fc01daae5a5 160 #elif defined(STM32F091xC)
bogdanm 92:4fc01daae5a5 161 #include "stm32f091xc.h"
bogdanm 92:4fc01daae5a5 162 #elif defined(STM32F098xx)
Kojto 93:e188a91d3eaa 163 #include "stm32f098xx.h"
Kojto 93:e188a91d3eaa 164 #elif defined(STM32F030xC)
Kojto 93:e188a91d3eaa 165 #include "stm32f030xc.h"
bogdanm 85:024bf7f99721 166 #else
bogdanm 85:024bf7f99721 167 #error "Please select first the target STM32F0xx device used in your application (in stm32f0xx.h file)"
bogdanm 85:024bf7f99721 168 #endif
bogdanm 85:024bf7f99721 169
bogdanm 85:024bf7f99721 170 /**
bogdanm 85:024bf7f99721 171 * @}
bogdanm 85:024bf7f99721 172 */
bogdanm 85:024bf7f99721 173
bogdanm 85:024bf7f99721 174 /** @addtogroup Exported_types
bogdanm 85:024bf7f99721 175 * @{
bogdanm 85:024bf7f99721 176 */
bogdanm 85:024bf7f99721 177 typedef enum
bogdanm 85:024bf7f99721 178 {
bogdanm 85:024bf7f99721 179 RESET = 0,
bogdanm 85:024bf7f99721 180 SET = !RESET
bogdanm 85:024bf7f99721 181 } FlagStatus, ITStatus;
bogdanm 85:024bf7f99721 182
bogdanm 85:024bf7f99721 183 typedef enum
bogdanm 85:024bf7f99721 184 {
bogdanm 85:024bf7f99721 185 DISABLE = 0,
bogdanm 85:024bf7f99721 186 ENABLE = !DISABLE
bogdanm 85:024bf7f99721 187 } FunctionalState;
bogdanm 85:024bf7f99721 188 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
bogdanm 85:024bf7f99721 189
bogdanm 85:024bf7f99721 190 typedef enum
bogdanm 85:024bf7f99721 191 {
bogdanm 85:024bf7f99721 192 ERROR = 0,
bogdanm 85:024bf7f99721 193 SUCCESS = !ERROR
bogdanm 85:024bf7f99721 194 } ErrorStatus;
bogdanm 85:024bf7f99721 195
bogdanm 85:024bf7f99721 196 /**
bogdanm 85:024bf7f99721 197 * @}
bogdanm 85:024bf7f99721 198 */
bogdanm 85:024bf7f99721 199
bogdanm 85:024bf7f99721 200
bogdanm 85:024bf7f99721 201 /** @addtogroup Exported_macros
bogdanm 85:024bf7f99721 202 * @{
bogdanm 85:024bf7f99721 203 */
bogdanm 85:024bf7f99721 204 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
bogdanm 85:024bf7f99721 205
bogdanm 85:024bf7f99721 206 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
bogdanm 85:024bf7f99721 207
bogdanm 85:024bf7f99721 208 #define READ_BIT(REG, BIT) ((REG) & (BIT))
bogdanm 85:024bf7f99721 209
bogdanm 85:024bf7f99721 210 #define CLEAR_REG(REG) ((REG) = (0x0))
bogdanm 85:024bf7f99721 211
bogdanm 85:024bf7f99721 212 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
bogdanm 85:024bf7f99721 213
bogdanm 85:024bf7f99721 214 #define READ_REG(REG) ((REG))
bogdanm 85:024bf7f99721 215
bogdanm 85:024bf7f99721 216 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
bogdanm 85:024bf7f99721 217
bogdanm 85:024bf7f99721 218
bogdanm 85:024bf7f99721 219 /**
bogdanm 85:024bf7f99721 220 * @}
bogdanm 85:024bf7f99721 221 */
bogdanm 85:024bf7f99721 222
bogdanm 85:024bf7f99721 223 #if defined (USE_HAL_DRIVER)
bogdanm 85:024bf7f99721 224 #include "stm32f0xx_hal.h"
bogdanm 85:024bf7f99721 225 #endif /* USE_HAL_DRIVER */
bogdanm 85:024bf7f99721 226
bogdanm 85:024bf7f99721 227
bogdanm 85:024bf7f99721 228 #ifdef __cplusplus
bogdanm 85:024bf7f99721 229 }
bogdanm 85:024bf7f99721 230 #endif /* __cplusplus */
bogdanm 85:024bf7f99721 231
bogdanm 85:024bf7f99721 232 #endif /* __STM32F0xx_H */
bogdanm 85:024bf7f99721 233 /**
bogdanm 85:024bf7f99721 234 * @}
bogdanm 85:024bf7f99721 235 */
bogdanm 85:024bf7f99721 236
bogdanm 85:024bf7f99721 237 /**
bogdanm 85:024bf7f99721 238 * @}
bogdanm 85:024bf7f99721 239 */
bogdanm 85:024bf7f99721 240
bogdanm 85:024bf7f99721 241
bogdanm 85:024bf7f99721 242
bogdanm 85:024bf7f99721 243
bogdanm 85:024bf7f99721 244 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/