Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
99:dbbf35b96557
.

Who changed what in which revision?

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