fix LPC812 PWM

Dependents:   IR_LED_Send

Fork of mbed-dev by mbed official

Committer:
mbed_official
Date:
Tue Apr 26 17:15:11 2016 +0100
Revision:
114:fe4fe5cfc3a3
Synchronized with git revision d25daf7fad8fea9180bfa5134105bc6439ed808a

Full URL: https://github.com/mbedmicro/mbed/commit/d25daf7fad8fea9180bfa5134105bc6439ed808a/

[NUCLEO_L031K6] Add target

Who changed what in which revision?

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