mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
<>
Date:
Thu Oct 27 16:45:56 2016 +0100
Revision:
128:9bcdf88f62b0
Child:
143:86740a56073b
Release 128 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

2966: Add kw24 support https://github.com/ARMmbed/mbed-os/pull/2966
3068: MultiTech mDot - clean up PeripheralPins.c and add new pin names https://github.com/ARMmbed/mbed-os/pull/3068
3089: Kinetis HAL: Remove clock initialization code from serial and ticker https://github.com/ARMmbed/mbed-os/pull/3089
2943: [NRF5] NVIC_SetVector functionality https://github.com/ARMmbed/mbed-os/pull/2943
2938: InterruptIn changes in NCS36510 HAL. https://github.com/ARMmbed/mbed-os/pull/2938
3108: Fix sleep function for NRF52. https://github.com/ARMmbed/mbed-os/pull/3108
3076: STM32F1: Correct timer master value reading https://github.com/ARMmbed/mbed-os/pull/3076
3085: Add LOWPOWERTIMER capability for NUCLEO_F303ZE https://github.com/ARMmbed/mbed-os/pull/3085
3046: [BEETLE] Update BLE stack on Beetle board https://github.com/ARMmbed/mbed-os/pull/3046
3122: [Silicon Labs] Update of Silicon Labs HAL https://github.com/ARMmbed/mbed-os/pull/3122
3022: OnSemi RAM usage fix https://github.com/ARMmbed/mbed-os/pull/3022
3121: STM32F3: Correct UART4 and UART5 defines when using DEVICE_SERIAL_ASYNCH https://github.com/ARMmbed/mbed-os/pull/3121
3142: Targets- NUMAKER_PFM_NUC47216 remove mbed 2 https://github.com/ARMmbed/mbed-os/pull/3142

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 128:9bcdf88f62b0 1 /**
<> 128:9bcdf88f62b0 2 ******************************************************************************
<> 128:9bcdf88f62b0 3 * @file stm32f1xx.h
<> 128:9bcdf88f62b0 4 * @author MCD Application Team
<> 128:9bcdf88f62b0 5 * @version V4.1.0
<> 128:9bcdf88f62b0 6 * @date 29-April-2016
<> 128:9bcdf88f62b0 7 * @brief CMSIS STM32F1xx Device Peripheral Access Layer Header File.
<> 128:9bcdf88f62b0 8 *
<> 128:9bcdf88f62b0 9 * The file is the unique include file that the application programmer
<> 128:9bcdf88f62b0 10 * is using in the C source code, usually in main.c. This file contains:
<> 128:9bcdf88f62b0 11 * - Configuration section that allows to select:
<> 128:9bcdf88f62b0 12 * - The STM32F1xx device used in the target application
<> 128:9bcdf88f62b0 13 * - To use or not the peripheral’s drivers in application code(i.e.
<> 128:9bcdf88f62b0 14 * code will be based on direct access to peripheral’s registers
<> 128:9bcdf88f62b0 15 * rather than drivers API), this option is controlled by
<> 128:9bcdf88f62b0 16 * "#define USE_HAL_DRIVER"
<> 128:9bcdf88f62b0 17 *
<> 128:9bcdf88f62b0 18 ******************************************************************************
<> 128:9bcdf88f62b0 19 * @attention
<> 128:9bcdf88f62b0 20 *
<> 128:9bcdf88f62b0 21 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
<> 128:9bcdf88f62b0 22 *
<> 128:9bcdf88f62b0 23 * Redistribution and use in source and binary forms, with or without modification,
<> 128:9bcdf88f62b0 24 * are permitted provided that the following conditions are met:
<> 128:9bcdf88f62b0 25 * 1. Redistributions of source code must retain the above copyright notice,
<> 128:9bcdf88f62b0 26 * this list of conditions and the following disclaimer.
<> 128:9bcdf88f62b0 27 * 2. Redistributions in binary form must reproduce the above copyright notice,
<> 128:9bcdf88f62b0 28 * this list of conditions and the following disclaimer in the documentation
<> 128:9bcdf88f62b0 29 * and/or other materials provided with the distribution.
<> 128:9bcdf88f62b0 30 * 3. Neither the name of STMicroelectronics nor the names of its contributors
<> 128:9bcdf88f62b0 31 * may be used to endorse or promote products derived from this software
<> 128:9bcdf88f62b0 32 * without specific prior written permission.
<> 128:9bcdf88f62b0 33 *
<> 128:9bcdf88f62b0 34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<> 128:9bcdf88f62b0 35 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<> 128:9bcdf88f62b0 36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 128:9bcdf88f62b0 37 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
<> 128:9bcdf88f62b0 38 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
<> 128:9bcdf88f62b0 39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
<> 128:9bcdf88f62b0 40 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 128:9bcdf88f62b0 41 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
<> 128:9bcdf88f62b0 42 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<> 128:9bcdf88f62b0 43 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 128:9bcdf88f62b0 44 *
<> 128:9bcdf88f62b0 45 ******************************************************************************
<> 128:9bcdf88f62b0 46 */
<> 128:9bcdf88f62b0 47
<> 128:9bcdf88f62b0 48 /** @addtogroup CMSIS
<> 128:9bcdf88f62b0 49 * @{
<> 128:9bcdf88f62b0 50 */
<> 128:9bcdf88f62b0 51
<> 128:9bcdf88f62b0 52 /** @addtogroup stm32f1xx
<> 128:9bcdf88f62b0 53 * @{
<> 128:9bcdf88f62b0 54 */
<> 128:9bcdf88f62b0 55
<> 128:9bcdf88f62b0 56 #ifndef __STM32F1XX_H
<> 128:9bcdf88f62b0 57 #define __STM32F1XX_H
<> 128:9bcdf88f62b0 58
<> 128:9bcdf88f62b0 59 #ifdef __cplusplus
<> 128:9bcdf88f62b0 60 extern "C" {
<> 128:9bcdf88f62b0 61 #endif /* __cplusplus */
<> 128:9bcdf88f62b0 62
<> 128:9bcdf88f62b0 63 /** @addtogroup Library_configuration_section
<> 128:9bcdf88f62b0 64 * @{
<> 128:9bcdf88f62b0 65 */
<> 128:9bcdf88f62b0 66
<> 128:9bcdf88f62b0 67 /**
<> 128:9bcdf88f62b0 68 * @brief STM32 Family
<> 128:9bcdf88f62b0 69 */
<> 128:9bcdf88f62b0 70 #if !defined (STM32F1)
<> 128:9bcdf88f62b0 71 #define STM32F1
<> 128:9bcdf88f62b0 72 #endif /* STM32F1 */
<> 128:9bcdf88f62b0 73
<> 128:9bcdf88f62b0 74 /* Uncomment the line below according to the target STM32L device used in your
<> 128:9bcdf88f62b0 75 application
<> 128:9bcdf88f62b0 76 */
<> 128:9bcdf88f62b0 77
<> 128:9bcdf88f62b0 78 #if !defined (STM32F100xB) && !defined (STM32F100xE) && !defined (STM32F101x6) && \
<> 128:9bcdf88f62b0 79 !defined (STM32F101xB) && !defined (STM32F101xE) && !defined (STM32F101xG) && !defined (STM32F102x6) && !defined (STM32F102xB) && !defined (STM32F103x6) && \
<> 128:9bcdf88f62b0 80 !defined (STM32F103xB) && !defined (STM32F103xE) && !defined (STM32F103xG) && !defined (STM32F105xC) && !defined (STM32F107xC)
<> 128:9bcdf88f62b0 81 /* #define STM32F100xB */ /*!< STM32F100C4, STM32F100R4, STM32F100C6, STM32F100R6, STM32F100C8, STM32F100R8, STM32F100V8, STM32F100CB, STM32F100RB and STM32F100VB */
<> 128:9bcdf88f62b0 82 /* #define STM32F100xE */ /*!< STM32F100RC, STM32F100VC, STM32F100ZC, STM32F100RD, STM32F100VD, STM32F100ZD, STM32F100RE, STM32F100VE and STM32F100ZE */
<> 128:9bcdf88f62b0 83 /* #define STM32F101x6 */ /*!< STM32F101C4, STM32F101R4, STM32F101T4, STM32F101C6, STM32F101R6 and STM32F101T6 Devices */
<> 128:9bcdf88f62b0 84 /* #define STM32F101xB */ /*!< STM32F101C8, STM32F101R8, STM32F101T8, STM32F101V8, STM32F101CB, STM32F101RB, STM32F101TB and STM32F101VB */
<> 128:9bcdf88f62b0 85 /* #define STM32F101xE */ /*!< STM32F101RC, STM32F101VC, STM32F101ZC, STM32F101RD, STM32F101VD, STM32F101ZD, STM32F101RE, STM32F101VE and STM32F101ZE */
<> 128:9bcdf88f62b0 86 /* #define STM32F101xG */ /*!< STM32F101RF, STM32F101VF, STM32F101ZF, STM32F101RG, STM32F101VG and STM32F101ZG */
<> 128:9bcdf88f62b0 87 /* #define STM32F102x6 */ /*!< STM32F102C4, STM32F102R4, STM32F102C6 and STM32F102R6 */
<> 128:9bcdf88f62b0 88 /* #define STM32F102xB */ /*!< STM32F102C8, STM32F102R8, STM32F102CB and STM32F102RB */
<> 128:9bcdf88f62b0 89 /* #define STM32F103x6 */ /*!< STM32F103C4, STM32F103R4, STM32F103T4, STM32F103C6, STM32F103R6 and STM32F103T6 */
<> 128:9bcdf88f62b0 90 #define STM32F103xB /*!< STM32F103C8, STM32F103R8, STM32F103T8, STM32F103V8, STM32F103CB, STM32F103RB, STM32F103TB and STM32F103VB */
<> 128:9bcdf88f62b0 91 /* #define STM32F103xE */ /*!< STM32F103RC, STM32F103VC, STM32F103ZC, STM32F103RD, STM32F103VD, STM32F103ZD, STM32F103RE, STM32F103VE and STM32F103ZE */
<> 128:9bcdf88f62b0 92 /* #define STM32F103xG */ /*!< STM32F103RF, STM32F103VF, STM32F103ZF, STM32F103RG, STM32F103VG and STM32F103ZG */
<> 128:9bcdf88f62b0 93 /* #define STM32F105xC */ /*!< STM32F105R8, STM32F105V8, STM32F105RB, STM32F105VB, STM32F105RC and STM32F105VC */
<> 128:9bcdf88f62b0 94 /* #define STM32F107xC */ /*!< STM32F107RB, STM32F107VB, STM32F107RC and STM32F107VC */
<> 128:9bcdf88f62b0 95 #endif
<> 128:9bcdf88f62b0 96
<> 128:9bcdf88f62b0 97 /* Tip: To avoid modifying this file each time you need to switch between these
<> 128:9bcdf88f62b0 98 devices, you can define the device in your toolchain compiler preprocessor.
<> 128:9bcdf88f62b0 99 */
<> 128:9bcdf88f62b0 100
<> 128:9bcdf88f62b0 101 #if !defined (USE_HAL_DRIVER)
<> 128:9bcdf88f62b0 102 /**
<> 128:9bcdf88f62b0 103 * @brief Comment the line below if you will not use the peripherals drivers.
<> 128:9bcdf88f62b0 104 In this case, these drivers will not be included and the application code will
<> 128:9bcdf88f62b0 105 be based on direct access to peripherals registers
<> 128:9bcdf88f62b0 106 */
<> 128:9bcdf88f62b0 107 #define USE_HAL_DRIVER
<> 128:9bcdf88f62b0 108 #endif /* USE_HAL_DRIVER */
<> 128:9bcdf88f62b0 109
<> 128:9bcdf88f62b0 110 /**
<> 128:9bcdf88f62b0 111 * @brief CMSIS Device version number V4.0.0
<> 128:9bcdf88f62b0 112 */
<> 128:9bcdf88f62b0 113 #define __STM32F1_CMSIS_VERSION_MAIN (0x04) /*!< [31:24] main version */
<> 128:9bcdf88f62b0 114 #define __STM32F1_CMSIS_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */
<> 128:9bcdf88f62b0 115 #define __STM32F1_CMSIS_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
<> 128:9bcdf88f62b0 116 #define __STM32F1_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
<> 128:9bcdf88f62b0 117 #define __STM32F1_CMSIS_VERSION ((__STM32F1_CMSIS_VERSION_MAIN << 24)\
<> 128:9bcdf88f62b0 118 |(__STM32F1_CMSIS_VERSION_SUB1 << 16)\
<> 128:9bcdf88f62b0 119 |(__STM32F1_CMSIS_VERSION_SUB2 << 8 )\
<> 128:9bcdf88f62b0 120 |(__STM32F1_CMSIS_VERSION_RC))
<> 128:9bcdf88f62b0 121
<> 128:9bcdf88f62b0 122 /**
<> 128:9bcdf88f62b0 123 * @}
<> 128:9bcdf88f62b0 124 */
<> 128:9bcdf88f62b0 125
<> 128:9bcdf88f62b0 126 /** @addtogroup Device_Included
<> 128:9bcdf88f62b0 127 * @{
<> 128:9bcdf88f62b0 128 */
<> 128:9bcdf88f62b0 129
<> 128:9bcdf88f62b0 130 #if defined(STM32F100xB)
<> 128:9bcdf88f62b0 131 #include "stm32f100xb.h"
<> 128:9bcdf88f62b0 132 #elif defined(STM32F100xE)
<> 128:9bcdf88f62b0 133 #include "stm32f100xe.h"
<> 128:9bcdf88f62b0 134 #elif defined(STM32F101x6)
<> 128:9bcdf88f62b0 135 #include "stm32f101x6.h"
<> 128:9bcdf88f62b0 136 #elif defined(STM32F101xB)
<> 128:9bcdf88f62b0 137 #include "stm32f101xb.h"
<> 128:9bcdf88f62b0 138 #elif defined(STM32F101xE)
<> 128:9bcdf88f62b0 139 #include "stm32f101xe.h"
<> 128:9bcdf88f62b0 140 #elif defined(STM32F101xG)
<> 128:9bcdf88f62b0 141 #include "stm32f101xg.h"
<> 128:9bcdf88f62b0 142 #elif defined(STM32F102x6)
<> 128:9bcdf88f62b0 143 #include "stm32f102x6.h"
<> 128:9bcdf88f62b0 144 #elif defined(STM32F102xB)
<> 128:9bcdf88f62b0 145 #include "stm32f102xb.h"
<> 128:9bcdf88f62b0 146 #elif defined(STM32F103x6)
<> 128:9bcdf88f62b0 147 #include "stm32f103x6.h"
<> 128:9bcdf88f62b0 148 #elif defined(STM32F103xB)
<> 128:9bcdf88f62b0 149 #include "stm32f103xb.h"
<> 128:9bcdf88f62b0 150 #elif defined(STM32F103xE)
<> 128:9bcdf88f62b0 151 #include "stm32f103xe.h"
<> 128:9bcdf88f62b0 152 #elif defined(STM32F103xG)
<> 128:9bcdf88f62b0 153 #include "stm32f103xg.h"
<> 128:9bcdf88f62b0 154 #elif defined(STM32F105xC)
<> 128:9bcdf88f62b0 155 #include "stm32f105xc.h"
<> 128:9bcdf88f62b0 156 #elif defined(STM32F107xC)
<> 128:9bcdf88f62b0 157 #include "stm32f107xc.h"
<> 128:9bcdf88f62b0 158 #else
<> 128:9bcdf88f62b0 159 #error "Please select first the target STM32F1xx device used in your application (in stm32f1xx.h file)"
<> 128:9bcdf88f62b0 160 #endif
<> 128:9bcdf88f62b0 161
<> 128:9bcdf88f62b0 162 /**
<> 128:9bcdf88f62b0 163 * @}
<> 128:9bcdf88f62b0 164 */
<> 128:9bcdf88f62b0 165
<> 128:9bcdf88f62b0 166 /** @addtogroup Exported_types
<> 128:9bcdf88f62b0 167 * @{
<> 128:9bcdf88f62b0 168 */
<> 128:9bcdf88f62b0 169 typedef enum
<> 128:9bcdf88f62b0 170 {
<> 128:9bcdf88f62b0 171 RESET = 0,
<> 128:9bcdf88f62b0 172 SET = !RESET
<> 128:9bcdf88f62b0 173 } FlagStatus, ITStatus;
<> 128:9bcdf88f62b0 174
<> 128:9bcdf88f62b0 175 typedef enum
<> 128:9bcdf88f62b0 176 {
<> 128:9bcdf88f62b0 177 DISABLE = 0,
<> 128:9bcdf88f62b0 178 ENABLE = !DISABLE
<> 128:9bcdf88f62b0 179 } FunctionalState;
<> 128:9bcdf88f62b0 180 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
<> 128:9bcdf88f62b0 181
<> 128:9bcdf88f62b0 182 typedef enum
<> 128:9bcdf88f62b0 183 {
<> 128:9bcdf88f62b0 184 ERROR = 0,
<> 128:9bcdf88f62b0 185 SUCCESS = !ERROR
<> 128:9bcdf88f62b0 186 } ErrorStatus;
<> 128:9bcdf88f62b0 187
<> 128:9bcdf88f62b0 188 /**
<> 128:9bcdf88f62b0 189 * @}
<> 128:9bcdf88f62b0 190 */
<> 128:9bcdf88f62b0 191
<> 128:9bcdf88f62b0 192
<> 128:9bcdf88f62b0 193 /** @addtogroup Exported_macros
<> 128:9bcdf88f62b0 194 * @{
<> 128:9bcdf88f62b0 195 */
<> 128:9bcdf88f62b0 196 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
<> 128:9bcdf88f62b0 197
<> 128:9bcdf88f62b0 198 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
<> 128:9bcdf88f62b0 199
<> 128:9bcdf88f62b0 200 #define READ_BIT(REG, BIT) ((REG) & (BIT))
<> 128:9bcdf88f62b0 201
<> 128:9bcdf88f62b0 202 #define CLEAR_REG(REG) ((REG) = (0x0))
<> 128:9bcdf88f62b0 203
<> 128:9bcdf88f62b0 204 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
<> 128:9bcdf88f62b0 205
<> 128:9bcdf88f62b0 206 #define READ_REG(REG) ((REG))
<> 128:9bcdf88f62b0 207
<> 128:9bcdf88f62b0 208 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
<> 128:9bcdf88f62b0 209
<> 128:9bcdf88f62b0 210 #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
<> 128:9bcdf88f62b0 211
<> 128:9bcdf88f62b0 212
<> 128:9bcdf88f62b0 213 /**
<> 128:9bcdf88f62b0 214 * @}
<> 128:9bcdf88f62b0 215 */
<> 128:9bcdf88f62b0 216
<> 128:9bcdf88f62b0 217 #if defined (USE_HAL_DRIVER)
<> 128:9bcdf88f62b0 218 #include "stm32f1xx_hal.h"
<> 128:9bcdf88f62b0 219 #endif /* USE_HAL_DRIVER */
<> 128:9bcdf88f62b0 220
<> 128:9bcdf88f62b0 221
<> 128:9bcdf88f62b0 222 #ifdef __cplusplus
<> 128:9bcdf88f62b0 223 }
<> 128:9bcdf88f62b0 224 #endif /* __cplusplus */
<> 128:9bcdf88f62b0 225
<> 128:9bcdf88f62b0 226 #endif /* __STM32F1xx_H */
<> 128:9bcdf88f62b0 227 /**
<> 128:9bcdf88f62b0 228 * @}
<> 128:9bcdf88f62b0 229 */
<> 128:9bcdf88f62b0 230
<> 128:9bcdf88f62b0 231 /**
<> 128:9bcdf88f62b0 232 * @}
<> 128:9bcdf88f62b0 233 */
<> 128:9bcdf88f62b0 234
<> 128:9bcdf88f62b0 235
<> 128:9bcdf88f62b0 236
<> 128:9bcdf88f62b0 237
<> 128:9bcdf88f62b0 238 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/