mbed official / mbed-src

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Committer:
mbed_official
Date:
Fri Aug 14 13:15:17 2015 +0100
Revision:
610:813dcc80987e
Synchronized with git revision 6d84db41c6833e0b9b024741eb0616a5f62d5599

Full URL: https://github.com/mbedmicro/mbed/commit/6d84db41c6833e0b9b024741eb0616a5f62d5599/

DISCO_F746NG - Improvements

Who changed what in which revision?

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