my fork
Fork of mbed by
TARGET_NUCLEO_L053R8/stm32l0xx.h@97:4298809c7c9e, 2015-04-08 (annotated)
- Committer:
- filartrix
- Date:
- Wed Apr 08 14:12:53 2015 +0000
- Revision:
- 97:4298809c7c9e
- Parent:
- 96:487b796308b0
First reale BlueNRG module for nucleo 401 board
Who changed what in which revision?
User | Revision | Line number | New 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 | 96:487b796308b0 | 5 | * @version V1.2.0 |
Kojto | 96:487b796308b0 | 6 | * @date 06-February-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>© 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 | 96:487b796308b0 | 80 | #if !defined (STM32L051xx) && !defined (STM32L052xx) && !defined (STM32L053xx) && !defined (STM32L061xx) && !defined (STM32L062xx) && !defined (STM32L063xx) \ |
Kojto | 96:487b796308b0 | 81 | && !defined (STM32L071xx) && !defined (STM32L072xx) && !defined (STM32L073xx) && !defined (STM32L081xx) && !defined (STM32L082xx) && !defined (STM32L083xx) |
Kojto | 96:487b796308b0 | 82 | /* #define STM32L051xx */ /*!< STM32L051K8, STM32L051C6, STM32L051C8, STM32L051R6, STM32L051R8 Devices */ |
Kojto | 96:487b796308b0 | 83 | /* #define STM32L052xx */ /*!< STM32L052K6, STM32L052K8, STM32L052C6, STM32L052C8, STM32L052R6, STM32L052R8 Devices */ |
Kojto | 96:487b796308b0 | 84 | #define STM32L053xx /*!< STM32L053C6, STM32L053C8, STM32L053R6, STM32L053R8 Devices */ |
Kojto | 96:487b796308b0 | 85 | /* #define STM32L061xx */ /*!< */ |
bogdanm | 84:0b3ab51c8877 | 86 | /* #define STM32L062xx */ /*!< STM32L062K8 */ |
bogdanm | 84:0b3ab51c8877 | 87 | /* #define STM32L063xx */ /*!< STM32L063C8, STM32L063R8 */ |
Kojto | 96:487b796308b0 | 88 | /* #define STM32L071xx */ /*!< */ |
Kojto | 96:487b796308b0 | 89 | /* #define STM32L072xx */ /*!< */ |
Kojto | 96:487b796308b0 | 90 | /* #define STM32L073xx */ /*!< STM32L073V8, STM32L073VB, STM32L073RB, STM32L073VZ, STM32L073RZ Devices */ |
Kojto | 96:487b796308b0 | 91 | /* #define STM32L081xx */ /*!< */ |
Kojto | 96:487b796308b0 | 92 | /* #define STM32L082xx */ /*!< */ |
Kojto | 96:487b796308b0 | 93 | /* #define STM32L083xx */ /*!< */ |
bogdanm | 84:0b3ab51c8877 | 94 | #endif |
bogdanm | 84:0b3ab51c8877 | 95 | |
bogdanm | 84:0b3ab51c8877 | 96 | /* Tip: To avoid modifying this file each time you need to switch between these |
bogdanm | 84:0b3ab51c8877 | 97 | devices, you can define the device in your toolchain compiler preprocessor. |
bogdanm | 84:0b3ab51c8877 | 98 | */ |
bogdanm | 84:0b3ab51c8877 | 99 | #if !defined (USE_HAL_DRIVER) |
bogdanm | 84:0b3ab51c8877 | 100 | /** |
bogdanm | 84:0b3ab51c8877 | 101 | * @brief Comment the line below if you will not use the peripherals drivers. |
bogdanm | 84:0b3ab51c8877 | 102 | In this case, these drivers will not be included and the application code will |
bogdanm | 84:0b3ab51c8877 | 103 | be based on direct access to peripherals registers |
bogdanm | 84:0b3ab51c8877 | 104 | */ |
bogdanm | 84:0b3ab51c8877 | 105 | #define USE_HAL_DRIVER |
bogdanm | 84:0b3ab51c8877 | 106 | #endif /* USE_HAL_DRIVER */ |
bogdanm | 84:0b3ab51c8877 | 107 | |
bogdanm | 84:0b3ab51c8877 | 108 | /** |
Kojto | 96:487b796308b0 | 109 | * @brief CMSIS Device version number V1.2.0 |
bogdanm | 84:0b3ab51c8877 | 110 | */ |
bogdanm | 84:0b3ab51c8877 | 111 | #define __STM32L0xx_CMSIS_DEVICE_VERSION_MAIN (0x01) /*!< [31:24] main version */ |
Kojto | 96:487b796308b0 | 112 | #define __STM32L0xx_CMSIS_DEVICE_VERSION_SUB1 (0x02) /*!< [23:16] sub1 version */ |
bogdanm | 84:0b3ab51c8877 | 113 | #define __STM32L0xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ |
bogdanm | 84:0b3ab51c8877 | 114 | #define __STM32L0xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */ |
bogdanm | 84:0b3ab51c8877 | 115 | #define __STM32L0xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\ |
bogdanm | 84:0b3ab51c8877 | 116 | |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\ |
bogdanm | 84:0b3ab51c8877 | 117 | |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\ |
bogdanm | 84:0b3ab51c8877 | 118 | |(__CMSIS_DEVICE_HAL_VERSION_RC)) |
bogdanm | 84:0b3ab51c8877 | 119 | |
bogdanm | 84:0b3ab51c8877 | 120 | /** |
bogdanm | 84:0b3ab51c8877 | 121 | * @} |
bogdanm | 84:0b3ab51c8877 | 122 | */ |
bogdanm | 84:0b3ab51c8877 | 123 | |
bogdanm | 84:0b3ab51c8877 | 124 | /** @addtogroup Device_Included |
bogdanm | 84:0b3ab51c8877 | 125 | * @{ |
bogdanm | 84:0b3ab51c8877 | 126 | */ |
bogdanm | 84:0b3ab51c8877 | 127 | |
Kojto | 96:487b796308b0 | 128 | #if defined(STM32L031xx) |
Kojto | 96:487b796308b0 | 129 | #include "stm32l031xx.h" |
Kojto | 96:487b796308b0 | 130 | #elif defined(STM32L041xx) |
Kojto | 96:487b796308b0 | 131 | #include "stm32l041xx.h" |
Kojto | 96:487b796308b0 | 132 | #elif defined(STM32L051xx) |
bogdanm | 84:0b3ab51c8877 | 133 | #include "stm32l051xx.h" |
bogdanm | 84:0b3ab51c8877 | 134 | #elif defined(STM32L052xx) |
bogdanm | 84:0b3ab51c8877 | 135 | #include "stm32l052xx.h" |
bogdanm | 84:0b3ab51c8877 | 136 | #elif defined(STM32L053xx) |
bogdanm | 84:0b3ab51c8877 | 137 | #include "stm32l053xx.h" |
bogdanm | 84:0b3ab51c8877 | 138 | #elif defined(STM32L062xx) |
bogdanm | 84:0b3ab51c8877 | 139 | #include "stm32l062xx.h" |
bogdanm | 84:0b3ab51c8877 | 140 | #elif defined(STM32L063xx) |
bogdanm | 84:0b3ab51c8877 | 141 | #include "stm32l063xx.h" |
bogdanm | 84:0b3ab51c8877 | 142 | #elif defined(STM32L061xx) |
bogdanm | 84:0b3ab51c8877 | 143 | #include "stm32l061xx.h" |
Kojto | 96:487b796308b0 | 144 | #elif defined(STM32L071xx) |
Kojto | 96:487b796308b0 | 145 | #include "stm32l071xx.h" |
Kojto | 96:487b796308b0 | 146 | #elif defined(STM32L072xx) |
Kojto | 96:487b796308b0 | 147 | #include "stm32l072xx.h" |
Kojto | 96:487b796308b0 | 148 | #elif defined(STM32L073xx) |
Kojto | 96:487b796308b0 | 149 | #include "stm32l073xx.h" |
Kojto | 96:487b796308b0 | 150 | #elif defined(STM32L082xx) |
Kojto | 96:487b796308b0 | 151 | #include "stm32l082xx.h" |
Kojto | 96:487b796308b0 | 152 | #elif defined(STM32L083xx) |
Kojto | 96:487b796308b0 | 153 | #include "stm32l083xx.h" |
Kojto | 96:487b796308b0 | 154 | #elif defined(STM32L081xx) |
Kojto | 96:487b796308b0 | 155 | #include "stm32l081xx.h" |
bogdanm | 84:0b3ab51c8877 | 156 | #else |
bogdanm | 84:0b3ab51c8877 | 157 | #error "Please select first the target STM32L0xx device used in your application (in stm32l0xx.h file)" |
bogdanm | 84:0b3ab51c8877 | 158 | #endif |
bogdanm | 84:0b3ab51c8877 | 159 | |
bogdanm | 84:0b3ab51c8877 | 160 | /** |
bogdanm | 84:0b3ab51c8877 | 161 | * @} |
bogdanm | 84:0b3ab51c8877 | 162 | */ |
bogdanm | 84:0b3ab51c8877 | 163 | |
bogdanm | 84:0b3ab51c8877 | 164 | /** @addtogroup Exported_types |
bogdanm | 84:0b3ab51c8877 | 165 | * @{ |
bogdanm | 84:0b3ab51c8877 | 166 | */ |
bogdanm | 84:0b3ab51c8877 | 167 | typedef enum |
bogdanm | 84:0b3ab51c8877 | 168 | { |
bogdanm | 84:0b3ab51c8877 | 169 | RESET = 0, |
bogdanm | 84:0b3ab51c8877 | 170 | SET = !RESET |
bogdanm | 84:0b3ab51c8877 | 171 | } FlagStatus, ITStatus; |
bogdanm | 84:0b3ab51c8877 | 172 | |
bogdanm | 84:0b3ab51c8877 | 173 | typedef enum |
bogdanm | 84:0b3ab51c8877 | 174 | { |
bogdanm | 84:0b3ab51c8877 | 175 | DISABLE = 0, |
bogdanm | 84:0b3ab51c8877 | 176 | ENABLE = !DISABLE |
bogdanm | 84:0b3ab51c8877 | 177 | } FunctionalState; |
bogdanm | 84:0b3ab51c8877 | 178 | #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE)) |
bogdanm | 84:0b3ab51c8877 | 179 | |
bogdanm | 84:0b3ab51c8877 | 180 | typedef enum |
bogdanm | 84:0b3ab51c8877 | 181 | { |
bogdanm | 84:0b3ab51c8877 | 182 | ERROR = 0, |
bogdanm | 84:0b3ab51c8877 | 183 | SUCCESS = !ERROR |
bogdanm | 84:0b3ab51c8877 | 184 | } ErrorStatus; |
bogdanm | 84:0b3ab51c8877 | 185 | |
bogdanm | 84:0b3ab51c8877 | 186 | /** |
bogdanm | 84:0b3ab51c8877 | 187 | * @} |
bogdanm | 84:0b3ab51c8877 | 188 | */ |
bogdanm | 84:0b3ab51c8877 | 189 | |
bogdanm | 84:0b3ab51c8877 | 190 | |
bogdanm | 84:0b3ab51c8877 | 191 | /** @addtogroup Exported_macro |
bogdanm | 84:0b3ab51c8877 | 192 | * @{ |
bogdanm | 84:0b3ab51c8877 | 193 | */ |
bogdanm | 84:0b3ab51c8877 | 194 | #define SET_BIT(REG, BIT) ((REG) |= (BIT)) |
bogdanm | 84:0b3ab51c8877 | 195 | |
bogdanm | 84:0b3ab51c8877 | 196 | #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT)) |
bogdanm | 84:0b3ab51c8877 | 197 | |
bogdanm | 84:0b3ab51c8877 | 198 | #define READ_BIT(REG, BIT) ((REG) & (BIT)) |
bogdanm | 84:0b3ab51c8877 | 199 | |
bogdanm | 84:0b3ab51c8877 | 200 | #define CLEAR_REG(REG) ((REG) = (0x0)) |
bogdanm | 84:0b3ab51c8877 | 201 | |
bogdanm | 84:0b3ab51c8877 | 202 | #define WRITE_REG(REG, VAL) ((REG) = (VAL)) |
bogdanm | 84:0b3ab51c8877 | 203 | |
bogdanm | 84:0b3ab51c8877 | 204 | #define READ_REG(REG) ((REG)) |
bogdanm | 84:0b3ab51c8877 | 205 | |
bogdanm | 84:0b3ab51c8877 | 206 | #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK))) |
bogdanm | 84:0b3ab51c8877 | 207 | |
bogdanm | 84:0b3ab51c8877 | 208 | |
bogdanm | 84:0b3ab51c8877 | 209 | /** |
bogdanm | 84:0b3ab51c8877 | 210 | * @} |
bogdanm | 84:0b3ab51c8877 | 211 | */ |
bogdanm | 84:0b3ab51c8877 | 212 | |
bogdanm | 84:0b3ab51c8877 | 213 | #if defined (USE_HAL_DRIVER) |
bogdanm | 84:0b3ab51c8877 | 214 | #include "stm32l0xx_hal.h" |
bogdanm | 84:0b3ab51c8877 | 215 | #endif /* USE_HAL_DRIVER */ |
bogdanm | 84:0b3ab51c8877 | 216 | |
bogdanm | 84:0b3ab51c8877 | 217 | #ifdef __cplusplus |
bogdanm | 84:0b3ab51c8877 | 218 | } |
bogdanm | 84:0b3ab51c8877 | 219 | #endif /* __cplusplus */ |
bogdanm | 84:0b3ab51c8877 | 220 | |
bogdanm | 84:0b3ab51c8877 | 221 | #endif /* __STM32L0xx_H */ |
bogdanm | 84:0b3ab51c8877 | 222 | /** |
bogdanm | 84:0b3ab51c8877 | 223 | * @} |
bogdanm | 84:0b3ab51c8877 | 224 | */ |
bogdanm | 84:0b3ab51c8877 | 225 | |
bogdanm | 84:0b3ab51c8877 | 226 | /** |
bogdanm | 84:0b3ab51c8877 | 227 | * @} |
bogdanm | 84:0b3ab51c8877 | 228 | */ |
bogdanm | 84:0b3ab51c8877 | 229 | |
bogdanm | 84:0b3ab51c8877 | 230 | |
bogdanm | 84:0b3ab51c8877 | 231 | |
bogdanm | 84:0b3ab51c8877 | 232 | |
bogdanm | 84:0b3ab51c8877 | 233 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |