mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Wed Feb 20 22:31:08 2019 +0000
Revision:
189:f392fc9709a3
Parent:
180:96ed750bd169
mbed library release version 165

Who changed what in which revision?

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