mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
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 122:f9eeca106725 1 /**
Kojto 122:f9eeca106725 2 ******************************************************************************
Kojto 122:f9eeca106725 3 * @file stm32l4xx.h
Kojto 122:f9eeca106725 4 * @author MCD Application Team
Kojto 122:f9eeca106725 5 * @version V1.1.1
Kojto 122:f9eeca106725 6 * @date 29-April-2016
Kojto 122:f9eeca106725 7 * @brief CMSIS STM32L4xx Device Peripheral Access Layer Header File.
Kojto 122:f9eeca106725 8 *
Kojto 122:f9eeca106725 9 * The file is the unique include file that the application programmer
Kojto 122:f9eeca106725 10 * is using in the C source code, usually in main.c. This file contains:
Kojto 122:f9eeca106725 11 * - Configuration section that allows to select:
Kojto 122:f9eeca106725 12 * - The STM32L4xx device used in the target application
Kojto 122:f9eeca106725 13 * - To use or not the peripheral�s drivers in application code(i.e.
Kojto 122:f9eeca106725 14 * code will be based on direct access to peripheral�s registers
Kojto 122:f9eeca106725 15 * rather than drivers API), this option is controlled by
Kojto 122:f9eeca106725 16 * "#define USE_HAL_DRIVER"
Kojto 122:f9eeca106725 17 *
Kojto 122:f9eeca106725 18 ******************************************************************************
Kojto 122:f9eeca106725 19 * @attention
Kojto 122:f9eeca106725 20 *
Kojto 122:f9eeca106725 21 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 122:f9eeca106725 22 *
Kojto 122:f9eeca106725 23 * Redistribution and use in source and binary forms, with or without modification,
Kojto 122:f9eeca106725 24 * are permitted provided that the following conditions are met:
Kojto 122:f9eeca106725 25 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 122:f9eeca106725 26 * this list of conditions and the following disclaimer.
Kojto 122:f9eeca106725 27 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 122:f9eeca106725 28 * this list of conditions and the following disclaimer in the documentation
Kojto 122:f9eeca106725 29 * and/or other materials provided with the distribution.
Kojto 122:f9eeca106725 30 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 122:f9eeca106725 31 * may be used to endorse or promote products derived from this software
Kojto 122:f9eeca106725 32 * without specific prior written permission.
Kojto 122:f9eeca106725 33 *
Kojto 122:f9eeca106725 34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 122:f9eeca106725 35 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 122:f9eeca106725 36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 122:f9eeca106725 37 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 122:f9eeca106725 38 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 122:f9eeca106725 39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 122:f9eeca106725 40 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 122:f9eeca106725 41 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 122:f9eeca106725 42 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 122:f9eeca106725 43 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 122:f9eeca106725 44 *
Kojto 122:f9eeca106725 45 ******************************************************************************
Kojto 122:f9eeca106725 46 */
Kojto 122:f9eeca106725 47
Kojto 122:f9eeca106725 48 /** @addtogroup CMSIS
Kojto 122:f9eeca106725 49 * @{
Kojto 122:f9eeca106725 50 */
Kojto 122:f9eeca106725 51
Kojto 122:f9eeca106725 52 /** @addtogroup stm32l4xx
Kojto 122:f9eeca106725 53 * @{
Kojto 122:f9eeca106725 54 */
Kojto 122:f9eeca106725 55
Kojto 122:f9eeca106725 56 #ifndef __STM32L4xx_H
Kojto 122:f9eeca106725 57 #define __STM32L4xx_H
Kojto 122:f9eeca106725 58
Kojto 122:f9eeca106725 59 #ifdef __cplusplus
Kojto 122:f9eeca106725 60 extern "C" {
Kojto 122:f9eeca106725 61 #endif /* __cplusplus */
Kojto 122:f9eeca106725 62
Kojto 122:f9eeca106725 63 /** @addtogroup Library_configuration_section
Kojto 122:f9eeca106725 64 * @{
Kojto 122:f9eeca106725 65 */
Kojto 122:f9eeca106725 66
Kojto 122:f9eeca106725 67 /**
Kojto 122:f9eeca106725 68 * @brief STM32 Family
Kojto 122:f9eeca106725 69 */
Kojto 122:f9eeca106725 70 #if !defined (STM32L4)
Kojto 122:f9eeca106725 71 #define STM32L4
Kojto 122:f9eeca106725 72 #endif /* STM32L4 */
Kojto 122:f9eeca106725 73
Kojto 122:f9eeca106725 74 /* Uncomment the line below according to the target STM32L4 device used in your
Kojto 122:f9eeca106725 75 application
Kojto 122:f9eeca106725 76 */
Kojto 122:f9eeca106725 77
Kojto 122:f9eeca106725 78 #if !defined (STM32L431xx) && !defined (STM32L432xx) && !defined (STM32L433xx) && !defined (STM32L442xx) && !defined (STM32L443xx) && \
Kojto 122:f9eeca106725 79 !defined (STM32L471xx) && !defined (STM32L475xx) && !defined (STM32L476xx) && !defined (STM32L485xx) && !defined (STM32L486xx)
Kojto 122:f9eeca106725 80 /* #define STM32L431xx */ /*!< STM32L431xx Devices */
Kojto 122:f9eeca106725 81 #define STM32L432xx /*!< STM32L432xx Devices */
Kojto 122:f9eeca106725 82 /* #define STM32L433xx */ /*!< STM32L433xx Devices */
Kojto 122:f9eeca106725 83 /* #define STM32L442xx */ /*!< STM32L442xx Devices */
Kojto 122:f9eeca106725 84 /* #define STM32L443xx */ /*!< STM32L443xx Devices */
Kojto 122:f9eeca106725 85 /* #define STM32L471xx */ /*!< STM32L471xx Devices */
Kojto 122:f9eeca106725 86 /* #define STM32L475xx */ /*!< STM32L475xx Devices */
Kojto 122:f9eeca106725 87 /* #define STM32L476xx */ /*!< STM32L476xx Devices */
Kojto 122:f9eeca106725 88 /* #define STM32L485xx */ /*!< STM32L485xx Devices */
Kojto 122:f9eeca106725 89 /* #define STM32L486xx */ /*!< STM32L486xx Devices */
Kojto 122:f9eeca106725 90 #endif
Kojto 122:f9eeca106725 91
Kojto 122:f9eeca106725 92 /* Tip: To avoid modifying this file each time you need to switch between these
Kojto 122:f9eeca106725 93 devices, you can define the device in your toolchain compiler preprocessor.
Kojto 122:f9eeca106725 94 */
Kojto 122:f9eeca106725 95 #if !defined (USE_HAL_DRIVER)
Kojto 122:f9eeca106725 96 /**
Kojto 122:f9eeca106725 97 * @brief Comment the line below if you will not use the peripherals drivers.
Kojto 122:f9eeca106725 98 In this case, these drivers will not be included and the application code will
Kojto 122:f9eeca106725 99 be based on direct access to peripherals registers
Kojto 122:f9eeca106725 100 */
Kojto 122:f9eeca106725 101 #define USE_HAL_DRIVER
Kojto 122:f9eeca106725 102 #endif /* USE_HAL_DRIVER */
Kojto 122:f9eeca106725 103
Kojto 122:f9eeca106725 104 /**
Kojto 122:f9eeca106725 105 * @brief CMSIS Device version number V1.1.1
Kojto 122:f9eeca106725 106 */
Kojto 122:f9eeca106725 107 #define __STM32L4_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */
Kojto 122:f9eeca106725 108 #define __STM32L4_CMSIS_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */
Kojto 122:f9eeca106725 109 #define __STM32L4_CMSIS_VERSION_SUB2 (0x01) /*!< [15:8] sub2 version */
Kojto 122:f9eeca106725 110 #define __STM32L4_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
Kojto 122:f9eeca106725 111 #define __STM32L4_CMSIS_VERSION ((__STM32L4_CMSIS_VERSION_MAIN << 24)\
Kojto 122:f9eeca106725 112 |(__STM32L4_CMSIS_VERSION_SUB1 << 16)\
Kojto 122:f9eeca106725 113 |(__STM32L4_CMSIS_VERSION_SUB2 << 8 )\
Kojto 122:f9eeca106725 114 |(__STM32L4_CMSIS_VERSION_RC))
Kojto 122:f9eeca106725 115
Kojto 122:f9eeca106725 116 /**
Kojto 122:f9eeca106725 117 * @}
Kojto 122:f9eeca106725 118 */
Kojto 122:f9eeca106725 119
Kojto 122:f9eeca106725 120 /** @addtogroup Device_Included
Kojto 122:f9eeca106725 121 * @{
Kojto 122:f9eeca106725 122 */
Kojto 122:f9eeca106725 123
Kojto 122:f9eeca106725 124 #if defined(STM32L431xx)
Kojto 122:f9eeca106725 125 #include "stm32l431xx.h"
Kojto 122:f9eeca106725 126 #elif defined(STM32L432xx)
Kojto 122:f9eeca106725 127 #include "stm32l432xx.h"
Kojto 122:f9eeca106725 128 #elif defined(STM32L433xx)
Kojto 122:f9eeca106725 129 #include "stm32l433xx.h"
Kojto 122:f9eeca106725 130 #elif defined(STM32L442xx)
Kojto 122:f9eeca106725 131 #include "stm32l442xx.h"
Kojto 122:f9eeca106725 132 #elif defined(STM32L443xx)
Kojto 122:f9eeca106725 133 #include "stm32l443xx.h"
Kojto 122:f9eeca106725 134 #elif defined(STM32L451xx)
Kojto 122:f9eeca106725 135 #include "stm32l451xx.h"
Kojto 122:f9eeca106725 136 #elif defined(STM32L452xx)
Kojto 122:f9eeca106725 137 #include "stm32l452xx.h"
Kojto 122:f9eeca106725 138 #elif defined(STM32L462xx)
Kojto 122:f9eeca106725 139 #include "stm32l462xx.h"
Kojto 122:f9eeca106725 140 #elif defined(STM32L471xx)
Kojto 122:f9eeca106725 141 #include "stm32l471xx.h"
Kojto 122:f9eeca106725 142 #elif defined(STM32L475xx)
Kojto 122:f9eeca106725 143 #include "stm32l475xx.h"
Kojto 122:f9eeca106725 144 #elif defined(STM32L476xx)
Kojto 122:f9eeca106725 145 #include "stm32l476xx.h"
Kojto 122:f9eeca106725 146 #elif defined(STM32L485xx)
Kojto 122:f9eeca106725 147 #include "stm32l485xx.h"
Kojto 122:f9eeca106725 148 #elif defined(STM32L486xx)
Kojto 122:f9eeca106725 149 #include "stm32l486xx.h"
Kojto 122:f9eeca106725 150 #elif defined(STM32L496xx)
Kojto 122:f9eeca106725 151 #include "stm32l496xx.h"
Kojto 122:f9eeca106725 152 #elif defined(STM32L4A6xx)
Kojto 122:f9eeca106725 153 #include "stm32l4a6xx.h"
Kojto 122:f9eeca106725 154 #elif defined(STM32L4R5xx)
Kojto 122:f9eeca106725 155 #include "stm32l4r5xx.h"
Kojto 122:f9eeca106725 156 #elif defined(STM32L4R9xx)
Kojto 122:f9eeca106725 157 #include "stm32l4r9xx.h"
Kojto 122:f9eeca106725 158 #elif defined(STM32L4S5xx)
Kojto 122:f9eeca106725 159 #include "stm32l4s5xx.h"
Kojto 122:f9eeca106725 160 #elif defined(STM32L4S9xx)
Kojto 122:f9eeca106725 161 #include "stm32l4s9xx.h"
Kojto 122:f9eeca106725 162 #else
Kojto 122:f9eeca106725 163 #error "Please select first the target STM32L4xx device used in your application (in stm32l4xx.h file)"
Kojto 122:f9eeca106725 164 #endif
Kojto 122:f9eeca106725 165
Kojto 122:f9eeca106725 166 /**
Kojto 122:f9eeca106725 167 * @}
Kojto 122:f9eeca106725 168 */
Kojto 122:f9eeca106725 169
Kojto 122:f9eeca106725 170 /** @addtogroup Exported_types
Kojto 122:f9eeca106725 171 * @{
Kojto 122:f9eeca106725 172 */
Kojto 122:f9eeca106725 173 typedef enum
Kojto 122:f9eeca106725 174 {
Kojto 122:f9eeca106725 175 RESET = 0,
Kojto 122:f9eeca106725 176 SET = !RESET
Kojto 122:f9eeca106725 177 } FlagStatus, ITStatus;
Kojto 122:f9eeca106725 178
Kojto 122:f9eeca106725 179 typedef enum
Kojto 122:f9eeca106725 180 {
Kojto 122:f9eeca106725 181 DISABLE = 0,
Kojto 122:f9eeca106725 182 ENABLE = !DISABLE
Kojto 122:f9eeca106725 183 } FunctionalState;
Kojto 122:f9eeca106725 184 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
Kojto 122:f9eeca106725 185
Kojto 122:f9eeca106725 186 typedef enum
Kojto 122:f9eeca106725 187 {
Kojto 122:f9eeca106725 188 ERROR = 0,
Kojto 122:f9eeca106725 189 SUCCESS = !ERROR
Kojto 122:f9eeca106725 190 } ErrorStatus;
Kojto 122:f9eeca106725 191
Kojto 122:f9eeca106725 192 /**
Kojto 122:f9eeca106725 193 * @}
Kojto 122:f9eeca106725 194 */
Kojto 122:f9eeca106725 195
Kojto 122:f9eeca106725 196
Kojto 122:f9eeca106725 197 /** @addtogroup Exported_macros
Kojto 122:f9eeca106725 198 * @{
Kojto 122:f9eeca106725 199 */
Kojto 122:f9eeca106725 200 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
Kojto 122:f9eeca106725 201
Kojto 122:f9eeca106725 202 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
Kojto 122:f9eeca106725 203
Kojto 122:f9eeca106725 204 #define READ_BIT(REG, BIT) ((REG) & (BIT))
Kojto 122:f9eeca106725 205
Kojto 122:f9eeca106725 206 #define CLEAR_REG(REG) ((REG) = (0x0))
Kojto 122:f9eeca106725 207
Kojto 122:f9eeca106725 208 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
Kojto 122:f9eeca106725 209
Kojto 122:f9eeca106725 210 #define READ_REG(REG) ((REG))
Kojto 122:f9eeca106725 211
Kojto 122:f9eeca106725 212 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
Kojto 122:f9eeca106725 213
Kojto 122:f9eeca106725 214 #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
Kojto 122:f9eeca106725 215
Kojto 122:f9eeca106725 216
Kojto 122:f9eeca106725 217 /**
Kojto 122:f9eeca106725 218 * @}
Kojto 122:f9eeca106725 219 */
Kojto 122:f9eeca106725 220
Kojto 122:f9eeca106725 221 #if defined (USE_HAL_DRIVER)
Kojto 122:f9eeca106725 222 #include "stm32l4xx_hal.h"
Kojto 122:f9eeca106725 223 #endif /* USE_HAL_DRIVER */
Kojto 122:f9eeca106725 224
Kojto 122:f9eeca106725 225 #ifdef __cplusplus
Kojto 122:f9eeca106725 226 }
Kojto 122:f9eeca106725 227 #endif /* __cplusplus */
Kojto 122:f9eeca106725 228
Kojto 122:f9eeca106725 229 #endif /* __STM32L4xx_H */
Kojto 122:f9eeca106725 230 /**
Kojto 122:f9eeca106725 231 * @}
Kojto 122:f9eeca106725 232 */
Kojto 122:f9eeca106725 233
Kojto 122:f9eeca106725 234 /**
Kojto 122:f9eeca106725 235 * @}
Kojto 122:f9eeca106725 236 */
Kojto 122:f9eeca106725 237
Kojto 122:f9eeca106725 238
Kojto 122:f9eeca106725 239
Kojto 122:f9eeca106725 240
Kojto 122:f9eeca106725 241 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/