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