cc y / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
116:c0f6e94411f5
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 115:87f2f5183dfb 1 /**
Kojto 115:87f2f5183dfb 2 ******************************************************************************
Kojto 115:87f2f5183dfb 3 * @file stm32f7xx.h
Kojto 115:87f2f5183dfb 4 * @author MCD Application Team
Kojto 122:f9eeca106725 5 * @version V1.1.0
Kojto 122:f9eeca106725 6 * @date 22-April-2016
Kojto 115:87f2f5183dfb 7 * @brief CMSIS STM32F7xx Device Peripheral Access Layer Header File.
Kojto 115:87f2f5183dfb 8 *
Kojto 115:87f2f5183dfb 9 * The file is the unique include file that the application programmer
Kojto 115:87f2f5183dfb 10 * is using in the C source code, usually in main.c. This file contains:
Kojto 115:87f2f5183dfb 11 * - Configuration section that allows to select:
Kojto 115:87f2f5183dfb 12 * - The STM32F7xx device used in the target application
Kojto 115:87f2f5183dfb 13 * - To use or not the peripheral’s drivers in application code(i.e.
Kojto 115:87f2f5183dfb 14 * code will be based on direct access to peripheral’s registers
Kojto 115:87f2f5183dfb 15 * rather than drivers API), this option is controlled by
Kojto 115:87f2f5183dfb 16 * "#define USE_HAL_DRIVER"
Kojto 115:87f2f5183dfb 17 *
Kojto 115:87f2f5183dfb 18 ******************************************************************************
Kojto 115:87f2f5183dfb 19 * @attention
Kojto 115:87f2f5183dfb 20 *
Kojto 116:c0f6e94411f5 21 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 115:87f2f5183dfb 22 *
Kojto 115:87f2f5183dfb 23 * Redistribution and use in source and binary forms, with or without modification,
Kojto 115:87f2f5183dfb 24 * are permitted provided that the following conditions are met:
Kojto 115:87f2f5183dfb 25 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 115:87f2f5183dfb 26 * this list of conditions and the following disclaimer.
Kojto 115:87f2f5183dfb 27 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 115:87f2f5183dfb 28 * this list of conditions and the following disclaimer in the documentation
Kojto 115:87f2f5183dfb 29 * and/or other materials provided with the distribution.
Kojto 115:87f2f5183dfb 30 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 115:87f2f5183dfb 31 * may be used to endorse or promote products derived from this software
Kojto 115:87f2f5183dfb 32 * without specific prior written permission.
Kojto 115:87f2f5183dfb 33 *
Kojto 115:87f2f5183dfb 34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 115:87f2f5183dfb 35 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 115:87f2f5183dfb 36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 115:87f2f5183dfb 37 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 115:87f2f5183dfb 38 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 115:87f2f5183dfb 39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 115:87f2f5183dfb 40 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 115:87f2f5183dfb 41 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 115:87f2f5183dfb 42 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 115:87f2f5183dfb 43 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 115:87f2f5183dfb 44 *
Kojto 115:87f2f5183dfb 45 ******************************************************************************
Kojto 115:87f2f5183dfb 46 */
Kojto 115:87f2f5183dfb 47
Kojto 115:87f2f5183dfb 48 /** @addtogroup CMSIS
Kojto 115:87f2f5183dfb 49 * @{
Kojto 115:87f2f5183dfb 50 */
Kojto 115:87f2f5183dfb 51
Kojto 115:87f2f5183dfb 52 /** @addtogroup stm32f7xx
Kojto 115:87f2f5183dfb 53 * @{
Kojto 115:87f2f5183dfb 54 */
Kojto 115:87f2f5183dfb 55
Kojto 115:87f2f5183dfb 56 #ifndef __STM32F7xx_H
Kojto 115:87f2f5183dfb 57 #define __STM32F7xx_H
Kojto 115:87f2f5183dfb 58
Kojto 115:87f2f5183dfb 59 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 60 extern "C" {
Kojto 115:87f2f5183dfb 61 #endif /* __cplusplus */
Kojto 115:87f2f5183dfb 62
Kojto 115:87f2f5183dfb 63 /** @addtogroup Library_configuration_section
Kojto 115:87f2f5183dfb 64 * @{
Kojto 115:87f2f5183dfb 65 */
Kojto 115:87f2f5183dfb 66
Kojto 115:87f2f5183dfb 67 /**
Kojto 115:87f2f5183dfb 68 * @brief STM32 Family
Kojto 115:87f2f5183dfb 69 */
Kojto 115:87f2f5183dfb 70 #if !defined (STM32F7)
Kojto 115:87f2f5183dfb 71 #define STM32F7
Kojto 115:87f2f5183dfb 72 #endif /* STM32F7 */
Kojto 115:87f2f5183dfb 73
Kojto 115:87f2f5183dfb 74 /* Uncomment the line below according to the target STM32 device used in your
Kojto 115:87f2f5183dfb 75 application
Kojto 115:87f2f5183dfb 76 */
Kojto 122:f9eeca106725 77 #if !defined (STM32F756xx) && !defined (STM32F746xx) && !defined (STM32F745xx) && !defined (STM32F767xx) && \
Kojto 122:f9eeca106725 78 !defined (STM32F769xx) && !defined (STM32F777xx) && !defined (STM32F779xx)
Kojto 115:87f2f5183dfb 79 /* #define STM32F756xx */ /*!< STM32F756VG, STM32F756ZG, STM32F756ZG, STM32F756IG, STM32F756BG,
Kojto 115:87f2f5183dfb 80 STM32F756NG Devices */
Kojto 115:87f2f5183dfb 81 #define STM32F746xx /*!< STM32F746VE, STM32F746VG, STM32F746ZE, STM32F746ZG, STM32F746IE, STM32F746IG,
Kojto 115:87f2f5183dfb 82 STM32F746BE, STM32F746BG, STM32F746NE, STM32F746NG Devices */
Kojto 115:87f2f5183dfb 83 /* #define STM32F745xx */ /*!< STM32F745VE, STM32F745VG, STM32F745ZG, STM32F745ZE, STM32F745IE, STM32F745IG Devices */
Kojto 122:f9eeca106725 84 /* #define STM32F765xx */ /*!< STM32F765BI, STM32F765BG, STM32F765NI, STM32F765NG, STM32F765II, STM32F765IG,
Kojto 122:f9eeca106725 85 STM32F765ZI, STM32F765ZG, STM32F765VI, STM32F765VG Devices */
Kojto 122:f9eeca106725 86 /* #define STM32F767xx */ /*!< STM32F767BG, STM32F767BI, STM32F767IG, STM32F767II, STM32F767NG, STM32F767NI,
Kojto 122:f9eeca106725 87 STM32F767VG, STM32F767VI, STM32F767ZG, STM32F767ZI, STM32F768AI Devices */
Kojto 122:f9eeca106725 88 /* #define STM32F769xx */ /*!< STM32F769AG, STM32F769AI, STM32F769BG, STM32F769BI, STM32F769IG, STM32F769II,
Kojto 122:f9eeca106725 89 STM32F769NG, STM32F769NI Devices */
Kojto 122:f9eeca106725 90 /* #define STM32F777xx */ /*!< STM32F777VI, STM32F777ZI, STM32F777II, STM32F777BI, STM32F777NI, STM32F778AI Devices */
Kojto 122:f9eeca106725 91 /* #define STM32F779xx */ /*!< STM32F779II, STM32F779BI, STM32F779NI, STM32F779AI Devices */
Kojto 115:87f2f5183dfb 92 #endif
Kojto 115:87f2f5183dfb 93
Kojto 115:87f2f5183dfb 94 /* Tip: To avoid modifying this file each time you need to switch between these
Kojto 115:87f2f5183dfb 95 devices, you can define the device in your toolchain compiler preprocessor.
Kojto 115:87f2f5183dfb 96 */
Kojto 115:87f2f5183dfb 97
Kojto 115:87f2f5183dfb 98 #if !defined (USE_HAL_DRIVER)
Kojto 115:87f2f5183dfb 99 /**
Kojto 115:87f2f5183dfb 100 * @brief Comment the line below if you will not use the peripherals drivers.
Kojto 115:87f2f5183dfb 101 In this case, these drivers will not be included and the application code will
Kojto 115:87f2f5183dfb 102 be based on direct access to peripherals registers
Kojto 115:87f2f5183dfb 103 */
Kojto 115:87f2f5183dfb 104 #define USE_HAL_DRIVER
Kojto 115:87f2f5183dfb 105 #endif /* USE_HAL_DRIVER */
Kojto 115:87f2f5183dfb 106
Kojto 115:87f2f5183dfb 107 /**
Kojto 122:f9eeca106725 108 * @brief CMSIS Device version number V1.1.0
Kojto 115:87f2f5183dfb 109 */
Kojto 122:f9eeca106725 110 #define __STM32F7_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */
Kojto 122:f9eeca106725 111 #define __STM32F7_CMSIS_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */
Kojto 122:f9eeca106725 112 #define __STM32F7_CMSIS_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
Kojto 122:f9eeca106725 113 #define __STM32F7_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
Kojto 122:f9eeca106725 114 #define __STM32F7_CMSIS_VERSION ((__STM32F7_CMSIS_VERSION_MAIN << 24)\
Kojto 122:f9eeca106725 115 |(__STM32F7_CMSIS_VERSION_SUB1 << 16)\
Kojto 122:f9eeca106725 116 |(__STM32F7_CMSIS_VERSION_SUB2 << 8 )\
Kojto 122:f9eeca106725 117 |(__STM32F7_CMSIS_VERSION))
Kojto 115:87f2f5183dfb 118 /**
Kojto 115:87f2f5183dfb 119 * @}
Kojto 115:87f2f5183dfb 120 */
Kojto 115:87f2f5183dfb 121
Kojto 115:87f2f5183dfb 122 /** @addtogroup Device_Included
Kojto 115:87f2f5183dfb 123 * @{
Kojto 115:87f2f5183dfb 124 */
Kojto 115:87f2f5183dfb 125 #if defined(STM32F756xx)
Kojto 115:87f2f5183dfb 126 #include "stm32f756xx.h"
Kojto 115:87f2f5183dfb 127 #elif defined(STM32F746xx)
Kojto 115:87f2f5183dfb 128 #include "stm32f746xx.h"
Kojto 115:87f2f5183dfb 129 #elif defined(STM32F745xx)
Kojto 115:87f2f5183dfb 130 #include "stm32f745xx.h"
Kojto 122:f9eeca106725 131 #elif defined(STM32F765xx)
Kojto 122:f9eeca106725 132 #include "stm32f765xx.h"
Kojto 122:f9eeca106725 133 #elif defined(STM32F767xx)
Kojto 122:f9eeca106725 134 #include "stm32f767xx.h"
Kojto 122:f9eeca106725 135 #elif defined(STM32F769xx)
Kojto 122:f9eeca106725 136 #include "stm32f769xx.h"
Kojto 122:f9eeca106725 137 #elif defined(STM32F777xx)
Kojto 122:f9eeca106725 138 #include "stm32f777xx.h"
Kojto 122:f9eeca106725 139 #elif defined(STM32F779xx)
Kojto 122:f9eeca106725 140 #include "stm32f779xx.h"
Kojto 115:87f2f5183dfb 141 #else
Kojto 115:87f2f5183dfb 142 #error "Please select first the target STM32F7xx device used in your application (in stm32f7xx.h file)"
Kojto 115:87f2f5183dfb 143 #endif
Kojto 115:87f2f5183dfb 144
Kojto 115:87f2f5183dfb 145 /**
Kojto 115:87f2f5183dfb 146 * @}
Kojto 115:87f2f5183dfb 147 */
Kojto 115:87f2f5183dfb 148
Kojto 115:87f2f5183dfb 149 /** @addtogroup Exported_types
Kojto 115:87f2f5183dfb 150 * @{
Kojto 115:87f2f5183dfb 151 */
Kojto 115:87f2f5183dfb 152 typedef enum
Kojto 115:87f2f5183dfb 153 {
Kojto 115:87f2f5183dfb 154 RESET = 0,
Kojto 115:87f2f5183dfb 155 SET = !RESET
Kojto 115:87f2f5183dfb 156 } FlagStatus, ITStatus;
Kojto 115:87f2f5183dfb 157
Kojto 115:87f2f5183dfb 158 typedef enum
Kojto 115:87f2f5183dfb 159 {
Kojto 115:87f2f5183dfb 160 DISABLE = 0,
Kojto 115:87f2f5183dfb 161 ENABLE = !DISABLE
Kojto 115:87f2f5183dfb 162 } FunctionalState;
Kojto 115:87f2f5183dfb 163 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
Kojto 115:87f2f5183dfb 164
Kojto 115:87f2f5183dfb 165 typedef enum
Kojto 115:87f2f5183dfb 166 {
Kojto 115:87f2f5183dfb 167 ERROR = 0,
Kojto 115:87f2f5183dfb 168 SUCCESS = !ERROR
Kojto 115:87f2f5183dfb 169 } ErrorStatus;
Kojto 115:87f2f5183dfb 170
Kojto 115:87f2f5183dfb 171 /**
Kojto 115:87f2f5183dfb 172 * @}
Kojto 115:87f2f5183dfb 173 */
Kojto 115:87f2f5183dfb 174
Kojto 115:87f2f5183dfb 175 /** @addtogroup Exported_macro
Kojto 115:87f2f5183dfb 176 * @{
Kojto 115:87f2f5183dfb 177 */
Kojto 115:87f2f5183dfb 178 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
Kojto 115:87f2f5183dfb 179
Kojto 115:87f2f5183dfb 180 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
Kojto 115:87f2f5183dfb 181
Kojto 115:87f2f5183dfb 182 #define READ_BIT(REG, BIT) ((REG) & (BIT))
Kojto 115:87f2f5183dfb 183
Kojto 115:87f2f5183dfb 184 #define CLEAR_REG(REG) ((REG) = (0x0))
Kojto 115:87f2f5183dfb 185
Kojto 115:87f2f5183dfb 186 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
Kojto 115:87f2f5183dfb 187
Kojto 115:87f2f5183dfb 188 #define READ_REG(REG) ((REG))
Kojto 115:87f2f5183dfb 189
Kojto 115:87f2f5183dfb 190 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
Kojto 115:87f2f5183dfb 191
Kojto 115:87f2f5183dfb 192 #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
Kojto 115:87f2f5183dfb 193
Kojto 115:87f2f5183dfb 194 /**
Kojto 115:87f2f5183dfb 195 * @}
Kojto 115:87f2f5183dfb 196 */
Kojto 115:87f2f5183dfb 197
Kojto 115:87f2f5183dfb 198 #ifdef USE_HAL_DRIVER
Kojto 115:87f2f5183dfb 199 #include "stm32f7xx_hal_conf.h"
Kojto 115:87f2f5183dfb 200 #endif /* USE_HAL_DRIVER */
Kojto 115:87f2f5183dfb 201
Kojto 115:87f2f5183dfb 202 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 203 }
Kojto 115:87f2f5183dfb 204 #endif /* __cplusplus */
Kojto 115:87f2f5183dfb 205
Kojto 115:87f2f5183dfb 206 #endif /* __STM32F7xx_H */
Kojto 115:87f2f5183dfb 207
Kojto 115:87f2f5183dfb 208 /**
Kojto 115:87f2f5183dfb 209 * @}
Kojto 115:87f2f5183dfb 210 */
Kojto 115:87f2f5183dfb 211
Kojto 115:87f2f5183dfb 212 /**
Kojto 115:87f2f5183dfb 213 * @}
Kojto 115:87f2f5183dfb 214 */
Kojto 115:87f2f5183dfb 215
Kojto 115:87f2f5183dfb 216 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/