added prescaler for 16 bit pwm in LPC1347 target

Fork of mbed-dev by mbed official

Committer:
JojoS
Date:
Sat Sep 10 15:32:04 2016 +0000
Revision:
147:ba84b7dc41a7
Parent:
144:ef7eb2e8f9f7
added prescaler for 16 bit timers (solution as in LPC11xx), default prescaler 31 for max 28 ms period time

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 74:9322579e4309 1 /**
mbed_official 74:9322579e4309 2 ******************************************************************************
mbed_official 74:9322579e4309 3 * @file stm32f7xx.h
mbed_official 74:9322579e4309 4 * @author MCD Application Team
<> 144:ef7eb2e8f9f7 5 * @version V1.1.0
<> 144:ef7eb2e8f9f7 6 * @date 22-April-2016
mbed_official 74:9322579e4309 7 * @brief CMSIS STM32F7xx Device Peripheral Access Layer Header File.
mbed_official 74:9322579e4309 8 *
mbed_official 74:9322579e4309 9 * The file is the unique include file that the application programmer
mbed_official 74:9322579e4309 10 * is using in the C source code, usually in main.c. This file contains:
mbed_official 74:9322579e4309 11 * - Configuration section that allows to select:
mbed_official 74:9322579e4309 12 * - The STM32F7xx device used in the target application
mbed_official 74:9322579e4309 13 * - To use or not the peripheral’s drivers in application code(i.e.
mbed_official 74:9322579e4309 14 * code will be based on direct access to peripheral’s registers
mbed_official 74:9322579e4309 15 * rather than drivers API), this option is controlled by
mbed_official 74:9322579e4309 16 * "#define USE_HAL_DRIVER"
mbed_official 74:9322579e4309 17 *
mbed_official 74:9322579e4309 18 ******************************************************************************
mbed_official 74:9322579e4309 19 * @attention
mbed_official 74:9322579e4309 20 *
mbed_official 83:a036322b8637 21 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
mbed_official 74:9322579e4309 22 *
mbed_official 74:9322579e4309 23 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 74:9322579e4309 24 * are permitted provided that the following conditions are met:
mbed_official 74:9322579e4309 25 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 74:9322579e4309 26 * this list of conditions and the following disclaimer.
mbed_official 74:9322579e4309 27 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 74:9322579e4309 28 * this list of conditions and the following disclaimer in the documentation
mbed_official 74:9322579e4309 29 * and/or other materials provided with the distribution.
mbed_official 74:9322579e4309 30 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 74:9322579e4309 31 * may be used to endorse or promote products derived from this software
mbed_official 74:9322579e4309 32 * without specific prior written permission.
mbed_official 74:9322579e4309 33 *
mbed_official 74:9322579e4309 34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 74:9322579e4309 35 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 74:9322579e4309 36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 74:9322579e4309 37 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 74:9322579e4309 38 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 74:9322579e4309 39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 74:9322579e4309 40 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 74:9322579e4309 41 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 74:9322579e4309 42 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 74:9322579e4309 43 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 74:9322579e4309 44 *
mbed_official 74:9322579e4309 45 ******************************************************************************
mbed_official 74:9322579e4309 46 */
mbed_official 74:9322579e4309 47
mbed_official 74:9322579e4309 48 /** @addtogroup CMSIS
mbed_official 74:9322579e4309 49 * @{
mbed_official 74:9322579e4309 50 */
mbed_official 74:9322579e4309 51
mbed_official 74:9322579e4309 52 /** @addtogroup stm32f7xx
mbed_official 74:9322579e4309 53 * @{
mbed_official 74:9322579e4309 54 */
mbed_official 74:9322579e4309 55
mbed_official 74:9322579e4309 56 #ifndef __STM32F7xx_H
mbed_official 74:9322579e4309 57 #define __STM32F7xx_H
mbed_official 74:9322579e4309 58
mbed_official 74:9322579e4309 59 #ifdef __cplusplus
mbed_official 74:9322579e4309 60 extern "C" {
mbed_official 74:9322579e4309 61 #endif /* __cplusplus */
mbed_official 74:9322579e4309 62
mbed_official 74:9322579e4309 63 /** @addtogroup Library_configuration_section
mbed_official 74:9322579e4309 64 * @{
mbed_official 74:9322579e4309 65 */
mbed_official 74:9322579e4309 66
mbed_official 74:9322579e4309 67 /**
mbed_official 74:9322579e4309 68 * @brief STM32 Family
mbed_official 74:9322579e4309 69 */
mbed_official 74:9322579e4309 70 #if !defined (STM32F7)
mbed_official 74:9322579e4309 71 #define STM32F7
mbed_official 74:9322579e4309 72 #endif /* STM32F7 */
mbed_official 74:9322579e4309 73
mbed_official 74:9322579e4309 74 /* Uncomment the line below according to the target STM32 device used in your
mbed_official 74:9322579e4309 75 application
mbed_official 74:9322579e4309 76 */
<> 144:ef7eb2e8f9f7 77 #if !defined (STM32F756xx) && !defined (STM32F746xx) && !defined (STM32F745xx) && !defined (STM32F767xx) && \
<> 144:ef7eb2e8f9f7 78 !defined (STM32F769xx) && !defined (STM32F777xx) && !defined (STM32F779xx)
mbed_official 74:9322579e4309 79 /* #define STM32F756xx */ /*!< STM32F756VG, STM32F756ZG, STM32F756ZG, STM32F756IG, STM32F756BG,
mbed_official 74:9322579e4309 80 STM32F756NG Devices */
mbed_official 74:9322579e4309 81 #define STM32F746xx /*!< STM32F746VE, STM32F746VG, STM32F746ZE, STM32F746ZG, STM32F746IE, STM32F746IG,
mbed_official 74:9322579e4309 82 STM32F746BE, STM32F746BG, STM32F746NE, STM32F746NG Devices */
mbed_official 74:9322579e4309 83 /* #define STM32F745xx */ /*!< STM32F745VE, STM32F745VG, STM32F745ZG, STM32F745ZE, STM32F745IE, STM32F745IG Devices */
<> 144:ef7eb2e8f9f7 84 /* #define STM32F765xx */ /*!< STM32F765BI, STM32F765BG, STM32F765NI, STM32F765NG, STM32F765II, STM32F765IG,
<> 144:ef7eb2e8f9f7 85 STM32F765ZI, STM32F765ZG, STM32F765VI, STM32F765VG Devices */
<> 144:ef7eb2e8f9f7 86 /* #define STM32F767xx */ /*!< STM32F767BG, STM32F767BI, STM32F767IG, STM32F767II, STM32F767NG, STM32F767NI,
<> 144:ef7eb2e8f9f7 87 STM32F767VG, STM32F767VI, STM32F767ZG, STM32F767ZI, STM32F768AI Devices */
<> 144:ef7eb2e8f9f7 88 /* #define STM32F769xx */ /*!< STM32F769AG, STM32F769AI, STM32F769BG, STM32F769BI, STM32F769IG, STM32F769II,
<> 144:ef7eb2e8f9f7 89 STM32F769NG, STM32F769NI Devices */
<> 144:ef7eb2e8f9f7 90 /* #define STM32F777xx */ /*!< STM32F777VI, STM32F777ZI, STM32F777II, STM32F777BI, STM32F777NI, STM32F778AI Devices */
<> 144:ef7eb2e8f9f7 91 /* #define STM32F779xx */ /*!< STM32F779II, STM32F779BI, STM32F779NI, STM32F779AI Devices */
mbed_official 74:9322579e4309 92 #endif
mbed_official 74:9322579e4309 93
mbed_official 74:9322579e4309 94 /* Tip: To avoid modifying this file each time you need to switch between these
mbed_official 74:9322579e4309 95 devices, you can define the device in your toolchain compiler preprocessor.
mbed_official 74:9322579e4309 96 */
mbed_official 74:9322579e4309 97
mbed_official 74:9322579e4309 98 #if !defined (USE_HAL_DRIVER)
mbed_official 74:9322579e4309 99 /**
mbed_official 74:9322579e4309 100 * @brief Comment the line below if you will not use the peripherals drivers.
mbed_official 74:9322579e4309 101 In this case, these drivers will not be included and the application code will
mbed_official 74:9322579e4309 102 be based on direct access to peripherals registers
mbed_official 74:9322579e4309 103 */
mbed_official 74:9322579e4309 104 #define USE_HAL_DRIVER
mbed_official 74:9322579e4309 105 #endif /* USE_HAL_DRIVER */
mbed_official 74:9322579e4309 106
mbed_official 74:9322579e4309 107 /**
<> 144:ef7eb2e8f9f7 108 * @brief CMSIS Device version number V1.1.0
mbed_official 74:9322579e4309 109 */
<> 144:ef7eb2e8f9f7 110 #define __STM32F7_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */
<> 144:ef7eb2e8f9f7 111 #define __STM32F7_CMSIS_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */
<> 144:ef7eb2e8f9f7 112 #define __STM32F7_CMSIS_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
<> 144:ef7eb2e8f9f7 113 #define __STM32F7_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
<> 144:ef7eb2e8f9f7 114 #define __STM32F7_CMSIS_VERSION ((__STM32F7_CMSIS_VERSION_MAIN << 24)\
<> 144:ef7eb2e8f9f7 115 |(__STM32F7_CMSIS_VERSION_SUB1 << 16)\
<> 144:ef7eb2e8f9f7 116 |(__STM32F7_CMSIS_VERSION_SUB2 << 8 )\
<> 144:ef7eb2e8f9f7 117 |(__STM32F7_CMSIS_VERSION))
mbed_official 74:9322579e4309 118 /**
mbed_official 74:9322579e4309 119 * @}
mbed_official 74:9322579e4309 120 */
mbed_official 74:9322579e4309 121
mbed_official 74:9322579e4309 122 /** @addtogroup Device_Included
mbed_official 74:9322579e4309 123 * @{
mbed_official 74:9322579e4309 124 */
mbed_official 74:9322579e4309 125 #if defined(STM32F756xx)
mbed_official 74:9322579e4309 126 #include "stm32f756xx.h"
mbed_official 74:9322579e4309 127 #elif defined(STM32F746xx)
mbed_official 74:9322579e4309 128 #include "stm32f746xx.h"
mbed_official 74:9322579e4309 129 #elif defined(STM32F745xx)
mbed_official 74:9322579e4309 130 #include "stm32f745xx.h"
<> 144:ef7eb2e8f9f7 131 #elif defined(STM32F765xx)
<> 144:ef7eb2e8f9f7 132 #include "stm32f765xx.h"
<> 144:ef7eb2e8f9f7 133 #elif defined(STM32F767xx)
<> 144:ef7eb2e8f9f7 134 #include "stm32f767xx.h"
<> 144:ef7eb2e8f9f7 135 #elif defined(STM32F769xx)
<> 144:ef7eb2e8f9f7 136 #include "stm32f769xx.h"
<> 144:ef7eb2e8f9f7 137 #elif defined(STM32F777xx)
<> 144:ef7eb2e8f9f7 138 #include "stm32f777xx.h"
<> 144:ef7eb2e8f9f7 139 #elif defined(STM32F779xx)
<> 144:ef7eb2e8f9f7 140 #include "stm32f779xx.h"
mbed_official 74:9322579e4309 141 #else
mbed_official 74:9322579e4309 142 #error "Please select first the target STM32F7xx device used in your application (in stm32f7xx.h file)"
mbed_official 74:9322579e4309 143 #endif
mbed_official 74:9322579e4309 144
mbed_official 74:9322579e4309 145 /**
mbed_official 74:9322579e4309 146 * @}
mbed_official 74:9322579e4309 147 */
mbed_official 74:9322579e4309 148
mbed_official 74:9322579e4309 149 /** @addtogroup Exported_types
mbed_official 74:9322579e4309 150 * @{
mbed_official 74:9322579e4309 151 */
mbed_official 74:9322579e4309 152 typedef enum
mbed_official 74:9322579e4309 153 {
mbed_official 74:9322579e4309 154 RESET = 0,
mbed_official 74:9322579e4309 155 SET = !RESET
mbed_official 74:9322579e4309 156 } FlagStatus, ITStatus;
mbed_official 74:9322579e4309 157
mbed_official 74:9322579e4309 158 typedef enum
mbed_official 74:9322579e4309 159 {
mbed_official 74:9322579e4309 160 DISABLE = 0,
mbed_official 74:9322579e4309 161 ENABLE = !DISABLE
mbed_official 74:9322579e4309 162 } FunctionalState;
mbed_official 74:9322579e4309 163 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
mbed_official 74:9322579e4309 164
mbed_official 74:9322579e4309 165 typedef enum
mbed_official 74:9322579e4309 166 {
mbed_official 74:9322579e4309 167 ERROR = 0,
mbed_official 74:9322579e4309 168 SUCCESS = !ERROR
mbed_official 74:9322579e4309 169 } ErrorStatus;
mbed_official 74:9322579e4309 170
mbed_official 74:9322579e4309 171 /**
mbed_official 74:9322579e4309 172 * @}
mbed_official 74:9322579e4309 173 */
mbed_official 74:9322579e4309 174
mbed_official 74:9322579e4309 175 /** @addtogroup Exported_macro
mbed_official 74:9322579e4309 176 * @{
mbed_official 74:9322579e4309 177 */
mbed_official 74:9322579e4309 178 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
mbed_official 74:9322579e4309 179
mbed_official 74:9322579e4309 180 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
mbed_official 74:9322579e4309 181
mbed_official 74:9322579e4309 182 #define READ_BIT(REG, BIT) ((REG) & (BIT))
mbed_official 74:9322579e4309 183
mbed_official 74:9322579e4309 184 #define CLEAR_REG(REG) ((REG) = (0x0))
mbed_official 74:9322579e4309 185
mbed_official 74:9322579e4309 186 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
mbed_official 74:9322579e4309 187
mbed_official 74:9322579e4309 188 #define READ_REG(REG) ((REG))
mbed_official 74:9322579e4309 189
mbed_official 74:9322579e4309 190 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
mbed_official 74:9322579e4309 191
mbed_official 74:9322579e4309 192 #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
mbed_official 74:9322579e4309 193
mbed_official 74:9322579e4309 194 /**
mbed_official 74:9322579e4309 195 * @}
mbed_official 74:9322579e4309 196 */
mbed_official 74:9322579e4309 197
mbed_official 74:9322579e4309 198 #ifdef USE_HAL_DRIVER
mbed_official 74:9322579e4309 199 #include "stm32f7xx_hal_conf.h"
mbed_official 74:9322579e4309 200 #endif /* USE_HAL_DRIVER */
mbed_official 74:9322579e4309 201
mbed_official 74:9322579e4309 202 #ifdef __cplusplus
mbed_official 74:9322579e4309 203 }
mbed_official 74:9322579e4309 204 #endif /* __cplusplus */
mbed_official 74:9322579e4309 205
mbed_official 74:9322579e4309 206 #endif /* __STM32F7xx_H */
mbed_official 74:9322579e4309 207
mbed_official 74:9322579e4309 208 /**
mbed_official 74:9322579e4309 209 * @}
mbed_official 74:9322579e4309 210 */
mbed_official 74:9322579e4309 211
mbed_official 74:9322579e4309 212 /**
mbed_official 74:9322579e4309 213 * @}
mbed_official 74:9322579e4309 214 */
mbed_official 74:9322579e4309 215
mbed_official 74:9322579e4309 216 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/