Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
TARGET_NUCLEO_L476RG/stm32l4xx.h@122:f9eeca106725, 2016-07-07 (annotated)
- Committer:
- Kojto
- Date:
- Thu Jul 07 14:34:11 2016 +0100
- Revision:
- 122:f9eeca106725
- Parent:
- 107:4f6c30876dfa
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?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 107:4f6c30876dfa | 1 | /** |
Kojto | 107:4f6c30876dfa | 2 | ****************************************************************************** |
Kojto | 107:4f6c30876dfa | 3 | * @file stm32l4xx.h |
Kojto | 107:4f6c30876dfa | 4 | * @author MCD Application Team |
Kojto | 122:f9eeca106725 | 5 | * @version V1.1.1 |
Kojto | 122:f9eeca106725 | 6 | * @date 29-April-2016 |
Kojto | 107:4f6c30876dfa | 7 | * @brief CMSIS STM32L4xx Device Peripheral Access Layer Header File. |
Kojto | 107:4f6c30876dfa | 8 | * |
Kojto | 107:4f6c30876dfa | 9 | * The file is the unique include file that the application programmer |
Kojto | 107:4f6c30876dfa | 10 | * is using in the C source code, usually in main.c. This file contains: |
Kojto | 107:4f6c30876dfa | 11 | * - Configuration section that allows to select: |
Kojto | 107:4f6c30876dfa | 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 | 107:4f6c30876dfa | 15 | * rather than drivers API), this option is controlled by |
Kojto | 107:4f6c30876dfa | 16 | * "#define USE_HAL_DRIVER" |
Kojto | 107:4f6c30876dfa | 17 | * |
Kojto | 107:4f6c30876dfa | 18 | ****************************************************************************** |
Kojto | 107:4f6c30876dfa | 19 | * @attention |
Kojto | 107:4f6c30876dfa | 20 | * |
Kojto | 122:f9eeca106725 | 21 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
Kojto | 107:4f6c30876dfa | 22 | * |
Kojto | 107:4f6c30876dfa | 23 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 107:4f6c30876dfa | 24 | * are permitted provided that the following conditions are met: |
Kojto | 107:4f6c30876dfa | 25 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 107:4f6c30876dfa | 26 | * this list of conditions and the following disclaimer. |
Kojto | 107:4f6c30876dfa | 27 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 107:4f6c30876dfa | 28 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 107:4f6c30876dfa | 29 | * and/or other materials provided with the distribution. |
Kojto | 107:4f6c30876dfa | 30 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Kojto | 107:4f6c30876dfa | 31 | * may be used to endorse or promote products derived from this software |
Kojto | 107:4f6c30876dfa | 32 | * without specific prior written permission. |
Kojto | 107:4f6c30876dfa | 33 | * |
Kojto | 107:4f6c30876dfa | 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 107:4f6c30876dfa | 35 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 107:4f6c30876dfa | 36 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 107:4f6c30876dfa | 37 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Kojto | 107:4f6c30876dfa | 38 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 107:4f6c30876dfa | 39 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Kojto | 107:4f6c30876dfa | 40 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 107:4f6c30876dfa | 41 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Kojto | 107:4f6c30876dfa | 42 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Kojto | 107:4f6c30876dfa | 43 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 107:4f6c30876dfa | 44 | * |
Kojto | 107:4f6c30876dfa | 45 | ****************************************************************************** |
Kojto | 107:4f6c30876dfa | 46 | */ |
Kojto | 107:4f6c30876dfa | 47 | |
Kojto | 107:4f6c30876dfa | 48 | /** @addtogroup CMSIS |
Kojto | 107:4f6c30876dfa | 49 | * @{ |
Kojto | 107:4f6c30876dfa | 50 | */ |
Kojto | 107:4f6c30876dfa | 51 | |
Kojto | 107:4f6c30876dfa | 52 | /** @addtogroup stm32l4xx |
Kojto | 107:4f6c30876dfa | 53 | * @{ |
Kojto | 107:4f6c30876dfa | 54 | */ |
Kojto | 107:4f6c30876dfa | 55 | |
Kojto | 107:4f6c30876dfa | 56 | #ifndef __STM32L4xx_H |
Kojto | 107:4f6c30876dfa | 57 | #define __STM32L4xx_H |
Kojto | 107:4f6c30876dfa | 58 | |
Kojto | 107:4f6c30876dfa | 59 | #ifdef __cplusplus |
Kojto | 107:4f6c30876dfa | 60 | extern "C" { |
Kojto | 107:4f6c30876dfa | 61 | #endif /* __cplusplus */ |
Kojto | 107:4f6c30876dfa | 62 | |
Kojto | 107:4f6c30876dfa | 63 | /** @addtogroup Library_configuration_section |
Kojto | 107:4f6c30876dfa | 64 | * @{ |
Kojto | 107:4f6c30876dfa | 65 | */ |
Kojto | 107:4f6c30876dfa | 66 | |
Kojto | 107:4f6c30876dfa | 67 | /** |
Kojto | 107:4f6c30876dfa | 68 | * @brief STM32 Family |
Kojto | 107:4f6c30876dfa | 69 | */ |
Kojto | 107:4f6c30876dfa | 70 | #if !defined (STM32L4) |
Kojto | 107:4f6c30876dfa | 71 | #define STM32L4 |
Kojto | 107:4f6c30876dfa | 72 | #endif /* STM32L4 */ |
Kojto | 107:4f6c30876dfa | 73 | |
Kojto | 107:4f6c30876dfa | 74 | /* Uncomment the line below according to the target STM32L4 device used in your |
Kojto | 107:4f6c30876dfa | 75 | application |
Kojto | 107:4f6c30876dfa | 76 | */ |
Kojto | 107:4f6c30876dfa | 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 | 107:4f6c30876dfa | 85 | /* #define STM32L471xx */ /*!< STM32L471xx Devices */ |
Kojto | 107:4f6c30876dfa | 86 | /* #define STM32L475xx */ /*!< STM32L475xx Devices */ |
Kojto | 107:4f6c30876dfa | 87 | #define STM32L476xx /*!< STM32L476xx Devices */ |
Kojto | 107:4f6c30876dfa | 88 | /* #define STM32L485xx */ /*!< STM32L485xx Devices */ |
Kojto | 107:4f6c30876dfa | 89 | /* #define STM32L486xx */ /*!< STM32L486xx Devices */ |
Kojto | 107:4f6c30876dfa | 90 | #endif |
Kojto | 107:4f6c30876dfa | 91 | |
Kojto | 107:4f6c30876dfa | 92 | /* Tip: To avoid modifying this file each time you need to switch between these |
Kojto | 107:4f6c30876dfa | 93 | devices, you can define the device in your toolchain compiler preprocessor. |
Kojto | 107:4f6c30876dfa | 94 | */ |
Kojto | 107:4f6c30876dfa | 95 | #if !defined (USE_HAL_DRIVER) |
Kojto | 107:4f6c30876dfa | 96 | /** |
Kojto | 107:4f6c30876dfa | 97 | * @brief Comment the line below if you will not use the peripherals drivers. |
Kojto | 107:4f6c30876dfa | 98 | In this case, these drivers will not be included and the application code will |
Kojto | 107:4f6c30876dfa | 99 | be based on direct access to peripherals registers |
Kojto | 107:4f6c30876dfa | 100 | */ |
Kojto | 122:f9eeca106725 | 101 | #define USE_HAL_DRIVER |
Kojto | 107:4f6c30876dfa | 102 | #endif /* USE_HAL_DRIVER */ |
Kojto | 107:4f6c30876dfa | 103 | |
Kojto | 107:4f6c30876dfa | 104 | /** |
Kojto | 122:f9eeca106725 | 105 | * @brief CMSIS Device version number V1.1.1 |
Kojto | 107:4f6c30876dfa | 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 | 107:4f6c30876dfa | 115 | |
Kojto | 107:4f6c30876dfa | 116 | /** |
Kojto | 107:4f6c30876dfa | 117 | * @} |
Kojto | 107:4f6c30876dfa | 118 | */ |
Kojto | 107:4f6c30876dfa | 119 | |
Kojto | 107:4f6c30876dfa | 120 | /** @addtogroup Device_Included |
Kojto | 107:4f6c30876dfa | 121 | * @{ |
Kojto | 107:4f6c30876dfa | 122 | */ |
Kojto | 107:4f6c30876dfa | 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 | 107:4f6c30876dfa | 141 | #include "stm32l471xx.h" |
Kojto | 107:4f6c30876dfa | 142 | #elif defined(STM32L475xx) |
Kojto | 107:4f6c30876dfa | 143 | #include "stm32l475xx.h" |
Kojto | 107:4f6c30876dfa | 144 | #elif defined(STM32L476xx) |
Kojto | 107:4f6c30876dfa | 145 | #include "stm32l476xx.h" |
Kojto | 107:4f6c30876dfa | 146 | #elif defined(STM32L485xx) |
Kojto | 107:4f6c30876dfa | 147 | #include "stm32l485xx.h" |
Kojto | 107:4f6c30876dfa | 148 | #elif defined(STM32L486xx) |
Kojto | 107:4f6c30876dfa | 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 | 107:4f6c30876dfa | 162 | #else |
Kojto | 107:4f6c30876dfa | 163 | #error "Please select first the target STM32L4xx device used in your application (in stm32l4xx.h file)" |
Kojto | 107:4f6c30876dfa | 164 | #endif |
Kojto | 107:4f6c30876dfa | 165 | |
Kojto | 107:4f6c30876dfa | 166 | /** |
Kojto | 107:4f6c30876dfa | 167 | * @} |
Kojto | 107:4f6c30876dfa | 168 | */ |
Kojto | 107:4f6c30876dfa | 169 | |
Kojto | 107:4f6c30876dfa | 170 | /** @addtogroup Exported_types |
Kojto | 107:4f6c30876dfa | 171 | * @{ |
Kojto | 107:4f6c30876dfa | 172 | */ |
Kojto | 107:4f6c30876dfa | 173 | typedef enum |
Kojto | 107:4f6c30876dfa | 174 | { |
Kojto | 107:4f6c30876dfa | 175 | RESET = 0, |
Kojto | 107:4f6c30876dfa | 176 | SET = !RESET |
Kojto | 107:4f6c30876dfa | 177 | } FlagStatus, ITStatus; |
Kojto | 107:4f6c30876dfa | 178 | |
Kojto | 107:4f6c30876dfa | 179 | typedef enum |
Kojto | 107:4f6c30876dfa | 180 | { |
Kojto | 107:4f6c30876dfa | 181 | DISABLE = 0, |
Kojto | 107:4f6c30876dfa | 182 | ENABLE = !DISABLE |
Kojto | 107:4f6c30876dfa | 183 | } FunctionalState; |
Kojto | 107:4f6c30876dfa | 184 | #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE)) |
Kojto | 107:4f6c30876dfa | 185 | |
Kojto | 107:4f6c30876dfa | 186 | typedef enum |
Kojto | 107:4f6c30876dfa | 187 | { |
Kojto | 107:4f6c30876dfa | 188 | ERROR = 0, |
Kojto | 107:4f6c30876dfa | 189 | SUCCESS = !ERROR |
Kojto | 107:4f6c30876dfa | 190 | } ErrorStatus; |
Kojto | 107:4f6c30876dfa | 191 | |
Kojto | 107:4f6c30876dfa | 192 | /** |
Kojto | 107:4f6c30876dfa | 193 | * @} |
Kojto | 107:4f6c30876dfa | 194 | */ |
Kojto | 107:4f6c30876dfa | 195 | |
Kojto | 107:4f6c30876dfa | 196 | |
Kojto | 107:4f6c30876dfa | 197 | /** @addtogroup Exported_macros |
Kojto | 107:4f6c30876dfa | 198 | * @{ |
Kojto | 107:4f6c30876dfa | 199 | */ |
Kojto | 107:4f6c30876dfa | 200 | #define SET_BIT(REG, BIT) ((REG) |= (BIT)) |
Kojto | 107:4f6c30876dfa | 201 | |
Kojto | 107:4f6c30876dfa | 202 | #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT)) |
Kojto | 107:4f6c30876dfa | 203 | |
Kojto | 107:4f6c30876dfa | 204 | #define READ_BIT(REG, BIT) ((REG) & (BIT)) |
Kojto | 107:4f6c30876dfa | 205 | |
Kojto | 107:4f6c30876dfa | 206 | #define CLEAR_REG(REG) ((REG) = (0x0)) |
Kojto | 107:4f6c30876dfa | 207 | |
Kojto | 107:4f6c30876dfa | 208 | #define WRITE_REG(REG, VAL) ((REG) = (VAL)) |
Kojto | 107:4f6c30876dfa | 209 | |
Kojto | 107:4f6c30876dfa | 210 | #define READ_REG(REG) ((REG)) |
Kojto | 107:4f6c30876dfa | 211 | |
Kojto | 107:4f6c30876dfa | 212 | #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK))) |
Kojto | 107:4f6c30876dfa | 213 | |
Kojto | 107:4f6c30876dfa | 214 | #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL))) |
Kojto | 107:4f6c30876dfa | 215 | |
Kojto | 107:4f6c30876dfa | 216 | |
Kojto | 107:4f6c30876dfa | 217 | /** |
Kojto | 107:4f6c30876dfa | 218 | * @} |
Kojto | 107:4f6c30876dfa | 219 | */ |
Kojto | 107:4f6c30876dfa | 220 | |
Kojto | 107:4f6c30876dfa | 221 | #if defined (USE_HAL_DRIVER) |
Kojto | 107:4f6c30876dfa | 222 | #include "stm32l4xx_hal.h" |
Kojto | 107:4f6c30876dfa | 223 | #endif /* USE_HAL_DRIVER */ |
Kojto | 107:4f6c30876dfa | 224 | |
Kojto | 107:4f6c30876dfa | 225 | #ifdef __cplusplus |
Kojto | 107:4f6c30876dfa | 226 | } |
Kojto | 107:4f6c30876dfa | 227 | #endif /* __cplusplus */ |
Kojto | 107:4f6c30876dfa | 228 | |
Kojto | 107:4f6c30876dfa | 229 | #endif /* __STM32L4xx_H */ |
Kojto | 107:4f6c30876dfa | 230 | /** |
Kojto | 107:4f6c30876dfa | 231 | * @} |
Kojto | 107:4f6c30876dfa | 232 | */ |
Kojto | 107:4f6c30876dfa | 233 | |
Kojto | 107:4f6c30876dfa | 234 | /** |
Kojto | 107:4f6c30876dfa | 235 | * @} |
Kojto | 107:4f6c30876dfa | 236 | */ |
Kojto | 107:4f6c30876dfa | 237 | |
Kojto | 107:4f6c30876dfa | 238 | |
Kojto | 107:4f6c30876dfa | 239 | |
Kojto | 107:4f6c30876dfa | 240 | |
Kojto | 107:4f6c30876dfa | 241 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |