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:
Tue Feb 03 15:31:20 2015 +0000
Revision:
93:e188a91d3eaa
Parent:
92:4fc01daae5a5
Child:
108:34e6b704fe68
Release 93 of the mbed library

Main changes:

- Renesas RZ_A1H bugfixes - i2c, ticker
- new targets - Nucleo F303RE, Nucleo F070RB, BLE SMURFS,
Dragonfly 411RE,
- BusXXX - is connected method, plus operators addition
- LPC8xx - I2c fixes
- timestamp_t reverted to uint32_t
- RTX - fixes regarding stack (alignment, magic word)

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 93:e188a91d3eaa 5 * @version V2.2.0
Kojto 93:e188a91d3eaa 6 * @date 05-December-2014
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 *
bogdanm 85:024bf7f99721 21 * <h2><center>&copy; COPYRIGHT(c) 2014 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 */
bogdanm 85:024bf7f99721 66
bogdanm 85:024bf7f99721 67 /* Uncomment the line below according to the target STM32 device used in your
bogdanm 85:024bf7f99721 68 application
bogdanm 85:024bf7f99721 69 */
bogdanm 85:024bf7f99721 70
bogdanm 85:024bf7f99721 71 #if !defined (STM32F030x6) && !defined (STM32F030x8) && \
bogdanm 85:024bf7f99721 72 !defined (STM32F031x6) && !defined (STM32F038xx) && \
Kojto 93:e188a91d3eaa 73 !defined (STM32F042x6) && !defined (STM32F048xx) && !defined (STM32F070x6) && \
bogdanm 85:024bf7f99721 74 !defined (STM32F051x8) && !defined (STM32F058xx) && \
Kojto 93:e188a91d3eaa 75 !defined (STM32F071xB) && !defined (STM32F072xB) && !defined (STM32F078xx) && !defined (STM32F070xB) && \
Kojto 93:e188a91d3eaa 76 !defined (STM32F091xC) && !defined (STM32F098xx) && !defined (STM32F030xC)
bogdanm 85:024bf7f99721 77 /* #define STM32F030x6 */ /*!< STM32F030x4, STM32F030x6 Devices (STM32F030xx microcontrollers where the Flash memory ranges between 16 and 32 Kbytes) */
bogdanm 85:024bf7f99721 78 /* #define STM32F030x8 */ /*!< STM32F030x8 Devices (STM32F030xx microcontrollers where the Flash memory is 64 Kbytes) */
bogdanm 85:024bf7f99721 79 /* #define STM32F031x6 */ /*!< STM32F031x4, STM32F031x6 Devices (STM32F031xx microcontrollers where the Flash memory ranges between 16 and 32 Kbytes) */
bogdanm 85:024bf7f99721 80 /* #define STM32F038xx */ /*!< STM32F038xx Devices (STM32F038xx microcontrollers where the Flash memory is 32 Kbytes) */
bogdanm 85:024bf7f99721 81 /* #define STM32F042x6 */ /*!< STM32F042x4, STM32F042x6 Devices (STM32F042xx microcontrollers where the Flash memory ranges between 16 and 32 Kbytes) */
bogdanm 85:024bf7f99721 82 /* #define STM32F048x6 */ /*!< STM32F048xx Devices (STM32F042xx microcontrollers where the Flash memory is 32 Kbytes) */
bogdanm 85:024bf7f99721 83 /* #define STM32F051x8 */ /*!< STM32F051x4, STM32F051x6, STM32F051x8 Devices (STM32F051xx microcontrollers where the Flash memory ranges between 16 and 64 Kbytes) */
bogdanm 85:024bf7f99721 84 /* #define STM32F058xx */ /*!< STM32F058xx Devices (STM32F058xx microcontrollers where the Flash memory is 64 Kbytes) */
Kojto 93:e188a91d3eaa 85 /* #define STM32F070x6 */ /*!< STM32F070x6 Devices (STM32F070x6 microcontrollers where the Flash memory ranges between 16 and 32 Kbytes) */
Kojto 93:e188a91d3eaa 86 /* #define STM32F070xB */ /*!< STM32F070xB Devices (STM32F070xB microcontrollers where the Flash memory ranges between 64 and 128 Kbytes) */
bogdanm 85:024bf7f99721 87 /* #define STM32F071xB */ /*!< STM32F071x8, STM32F071xB Devices (STM32F071xx microcontrollers where the Flash memory ranges between 64 and 128 Kbytes) */
bogdanm 85:024bf7f99721 88 #define STM32F072xB /*!< STM32F072x8, STM32F072xB Devices (STM32F072xx microcontrollers where the Flash memory ranges between 64 and 128 Kbytes) */
bogdanm 85:024bf7f99721 89 /* #define STM32F078xx */ /*!< STM32F078xx Devices (STM32F078xx microcontrollers where the Flash memory is 128 Kbytes) */
Kojto 93:e188a91d3eaa 90 /* #define STM32F030xC */ /*!< STM32F030xC Devices (STM32F030xC microcontrollers where the Flash memory is 256 Kbytes) */
bogdanm 92:4fc01daae5a5 91 /* #define STM32F091xC */ /*!< STM32F091xC Devices (STM32F091xx microcontrollers where the Flash memory is 256 Kbytes) */
bogdanm 92:4fc01daae5a5 92 /* #define STM32F098xx */ /*!< STM32F098xx Devices (STM32F098xx microcontrollers where the Flash memory is 256 Kbytes) */
bogdanm 85:024bf7f99721 93 #endif
bogdanm 85:024bf7f99721 94
bogdanm 85:024bf7f99721 95 /* Tip: To avoid modifying this file each time you need to switch between these
bogdanm 85:024bf7f99721 96 devices, you can define the device in your toolchain compiler preprocessor.
bogdanm 85:024bf7f99721 97 */
bogdanm 85:024bf7f99721 98 #if !defined (USE_HAL_DRIVER)
bogdanm 85:024bf7f99721 99 /**
bogdanm 85:024bf7f99721 100 * @brief Comment the line below if you will not use the peripherals drivers.
bogdanm 85:024bf7f99721 101 In this case, these drivers will not be included and the application code will
bogdanm 85:024bf7f99721 102 be based on direct access to peripherals registers
bogdanm 85:024bf7f99721 103 */
bogdanm 85:024bf7f99721 104 #define USE_HAL_DRIVER
bogdanm 85:024bf7f99721 105 #endif /* USE_HAL_DRIVER */
bogdanm 85:024bf7f99721 106
bogdanm 85:024bf7f99721 107 /**
Kojto 93:e188a91d3eaa 108 * @brief CMSIS Device version number V2.2.0
bogdanm 85:024bf7f99721 109 */
bogdanm 85:024bf7f99721 110 #define __STM32F0xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */
Kojto 93:e188a91d3eaa 111 #define __STM32F0xx_CMSIS_DEVICE_VERSION_SUB1 (0x02) /*!< [23:16] sub1 version */
bogdanm 85:024bf7f99721 112 #define __STM32F0xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
bogdanm 85:024bf7f99721 113 #define __STM32F0xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
bogdanm 85:024bf7f99721 114 #define __STM32F0xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
bogdanm 85:024bf7f99721 115 |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
bogdanm 85:024bf7f99721 116 |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
bogdanm 85:024bf7f99721 117 |(__CMSIS_DEVICE_HAL_VERSION_RC))
bogdanm 85:024bf7f99721 118
bogdanm 85:024bf7f99721 119 /**
bogdanm 85:024bf7f99721 120 * @}
bogdanm 85:024bf7f99721 121 */
bogdanm 85:024bf7f99721 122
bogdanm 85:024bf7f99721 123 /** @addtogroup Device_Included
bogdanm 85:024bf7f99721 124 * @{
bogdanm 85:024bf7f99721 125 */
bogdanm 85:024bf7f99721 126
bogdanm 85:024bf7f99721 127 #if defined(STM32F030x6)
bogdanm 85:024bf7f99721 128 #include "stm32f030x6.h"
bogdanm 85:024bf7f99721 129 #elif defined(STM32F030x8)
bogdanm 85:024bf7f99721 130 #include "stm32f030x8.h"
bogdanm 85:024bf7f99721 131 #elif defined(STM32F031x6)
bogdanm 85:024bf7f99721 132 #include "stm32f031x6.h"
bogdanm 85:024bf7f99721 133 #elif defined(STM32F038xx)
bogdanm 85:024bf7f99721 134 #include "stm32f038xx.h"
bogdanm 85:024bf7f99721 135 #elif defined(STM32F042x6)
bogdanm 85:024bf7f99721 136 #include "stm32f042x6.h"
bogdanm 85:024bf7f99721 137 #elif defined(STM32F048xx)
bogdanm 85:024bf7f99721 138 #include "stm32f048xx.h"
bogdanm 85:024bf7f99721 139 #elif defined(STM32F051x8)
bogdanm 85:024bf7f99721 140 #include "stm32f051x8.h"
bogdanm 85:024bf7f99721 141 #elif defined(STM32F058xx)
bogdanm 85:024bf7f99721 142 #include "stm32f058xx.h"
Kojto 93:e188a91d3eaa 143 #elif defined(STM32F070x6)
Kojto 93:e188a91d3eaa 144 #include "stm32f070x6.h"
Kojto 93:e188a91d3eaa 145 #elif defined(STM32F070xB)
Kojto 93:e188a91d3eaa 146 #include "stm32f070xb.h"
bogdanm 85:024bf7f99721 147 #elif defined(STM32F071xB)
bogdanm 85:024bf7f99721 148 #include "stm32f071xb.h"
bogdanm 85:024bf7f99721 149 #elif defined(STM32F072xB)
bogdanm 85:024bf7f99721 150 #include "stm32f072xb.h"
bogdanm 85:024bf7f99721 151 #elif defined(STM32F078xx)
bogdanm 85:024bf7f99721 152 #include "stm32f078xx.h"
bogdanm 92:4fc01daae5a5 153 #elif defined(STM32F091xC)
bogdanm 92:4fc01daae5a5 154 #include "stm32f091xc.h"
bogdanm 92:4fc01daae5a5 155 #elif defined(STM32F098xx)
Kojto 93:e188a91d3eaa 156 #include "stm32f098xx.h"
Kojto 93:e188a91d3eaa 157 #elif defined(STM32F030xC)
Kojto 93:e188a91d3eaa 158 #include "stm32f030xc.h"
bogdanm 85:024bf7f99721 159 #else
bogdanm 85:024bf7f99721 160 #error "Please select first the target STM32F0xx device used in your application (in stm32f0xx.h file)"
bogdanm 85:024bf7f99721 161 #endif
bogdanm 85:024bf7f99721 162
bogdanm 85:024bf7f99721 163 /**
bogdanm 85:024bf7f99721 164 * @}
bogdanm 85:024bf7f99721 165 */
bogdanm 85:024bf7f99721 166
bogdanm 85:024bf7f99721 167 /** @addtogroup Exported_types
bogdanm 85:024bf7f99721 168 * @{
bogdanm 85:024bf7f99721 169 */
bogdanm 85:024bf7f99721 170 typedef enum
bogdanm 85:024bf7f99721 171 {
bogdanm 85:024bf7f99721 172 RESET = 0,
bogdanm 85:024bf7f99721 173 SET = !RESET
bogdanm 85:024bf7f99721 174 } FlagStatus, ITStatus;
bogdanm 85:024bf7f99721 175
bogdanm 85:024bf7f99721 176 typedef enum
bogdanm 85:024bf7f99721 177 {
bogdanm 85:024bf7f99721 178 DISABLE = 0,
bogdanm 85:024bf7f99721 179 ENABLE = !DISABLE
bogdanm 85:024bf7f99721 180 } FunctionalState;
bogdanm 85:024bf7f99721 181 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
bogdanm 85:024bf7f99721 182
bogdanm 85:024bf7f99721 183 typedef enum
bogdanm 85:024bf7f99721 184 {
bogdanm 85:024bf7f99721 185 ERROR = 0,
bogdanm 85:024bf7f99721 186 SUCCESS = !ERROR
bogdanm 85:024bf7f99721 187 } ErrorStatus;
bogdanm 85:024bf7f99721 188
bogdanm 85:024bf7f99721 189 /**
bogdanm 85:024bf7f99721 190 * @}
bogdanm 85:024bf7f99721 191 */
bogdanm 85:024bf7f99721 192
bogdanm 85:024bf7f99721 193
bogdanm 85:024bf7f99721 194 /** @addtogroup Exported_macros
bogdanm 85:024bf7f99721 195 * @{
bogdanm 85:024bf7f99721 196 */
bogdanm 85:024bf7f99721 197 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
bogdanm 85:024bf7f99721 198
bogdanm 85:024bf7f99721 199 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
bogdanm 85:024bf7f99721 200
bogdanm 85:024bf7f99721 201 #define READ_BIT(REG, BIT) ((REG) & (BIT))
bogdanm 85:024bf7f99721 202
bogdanm 85:024bf7f99721 203 #define CLEAR_REG(REG) ((REG) = (0x0))
bogdanm 85:024bf7f99721 204
bogdanm 85:024bf7f99721 205 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
bogdanm 85:024bf7f99721 206
bogdanm 85:024bf7f99721 207 #define READ_REG(REG) ((REG))
bogdanm 85:024bf7f99721 208
bogdanm 85:024bf7f99721 209 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
bogdanm 85:024bf7f99721 210
bogdanm 85:024bf7f99721 211
bogdanm 85:024bf7f99721 212 /**
bogdanm 85:024bf7f99721 213 * @}
bogdanm 85:024bf7f99721 214 */
bogdanm 85:024bf7f99721 215
bogdanm 85:024bf7f99721 216 #if defined (USE_HAL_DRIVER)
bogdanm 85:024bf7f99721 217 #include "stm32f0xx_hal.h"
bogdanm 85:024bf7f99721 218 #endif /* USE_HAL_DRIVER */
bogdanm 85:024bf7f99721 219
bogdanm 85:024bf7f99721 220
bogdanm 85:024bf7f99721 221 #ifdef __cplusplus
bogdanm 85:024bf7f99721 222 }
bogdanm 85:024bf7f99721 223 #endif /* __cplusplus */
bogdanm 85:024bf7f99721 224
bogdanm 85:024bf7f99721 225 #endif /* __STM32F0xx_H */
bogdanm 85:024bf7f99721 226 /**
bogdanm 85:024bf7f99721 227 * @}
bogdanm 85:024bf7f99721 228 */
bogdanm 85:024bf7f99721 229
bogdanm 85:024bf7f99721 230 /**
bogdanm 85:024bf7f99721 231 * @}
bogdanm 85:024bf7f99721 232 */
bogdanm 85:024bf7f99721 233
bogdanm 85:024bf7f99721 234
bogdanm 85:024bf7f99721 235
bogdanm 85:024bf7f99721 236
bogdanm 85:024bf7f99721 237 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/