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:
112:6f327212ef96
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 112:6f327212ef96 1 /**
Kojto 112:6f327212ef96 2 ******************************************************************************
Kojto 112:6f327212ef96 3 * @file stm32l1xx.h
Kojto 112:6f327212ef96 4 * @author MCD Application Team
Kojto 112:6f327212ef96 5 * @version V2.0.0
Kojto 112:6f327212ef96 6 * @date 5-September-2014
Kojto 112:6f327212ef96 7 * @brief CMSIS STM32L1xx Device Peripheral Access Layer Header File.
Kojto 112:6f327212ef96 8 *
Kojto 112:6f327212ef96 9 * The file is the unique include file that the application programmer
Kojto 112:6f327212ef96 10 * is using in the C source code, usually in main.c. This file contains:
Kojto 112:6f327212ef96 11 * - Configuration section that allows to select:
Kojto 112:6f327212ef96 12 * - The STM32L1xx device used in the target application
Kojto 112:6f327212ef96 13 * - To use or not the peripheral’s drivers in application code(i.e.
Kojto 112:6f327212ef96 14 * code will be based on direct access to peripheral’s registers
Kojto 112:6f327212ef96 15 * rather than drivers API), this option is controlled by
Kojto 112:6f327212ef96 16 * "#define USE_HAL_DRIVER"
Kojto 112:6f327212ef96 17 *
Kojto 112:6f327212ef96 18 ******************************************************************************
Kojto 112:6f327212ef96 19 * @attention
Kojto 112:6f327212ef96 20 *
Kojto 112:6f327212ef96 21 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 112:6f327212ef96 22 *
Kojto 112:6f327212ef96 23 * Redistribution and use in source and binary forms, with or without modification,
Kojto 112:6f327212ef96 24 * are permitted provided that the following conditions are met:
Kojto 112:6f327212ef96 25 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 112:6f327212ef96 26 * this list of conditions and the following disclaimer.
Kojto 112:6f327212ef96 27 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 112:6f327212ef96 28 * this list of conditions and the following disclaimer in the documentation
Kojto 112:6f327212ef96 29 * and/or other materials provided with the distribution.
Kojto 112:6f327212ef96 30 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 112:6f327212ef96 31 * may be used to endorse or promote products derived from this software
Kojto 112:6f327212ef96 32 * without specific prior written permission.
Kojto 112:6f327212ef96 33 *
Kojto 112:6f327212ef96 34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 112:6f327212ef96 35 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 112:6f327212ef96 36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 112:6f327212ef96 37 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 112:6f327212ef96 38 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 112:6f327212ef96 39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 112:6f327212ef96 40 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 112:6f327212ef96 41 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 112:6f327212ef96 42 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 112:6f327212ef96 43 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 112:6f327212ef96 44 *
Kojto 112:6f327212ef96 45 ******************************************************************************
Kojto 112:6f327212ef96 46 */
Kojto 112:6f327212ef96 47
Kojto 112:6f327212ef96 48 /** @addtogroup CMSIS
Kojto 112:6f327212ef96 49 * @{
Kojto 112:6f327212ef96 50 */
Kojto 112:6f327212ef96 51
Kojto 112:6f327212ef96 52 /** @addtogroup stm32l1xx
Kojto 112:6f327212ef96 53 * @{
Kojto 112:6f327212ef96 54 */
Kojto 112:6f327212ef96 55
Kojto 112:6f327212ef96 56 #ifndef __STM32L1XX_H
Kojto 112:6f327212ef96 57 #define __STM32L1XX_H
Kojto 112:6f327212ef96 58
Kojto 112:6f327212ef96 59 #ifdef __cplusplus
Kojto 112:6f327212ef96 60 extern "C" {
Kojto 112:6f327212ef96 61 #endif /* __cplusplus */
Kojto 112:6f327212ef96 62
Kojto 112:6f327212ef96 63 /** @addtogroup Library_configuration_section
Kojto 112:6f327212ef96 64 * @{
Kojto 112:6f327212ef96 65 */
Kojto 112:6f327212ef96 66
Kojto 112:6f327212ef96 67 /* Uncomment the line below according to the target STM32L device used in your
Kojto 112:6f327212ef96 68 application
Kojto 112:6f327212ef96 69 */
Kojto 112:6f327212ef96 70
Kojto 112:6f327212ef96 71 #if !defined (STM32L100xB) && !defined (STM32L100xBA) && !defined (STM32L100xC) && \
Kojto 112:6f327212ef96 72 !defined (STM32L151xB) && !defined (STM32L151xBA) && !defined (STM32L151xC) && !defined (STM32L151xCA) && !defined (STM32L151xD) && !defined (STM32L151xE) && \
Kojto 112:6f327212ef96 73 !defined (STM32L152xB) && !defined (STM32L152xBA) && !defined (STM32L152xC) && !defined (STM32L152xCA) && !defined (STM32L152xD) && !defined (STM32L152xE) && \
Kojto 112:6f327212ef96 74 !defined (STM32L162xC) && !defined (STM32L162xCA) && !defined (STM32L162xD) && !defined (STM32L162xE)
Kojto 112:6f327212ef96 75 /* #define STM32L100xB */ /*!< STM32L100C6, STM32L100R and STM32L100RB Devices */
Kojto 112:6f327212ef96 76 /* #define STM32L100xBA */ /*!< STM32L100C6-A, STM32L100R8-A and STM32L100RB-A Devices */
Kojto 112:6f327212ef96 77 /* #define STM32L100xC */ /*!< STM32L100RC Devices */
Kojto 112:6f327212ef96 78 /* #define STM32L151xB */ /*!< STM32L151C6, STM32L151R6, STM32L151C8, STM32L151R8, STM32L151V8, STM32L151CB, STM32L151RB and STM32L151VB */
Kojto 112:6f327212ef96 79 /* #define STM32L151xBA */ /*!< STM32L151C6-A, STM32L151R6-A, STM32L151C8-A, STM32L151R8-A, STM32L151V8-A, STM32L151CB-A, STM32L151RB-A and STM32L151VB-A */
Kojto 112:6f327212ef96 80 /* #define STM32L151xC */ /*!< STM32L151CC, STM32L151UC, STM32L151RC and STM32L151VC */
Kojto 112:6f327212ef96 81 /* #define STM32L151xCA */ /*!< STM32L151RC-A, STM32L151VC-A, STM32L151QC and STM32L151ZC */
Kojto 112:6f327212ef96 82 /* #define STM32L151xD */ /*!< STM32L151QD, STM32L151RD, STM32L151VD & STM32L151ZD */
Kojto 112:6f327212ef96 83 /* #define STM32L151xE */ /*!< STM32L151QE, STM32L151RE, STM32L151VE and STM32L151ZE */
Kojto 112:6f327212ef96 84 /* #define STM32L152xB */ /*!< STM32L152C6, STM32L152R6, STM32L152C8, STM32L152R8, STM32L152V8, STM32L152CB, STM32L152RB and STM32L152VB */
Kojto 112:6f327212ef96 85 /* #define STM32L152xBA */ /*!< STM32L152C6-A, STM32L152R6-A, STM32L152C8-A, STM32L152R8-A, STM32L152V8-A, STM32L152CB-A, STM32L152RB-A and STM32L152VB-A */
Kojto 112:6f327212ef96 86 #define STM32L152xC /*!< STM32L152CC, STM32L152UC, STM32L152RC and STM32L152VC */
Kojto 112:6f327212ef96 87 /* #define STM32L152xCA */ /*!< STM32L152RC-A, STM32L152VC-A, STM32L152QC and STM32L152ZC */
Kojto 112:6f327212ef96 88 /* #define STM32L152xD */ /*!< STM32L152QD, STM32L152RD, STM32L152VD and STM32L152ZD */
Kojto 112:6f327212ef96 89 /* #define STM32L152xE */ /*!< STM32L152QE, STM32L152RE, STM32L152VE and STM32L152ZE */
Kojto 112:6f327212ef96 90 /* #define STM32L162xC */ /*!< STM32L162RC and STM32L162VC */
Kojto 112:6f327212ef96 91 /* #define STM32L162xCA */ /*!< STM32L162RC-A, STM32L162VC-A, STM32L162QC and STM32L162ZC */
Kojto 112:6f327212ef96 92 /* #define STM32L162xD */ /*!< STM32L162QD, STM32L162RD, STM32L162VD and STM32L162ZD */
Kojto 112:6f327212ef96 93 /* #define STM32L162xE */ /*!< STM32L162RE, STM32L162VE and STM32L162ZE */
Kojto 112:6f327212ef96 94 #endif
Kojto 112:6f327212ef96 95
Kojto 112:6f327212ef96 96 /* Tip: To avoid modifying this file each time you need to switch between these
Kojto 112:6f327212ef96 97 devices, you can define the device in your toolchain compiler preprocessor.
Kojto 112:6f327212ef96 98 */
Kojto 112:6f327212ef96 99
Kojto 112:6f327212ef96 100 #if !defined (USE_HAL_DRIVER)
Kojto 112:6f327212ef96 101 /**
Kojto 112:6f327212ef96 102 * @brief Comment the line below if you will not use the peripherals drivers.
Kojto 112:6f327212ef96 103 In this case, these drivers will not be included and the application code will
Kojto 112:6f327212ef96 104 be based on direct access to peripherals registers
Kojto 112:6f327212ef96 105 */
Kojto 112:6f327212ef96 106 #define USE_HAL_DRIVER
Kojto 112:6f327212ef96 107 #endif /* USE_HAL_DRIVER */
Kojto 112:6f327212ef96 108
Kojto 112:6f327212ef96 109 /**
Kojto 112:6f327212ef96 110 * @brief CMSIS Device version number V2.0.0
Kojto 112:6f327212ef96 111 */
Kojto 112:6f327212ef96 112 #define __STM32L1xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */
Kojto 112:6f327212ef96 113 #define __STM32L1xx_CMSIS_DEVICE_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
Kojto 112:6f327212ef96 114 #define __STM32L1xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
Kojto 112:6f327212ef96 115 #define __STM32L1xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
Kojto 112:6f327212ef96 116 #define __STM32L1xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
Kojto 112:6f327212ef96 117 |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
Kojto 112:6f327212ef96 118 |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
Kojto 112:6f327212ef96 119 |(__CMSIS_DEVICE_HAL_VERSION_RC))
Kojto 112:6f327212ef96 120
Kojto 112:6f327212ef96 121 /**
Kojto 112:6f327212ef96 122 * @}
Kojto 112:6f327212ef96 123 */
Kojto 112:6f327212ef96 124
Kojto 112:6f327212ef96 125 /** @addtogroup Device_Included
Kojto 112:6f327212ef96 126 * @{
Kojto 112:6f327212ef96 127 */
Kojto 112:6f327212ef96 128
Kojto 112:6f327212ef96 129 #if defined(STM32L100xB)
Kojto 112:6f327212ef96 130 #include "stm32l100xb.h"
Kojto 112:6f327212ef96 131 #elif defined(STM32L100xBA)
Kojto 112:6f327212ef96 132 #include "stm32l100xba.h"
Kojto 112:6f327212ef96 133 #elif defined(STM32L100xC)
Kojto 112:6f327212ef96 134 #include "stm32l100xc.h"
Kojto 112:6f327212ef96 135 #elif defined(STM32L151xB)
Kojto 112:6f327212ef96 136 #include "stm32l151xb.h"
Kojto 112:6f327212ef96 137 #elif defined(STM32L151xBA)
Kojto 112:6f327212ef96 138 #include "stm32l151xba.h"
Kojto 112:6f327212ef96 139 #elif defined(STM32L151xC)
Kojto 112:6f327212ef96 140 #include "stm32l151xc.h"
Kojto 112:6f327212ef96 141 #elif defined(STM32L151xCA)
Kojto 112:6f327212ef96 142 #include "stm32l151xca.h"
Kojto 112:6f327212ef96 143 #elif defined(STM32L151xD)
Kojto 112:6f327212ef96 144 #include "stm32l151xd.h"
Kojto 112:6f327212ef96 145 #elif defined(STM32L151xE)
Kojto 112:6f327212ef96 146 #include "stm32l151xe.h"
Kojto 112:6f327212ef96 147 #elif defined(STM32L152xB)
Kojto 112:6f327212ef96 148 #include "stm32l152xb.h"
Kojto 112:6f327212ef96 149 #elif defined(STM32L152xBA)
Kojto 112:6f327212ef96 150 #include "stm32l152xba.h"
Kojto 112:6f327212ef96 151 #elif defined(STM32L152xC)
Kojto 112:6f327212ef96 152 #include "stm32l152xc.h"
Kojto 112:6f327212ef96 153 #elif defined(STM32L152xCA)
Kojto 112:6f327212ef96 154 #include "stm32l152xca.h"
Kojto 112:6f327212ef96 155 #elif defined(STM32L152xD)
Kojto 112:6f327212ef96 156 #include "stm32l152xd.h"
Kojto 112:6f327212ef96 157 #elif defined(STM32L152xE)
Kojto 112:6f327212ef96 158 #include "stm32l152xe.h"
Kojto 112:6f327212ef96 159 #elif defined(STM32L162xC)
Kojto 112:6f327212ef96 160 #include "stm32l162xc.h"
Kojto 112:6f327212ef96 161 #elif defined(STM32L162xCA)
Kojto 112:6f327212ef96 162 #include "stm32l162xca.h"
Kojto 112:6f327212ef96 163 #elif defined(STM32L162xD)
Kojto 112:6f327212ef96 164 #include "stm32l162xd.h"
Kojto 112:6f327212ef96 165 #elif defined(STM32L162xE)
Kojto 112:6f327212ef96 166 #include "stm32l162xe.h"
Kojto 112:6f327212ef96 167 #else
Kojto 112:6f327212ef96 168 #error "Please select first the target STM32L1xx device used in your application (in stm32l1xx.h file)"
Kojto 112:6f327212ef96 169 #endif
Kojto 112:6f327212ef96 170
Kojto 112:6f327212ef96 171 /**
Kojto 112:6f327212ef96 172 * @}
Kojto 112:6f327212ef96 173 */
Kojto 112:6f327212ef96 174
Kojto 112:6f327212ef96 175 /** @addtogroup Exported_types
Kojto 112:6f327212ef96 176 * @{
Kojto 112:6f327212ef96 177 */
Kojto 112:6f327212ef96 178 typedef enum
Kojto 112:6f327212ef96 179 {
Kojto 112:6f327212ef96 180 RESET = 0,
Kojto 112:6f327212ef96 181 SET = !RESET
Kojto 112:6f327212ef96 182 } FlagStatus, ITStatus;
Kojto 112:6f327212ef96 183
Kojto 112:6f327212ef96 184 typedef enum
Kojto 112:6f327212ef96 185 {
Kojto 112:6f327212ef96 186 DISABLE = 0,
Kojto 112:6f327212ef96 187 ENABLE = !DISABLE
Kojto 112:6f327212ef96 188 } FunctionalState;
Kojto 112:6f327212ef96 189 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
Kojto 112:6f327212ef96 190
Kojto 112:6f327212ef96 191 typedef enum
Kojto 112:6f327212ef96 192 {
Kojto 112:6f327212ef96 193 ERROR = 0,
Kojto 112:6f327212ef96 194 SUCCESS = !ERROR
Kojto 112:6f327212ef96 195 } ErrorStatus;
Kojto 112:6f327212ef96 196
Kojto 112:6f327212ef96 197 /**
Kojto 112:6f327212ef96 198 * @}
Kojto 112:6f327212ef96 199 */
Kojto 112:6f327212ef96 200
Kojto 112:6f327212ef96 201
Kojto 112:6f327212ef96 202 /** @addtogroup Exported_macros
Kojto 112:6f327212ef96 203 * @{
Kojto 112:6f327212ef96 204 */
Kojto 112:6f327212ef96 205 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
Kojto 112:6f327212ef96 206
Kojto 112:6f327212ef96 207 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
Kojto 112:6f327212ef96 208
Kojto 112:6f327212ef96 209 #define READ_BIT(REG, BIT) ((REG) & (BIT))
Kojto 112:6f327212ef96 210
Kojto 112:6f327212ef96 211 #define CLEAR_REG(REG) ((REG) = (0x0))
Kojto 112:6f327212ef96 212
Kojto 112:6f327212ef96 213 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
Kojto 112:6f327212ef96 214
Kojto 112:6f327212ef96 215 #define READ_REG(REG) ((REG))
Kojto 112:6f327212ef96 216
Kojto 112:6f327212ef96 217 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
Kojto 112:6f327212ef96 218
Kojto 112:6f327212ef96 219 #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
Kojto 112:6f327212ef96 220
Kojto 112:6f327212ef96 221
Kojto 112:6f327212ef96 222 /**
Kojto 112:6f327212ef96 223 * @}
Kojto 112:6f327212ef96 224 */
Kojto 112:6f327212ef96 225
Kojto 112:6f327212ef96 226 #if defined (USE_HAL_DRIVER)
Kojto 112:6f327212ef96 227 #include "stm32l1xx_hal.h"
Kojto 112:6f327212ef96 228 #endif /* USE_HAL_DRIVER */
Kojto 112:6f327212ef96 229
Kojto 112:6f327212ef96 230
Kojto 112:6f327212ef96 231 #ifdef __cplusplus
Kojto 112:6f327212ef96 232 }
Kojto 112:6f327212ef96 233 #endif /* __cplusplus */
Kojto 112:6f327212ef96 234
Kojto 112:6f327212ef96 235 #endif /* __STM32L1xx_H */
Kojto 112:6f327212ef96 236 /**
Kojto 112:6f327212ef96 237 * @}
Kojto 112:6f327212ef96 238 */
Kojto 112:6f327212ef96 239
Kojto 112:6f327212ef96 240 /**
Kojto 112:6f327212ef96 241 * @}
Kojto 112:6f327212ef96 242 */
Kojto 112:6f327212ef96 243
Kojto 112:6f327212ef96 244
Kojto 112:6f327212ef96 245
Kojto 112:6f327212ef96 246
Kojto 112:6f327212ef96 247 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/