cc y / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Apr 27 12:10:56 2016 -0500
Revision:
119:aae6fcc7d9bb
Parent:
96:487b796308b0
Release 119 of the mbed library

Changes:
- new targets - EFM32PG_STK3401, NUCLEO_L031K6
- ST - hwflwctl support for NUCLEO_L476RG
- Update STM32CUBE_L0 from v1.2 to v1.5
- STM32F7 - bugfix - The weak function HAL_Delay is overwritten to use us ticker API.
- Maxim - Fixing the send break for the MAXWSNENV and MAX32600MBED

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 84:0b3ab51c8877 1 /**
bogdanm 84:0b3ab51c8877 2 ******************************************************************************
bogdanm 84:0b3ab51c8877 3 * @file stm32l0xx.h
bogdanm 84:0b3ab51c8877 4 * @author MCD Application Team
Kojto 119:aae6fcc7d9bb 5 * @version V1.4.0
Kojto 119:aae6fcc7d9bb 6 * @date 01-October-2015
bogdanm 84:0b3ab51c8877 7 * @brief CMSIS Cortex-M0+ Device Peripheral Access Layer Header File.
bogdanm 84:0b3ab51c8877 8 * This file contains all the peripheral register's definitions, bits
bogdanm 84:0b3ab51c8877 9 * definitions and memory mapping for STM32L0xx devices.
bogdanm 84:0b3ab51c8877 10 *
bogdanm 84:0b3ab51c8877 11 * The file is the unique include file that the application programmer
bogdanm 84:0b3ab51c8877 12 * is using in the C source code, usually in main.c. This file contains:
bogdanm 84:0b3ab51c8877 13 * - Configuration section that allows to select:
bogdanm 84:0b3ab51c8877 14 * - The device used in the target application
bogdanm 84:0b3ab51c8877 15 * - To use or not the peripheral’s drivers in application code(i.e.
bogdanm 84:0b3ab51c8877 16 * code will be based on direct access to peripheral’s registers
bogdanm 84:0b3ab51c8877 17 * rather than drivers API), this option is controlled by
bogdanm 84:0b3ab51c8877 18 * "#define USE_HAL_DRIVER"
bogdanm 84:0b3ab51c8877 19 *
bogdanm 84:0b3ab51c8877 20 ******************************************************************************
bogdanm 84:0b3ab51c8877 21 * @attention
bogdanm 84:0b3ab51c8877 22 *
Kojto 96:487b796308b0 23 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bogdanm 84:0b3ab51c8877 24 *
bogdanm 84:0b3ab51c8877 25 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 84:0b3ab51c8877 26 * are permitted provided that the following conditions are met:
bogdanm 84:0b3ab51c8877 27 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 84:0b3ab51c8877 28 * this list of conditions and the following disclaimer.
bogdanm 84:0b3ab51c8877 29 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 84:0b3ab51c8877 30 * this list of conditions and the following disclaimer in the documentation
bogdanm 84:0b3ab51c8877 31 * and/or other materials provided with the distribution.
bogdanm 84:0b3ab51c8877 32 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 84:0b3ab51c8877 33 * may be used to endorse or promote products derived from this software
bogdanm 84:0b3ab51c8877 34 * without specific prior written permission.
bogdanm 84:0b3ab51c8877 35 *
bogdanm 84:0b3ab51c8877 36 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 84:0b3ab51c8877 37 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 84:0b3ab51c8877 38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 84:0b3ab51c8877 39 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 84:0b3ab51c8877 40 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 84:0b3ab51c8877 41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 84:0b3ab51c8877 42 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 84:0b3ab51c8877 43 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 84:0b3ab51c8877 44 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 84:0b3ab51c8877 45 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 84:0b3ab51c8877 46 *
bogdanm 84:0b3ab51c8877 47 ******************************************************************************
bogdanm 84:0b3ab51c8877 48 */
bogdanm 84:0b3ab51c8877 49
bogdanm 84:0b3ab51c8877 50 /** @addtogroup CMSIS
bogdanm 84:0b3ab51c8877 51 * @{
bogdanm 84:0b3ab51c8877 52 */
bogdanm 84:0b3ab51c8877 53
bogdanm 84:0b3ab51c8877 54 /** @addtogroup stm32l0xx
bogdanm 84:0b3ab51c8877 55 * @{
bogdanm 84:0b3ab51c8877 56 */
bogdanm 84:0b3ab51c8877 57
bogdanm 84:0b3ab51c8877 58 #ifndef __STM32L0xx_H
bogdanm 84:0b3ab51c8877 59 #define __STM32L0xx_H
bogdanm 84:0b3ab51c8877 60
bogdanm 84:0b3ab51c8877 61 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 62 extern "C" {
bogdanm 84:0b3ab51c8877 63 #endif /* __cplusplus */
bogdanm 84:0b3ab51c8877 64
bogdanm 84:0b3ab51c8877 65 /** @addtogroup Library_configuration_section
bogdanm 84:0b3ab51c8877 66 * @{
bogdanm 84:0b3ab51c8877 67 */
bogdanm 84:0b3ab51c8877 68
Kojto 96:487b796308b0 69 /**
Kojto 96:487b796308b0 70 * @brief STM32 Family
Kojto 96:487b796308b0 71 */
Kojto 96:487b796308b0 72 #if !defined (STM32L0)
Kojto 96:487b796308b0 73 #define STM32L0
Kojto 96:487b796308b0 74 #endif /* STM32L0 */
Kojto 96:487b796308b0 75
bogdanm 84:0b3ab51c8877 76 /* Uncomment the line below according to the target STM32 device used in your
bogdanm 84:0b3ab51c8877 77 application
bogdanm 84:0b3ab51c8877 78 */
bogdanm 84:0b3ab51c8877 79
Kojto 119:aae6fcc7d9bb 80 #if !defined (STM32L011xx) && !defined (STM32L021xx) && \
Kojto 119:aae6fcc7d9bb 81 !defined (STM32L031xx) && !defined (STM32L041xx) && \
Kojto 119:aae6fcc7d9bb 82 !defined (STM32L051xx) && !defined (STM32L052xx) && !defined (STM32L053xx) && \
Kojto 119:aae6fcc7d9bb 83 !defined (STM32L061xx) && !defined (STM32L062xx) && !defined (STM32L063xx) && \
Kojto 119:aae6fcc7d9bb 84 !defined (STM32L071xx) && !defined (STM32L072xx) && !defined (STM32L073xx) && \
Kojto 119:aae6fcc7d9bb 85 !defined (STM32L081xx) && !defined (STM32L082xx) && !defined (STM32L083xx) \
Kojto 119:aae6fcc7d9bb 86 /* #define STM32L011xx */
Kojto 119:aae6fcc7d9bb 87 /* #define STM32L021xx */
Kojto 119:aae6fcc7d9bb 88 /* #define STM32L031xx */ /*!< STM32L031C6, STM32L031E6, STM32L031F6, STM32L031G6, STM32L031K6 Devices */
Kojto 119:aae6fcc7d9bb 89 /* #define STM32L041xx */ /*!< STM32L041C6, STM32L041E6, STM32L041F6, STM32L041G6, STM32L041K6 Devices */
Kojto 96:487b796308b0 90 /* #define STM32L051xx */ /*!< STM32L051K8, STM32L051C6, STM32L051C8, STM32L051R6, STM32L051R8 Devices */
Kojto 96:487b796308b0 91 /* #define STM32L052xx */ /*!< STM32L052K6, STM32L052K8, STM32L052C6, STM32L052C8, STM32L052R6, STM32L052R8 Devices */
Kojto 96:487b796308b0 92 #define STM32L053xx /*!< STM32L053C6, STM32L053C8, STM32L053R6, STM32L053R8 Devices */
Kojto 96:487b796308b0 93 /* #define STM32L061xx */ /*!< */
bogdanm 84:0b3ab51c8877 94 /* #define STM32L062xx */ /*!< STM32L062K8 */
bogdanm 84:0b3ab51c8877 95 /* #define STM32L063xx */ /*!< STM32L063C8, STM32L063R8 */
Kojto 96:487b796308b0 96 /* #define STM32L071xx */ /*!< */
Kojto 96:487b796308b0 97 /* #define STM32L072xx */ /*!< */
Kojto 96:487b796308b0 98 /* #define STM32L073xx */ /*!< STM32L073V8, STM32L073VB, STM32L073RB, STM32L073VZ, STM32L073RZ Devices */
Kojto 96:487b796308b0 99 /* #define STM32L081xx */ /*!< */
Kojto 96:487b796308b0 100 /* #define STM32L082xx */ /*!< */
Kojto 96:487b796308b0 101 /* #define STM32L083xx */ /*!< */
bogdanm 84:0b3ab51c8877 102 #endif
bogdanm 84:0b3ab51c8877 103
bogdanm 84:0b3ab51c8877 104 /* Tip: To avoid modifying this file each time you need to switch between these
bogdanm 84:0b3ab51c8877 105 devices, you can define the device in your toolchain compiler preprocessor.
bogdanm 84:0b3ab51c8877 106 */
bogdanm 84:0b3ab51c8877 107 #if !defined (USE_HAL_DRIVER)
bogdanm 84:0b3ab51c8877 108 /**
bogdanm 84:0b3ab51c8877 109 * @brief Comment the line below if you will not use the peripherals drivers.
bogdanm 84:0b3ab51c8877 110 In this case, these drivers will not be included and the application code will
bogdanm 84:0b3ab51c8877 111 be based on direct access to peripherals registers
bogdanm 84:0b3ab51c8877 112 */
bogdanm 84:0b3ab51c8877 113 #define USE_HAL_DRIVER
bogdanm 84:0b3ab51c8877 114 #endif /* USE_HAL_DRIVER */
bogdanm 84:0b3ab51c8877 115
bogdanm 84:0b3ab51c8877 116 /**
Kojto 119:aae6fcc7d9bb 117 * @brief CMSIS Device version number V1.2.0RC1
bogdanm 84:0b3ab51c8877 118 */
bogdanm 84:0b3ab51c8877 119 #define __STM32L0xx_CMSIS_DEVICE_VERSION_MAIN (0x01) /*!< [31:24] main version */
Kojto 119:aae6fcc7d9bb 120 #define __STM32L0xx_CMSIS_DEVICE_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */
bogdanm 84:0b3ab51c8877 121 #define __STM32L0xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
Kojto 119:aae6fcc7d9bb 122 #define __STM32L0xx_CMSIS_DEVICE_VERSION_RC (0x01) /*!< [7:0] release candidate */
bogdanm 84:0b3ab51c8877 123 #define __STM32L0xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
bogdanm 84:0b3ab51c8877 124 |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
bogdanm 84:0b3ab51c8877 125 |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
bogdanm 84:0b3ab51c8877 126 |(__CMSIS_DEVICE_HAL_VERSION_RC))
bogdanm 84:0b3ab51c8877 127
bogdanm 84:0b3ab51c8877 128 /**
bogdanm 84:0b3ab51c8877 129 * @}
bogdanm 84:0b3ab51c8877 130 */
bogdanm 84:0b3ab51c8877 131
bogdanm 84:0b3ab51c8877 132 /** @addtogroup Device_Included
bogdanm 84:0b3ab51c8877 133 * @{
bogdanm 84:0b3ab51c8877 134 */
Kojto 119:aae6fcc7d9bb 135 #if defined(STM32L011xx)
Kojto 119:aae6fcc7d9bb 136 #include "stm32l011xx.h"
Kojto 119:aae6fcc7d9bb 137 #elif defined(STM32L021xx)
Kojto 119:aae6fcc7d9bb 138 #include "stm32l021xx.h"
Kojto 119:aae6fcc7d9bb 139 #elif defined(STM32L031xx)
Kojto 96:487b796308b0 140 #include "stm32l031xx.h"
Kojto 96:487b796308b0 141 #elif defined(STM32L041xx)
Kojto 96:487b796308b0 142 #include "stm32l041xx.h"
Kojto 96:487b796308b0 143 #elif defined(STM32L051xx)
bogdanm 84:0b3ab51c8877 144 #include "stm32l051xx.h"
bogdanm 84:0b3ab51c8877 145 #elif defined(STM32L052xx)
bogdanm 84:0b3ab51c8877 146 #include "stm32l052xx.h"
bogdanm 84:0b3ab51c8877 147 #elif defined(STM32L053xx)
bogdanm 84:0b3ab51c8877 148 #include "stm32l053xx.h"
bogdanm 84:0b3ab51c8877 149 #elif defined(STM32L062xx)
bogdanm 84:0b3ab51c8877 150 #include "stm32l062xx.h"
bogdanm 84:0b3ab51c8877 151 #elif defined(STM32L063xx)
bogdanm 84:0b3ab51c8877 152 #include "stm32l063xx.h"
bogdanm 84:0b3ab51c8877 153 #elif defined(STM32L061xx)
bogdanm 84:0b3ab51c8877 154 #include "stm32l061xx.h"
Kojto 96:487b796308b0 155 #elif defined(STM32L071xx)
Kojto 96:487b796308b0 156 #include "stm32l071xx.h"
Kojto 96:487b796308b0 157 #elif defined(STM32L072xx)
Kojto 96:487b796308b0 158 #include "stm32l072xx.h"
Kojto 96:487b796308b0 159 #elif defined(STM32L073xx)
Kojto 96:487b796308b0 160 #include "stm32l073xx.h"
Kojto 96:487b796308b0 161 #elif defined(STM32L082xx)
Kojto 96:487b796308b0 162 #include "stm32l082xx.h"
Kojto 96:487b796308b0 163 #elif defined(STM32L083xx)
Kojto 96:487b796308b0 164 #include "stm32l083xx.h"
Kojto 96:487b796308b0 165 #elif defined(STM32L081xx)
Kojto 96:487b796308b0 166 #include "stm32l081xx.h"
bogdanm 84:0b3ab51c8877 167 #else
bogdanm 84:0b3ab51c8877 168 #error "Please select first the target STM32L0xx device used in your application (in stm32l0xx.h file)"
bogdanm 84:0b3ab51c8877 169 #endif
bogdanm 84:0b3ab51c8877 170
bogdanm 84:0b3ab51c8877 171 /**
bogdanm 84:0b3ab51c8877 172 * @}
bogdanm 84:0b3ab51c8877 173 */
bogdanm 84:0b3ab51c8877 174
bogdanm 84:0b3ab51c8877 175 /** @addtogroup Exported_types
bogdanm 84:0b3ab51c8877 176 * @{
bogdanm 84:0b3ab51c8877 177 */
bogdanm 84:0b3ab51c8877 178 typedef enum
bogdanm 84:0b3ab51c8877 179 {
bogdanm 84:0b3ab51c8877 180 RESET = 0,
bogdanm 84:0b3ab51c8877 181 SET = !RESET
bogdanm 84:0b3ab51c8877 182 } FlagStatus, ITStatus;
bogdanm 84:0b3ab51c8877 183
bogdanm 84:0b3ab51c8877 184 typedef enum
bogdanm 84:0b3ab51c8877 185 {
bogdanm 84:0b3ab51c8877 186 DISABLE = 0,
bogdanm 84:0b3ab51c8877 187 ENABLE = !DISABLE
bogdanm 84:0b3ab51c8877 188 } FunctionalState;
bogdanm 84:0b3ab51c8877 189 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
bogdanm 84:0b3ab51c8877 190
bogdanm 84:0b3ab51c8877 191 typedef enum
bogdanm 84:0b3ab51c8877 192 {
bogdanm 84:0b3ab51c8877 193 ERROR = 0,
bogdanm 84:0b3ab51c8877 194 SUCCESS = !ERROR
bogdanm 84:0b3ab51c8877 195 } ErrorStatus;
bogdanm 84:0b3ab51c8877 196
bogdanm 84:0b3ab51c8877 197 /**
bogdanm 84:0b3ab51c8877 198 * @}
bogdanm 84:0b3ab51c8877 199 */
bogdanm 84:0b3ab51c8877 200
bogdanm 84:0b3ab51c8877 201
bogdanm 84:0b3ab51c8877 202 /** @addtogroup Exported_macro
bogdanm 84:0b3ab51c8877 203 * @{
bogdanm 84:0b3ab51c8877 204 */
bogdanm 84:0b3ab51c8877 205 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
bogdanm 84:0b3ab51c8877 206
bogdanm 84:0b3ab51c8877 207 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
bogdanm 84:0b3ab51c8877 208
bogdanm 84:0b3ab51c8877 209 #define READ_BIT(REG, BIT) ((REG) & (BIT))
bogdanm 84:0b3ab51c8877 210
bogdanm 84:0b3ab51c8877 211 #define CLEAR_REG(REG) ((REG) = (0x0))
bogdanm 84:0b3ab51c8877 212
bogdanm 84:0b3ab51c8877 213 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
bogdanm 84:0b3ab51c8877 214
bogdanm 84:0b3ab51c8877 215 #define READ_REG(REG) ((REG))
bogdanm 84:0b3ab51c8877 216
bogdanm 84:0b3ab51c8877 217 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
bogdanm 84:0b3ab51c8877 218
Kojto 119:aae6fcc7d9bb 219 #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
bogdanm 84:0b3ab51c8877 220
bogdanm 84:0b3ab51c8877 221 /**
bogdanm 84:0b3ab51c8877 222 * @}
bogdanm 84:0b3ab51c8877 223 */
bogdanm 84:0b3ab51c8877 224
bogdanm 84:0b3ab51c8877 225 #if defined (USE_HAL_DRIVER)
bogdanm 84:0b3ab51c8877 226 #include "stm32l0xx_hal.h"
bogdanm 84:0b3ab51c8877 227 #endif /* USE_HAL_DRIVER */
bogdanm 84:0b3ab51c8877 228
bogdanm 84:0b3ab51c8877 229 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 230 }
bogdanm 84:0b3ab51c8877 231 #endif /* __cplusplus */
bogdanm 84:0b3ab51c8877 232
bogdanm 84:0b3ab51c8877 233 #endif /* __STM32L0xx_H */
bogdanm 84:0b3ab51c8877 234 /**
bogdanm 84:0b3ab51c8877 235 * @}
bogdanm 84:0b3ab51c8877 236 */
bogdanm 84:0b3ab51c8877 237
bogdanm 84:0b3ab51c8877 238 /**
bogdanm 84:0b3ab51c8877 239 * @}
bogdanm 84:0b3ab51c8877 240 */
bogdanm 84:0b3ab51c8877 241
bogdanm 84:0b3ab51c8877 242
bogdanm 84:0b3ab51c8877 243
bogdanm 84:0b3ab51c8877 244
bogdanm 84:0b3ab51c8877 245 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/