The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
<>
Date:
Wed Apr 12 16:07:08 2017 +0100
Revision:
140:97feb9bacc10
Parent:
136:ef9c61f8c49f
Child:
145:64910690c574
Release 140 of the mbed library

Ports for Upcoming Targets

3841: Add nRf52840 target https://github.com/ARMmbed/mbed-os/pull/3841
3992: Introducing UBLOX_C030 platform. https://github.com/ARMmbed/mbed-os/pull/3992

Fixes and Changes

3951: [NUCLEO_F303ZE] Correct ARDUINO pin https://github.com/ARMmbed/mbed-os/pull/3951
4021: Fixing a macro to detect when RTOS was in use for the NRF52840_DK https://github.com/ARMmbed/mbed-os/pull/4021
3979: KW24D: Add missing SPI defines and Arduino connector definitions https://github.com/ARMmbed/mbed-os/pull/3979
3990: UBLOX_C027: construct a ticker-based wait, rather than calling wait_ms(), in the https://github.com/ARMmbed/mbed-os/pull/3990
4003: Fixed OBOE in async serial tx for NRF52 target, fixes #4002 https://github.com/ARMmbed/mbed-os/pull/4003
4012: STM32: Correct I2C master error handling https://github.com/ARMmbed/mbed-os/pull/4012
4020: NUCLEO_L011K4 remove unsupported tool chain files https://github.com/ARMmbed/mbed-os/pull/4020
4065: K66F: Move bss section to m_data_2 Section https://github.com/ARMmbed/mbed-os/pull/4065
4014: Issue 3763: Reduce heap allocation in the GCC linker file https://github.com/ARMmbed/mbed-os/pull/4014
4030: [STM32L0] reduce IAR heap and stack size for small targets https://github.com/ARMmbed/mbed-os/pull/4030
4109: NUCLEO_L476RG : minor serial pin update https://github.com/ARMmbed/mbed-os/pull/4109
3982: Ticker - kl25z bugfix for handling events in the past https://github.com/ARMmbed/mbed-os/pull/3982

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 128:9bcdf88f62b0 1 /**
<> 128:9bcdf88f62b0 2 ******************************************************************************
<> 128:9bcdf88f62b0 3 * @file stm32l4xx.h
<> 128:9bcdf88f62b0 4 * @author MCD Application Team
<> 128:9bcdf88f62b0 5 * @version V1.1.1
<> 128:9bcdf88f62b0 6 * @date 29-April-2016
<> 128:9bcdf88f62b0 7 * @brief CMSIS STM32L4xx 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 STM32L4xx 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 stm32l4xx
<> 128:9bcdf88f62b0 53 * @{
<> 128:9bcdf88f62b0 54 */
<> 128:9bcdf88f62b0 55
<> 128:9bcdf88f62b0 56 #ifndef __STM32L4xx_H
<> 128:9bcdf88f62b0 57 #define __STM32L4xx_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 (STM32L4)
<> 128:9bcdf88f62b0 71 #define STM32L4
<> 128:9bcdf88f62b0 72 #endif /* STM32L4 */
<> 128:9bcdf88f62b0 73
<> 128:9bcdf88f62b0 74 /* Uncomment the line below according to the target STM32L4 device used in your
<> 128:9bcdf88f62b0 75 application
<> 128:9bcdf88f62b0 76 */
<> 128:9bcdf88f62b0 77
<> 128:9bcdf88f62b0 78 #if !defined (STM32L431xx) && !defined (STM32L432xx) && !defined (STM32L433xx) && !defined (STM32L442xx) && !defined (STM32L443xx) && \
<> 128:9bcdf88f62b0 79 !defined (STM32L471xx) && !defined (STM32L475xx) && !defined (STM32L476xx) && !defined (STM32L485xx) && !defined (STM32L486xx)
<> 128:9bcdf88f62b0 80 /* #define STM32L431xx */ /*!< STM32L431xx Devices */
<> 128:9bcdf88f62b0 81 /* #define STM32L432xx */ /*!< STM32L432xx Devices */
<> 128:9bcdf88f62b0 82 /* #define STM32L433xx */ /*!< STM32L433xx Devices */
<> 128:9bcdf88f62b0 83 /* #define STM32L442xx */ /*!< STM32L442xx Devices */
<> 128:9bcdf88f62b0 84 /* #define STM32L443xx */ /*!< STM32L443xx Devices */
<> 128:9bcdf88f62b0 85 /* #define STM32L471xx */ /*!< STM32L471xx Devices */
<> 128:9bcdf88f62b0 86 /* #define STM32L475xx */ /*!< STM32L475xx Devices */
<> 128:9bcdf88f62b0 87 /* #define STM32L476xx */ /*!< STM32L476xx Devices */
<> 128:9bcdf88f62b0 88 /* #define STM32L485xx */ /*!< STM32L485xx Devices */
<> 128:9bcdf88f62b0 89 #define STM32L486xx /*!< STM32L486xx Devices */
<> 128:9bcdf88f62b0 90 #endif
<> 128:9bcdf88f62b0 91
<> 128:9bcdf88f62b0 92 /* Tip: To avoid modifying this file each time you need to switch between these
<> 128:9bcdf88f62b0 93 devices, you can define the device in your toolchain compiler preprocessor.
<> 128:9bcdf88f62b0 94 */
<> 128:9bcdf88f62b0 95 #if !defined (USE_HAL_DRIVER)
<> 128:9bcdf88f62b0 96 /**
<> 128:9bcdf88f62b0 97 * @brief Comment the line below if you will not use the peripherals drivers.
<> 128:9bcdf88f62b0 98 In this case, these drivers will not be included and the application code will
<> 128:9bcdf88f62b0 99 be based on direct access to peripherals registers
<> 128:9bcdf88f62b0 100 */
<> 128:9bcdf88f62b0 101 #define USE_HAL_DRIVER
<> 128:9bcdf88f62b0 102 #endif /* USE_HAL_DRIVER */
<> 128:9bcdf88f62b0 103
<> 128:9bcdf88f62b0 104 /**
<> 128:9bcdf88f62b0 105 * @brief CMSIS Device version number V1.1.1
<> 128:9bcdf88f62b0 106 */
<> 128:9bcdf88f62b0 107 #define __STM32L4_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */
<> 128:9bcdf88f62b0 108 #define __STM32L4_CMSIS_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */
<> 128:9bcdf88f62b0 109 #define __STM32L4_CMSIS_VERSION_SUB2 (0x01) /*!< [15:8] sub2 version */
<> 128:9bcdf88f62b0 110 #define __STM32L4_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
<> 128:9bcdf88f62b0 111 #define __STM32L4_CMSIS_VERSION ((__STM32L4_CMSIS_VERSION_MAIN << 24)\
<> 128:9bcdf88f62b0 112 |(__STM32L4_CMSIS_VERSION_SUB1 << 16)\
<> 128:9bcdf88f62b0 113 |(__STM32L4_CMSIS_VERSION_SUB2 << 8 )\
<> 128:9bcdf88f62b0 114 |(__STM32L4_CMSIS_VERSION_RC))
<> 128:9bcdf88f62b0 115
<> 128:9bcdf88f62b0 116 /**
<> 128:9bcdf88f62b0 117 * @}
<> 128:9bcdf88f62b0 118 */
<> 128:9bcdf88f62b0 119
<> 128:9bcdf88f62b0 120 /** @addtogroup Device_Included
<> 128:9bcdf88f62b0 121 * @{
<> 128:9bcdf88f62b0 122 */
<> 128:9bcdf88f62b0 123
<> 128:9bcdf88f62b0 124 #if defined(STM32L431xx)
<> 128:9bcdf88f62b0 125 #include "stm32l431xx.h"
<> 128:9bcdf88f62b0 126 #elif defined(STM32L432xx)
<> 128:9bcdf88f62b0 127 #include "stm32l432xx.h"
<> 128:9bcdf88f62b0 128 #elif defined(STM32L433xx)
<> 128:9bcdf88f62b0 129 #include "stm32l433xx.h"
<> 128:9bcdf88f62b0 130 #elif defined(STM32L442xx)
<> 128:9bcdf88f62b0 131 #include "stm32l442xx.h"
<> 128:9bcdf88f62b0 132 #elif defined(STM32L443xx)
<> 128:9bcdf88f62b0 133 #include "stm32l443xx.h"
<> 128:9bcdf88f62b0 134 #elif defined(STM32L451xx)
<> 128:9bcdf88f62b0 135 #include "stm32l451xx.h"
<> 128:9bcdf88f62b0 136 #elif defined(STM32L452xx)
<> 128:9bcdf88f62b0 137 #include "stm32l452xx.h"
<> 128:9bcdf88f62b0 138 #elif defined(STM32L462xx)
<> 128:9bcdf88f62b0 139 #include "stm32l462xx.h"
<> 128:9bcdf88f62b0 140 #elif defined(STM32L471xx)
<> 128:9bcdf88f62b0 141 #include "stm32l471xx.h"
<> 128:9bcdf88f62b0 142 #elif defined(STM32L475xx)
<> 128:9bcdf88f62b0 143 #include "stm32l475xx.h"
<> 128:9bcdf88f62b0 144 #elif defined(STM32L476xx)
<> 128:9bcdf88f62b0 145 #include "stm32l476xx.h"
<> 128:9bcdf88f62b0 146 #elif defined(STM32L485xx)
<> 128:9bcdf88f62b0 147 #include "stm32l485xx.h"
<> 128:9bcdf88f62b0 148 #elif defined(STM32L486xx)
<> 128:9bcdf88f62b0 149 #include "stm32l486xx.h"
<> 128:9bcdf88f62b0 150 #elif defined(STM32L496xx)
<> 128:9bcdf88f62b0 151 #include "stm32l496xx.h"
<> 128:9bcdf88f62b0 152 #elif defined(STM32L4A6xx)
<> 128:9bcdf88f62b0 153 #include "stm32l4a6xx.h"
<> 128:9bcdf88f62b0 154 #elif defined(STM32L4R5xx)
<> 128:9bcdf88f62b0 155 #include "stm32l4r5xx.h"
<> 128:9bcdf88f62b0 156 #elif defined(STM32L4R9xx)
<> 128:9bcdf88f62b0 157 #include "stm32l4r9xx.h"
<> 128:9bcdf88f62b0 158 #elif defined(STM32L4S5xx)
<> 128:9bcdf88f62b0 159 #include "stm32l4s5xx.h"
<> 128:9bcdf88f62b0 160 #elif defined(STM32L4S9xx)
<> 128:9bcdf88f62b0 161 #include "stm32l4s9xx.h"
<> 128:9bcdf88f62b0 162 #else
<> 128:9bcdf88f62b0 163 #error "Please select first the target STM32L4xx device used in your application (in stm32l4xx.h file)"
<> 128:9bcdf88f62b0 164 #endif
<> 128:9bcdf88f62b0 165
<> 128:9bcdf88f62b0 166 /**
<> 128:9bcdf88f62b0 167 * @}
<> 128:9bcdf88f62b0 168 */
<> 128:9bcdf88f62b0 169
<> 128:9bcdf88f62b0 170 /** @addtogroup Exported_types
<> 128:9bcdf88f62b0 171 * @{
<> 128:9bcdf88f62b0 172 */
<> 128:9bcdf88f62b0 173 typedef enum
<> 128:9bcdf88f62b0 174 {
<> 128:9bcdf88f62b0 175 RESET = 0,
<> 128:9bcdf88f62b0 176 SET = !RESET
<> 128:9bcdf88f62b0 177 } FlagStatus, ITStatus;
<> 128:9bcdf88f62b0 178
<> 128:9bcdf88f62b0 179 typedef enum
<> 128:9bcdf88f62b0 180 {
<> 128:9bcdf88f62b0 181 DISABLE = 0,
<> 128:9bcdf88f62b0 182 ENABLE = !DISABLE
<> 128:9bcdf88f62b0 183 } FunctionalState;
<> 128:9bcdf88f62b0 184 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
<> 128:9bcdf88f62b0 185
<> 128:9bcdf88f62b0 186 typedef enum
<> 128:9bcdf88f62b0 187 {
<> 128:9bcdf88f62b0 188 ERROR = 0,
<> 128:9bcdf88f62b0 189 SUCCESS = !ERROR
<> 128:9bcdf88f62b0 190 } ErrorStatus;
<> 128:9bcdf88f62b0 191
<> 128:9bcdf88f62b0 192 /**
<> 128:9bcdf88f62b0 193 * @}
<> 128:9bcdf88f62b0 194 */
<> 128:9bcdf88f62b0 195
<> 128:9bcdf88f62b0 196
<> 128:9bcdf88f62b0 197 /** @addtogroup Exported_macros
<> 128:9bcdf88f62b0 198 * @{
<> 128:9bcdf88f62b0 199 */
<> 128:9bcdf88f62b0 200 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
<> 128:9bcdf88f62b0 201
<> 128:9bcdf88f62b0 202 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
<> 128:9bcdf88f62b0 203
<> 128:9bcdf88f62b0 204 #define READ_BIT(REG, BIT) ((REG) & (BIT))
<> 128:9bcdf88f62b0 205
<> 128:9bcdf88f62b0 206 #define CLEAR_REG(REG) ((REG) = (0x0))
<> 128:9bcdf88f62b0 207
<> 128:9bcdf88f62b0 208 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
<> 128:9bcdf88f62b0 209
<> 128:9bcdf88f62b0 210 #define READ_REG(REG) ((REG))
<> 128:9bcdf88f62b0 211
<> 128:9bcdf88f62b0 212 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
<> 128:9bcdf88f62b0 213
<> 128:9bcdf88f62b0 214 #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
<> 128:9bcdf88f62b0 215
<> 128:9bcdf88f62b0 216
<> 128:9bcdf88f62b0 217 /**
<> 128:9bcdf88f62b0 218 * @}
<> 128:9bcdf88f62b0 219 */
<> 128:9bcdf88f62b0 220
<> 128:9bcdf88f62b0 221 #if defined (USE_HAL_DRIVER)
<> 128:9bcdf88f62b0 222 #include "stm32l4xx_hal.h"
<> 128:9bcdf88f62b0 223 #endif /* USE_HAL_DRIVER */
<> 128:9bcdf88f62b0 224
<> 128:9bcdf88f62b0 225 #ifdef __cplusplus
<> 128:9bcdf88f62b0 226 }
<> 128:9bcdf88f62b0 227 #endif /* __cplusplus */
<> 128:9bcdf88f62b0 228
<> 128:9bcdf88f62b0 229 #endif /* __STM32L4xx_H */
<> 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
<> 128:9bcdf88f62b0 239
<> 128:9bcdf88f62b0 240
<> 128:9bcdf88f62b0 241 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/