mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Mon Feb 03 09:30:05 2014 +0000
Revision:
84:f54042cbc282
Parent:
70:c1fbde68b492
Synchronized with git revision bbbd8699601c42149ccf0c37bc42bb6856ccc4c6

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

[NUCLEO_L152RE/F030_R8] SPI, I2C, Ticker, PWM updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 52:a51c77007319 1 /**
mbed_official 52:a51c77007319 2 ******************************************************************************
mbed_official 52:a51c77007319 3 * @file stm32f10x_tim.h
mbed_official 52:a51c77007319 4 * @author MCD Application Team
mbed_official 84:f54042cbc282 5 * @version V3.6.1
mbed_official 84:f54042cbc282 6 * @date 05-March-2012
mbed_official 52:a51c77007319 7 * @brief This file contains all the functions prototypes for the TIM firmware
mbed_official 52:a51c77007319 8 * library.
mbed_official 70:c1fbde68b492 9 *******************************************************************************
mbed_official 70:c1fbde68b492 10 * Copyright (c) 2014, STMicroelectronics
mbed_official 70:c1fbde68b492 11 * All rights reserved.
mbed_official 70:c1fbde68b492 12 *
mbed_official 70:c1fbde68b492 13 * Redistribution and use in source and binary forms, with or without
mbed_official 70:c1fbde68b492 14 * modification, are permitted provided that the following conditions are met:
mbed_official 70:c1fbde68b492 15 *
mbed_official 70:c1fbde68b492 16 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 70:c1fbde68b492 17 * this list of conditions and the following disclaimer.
mbed_official 70:c1fbde68b492 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 70:c1fbde68b492 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 70:c1fbde68b492 20 * and/or other materials provided with the distribution.
mbed_official 70:c1fbde68b492 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 70:c1fbde68b492 22 * may be used to endorse or promote products derived from this software
mbed_official 70:c1fbde68b492 23 * without specific prior written permission.
mbed_official 70:c1fbde68b492 24 *
mbed_official 70:c1fbde68b492 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 70:c1fbde68b492 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 70:c1fbde68b492 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 70:c1fbde68b492 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 70:c1fbde68b492 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 70:c1fbde68b492 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 70:c1fbde68b492 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 70:c1fbde68b492 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 70:c1fbde68b492 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 70:c1fbde68b492 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 70:c1fbde68b492 35 *******************************************************************************
mbed_official 70:c1fbde68b492 36 */
mbed_official 52:a51c77007319 37
mbed_official 52:a51c77007319 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 52:a51c77007319 39 #ifndef __STM32F10x_TIM_H
mbed_official 52:a51c77007319 40 #define __STM32F10x_TIM_H
mbed_official 52:a51c77007319 41
mbed_official 52:a51c77007319 42 #ifdef __cplusplus
mbed_official 52:a51c77007319 43 extern "C" {
mbed_official 52:a51c77007319 44 #endif
mbed_official 52:a51c77007319 45
mbed_official 52:a51c77007319 46 /* Includes ------------------------------------------------------------------*/
mbed_official 52:a51c77007319 47 #include "stm32f10x.h"
mbed_official 52:a51c77007319 48
mbed_official 52:a51c77007319 49 /** @addtogroup STM32F10x_StdPeriph_Driver
mbed_official 52:a51c77007319 50 * @{
mbed_official 52:a51c77007319 51 */
mbed_official 52:a51c77007319 52
mbed_official 52:a51c77007319 53 /** @addtogroup TIM
mbed_official 52:a51c77007319 54 * @{
mbed_official 52:a51c77007319 55 */
mbed_official 52:a51c77007319 56
mbed_official 52:a51c77007319 57 /** @defgroup TIM_Exported_Types
mbed_official 52:a51c77007319 58 * @{
mbed_official 52:a51c77007319 59 */
mbed_official 52:a51c77007319 60
mbed_official 52:a51c77007319 61 /**
mbed_official 52:a51c77007319 62 * @brief TIM Time Base Init structure definition
mbed_official 52:a51c77007319 63 * @note This structure is used with all TIMx except for TIM6 and TIM7.
mbed_official 52:a51c77007319 64 */
mbed_official 52:a51c77007319 65
mbed_official 52:a51c77007319 66 typedef struct
mbed_official 52:a51c77007319 67 {
mbed_official 52:a51c77007319 68 uint16_t TIM_Prescaler; /*!< Specifies the prescaler value used to divide the TIM clock.
mbed_official 52:a51c77007319 69 This parameter can be a number between 0x0000 and 0xFFFF */
mbed_official 52:a51c77007319 70
mbed_official 52:a51c77007319 71 uint16_t TIM_CounterMode; /*!< Specifies the counter mode.
mbed_official 52:a51c77007319 72 This parameter can be a value of @ref TIM_Counter_Mode */
mbed_official 52:a51c77007319 73
mbed_official 52:a51c77007319 74 uint16_t TIM_Period; /*!< Specifies the period value to be loaded into the active
mbed_official 52:a51c77007319 75 Auto-Reload Register at the next update event.
mbed_official 52:a51c77007319 76 This parameter must be a number between 0x0000 and 0xFFFF. */
mbed_official 52:a51c77007319 77
mbed_official 52:a51c77007319 78 uint16_t TIM_ClockDivision; /*!< Specifies the clock division.
mbed_official 52:a51c77007319 79 This parameter can be a value of @ref TIM_Clock_Division_CKD */
mbed_official 52:a51c77007319 80
mbed_official 52:a51c77007319 81 uint8_t TIM_RepetitionCounter; /*!< Specifies the repetition counter value. Each time the RCR downcounter
mbed_official 52:a51c77007319 82 reaches zero, an update event is generated and counting restarts
mbed_official 52:a51c77007319 83 from the RCR value (N).
mbed_official 52:a51c77007319 84 This means in PWM mode that (N+1) corresponds to:
mbed_official 52:a51c77007319 85 - the number of PWM periods in edge-aligned mode
mbed_official 52:a51c77007319 86 - the number of half PWM period in center-aligned mode
mbed_official 52:a51c77007319 87 This parameter must be a number between 0x00 and 0xFF.
mbed_official 52:a51c77007319 88 @note This parameter is valid only for TIM1 and TIM8. */
mbed_official 52:a51c77007319 89 } TIM_TimeBaseInitTypeDef;
mbed_official 52:a51c77007319 90
mbed_official 52:a51c77007319 91 /**
mbed_official 52:a51c77007319 92 * @brief TIM Output Compare Init structure definition
mbed_official 52:a51c77007319 93 */
mbed_official 52:a51c77007319 94
mbed_official 52:a51c77007319 95 typedef struct
mbed_official 52:a51c77007319 96 {
mbed_official 52:a51c77007319 97 uint16_t TIM_OCMode; /*!< Specifies the TIM mode.
mbed_official 52:a51c77007319 98 This parameter can be a value of @ref TIM_Output_Compare_and_PWM_modes */
mbed_official 52:a51c77007319 99
mbed_official 52:a51c77007319 100 uint16_t TIM_OutputState; /*!< Specifies the TIM Output Compare state.
mbed_official 52:a51c77007319 101 This parameter can be a value of @ref TIM_Output_Compare_state */
mbed_official 52:a51c77007319 102
mbed_official 52:a51c77007319 103 uint16_t TIM_OutputNState; /*!< Specifies the TIM complementary Output Compare state.
mbed_official 52:a51c77007319 104 This parameter can be a value of @ref TIM_Output_Compare_N_state
mbed_official 52:a51c77007319 105 @note This parameter is valid only for TIM1 and TIM8. */
mbed_official 52:a51c77007319 106
mbed_official 52:a51c77007319 107 uint16_t TIM_Pulse; /*!< Specifies the pulse value to be loaded into the Capture Compare Register.
mbed_official 52:a51c77007319 108 This parameter can be a number between 0x0000 and 0xFFFF */
mbed_official 52:a51c77007319 109
mbed_official 52:a51c77007319 110 uint16_t TIM_OCPolarity; /*!< Specifies the output polarity.
mbed_official 52:a51c77007319 111 This parameter can be a value of @ref TIM_Output_Compare_Polarity */
mbed_official 52:a51c77007319 112
mbed_official 52:a51c77007319 113 uint16_t TIM_OCNPolarity; /*!< Specifies the complementary output polarity.
mbed_official 52:a51c77007319 114 This parameter can be a value of @ref TIM_Output_Compare_N_Polarity
mbed_official 52:a51c77007319 115 @note This parameter is valid only for TIM1 and TIM8. */
mbed_official 52:a51c77007319 116
mbed_official 52:a51c77007319 117 uint16_t TIM_OCIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state.
mbed_official 52:a51c77007319 118 This parameter can be a value of @ref TIM_Output_Compare_Idle_State
mbed_official 52:a51c77007319 119 @note This parameter is valid only for TIM1 and TIM8. */
mbed_official 52:a51c77007319 120
mbed_official 52:a51c77007319 121 uint16_t TIM_OCNIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state.
mbed_official 52:a51c77007319 122 This parameter can be a value of @ref TIM_Output_Compare_N_Idle_State
mbed_official 52:a51c77007319 123 @note This parameter is valid only for TIM1 and TIM8. */
mbed_official 52:a51c77007319 124 } TIM_OCInitTypeDef;
mbed_official 52:a51c77007319 125
mbed_official 52:a51c77007319 126 /**
mbed_official 52:a51c77007319 127 * @brief TIM Input Capture Init structure definition
mbed_official 52:a51c77007319 128 */
mbed_official 52:a51c77007319 129
mbed_official 52:a51c77007319 130 typedef struct
mbed_official 52:a51c77007319 131 {
mbed_official 52:a51c77007319 132
mbed_official 52:a51c77007319 133 uint16_t TIM_Channel; /*!< Specifies the TIM channel.
mbed_official 52:a51c77007319 134 This parameter can be a value of @ref TIM_Channel */
mbed_official 52:a51c77007319 135
mbed_official 52:a51c77007319 136 uint16_t TIM_ICPolarity; /*!< Specifies the active edge of the input signal.
mbed_official 52:a51c77007319 137 This parameter can be a value of @ref TIM_Input_Capture_Polarity */
mbed_official 52:a51c77007319 138
mbed_official 52:a51c77007319 139 uint16_t TIM_ICSelection; /*!< Specifies the input.
mbed_official 52:a51c77007319 140 This parameter can be a value of @ref TIM_Input_Capture_Selection */
mbed_official 52:a51c77007319 141
mbed_official 52:a51c77007319 142 uint16_t TIM_ICPrescaler; /*!< Specifies the Input Capture Prescaler.
mbed_official 52:a51c77007319 143 This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
mbed_official 52:a51c77007319 144
mbed_official 52:a51c77007319 145 uint16_t TIM_ICFilter; /*!< Specifies the input capture filter.
mbed_official 52:a51c77007319 146 This parameter can be a number between 0x0 and 0xF */
mbed_official 52:a51c77007319 147 } TIM_ICInitTypeDef;
mbed_official 52:a51c77007319 148
mbed_official 52:a51c77007319 149 /**
mbed_official 52:a51c77007319 150 * @brief BDTR structure definition
mbed_official 52:a51c77007319 151 * @note This structure is used only with TIM1 and TIM8.
mbed_official 52:a51c77007319 152 */
mbed_official 52:a51c77007319 153
mbed_official 52:a51c77007319 154 typedef struct
mbed_official 52:a51c77007319 155 {
mbed_official 52:a51c77007319 156
mbed_official 52:a51c77007319 157 uint16_t TIM_OSSRState; /*!< Specifies the Off-State selection used in Run mode.
mbed_official 52:a51c77007319 158 This parameter can be a value of @ref OSSR_Off_State_Selection_for_Run_mode_state */
mbed_official 52:a51c77007319 159
mbed_official 52:a51c77007319 160 uint16_t TIM_OSSIState; /*!< Specifies the Off-State used in Idle state.
mbed_official 52:a51c77007319 161 This parameter can be a value of @ref OSSI_Off_State_Selection_for_Idle_mode_state */
mbed_official 52:a51c77007319 162
mbed_official 52:a51c77007319 163 uint16_t TIM_LOCKLevel; /*!< Specifies the LOCK level parameters.
mbed_official 52:a51c77007319 164 This parameter can be a value of @ref Lock_level */
mbed_official 52:a51c77007319 165
mbed_official 52:a51c77007319 166 uint16_t TIM_DeadTime; /*!< Specifies the delay time between the switching-off and the
mbed_official 52:a51c77007319 167 switching-on of the outputs.
mbed_official 52:a51c77007319 168 This parameter can be a number between 0x00 and 0xFF */
mbed_official 52:a51c77007319 169
mbed_official 52:a51c77007319 170 uint16_t TIM_Break; /*!< Specifies whether the TIM Break input is enabled or not.
mbed_official 52:a51c77007319 171 This parameter can be a value of @ref Break_Input_enable_disable */
mbed_official 52:a51c77007319 172
mbed_official 52:a51c77007319 173 uint16_t TIM_BreakPolarity; /*!< Specifies the TIM Break Input pin polarity.
mbed_official 52:a51c77007319 174 This parameter can be a value of @ref Break_Polarity */
mbed_official 52:a51c77007319 175
mbed_official 52:a51c77007319 176 uint16_t TIM_AutomaticOutput; /*!< Specifies whether the TIM Automatic Output feature is enabled or not.
mbed_official 52:a51c77007319 177 This parameter can be a value of @ref TIM_AOE_Bit_Set_Reset */
mbed_official 52:a51c77007319 178 } TIM_BDTRInitTypeDef;
mbed_official 52:a51c77007319 179
mbed_official 52:a51c77007319 180 /** @defgroup TIM_Exported_constants
mbed_official 52:a51c77007319 181 * @{
mbed_official 52:a51c77007319 182 */
mbed_official 52:a51c77007319 183
mbed_official 52:a51c77007319 184 #define IS_TIM_ALL_PERIPH(PERIPH) (((PERIPH) == TIM1) || \
mbed_official 52:a51c77007319 185 ((PERIPH) == TIM2) || \
mbed_official 52:a51c77007319 186 ((PERIPH) == TIM3) || \
mbed_official 52:a51c77007319 187 ((PERIPH) == TIM4) || \
mbed_official 52:a51c77007319 188 ((PERIPH) == TIM5) || \
mbed_official 52:a51c77007319 189 ((PERIPH) == TIM6) || \
mbed_official 52:a51c77007319 190 ((PERIPH) == TIM7) || \
mbed_official 52:a51c77007319 191 ((PERIPH) == TIM8) || \
mbed_official 52:a51c77007319 192 ((PERIPH) == TIM9) || \
mbed_official 52:a51c77007319 193 ((PERIPH) == TIM10)|| \
mbed_official 52:a51c77007319 194 ((PERIPH) == TIM11)|| \
mbed_official 52:a51c77007319 195 ((PERIPH) == TIM12)|| \
mbed_official 52:a51c77007319 196 ((PERIPH) == TIM13)|| \
mbed_official 52:a51c77007319 197 ((PERIPH) == TIM14)|| \
mbed_official 52:a51c77007319 198 ((PERIPH) == TIM15)|| \
mbed_official 52:a51c77007319 199 ((PERIPH) == TIM16)|| \
mbed_official 52:a51c77007319 200 ((PERIPH) == TIM17))
mbed_official 52:a51c77007319 201
mbed_official 52:a51c77007319 202 /* LIST1: TIM 1 and 8 */
mbed_official 52:a51c77007319 203 #define IS_TIM_LIST1_PERIPH(PERIPH) (((PERIPH) == TIM1) || \
mbed_official 52:a51c77007319 204 ((PERIPH) == TIM8))
mbed_official 52:a51c77007319 205
mbed_official 52:a51c77007319 206 /* LIST2: TIM 1, 8, 15 16 and 17 */
mbed_official 52:a51c77007319 207 #define IS_TIM_LIST2_PERIPH(PERIPH) (((PERIPH) == TIM1) || \
mbed_official 52:a51c77007319 208 ((PERIPH) == TIM8) || \
mbed_official 52:a51c77007319 209 ((PERIPH) == TIM15)|| \
mbed_official 52:a51c77007319 210 ((PERIPH) == TIM16)|| \
mbed_official 52:a51c77007319 211 ((PERIPH) == TIM17))
mbed_official 52:a51c77007319 212
mbed_official 52:a51c77007319 213 /* LIST3: TIM 1, 2, 3, 4, 5 and 8 */
mbed_official 52:a51c77007319 214 #define IS_TIM_LIST3_PERIPH(PERIPH) (((PERIPH) == TIM1) || \
mbed_official 52:a51c77007319 215 ((PERIPH) == TIM2) || \
mbed_official 52:a51c77007319 216 ((PERIPH) == TIM3) || \
mbed_official 52:a51c77007319 217 ((PERIPH) == TIM4) || \
mbed_official 52:a51c77007319 218 ((PERIPH) == TIM5) || \
mbed_official 52:a51c77007319 219 ((PERIPH) == TIM8))
mbed_official 52:a51c77007319 220
mbed_official 52:a51c77007319 221 /* LIST4: TIM 1, 2, 3, 4, 5, 8, 15, 16 and 17 */
mbed_official 52:a51c77007319 222 #define IS_TIM_LIST4_PERIPH(PERIPH) (((PERIPH) == TIM1) || \
mbed_official 52:a51c77007319 223 ((PERIPH) == TIM2) || \
mbed_official 52:a51c77007319 224 ((PERIPH) == TIM3) || \
mbed_official 52:a51c77007319 225 ((PERIPH) == TIM4) || \
mbed_official 52:a51c77007319 226 ((PERIPH) == TIM5) || \
mbed_official 52:a51c77007319 227 ((PERIPH) == TIM8) || \
mbed_official 52:a51c77007319 228 ((PERIPH) == TIM15)|| \
mbed_official 52:a51c77007319 229 ((PERIPH) == TIM16)|| \
mbed_official 52:a51c77007319 230 ((PERIPH) == TIM17))
mbed_official 52:a51c77007319 231
mbed_official 52:a51c77007319 232 /* LIST5: TIM 1, 2, 3, 4, 5, 8 and 15 */
mbed_official 52:a51c77007319 233 #define IS_TIM_LIST5_PERIPH(PERIPH) (((PERIPH) == TIM1) || \
mbed_official 52:a51c77007319 234 ((PERIPH) == TIM2) || \
mbed_official 52:a51c77007319 235 ((PERIPH) == TIM3) || \
mbed_official 52:a51c77007319 236 ((PERIPH) == TIM4) || \
mbed_official 52:a51c77007319 237 ((PERIPH) == TIM5) || \
mbed_official 52:a51c77007319 238 ((PERIPH) == TIM8) || \
mbed_official 52:a51c77007319 239 ((PERIPH) == TIM15))
mbed_official 52:a51c77007319 240
mbed_official 52:a51c77007319 241 /* LIST6: TIM 1, 2, 3, 4, 5, 8, 9, 12 and 15 */
mbed_official 52:a51c77007319 242 #define IS_TIM_LIST6_PERIPH(PERIPH) (((PERIPH) == TIM1) || \
mbed_official 52:a51c77007319 243 ((PERIPH) == TIM2) || \
mbed_official 52:a51c77007319 244 ((PERIPH) == TIM3) || \
mbed_official 52:a51c77007319 245 ((PERIPH) == TIM4) || \
mbed_official 52:a51c77007319 246 ((PERIPH) == TIM5) || \
mbed_official 52:a51c77007319 247 ((PERIPH) == TIM8) || \
mbed_official 52:a51c77007319 248 ((PERIPH) == TIM9) || \
mbed_official 52:a51c77007319 249 ((PERIPH) == TIM12)|| \
mbed_official 52:a51c77007319 250 ((PERIPH) == TIM15))
mbed_official 52:a51c77007319 251
mbed_official 52:a51c77007319 252 /* LIST7: TIM 1, 2, 3, 4, 5, 6, 7, 8, 9, 12 and 15 */
mbed_official 52:a51c77007319 253 #define IS_TIM_LIST7_PERIPH(PERIPH) (((PERIPH) == TIM1) || \
mbed_official 52:a51c77007319 254 ((PERIPH) == TIM2) || \
mbed_official 52:a51c77007319 255 ((PERIPH) == TIM3) || \
mbed_official 52:a51c77007319 256 ((PERIPH) == TIM4) || \
mbed_official 52:a51c77007319 257 ((PERIPH) == TIM5) || \
mbed_official 52:a51c77007319 258 ((PERIPH) == TIM6) || \
mbed_official 52:a51c77007319 259 ((PERIPH) == TIM7) || \
mbed_official 52:a51c77007319 260 ((PERIPH) == TIM8) || \
mbed_official 52:a51c77007319 261 ((PERIPH) == TIM9) || \
mbed_official 52:a51c77007319 262 ((PERIPH) == TIM12)|| \
mbed_official 52:a51c77007319 263 ((PERIPH) == TIM15))
mbed_official 52:a51c77007319 264
mbed_official 52:a51c77007319 265 /* LIST8: TIM 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16 and 17 */
mbed_official 52:a51c77007319 266 #define IS_TIM_LIST8_PERIPH(PERIPH) (((PERIPH) == TIM1) || \
mbed_official 52:a51c77007319 267 ((PERIPH) == TIM2) || \
mbed_official 52:a51c77007319 268 ((PERIPH) == TIM3) || \
mbed_official 52:a51c77007319 269 ((PERIPH) == TIM4) || \
mbed_official 52:a51c77007319 270 ((PERIPH) == TIM5) || \
mbed_official 52:a51c77007319 271 ((PERIPH) == TIM8) || \
mbed_official 52:a51c77007319 272 ((PERIPH) == TIM9) || \
mbed_official 52:a51c77007319 273 ((PERIPH) == TIM10)|| \
mbed_official 52:a51c77007319 274 ((PERIPH) == TIM11)|| \
mbed_official 52:a51c77007319 275 ((PERIPH) == TIM12)|| \
mbed_official 52:a51c77007319 276 ((PERIPH) == TIM13)|| \
mbed_official 52:a51c77007319 277 ((PERIPH) == TIM14)|| \
mbed_official 52:a51c77007319 278 ((PERIPH) == TIM15)|| \
mbed_official 52:a51c77007319 279 ((PERIPH) == TIM16)|| \
mbed_official 52:a51c77007319 280 ((PERIPH) == TIM17))
mbed_official 52:a51c77007319 281
mbed_official 52:a51c77007319 282 /* LIST9: TIM 1, 2, 3, 4, 5, 6, 7, 8, 15, 16, and 17 */
mbed_official 52:a51c77007319 283 #define IS_TIM_LIST9_PERIPH(PERIPH) (((PERIPH) == TIM1) || \
mbed_official 52:a51c77007319 284 ((PERIPH) == TIM2) || \
mbed_official 52:a51c77007319 285 ((PERIPH) == TIM3) || \
mbed_official 52:a51c77007319 286 ((PERIPH) == TIM4) || \
mbed_official 52:a51c77007319 287 ((PERIPH) == TIM5) || \
mbed_official 52:a51c77007319 288 ((PERIPH) == TIM6) || \
mbed_official 52:a51c77007319 289 ((PERIPH) == TIM7) || \
mbed_official 52:a51c77007319 290 ((PERIPH) == TIM8) || \
mbed_official 52:a51c77007319 291 ((PERIPH) == TIM15)|| \
mbed_official 52:a51c77007319 292 ((PERIPH) == TIM16)|| \
mbed_official 52:a51c77007319 293 ((PERIPH) == TIM17))
mbed_official 52:a51c77007319 294
mbed_official 52:a51c77007319 295 /**
mbed_official 52:a51c77007319 296 * @}
mbed_official 52:a51c77007319 297 */
mbed_official 52:a51c77007319 298
mbed_official 52:a51c77007319 299 /** @defgroup TIM_Output_Compare_and_PWM_modes
mbed_official 52:a51c77007319 300 * @{
mbed_official 52:a51c77007319 301 */
mbed_official 52:a51c77007319 302
mbed_official 52:a51c77007319 303 #define TIM_OCMode_Timing ((uint16_t)0x0000)
mbed_official 52:a51c77007319 304 #define TIM_OCMode_Active ((uint16_t)0x0010)
mbed_official 52:a51c77007319 305 #define TIM_OCMode_Inactive ((uint16_t)0x0020)
mbed_official 52:a51c77007319 306 #define TIM_OCMode_Toggle ((uint16_t)0x0030)
mbed_official 52:a51c77007319 307 #define TIM_OCMode_PWM1 ((uint16_t)0x0060)
mbed_official 52:a51c77007319 308 #define TIM_OCMode_PWM2 ((uint16_t)0x0070)
mbed_official 52:a51c77007319 309 #define IS_TIM_OC_MODE(MODE) (((MODE) == TIM_OCMode_Timing) || \
mbed_official 52:a51c77007319 310 ((MODE) == TIM_OCMode_Active) || \
mbed_official 52:a51c77007319 311 ((MODE) == TIM_OCMode_Inactive) || \
mbed_official 52:a51c77007319 312 ((MODE) == TIM_OCMode_Toggle)|| \
mbed_official 52:a51c77007319 313 ((MODE) == TIM_OCMode_PWM1) || \
mbed_official 52:a51c77007319 314 ((MODE) == TIM_OCMode_PWM2))
mbed_official 52:a51c77007319 315 #define IS_TIM_OCM(MODE) (((MODE) == TIM_OCMode_Timing) || \
mbed_official 52:a51c77007319 316 ((MODE) == TIM_OCMode_Active) || \
mbed_official 52:a51c77007319 317 ((MODE) == TIM_OCMode_Inactive) || \
mbed_official 52:a51c77007319 318 ((MODE) == TIM_OCMode_Toggle)|| \
mbed_official 52:a51c77007319 319 ((MODE) == TIM_OCMode_PWM1) || \
mbed_official 52:a51c77007319 320 ((MODE) == TIM_OCMode_PWM2) || \
mbed_official 52:a51c77007319 321 ((MODE) == TIM_ForcedAction_Active) || \
mbed_official 52:a51c77007319 322 ((MODE) == TIM_ForcedAction_InActive))
mbed_official 52:a51c77007319 323 /**
mbed_official 52:a51c77007319 324 * @}
mbed_official 52:a51c77007319 325 */
mbed_official 52:a51c77007319 326
mbed_official 52:a51c77007319 327 /** @defgroup TIM_One_Pulse_Mode
mbed_official 52:a51c77007319 328 * @{
mbed_official 52:a51c77007319 329 */
mbed_official 52:a51c77007319 330
mbed_official 52:a51c77007319 331 #define TIM_OPMode_Single ((uint16_t)0x0008)
mbed_official 52:a51c77007319 332 #define TIM_OPMode_Repetitive ((uint16_t)0x0000)
mbed_official 52:a51c77007319 333 #define IS_TIM_OPM_MODE(MODE) (((MODE) == TIM_OPMode_Single) || \
mbed_official 52:a51c77007319 334 ((MODE) == TIM_OPMode_Repetitive))
mbed_official 52:a51c77007319 335 /**
mbed_official 52:a51c77007319 336 * @}
mbed_official 52:a51c77007319 337 */
mbed_official 52:a51c77007319 338
mbed_official 52:a51c77007319 339 /** @defgroup TIM_Channel
mbed_official 52:a51c77007319 340 * @{
mbed_official 52:a51c77007319 341 */
mbed_official 52:a51c77007319 342
mbed_official 52:a51c77007319 343 #define TIM_Channel_1 ((uint16_t)0x0000)
mbed_official 52:a51c77007319 344 #define TIM_Channel_2 ((uint16_t)0x0004)
mbed_official 52:a51c77007319 345 #define TIM_Channel_3 ((uint16_t)0x0008)
mbed_official 52:a51c77007319 346 #define TIM_Channel_4 ((uint16_t)0x000C)
mbed_official 52:a51c77007319 347 #define IS_TIM_CHANNEL(CHANNEL) (((CHANNEL) == TIM_Channel_1) || \
mbed_official 52:a51c77007319 348 ((CHANNEL) == TIM_Channel_2) || \
mbed_official 52:a51c77007319 349 ((CHANNEL) == TIM_Channel_3) || \
mbed_official 52:a51c77007319 350 ((CHANNEL) == TIM_Channel_4))
mbed_official 52:a51c77007319 351 #define IS_TIM_PWMI_CHANNEL(CHANNEL) (((CHANNEL) == TIM_Channel_1) || \
mbed_official 52:a51c77007319 352 ((CHANNEL) == TIM_Channel_2))
mbed_official 52:a51c77007319 353 #define IS_TIM_COMPLEMENTARY_CHANNEL(CHANNEL) (((CHANNEL) == TIM_Channel_1) || \
mbed_official 52:a51c77007319 354 ((CHANNEL) == TIM_Channel_2) || \
mbed_official 52:a51c77007319 355 ((CHANNEL) == TIM_Channel_3))
mbed_official 52:a51c77007319 356 /**
mbed_official 52:a51c77007319 357 * @}
mbed_official 52:a51c77007319 358 */
mbed_official 52:a51c77007319 359
mbed_official 52:a51c77007319 360 /** @defgroup TIM_Clock_Division_CKD
mbed_official 52:a51c77007319 361 * @{
mbed_official 52:a51c77007319 362 */
mbed_official 52:a51c77007319 363
mbed_official 52:a51c77007319 364 #define TIM_CKD_DIV1 ((uint16_t)0x0000)
mbed_official 52:a51c77007319 365 #define TIM_CKD_DIV2 ((uint16_t)0x0100)
mbed_official 52:a51c77007319 366 #define TIM_CKD_DIV4 ((uint16_t)0x0200)
mbed_official 52:a51c77007319 367 #define IS_TIM_CKD_DIV(DIV) (((DIV) == TIM_CKD_DIV1) || \
mbed_official 52:a51c77007319 368 ((DIV) == TIM_CKD_DIV2) || \
mbed_official 52:a51c77007319 369 ((DIV) == TIM_CKD_DIV4))
mbed_official 52:a51c77007319 370 /**
mbed_official 52:a51c77007319 371 * @}
mbed_official 52:a51c77007319 372 */
mbed_official 52:a51c77007319 373
mbed_official 52:a51c77007319 374 /** @defgroup TIM_Counter_Mode
mbed_official 52:a51c77007319 375 * @{
mbed_official 52:a51c77007319 376 */
mbed_official 52:a51c77007319 377
mbed_official 52:a51c77007319 378 #define TIM_CounterMode_Up ((uint16_t)0x0000)
mbed_official 52:a51c77007319 379 #define TIM_CounterMode_Down ((uint16_t)0x0010)
mbed_official 52:a51c77007319 380 #define TIM_CounterMode_CenterAligned1 ((uint16_t)0x0020)
mbed_official 52:a51c77007319 381 #define TIM_CounterMode_CenterAligned2 ((uint16_t)0x0040)
mbed_official 52:a51c77007319 382 #define TIM_CounterMode_CenterAligned3 ((uint16_t)0x0060)
mbed_official 52:a51c77007319 383 #define IS_TIM_COUNTER_MODE(MODE) (((MODE) == TIM_CounterMode_Up) || \
mbed_official 52:a51c77007319 384 ((MODE) == TIM_CounterMode_Down) || \
mbed_official 52:a51c77007319 385 ((MODE) == TIM_CounterMode_CenterAligned1) || \
mbed_official 52:a51c77007319 386 ((MODE) == TIM_CounterMode_CenterAligned2) || \
mbed_official 52:a51c77007319 387 ((MODE) == TIM_CounterMode_CenterAligned3))
mbed_official 52:a51c77007319 388 /**
mbed_official 52:a51c77007319 389 * @}
mbed_official 52:a51c77007319 390 */
mbed_official 52:a51c77007319 391
mbed_official 52:a51c77007319 392 /** @defgroup TIM_Output_Compare_Polarity
mbed_official 52:a51c77007319 393 * @{
mbed_official 52:a51c77007319 394 */
mbed_official 52:a51c77007319 395
mbed_official 52:a51c77007319 396 #define TIM_OCPolarity_High ((uint16_t)0x0000)
mbed_official 52:a51c77007319 397 #define TIM_OCPolarity_Low ((uint16_t)0x0002)
mbed_official 52:a51c77007319 398 #define IS_TIM_OC_POLARITY(POLARITY) (((POLARITY) == TIM_OCPolarity_High) || \
mbed_official 52:a51c77007319 399 ((POLARITY) == TIM_OCPolarity_Low))
mbed_official 52:a51c77007319 400 /**
mbed_official 52:a51c77007319 401 * @}
mbed_official 52:a51c77007319 402 */
mbed_official 52:a51c77007319 403
mbed_official 52:a51c77007319 404 /** @defgroup TIM_Output_Compare_N_Polarity
mbed_official 52:a51c77007319 405 * @{
mbed_official 52:a51c77007319 406 */
mbed_official 52:a51c77007319 407
mbed_official 52:a51c77007319 408 #define TIM_OCNPolarity_High ((uint16_t)0x0000)
mbed_official 52:a51c77007319 409 #define TIM_OCNPolarity_Low ((uint16_t)0x0008)
mbed_official 52:a51c77007319 410 #define IS_TIM_OCN_POLARITY(POLARITY) (((POLARITY) == TIM_OCNPolarity_High) || \
mbed_official 52:a51c77007319 411 ((POLARITY) == TIM_OCNPolarity_Low))
mbed_official 52:a51c77007319 412 /**
mbed_official 52:a51c77007319 413 * @}
mbed_official 52:a51c77007319 414 */
mbed_official 52:a51c77007319 415
mbed_official 52:a51c77007319 416 /** @defgroup TIM_Output_Compare_state
mbed_official 52:a51c77007319 417 * @{
mbed_official 52:a51c77007319 418 */
mbed_official 52:a51c77007319 419
mbed_official 52:a51c77007319 420 #define TIM_OutputState_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 421 #define TIM_OutputState_Enable ((uint16_t)0x0001)
mbed_official 52:a51c77007319 422 #define IS_TIM_OUTPUT_STATE(STATE) (((STATE) == TIM_OutputState_Disable) || \
mbed_official 52:a51c77007319 423 ((STATE) == TIM_OutputState_Enable))
mbed_official 52:a51c77007319 424 /**
mbed_official 52:a51c77007319 425 * @}
mbed_official 52:a51c77007319 426 */
mbed_official 52:a51c77007319 427
mbed_official 52:a51c77007319 428 /** @defgroup TIM_Output_Compare_N_state
mbed_official 52:a51c77007319 429 * @{
mbed_official 52:a51c77007319 430 */
mbed_official 52:a51c77007319 431
mbed_official 52:a51c77007319 432 #define TIM_OutputNState_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 433 #define TIM_OutputNState_Enable ((uint16_t)0x0004)
mbed_official 52:a51c77007319 434 #define IS_TIM_OUTPUTN_STATE(STATE) (((STATE) == TIM_OutputNState_Disable) || \
mbed_official 52:a51c77007319 435 ((STATE) == TIM_OutputNState_Enable))
mbed_official 52:a51c77007319 436 /**
mbed_official 52:a51c77007319 437 * @}
mbed_official 52:a51c77007319 438 */
mbed_official 52:a51c77007319 439
mbed_official 52:a51c77007319 440 /** @defgroup TIM_Capture_Compare_state
mbed_official 52:a51c77007319 441 * @{
mbed_official 52:a51c77007319 442 */
mbed_official 52:a51c77007319 443
mbed_official 52:a51c77007319 444 #define TIM_CCx_Enable ((uint16_t)0x0001)
mbed_official 52:a51c77007319 445 #define TIM_CCx_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 446 #define IS_TIM_CCX(CCX) (((CCX) == TIM_CCx_Enable) || \
mbed_official 52:a51c77007319 447 ((CCX) == TIM_CCx_Disable))
mbed_official 52:a51c77007319 448 /**
mbed_official 52:a51c77007319 449 * @}
mbed_official 52:a51c77007319 450 */
mbed_official 52:a51c77007319 451
mbed_official 52:a51c77007319 452 /** @defgroup TIM_Capture_Compare_N_state
mbed_official 52:a51c77007319 453 * @{
mbed_official 52:a51c77007319 454 */
mbed_official 52:a51c77007319 455
mbed_official 52:a51c77007319 456 #define TIM_CCxN_Enable ((uint16_t)0x0004)
mbed_official 52:a51c77007319 457 #define TIM_CCxN_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 458 #define IS_TIM_CCXN(CCXN) (((CCXN) == TIM_CCxN_Enable) || \
mbed_official 52:a51c77007319 459 ((CCXN) == TIM_CCxN_Disable))
mbed_official 52:a51c77007319 460 /**
mbed_official 52:a51c77007319 461 * @}
mbed_official 52:a51c77007319 462 */
mbed_official 52:a51c77007319 463
mbed_official 52:a51c77007319 464 /** @defgroup Break_Input_enable_disable
mbed_official 52:a51c77007319 465 * @{
mbed_official 52:a51c77007319 466 */
mbed_official 52:a51c77007319 467
mbed_official 52:a51c77007319 468 #define TIM_Break_Enable ((uint16_t)0x1000)
mbed_official 52:a51c77007319 469 #define TIM_Break_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 470 #define IS_TIM_BREAK_STATE(STATE) (((STATE) == TIM_Break_Enable) || \
mbed_official 52:a51c77007319 471 ((STATE) == TIM_Break_Disable))
mbed_official 52:a51c77007319 472 /**
mbed_official 52:a51c77007319 473 * @}
mbed_official 52:a51c77007319 474 */
mbed_official 52:a51c77007319 475
mbed_official 52:a51c77007319 476 /** @defgroup Break_Polarity
mbed_official 52:a51c77007319 477 * @{
mbed_official 52:a51c77007319 478 */
mbed_official 52:a51c77007319 479
mbed_official 52:a51c77007319 480 #define TIM_BreakPolarity_Low ((uint16_t)0x0000)
mbed_official 52:a51c77007319 481 #define TIM_BreakPolarity_High ((uint16_t)0x2000)
mbed_official 52:a51c77007319 482 #define IS_TIM_BREAK_POLARITY(POLARITY) (((POLARITY) == TIM_BreakPolarity_Low) || \
mbed_official 52:a51c77007319 483 ((POLARITY) == TIM_BreakPolarity_High))
mbed_official 52:a51c77007319 484 /**
mbed_official 52:a51c77007319 485 * @}
mbed_official 52:a51c77007319 486 */
mbed_official 52:a51c77007319 487
mbed_official 52:a51c77007319 488 /** @defgroup TIM_AOE_Bit_Set_Reset
mbed_official 52:a51c77007319 489 * @{
mbed_official 52:a51c77007319 490 */
mbed_official 52:a51c77007319 491
mbed_official 52:a51c77007319 492 #define TIM_AutomaticOutput_Enable ((uint16_t)0x4000)
mbed_official 52:a51c77007319 493 #define TIM_AutomaticOutput_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 494 #define IS_TIM_AUTOMATIC_OUTPUT_STATE(STATE) (((STATE) == TIM_AutomaticOutput_Enable) || \
mbed_official 52:a51c77007319 495 ((STATE) == TIM_AutomaticOutput_Disable))
mbed_official 52:a51c77007319 496 /**
mbed_official 52:a51c77007319 497 * @}
mbed_official 52:a51c77007319 498 */
mbed_official 52:a51c77007319 499
mbed_official 52:a51c77007319 500 /** @defgroup Lock_level
mbed_official 52:a51c77007319 501 * @{
mbed_official 52:a51c77007319 502 */
mbed_official 52:a51c77007319 503
mbed_official 52:a51c77007319 504 #define TIM_LOCKLevel_OFF ((uint16_t)0x0000)
mbed_official 52:a51c77007319 505 #define TIM_LOCKLevel_1 ((uint16_t)0x0100)
mbed_official 52:a51c77007319 506 #define TIM_LOCKLevel_2 ((uint16_t)0x0200)
mbed_official 52:a51c77007319 507 #define TIM_LOCKLevel_3 ((uint16_t)0x0300)
mbed_official 52:a51c77007319 508 #define IS_TIM_LOCK_LEVEL(LEVEL) (((LEVEL) == TIM_LOCKLevel_OFF) || \
mbed_official 52:a51c77007319 509 ((LEVEL) == TIM_LOCKLevel_1) || \
mbed_official 52:a51c77007319 510 ((LEVEL) == TIM_LOCKLevel_2) || \
mbed_official 52:a51c77007319 511 ((LEVEL) == TIM_LOCKLevel_3))
mbed_official 52:a51c77007319 512 /**
mbed_official 52:a51c77007319 513 * @}
mbed_official 52:a51c77007319 514 */
mbed_official 52:a51c77007319 515
mbed_official 52:a51c77007319 516 /** @defgroup OSSI_Off_State_Selection_for_Idle_mode_state
mbed_official 52:a51c77007319 517 * @{
mbed_official 52:a51c77007319 518 */
mbed_official 52:a51c77007319 519
mbed_official 52:a51c77007319 520 #define TIM_OSSIState_Enable ((uint16_t)0x0400)
mbed_official 52:a51c77007319 521 #define TIM_OSSIState_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 522 #define IS_TIM_OSSI_STATE(STATE) (((STATE) == TIM_OSSIState_Enable) || \
mbed_official 52:a51c77007319 523 ((STATE) == TIM_OSSIState_Disable))
mbed_official 52:a51c77007319 524 /**
mbed_official 52:a51c77007319 525 * @}
mbed_official 52:a51c77007319 526 */
mbed_official 52:a51c77007319 527
mbed_official 52:a51c77007319 528 /** @defgroup OSSR_Off_State_Selection_for_Run_mode_state
mbed_official 52:a51c77007319 529 * @{
mbed_official 52:a51c77007319 530 */
mbed_official 52:a51c77007319 531
mbed_official 52:a51c77007319 532 #define TIM_OSSRState_Enable ((uint16_t)0x0800)
mbed_official 52:a51c77007319 533 #define TIM_OSSRState_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 534 #define IS_TIM_OSSR_STATE(STATE) (((STATE) == TIM_OSSRState_Enable) || \
mbed_official 52:a51c77007319 535 ((STATE) == TIM_OSSRState_Disable))
mbed_official 52:a51c77007319 536 /**
mbed_official 52:a51c77007319 537 * @}
mbed_official 52:a51c77007319 538 */
mbed_official 52:a51c77007319 539
mbed_official 52:a51c77007319 540 /** @defgroup TIM_Output_Compare_Idle_State
mbed_official 52:a51c77007319 541 * @{
mbed_official 52:a51c77007319 542 */
mbed_official 52:a51c77007319 543
mbed_official 52:a51c77007319 544 #define TIM_OCIdleState_Set ((uint16_t)0x0100)
mbed_official 52:a51c77007319 545 #define TIM_OCIdleState_Reset ((uint16_t)0x0000)
mbed_official 52:a51c77007319 546 #define IS_TIM_OCIDLE_STATE(STATE) (((STATE) == TIM_OCIdleState_Set) || \
mbed_official 52:a51c77007319 547 ((STATE) == TIM_OCIdleState_Reset))
mbed_official 52:a51c77007319 548 /**
mbed_official 52:a51c77007319 549 * @}
mbed_official 52:a51c77007319 550 */
mbed_official 52:a51c77007319 551
mbed_official 52:a51c77007319 552 /** @defgroup TIM_Output_Compare_N_Idle_State
mbed_official 52:a51c77007319 553 * @{
mbed_official 52:a51c77007319 554 */
mbed_official 52:a51c77007319 555
mbed_official 52:a51c77007319 556 #define TIM_OCNIdleState_Set ((uint16_t)0x0200)
mbed_official 52:a51c77007319 557 #define TIM_OCNIdleState_Reset ((uint16_t)0x0000)
mbed_official 52:a51c77007319 558 #define IS_TIM_OCNIDLE_STATE(STATE) (((STATE) == TIM_OCNIdleState_Set) || \
mbed_official 52:a51c77007319 559 ((STATE) == TIM_OCNIdleState_Reset))
mbed_official 52:a51c77007319 560 /**
mbed_official 52:a51c77007319 561 * @}
mbed_official 52:a51c77007319 562 */
mbed_official 52:a51c77007319 563
mbed_official 52:a51c77007319 564 /** @defgroup TIM_Input_Capture_Polarity
mbed_official 52:a51c77007319 565 * @{
mbed_official 52:a51c77007319 566 */
mbed_official 52:a51c77007319 567
mbed_official 52:a51c77007319 568 #define TIM_ICPolarity_Rising ((uint16_t)0x0000)
mbed_official 52:a51c77007319 569 #define TIM_ICPolarity_Falling ((uint16_t)0x0002)
mbed_official 52:a51c77007319 570 #define TIM_ICPolarity_BothEdge ((uint16_t)0x000A)
mbed_official 52:a51c77007319 571 #define IS_TIM_IC_POLARITY(POLARITY) (((POLARITY) == TIM_ICPolarity_Rising) || \
mbed_official 52:a51c77007319 572 ((POLARITY) == TIM_ICPolarity_Falling))
mbed_official 52:a51c77007319 573 #define IS_TIM_IC_POLARITY_LITE(POLARITY) (((POLARITY) == TIM_ICPolarity_Rising) || \
mbed_official 52:a51c77007319 574 ((POLARITY) == TIM_ICPolarity_Falling)|| \
mbed_official 52:a51c77007319 575 ((POLARITY) == TIM_ICPolarity_BothEdge))
mbed_official 52:a51c77007319 576 /**
mbed_official 52:a51c77007319 577 * @}
mbed_official 52:a51c77007319 578 */
mbed_official 52:a51c77007319 579
mbed_official 52:a51c77007319 580 /** @defgroup TIM_Input_Capture_Selection
mbed_official 52:a51c77007319 581 * @{
mbed_official 52:a51c77007319 582 */
mbed_official 52:a51c77007319 583
mbed_official 52:a51c77007319 584 #define TIM_ICSelection_DirectTI ((uint16_t)0x0001) /*!< TIM Input 1, 2, 3 or 4 is selected to be
mbed_official 52:a51c77007319 585 connected to IC1, IC2, IC3 or IC4, respectively */
mbed_official 52:a51c77007319 586 #define TIM_ICSelection_IndirectTI ((uint16_t)0x0002) /*!< TIM Input 1, 2, 3 or 4 is selected to be
mbed_official 52:a51c77007319 587 connected to IC2, IC1, IC4 or IC3, respectively. */
mbed_official 52:a51c77007319 588 #define TIM_ICSelection_TRC ((uint16_t)0x0003) /*!< TIM Input 1, 2, 3 or 4 is selected to be connected to TRC. */
mbed_official 52:a51c77007319 589 #define IS_TIM_IC_SELECTION(SELECTION) (((SELECTION) == TIM_ICSelection_DirectTI) || \
mbed_official 52:a51c77007319 590 ((SELECTION) == TIM_ICSelection_IndirectTI) || \
mbed_official 52:a51c77007319 591 ((SELECTION) == TIM_ICSelection_TRC))
mbed_official 52:a51c77007319 592 /**
mbed_official 52:a51c77007319 593 * @}
mbed_official 52:a51c77007319 594 */
mbed_official 52:a51c77007319 595
mbed_official 52:a51c77007319 596 /** @defgroup TIM_Input_Capture_Prescaler
mbed_official 52:a51c77007319 597 * @{
mbed_official 52:a51c77007319 598 */
mbed_official 52:a51c77007319 599
mbed_official 52:a51c77007319 600 #define TIM_ICPSC_DIV1 ((uint16_t)0x0000) /*!< Capture performed each time an edge is detected on the capture input. */
mbed_official 52:a51c77007319 601 #define TIM_ICPSC_DIV2 ((uint16_t)0x0004) /*!< Capture performed once every 2 events. */
mbed_official 52:a51c77007319 602 #define TIM_ICPSC_DIV4 ((uint16_t)0x0008) /*!< Capture performed once every 4 events. */
mbed_official 52:a51c77007319 603 #define TIM_ICPSC_DIV8 ((uint16_t)0x000C) /*!< Capture performed once every 8 events. */
mbed_official 52:a51c77007319 604 #define IS_TIM_IC_PRESCALER(PRESCALER) (((PRESCALER) == TIM_ICPSC_DIV1) || \
mbed_official 52:a51c77007319 605 ((PRESCALER) == TIM_ICPSC_DIV2) || \
mbed_official 52:a51c77007319 606 ((PRESCALER) == TIM_ICPSC_DIV4) || \
mbed_official 52:a51c77007319 607 ((PRESCALER) == TIM_ICPSC_DIV8))
mbed_official 52:a51c77007319 608 /**
mbed_official 52:a51c77007319 609 * @}
mbed_official 52:a51c77007319 610 */
mbed_official 52:a51c77007319 611
mbed_official 52:a51c77007319 612 /** @defgroup TIM_interrupt_sources
mbed_official 52:a51c77007319 613 * @{
mbed_official 52:a51c77007319 614 */
mbed_official 52:a51c77007319 615
mbed_official 52:a51c77007319 616 #define TIM_IT_Update ((uint16_t)0x0001)
mbed_official 52:a51c77007319 617 #define TIM_IT_CC1 ((uint16_t)0x0002)
mbed_official 52:a51c77007319 618 #define TIM_IT_CC2 ((uint16_t)0x0004)
mbed_official 52:a51c77007319 619 #define TIM_IT_CC3 ((uint16_t)0x0008)
mbed_official 52:a51c77007319 620 #define TIM_IT_CC4 ((uint16_t)0x0010)
mbed_official 52:a51c77007319 621 #define TIM_IT_COM ((uint16_t)0x0020)
mbed_official 52:a51c77007319 622 #define TIM_IT_Trigger ((uint16_t)0x0040)
mbed_official 52:a51c77007319 623 #define TIM_IT_Break ((uint16_t)0x0080)
mbed_official 52:a51c77007319 624 #define IS_TIM_IT(IT) ((((IT) & (uint16_t)0xFF00) == 0x0000) && ((IT) != 0x0000))
mbed_official 52:a51c77007319 625
mbed_official 52:a51c77007319 626 #define IS_TIM_GET_IT(IT) (((IT) == TIM_IT_Update) || \
mbed_official 52:a51c77007319 627 ((IT) == TIM_IT_CC1) || \
mbed_official 52:a51c77007319 628 ((IT) == TIM_IT_CC2) || \
mbed_official 52:a51c77007319 629 ((IT) == TIM_IT_CC3) || \
mbed_official 52:a51c77007319 630 ((IT) == TIM_IT_CC4) || \
mbed_official 52:a51c77007319 631 ((IT) == TIM_IT_COM) || \
mbed_official 52:a51c77007319 632 ((IT) == TIM_IT_Trigger) || \
mbed_official 52:a51c77007319 633 ((IT) == TIM_IT_Break))
mbed_official 52:a51c77007319 634 /**
mbed_official 52:a51c77007319 635 * @}
mbed_official 52:a51c77007319 636 */
mbed_official 52:a51c77007319 637
mbed_official 52:a51c77007319 638 /** @defgroup TIM_DMA_Base_address
mbed_official 52:a51c77007319 639 * @{
mbed_official 52:a51c77007319 640 */
mbed_official 52:a51c77007319 641
mbed_official 52:a51c77007319 642 #define TIM_DMABase_CR1 ((uint16_t)0x0000)
mbed_official 52:a51c77007319 643 #define TIM_DMABase_CR2 ((uint16_t)0x0001)
mbed_official 52:a51c77007319 644 #define TIM_DMABase_SMCR ((uint16_t)0x0002)
mbed_official 52:a51c77007319 645 #define TIM_DMABase_DIER ((uint16_t)0x0003)
mbed_official 52:a51c77007319 646 #define TIM_DMABase_SR ((uint16_t)0x0004)
mbed_official 52:a51c77007319 647 #define TIM_DMABase_EGR ((uint16_t)0x0005)
mbed_official 52:a51c77007319 648 #define TIM_DMABase_CCMR1 ((uint16_t)0x0006)
mbed_official 52:a51c77007319 649 #define TIM_DMABase_CCMR2 ((uint16_t)0x0007)
mbed_official 52:a51c77007319 650 #define TIM_DMABase_CCER ((uint16_t)0x0008)
mbed_official 52:a51c77007319 651 #define TIM_DMABase_CNT ((uint16_t)0x0009)
mbed_official 52:a51c77007319 652 #define TIM_DMABase_PSC ((uint16_t)0x000A)
mbed_official 52:a51c77007319 653 #define TIM_DMABase_ARR ((uint16_t)0x000B)
mbed_official 52:a51c77007319 654 #define TIM_DMABase_RCR ((uint16_t)0x000C)
mbed_official 52:a51c77007319 655 #define TIM_DMABase_CCR1 ((uint16_t)0x000D)
mbed_official 52:a51c77007319 656 #define TIM_DMABase_CCR2 ((uint16_t)0x000E)
mbed_official 52:a51c77007319 657 #define TIM_DMABase_CCR3 ((uint16_t)0x000F)
mbed_official 52:a51c77007319 658 #define TIM_DMABase_CCR4 ((uint16_t)0x0010)
mbed_official 52:a51c77007319 659 #define TIM_DMABase_BDTR ((uint16_t)0x0011)
mbed_official 52:a51c77007319 660 #define TIM_DMABase_DCR ((uint16_t)0x0012)
mbed_official 52:a51c77007319 661 #define IS_TIM_DMA_BASE(BASE) (((BASE) == TIM_DMABase_CR1) || \
mbed_official 52:a51c77007319 662 ((BASE) == TIM_DMABase_CR2) || \
mbed_official 52:a51c77007319 663 ((BASE) == TIM_DMABase_SMCR) || \
mbed_official 52:a51c77007319 664 ((BASE) == TIM_DMABase_DIER) || \
mbed_official 52:a51c77007319 665 ((BASE) == TIM_DMABase_SR) || \
mbed_official 52:a51c77007319 666 ((BASE) == TIM_DMABase_EGR) || \
mbed_official 52:a51c77007319 667 ((BASE) == TIM_DMABase_CCMR1) || \
mbed_official 52:a51c77007319 668 ((BASE) == TIM_DMABase_CCMR2) || \
mbed_official 52:a51c77007319 669 ((BASE) == TIM_DMABase_CCER) || \
mbed_official 52:a51c77007319 670 ((BASE) == TIM_DMABase_CNT) || \
mbed_official 52:a51c77007319 671 ((BASE) == TIM_DMABase_PSC) || \
mbed_official 52:a51c77007319 672 ((BASE) == TIM_DMABase_ARR) || \
mbed_official 52:a51c77007319 673 ((BASE) == TIM_DMABase_RCR) || \
mbed_official 52:a51c77007319 674 ((BASE) == TIM_DMABase_CCR1) || \
mbed_official 52:a51c77007319 675 ((BASE) == TIM_DMABase_CCR2) || \
mbed_official 52:a51c77007319 676 ((BASE) == TIM_DMABase_CCR3) || \
mbed_official 52:a51c77007319 677 ((BASE) == TIM_DMABase_CCR4) || \
mbed_official 52:a51c77007319 678 ((BASE) == TIM_DMABase_BDTR) || \
mbed_official 52:a51c77007319 679 ((BASE) == TIM_DMABase_DCR))
mbed_official 52:a51c77007319 680 /**
mbed_official 52:a51c77007319 681 * @}
mbed_official 52:a51c77007319 682 */
mbed_official 52:a51c77007319 683
mbed_official 52:a51c77007319 684 /** @defgroup TIM_DMA_Burst_Length
mbed_official 52:a51c77007319 685 * @{
mbed_official 52:a51c77007319 686 */
mbed_official 52:a51c77007319 687
mbed_official 52:a51c77007319 688 #define TIM_DMABurstLength_1Transfer ((uint16_t)0x0000)
mbed_official 52:a51c77007319 689 #define TIM_DMABurstLength_2Transfers ((uint16_t)0x0100)
mbed_official 52:a51c77007319 690 #define TIM_DMABurstLength_3Transfers ((uint16_t)0x0200)
mbed_official 52:a51c77007319 691 #define TIM_DMABurstLength_4Transfers ((uint16_t)0x0300)
mbed_official 52:a51c77007319 692 #define TIM_DMABurstLength_5Transfers ((uint16_t)0x0400)
mbed_official 52:a51c77007319 693 #define TIM_DMABurstLength_6Transfers ((uint16_t)0x0500)
mbed_official 52:a51c77007319 694 #define TIM_DMABurstLength_7Transfers ((uint16_t)0x0600)
mbed_official 52:a51c77007319 695 #define TIM_DMABurstLength_8Transfers ((uint16_t)0x0700)
mbed_official 52:a51c77007319 696 #define TIM_DMABurstLength_9Transfers ((uint16_t)0x0800)
mbed_official 52:a51c77007319 697 #define TIM_DMABurstLength_10Transfers ((uint16_t)0x0900)
mbed_official 52:a51c77007319 698 #define TIM_DMABurstLength_11Transfers ((uint16_t)0x0A00)
mbed_official 52:a51c77007319 699 #define TIM_DMABurstLength_12Transfers ((uint16_t)0x0B00)
mbed_official 52:a51c77007319 700 #define TIM_DMABurstLength_13Transfers ((uint16_t)0x0C00)
mbed_official 52:a51c77007319 701 #define TIM_DMABurstLength_14Transfers ((uint16_t)0x0D00)
mbed_official 52:a51c77007319 702 #define TIM_DMABurstLength_15Transfers ((uint16_t)0x0E00)
mbed_official 52:a51c77007319 703 #define TIM_DMABurstLength_16Transfers ((uint16_t)0x0F00)
mbed_official 52:a51c77007319 704 #define TIM_DMABurstLength_17Transfers ((uint16_t)0x1000)
mbed_official 52:a51c77007319 705 #define TIM_DMABurstLength_18Transfers ((uint16_t)0x1100)
mbed_official 52:a51c77007319 706 #define IS_TIM_DMA_LENGTH(LENGTH) (((LENGTH) == TIM_DMABurstLength_1Transfer) || \
mbed_official 52:a51c77007319 707 ((LENGTH) == TIM_DMABurstLength_2Transfers) || \
mbed_official 52:a51c77007319 708 ((LENGTH) == TIM_DMABurstLength_3Transfers) || \
mbed_official 52:a51c77007319 709 ((LENGTH) == TIM_DMABurstLength_4Transfers) || \
mbed_official 52:a51c77007319 710 ((LENGTH) == TIM_DMABurstLength_5Transfers) || \
mbed_official 52:a51c77007319 711 ((LENGTH) == TIM_DMABurstLength_6Transfers) || \
mbed_official 52:a51c77007319 712 ((LENGTH) == TIM_DMABurstLength_7Transfers) || \
mbed_official 52:a51c77007319 713 ((LENGTH) == TIM_DMABurstLength_8Transfers) || \
mbed_official 52:a51c77007319 714 ((LENGTH) == TIM_DMABurstLength_9Transfers) || \
mbed_official 52:a51c77007319 715 ((LENGTH) == TIM_DMABurstLength_10Transfers) || \
mbed_official 52:a51c77007319 716 ((LENGTH) == TIM_DMABurstLength_11Transfers) || \
mbed_official 52:a51c77007319 717 ((LENGTH) == TIM_DMABurstLength_12Transfers) || \
mbed_official 52:a51c77007319 718 ((LENGTH) == TIM_DMABurstLength_13Transfers) || \
mbed_official 52:a51c77007319 719 ((LENGTH) == TIM_DMABurstLength_14Transfers) || \
mbed_official 52:a51c77007319 720 ((LENGTH) == TIM_DMABurstLength_15Transfers) || \
mbed_official 52:a51c77007319 721 ((LENGTH) == TIM_DMABurstLength_16Transfers) || \
mbed_official 52:a51c77007319 722 ((LENGTH) == TIM_DMABurstLength_17Transfers) || \
mbed_official 52:a51c77007319 723 ((LENGTH) == TIM_DMABurstLength_18Transfers))
mbed_official 52:a51c77007319 724 /**
mbed_official 52:a51c77007319 725 * @}
mbed_official 52:a51c77007319 726 */
mbed_official 52:a51c77007319 727
mbed_official 52:a51c77007319 728 /** @defgroup TIM_DMA_sources
mbed_official 52:a51c77007319 729 * @{
mbed_official 52:a51c77007319 730 */
mbed_official 52:a51c77007319 731
mbed_official 52:a51c77007319 732 #define TIM_DMA_Update ((uint16_t)0x0100)
mbed_official 52:a51c77007319 733 #define TIM_DMA_CC1 ((uint16_t)0x0200)
mbed_official 52:a51c77007319 734 #define TIM_DMA_CC2 ((uint16_t)0x0400)
mbed_official 52:a51c77007319 735 #define TIM_DMA_CC3 ((uint16_t)0x0800)
mbed_official 52:a51c77007319 736 #define TIM_DMA_CC4 ((uint16_t)0x1000)
mbed_official 52:a51c77007319 737 #define TIM_DMA_COM ((uint16_t)0x2000)
mbed_official 52:a51c77007319 738 #define TIM_DMA_Trigger ((uint16_t)0x4000)
mbed_official 52:a51c77007319 739 #define IS_TIM_DMA_SOURCE(SOURCE) ((((SOURCE) & (uint16_t)0x80FF) == 0x0000) && ((SOURCE) != 0x0000))
mbed_official 52:a51c77007319 740
mbed_official 52:a51c77007319 741 /**
mbed_official 52:a51c77007319 742 * @}
mbed_official 52:a51c77007319 743 */
mbed_official 52:a51c77007319 744
mbed_official 52:a51c77007319 745 /** @defgroup TIM_External_Trigger_Prescaler
mbed_official 52:a51c77007319 746 * @{
mbed_official 52:a51c77007319 747 */
mbed_official 52:a51c77007319 748
mbed_official 52:a51c77007319 749 #define TIM_ExtTRGPSC_OFF ((uint16_t)0x0000)
mbed_official 52:a51c77007319 750 #define TIM_ExtTRGPSC_DIV2 ((uint16_t)0x1000)
mbed_official 52:a51c77007319 751 #define TIM_ExtTRGPSC_DIV4 ((uint16_t)0x2000)
mbed_official 52:a51c77007319 752 #define TIM_ExtTRGPSC_DIV8 ((uint16_t)0x3000)
mbed_official 52:a51c77007319 753 #define IS_TIM_EXT_PRESCALER(PRESCALER) (((PRESCALER) == TIM_ExtTRGPSC_OFF) || \
mbed_official 52:a51c77007319 754 ((PRESCALER) == TIM_ExtTRGPSC_DIV2) || \
mbed_official 52:a51c77007319 755 ((PRESCALER) == TIM_ExtTRGPSC_DIV4) || \
mbed_official 52:a51c77007319 756 ((PRESCALER) == TIM_ExtTRGPSC_DIV8))
mbed_official 52:a51c77007319 757 /**
mbed_official 52:a51c77007319 758 * @}
mbed_official 52:a51c77007319 759 */
mbed_official 52:a51c77007319 760
mbed_official 52:a51c77007319 761 /** @defgroup TIM_Internal_Trigger_Selection
mbed_official 52:a51c77007319 762 * @{
mbed_official 52:a51c77007319 763 */
mbed_official 52:a51c77007319 764
mbed_official 52:a51c77007319 765 #define TIM_TS_ITR0 ((uint16_t)0x0000)
mbed_official 52:a51c77007319 766 #define TIM_TS_ITR1 ((uint16_t)0x0010)
mbed_official 52:a51c77007319 767 #define TIM_TS_ITR2 ((uint16_t)0x0020)
mbed_official 52:a51c77007319 768 #define TIM_TS_ITR3 ((uint16_t)0x0030)
mbed_official 52:a51c77007319 769 #define TIM_TS_TI1F_ED ((uint16_t)0x0040)
mbed_official 52:a51c77007319 770 #define TIM_TS_TI1FP1 ((uint16_t)0x0050)
mbed_official 52:a51c77007319 771 #define TIM_TS_TI2FP2 ((uint16_t)0x0060)
mbed_official 52:a51c77007319 772 #define TIM_TS_ETRF ((uint16_t)0x0070)
mbed_official 52:a51c77007319 773 #define IS_TIM_TRIGGER_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \
mbed_official 52:a51c77007319 774 ((SELECTION) == TIM_TS_ITR1) || \
mbed_official 52:a51c77007319 775 ((SELECTION) == TIM_TS_ITR2) || \
mbed_official 52:a51c77007319 776 ((SELECTION) == TIM_TS_ITR3) || \
mbed_official 52:a51c77007319 777 ((SELECTION) == TIM_TS_TI1F_ED) || \
mbed_official 52:a51c77007319 778 ((SELECTION) == TIM_TS_TI1FP1) || \
mbed_official 52:a51c77007319 779 ((SELECTION) == TIM_TS_TI2FP2) || \
mbed_official 52:a51c77007319 780 ((SELECTION) == TIM_TS_ETRF))
mbed_official 52:a51c77007319 781 #define IS_TIM_INTERNAL_TRIGGER_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \
mbed_official 52:a51c77007319 782 ((SELECTION) == TIM_TS_ITR1) || \
mbed_official 52:a51c77007319 783 ((SELECTION) == TIM_TS_ITR2) || \
mbed_official 52:a51c77007319 784 ((SELECTION) == TIM_TS_ITR3))
mbed_official 52:a51c77007319 785 /**
mbed_official 52:a51c77007319 786 * @}
mbed_official 52:a51c77007319 787 */
mbed_official 52:a51c77007319 788
mbed_official 52:a51c77007319 789 /** @defgroup TIM_TIx_External_Clock_Source
mbed_official 52:a51c77007319 790 * @{
mbed_official 52:a51c77007319 791 */
mbed_official 52:a51c77007319 792
mbed_official 52:a51c77007319 793 #define TIM_TIxExternalCLK1Source_TI1 ((uint16_t)0x0050)
mbed_official 52:a51c77007319 794 #define TIM_TIxExternalCLK1Source_TI2 ((uint16_t)0x0060)
mbed_official 52:a51c77007319 795 #define TIM_TIxExternalCLK1Source_TI1ED ((uint16_t)0x0040)
mbed_official 52:a51c77007319 796 #define IS_TIM_TIXCLK_SOURCE(SOURCE) (((SOURCE) == TIM_TIxExternalCLK1Source_TI1) || \
mbed_official 52:a51c77007319 797 ((SOURCE) == TIM_TIxExternalCLK1Source_TI2) || \
mbed_official 52:a51c77007319 798 ((SOURCE) == TIM_TIxExternalCLK1Source_TI1ED))
mbed_official 52:a51c77007319 799 /**
mbed_official 52:a51c77007319 800 * @}
mbed_official 52:a51c77007319 801 */
mbed_official 52:a51c77007319 802
mbed_official 52:a51c77007319 803 /** @defgroup TIM_External_Trigger_Polarity
mbed_official 52:a51c77007319 804 * @{
mbed_official 52:a51c77007319 805 */
mbed_official 52:a51c77007319 806 #define TIM_ExtTRGPolarity_Inverted ((uint16_t)0x8000)
mbed_official 52:a51c77007319 807 #define TIM_ExtTRGPolarity_NonInverted ((uint16_t)0x0000)
mbed_official 52:a51c77007319 808 #define IS_TIM_EXT_POLARITY(POLARITY) (((POLARITY) == TIM_ExtTRGPolarity_Inverted) || \
mbed_official 52:a51c77007319 809 ((POLARITY) == TIM_ExtTRGPolarity_NonInverted))
mbed_official 52:a51c77007319 810 /**
mbed_official 52:a51c77007319 811 * @}
mbed_official 52:a51c77007319 812 */
mbed_official 52:a51c77007319 813
mbed_official 52:a51c77007319 814 /** @defgroup TIM_Prescaler_Reload_Mode
mbed_official 52:a51c77007319 815 * @{
mbed_official 52:a51c77007319 816 */
mbed_official 52:a51c77007319 817
mbed_official 52:a51c77007319 818 #define TIM_PSCReloadMode_Update ((uint16_t)0x0000)
mbed_official 52:a51c77007319 819 #define TIM_PSCReloadMode_Immediate ((uint16_t)0x0001)
mbed_official 52:a51c77007319 820 #define IS_TIM_PRESCALER_RELOAD(RELOAD) (((RELOAD) == TIM_PSCReloadMode_Update) || \
mbed_official 52:a51c77007319 821 ((RELOAD) == TIM_PSCReloadMode_Immediate))
mbed_official 52:a51c77007319 822 /**
mbed_official 52:a51c77007319 823 * @}
mbed_official 52:a51c77007319 824 */
mbed_official 52:a51c77007319 825
mbed_official 52:a51c77007319 826 /** @defgroup TIM_Forced_Action
mbed_official 52:a51c77007319 827 * @{
mbed_official 52:a51c77007319 828 */
mbed_official 52:a51c77007319 829
mbed_official 52:a51c77007319 830 #define TIM_ForcedAction_Active ((uint16_t)0x0050)
mbed_official 52:a51c77007319 831 #define TIM_ForcedAction_InActive ((uint16_t)0x0040)
mbed_official 52:a51c77007319 832 #define IS_TIM_FORCED_ACTION(ACTION) (((ACTION) == TIM_ForcedAction_Active) || \
mbed_official 52:a51c77007319 833 ((ACTION) == TIM_ForcedAction_InActive))
mbed_official 52:a51c77007319 834 /**
mbed_official 52:a51c77007319 835 * @}
mbed_official 52:a51c77007319 836 */
mbed_official 52:a51c77007319 837
mbed_official 52:a51c77007319 838 /** @defgroup TIM_Encoder_Mode
mbed_official 52:a51c77007319 839 * @{
mbed_official 52:a51c77007319 840 */
mbed_official 52:a51c77007319 841
mbed_official 52:a51c77007319 842 #define TIM_EncoderMode_TI1 ((uint16_t)0x0001)
mbed_official 52:a51c77007319 843 #define TIM_EncoderMode_TI2 ((uint16_t)0x0002)
mbed_official 52:a51c77007319 844 #define TIM_EncoderMode_TI12 ((uint16_t)0x0003)
mbed_official 52:a51c77007319 845 #define IS_TIM_ENCODER_MODE(MODE) (((MODE) == TIM_EncoderMode_TI1) || \
mbed_official 52:a51c77007319 846 ((MODE) == TIM_EncoderMode_TI2) || \
mbed_official 52:a51c77007319 847 ((MODE) == TIM_EncoderMode_TI12))
mbed_official 52:a51c77007319 848 /**
mbed_official 52:a51c77007319 849 * @}
mbed_official 52:a51c77007319 850 */
mbed_official 52:a51c77007319 851
mbed_official 52:a51c77007319 852
mbed_official 52:a51c77007319 853 /** @defgroup TIM_Event_Source
mbed_official 52:a51c77007319 854 * @{
mbed_official 52:a51c77007319 855 */
mbed_official 52:a51c77007319 856
mbed_official 52:a51c77007319 857 #define TIM_EventSource_Update ((uint16_t)0x0001)
mbed_official 52:a51c77007319 858 #define TIM_EventSource_CC1 ((uint16_t)0x0002)
mbed_official 52:a51c77007319 859 #define TIM_EventSource_CC2 ((uint16_t)0x0004)
mbed_official 52:a51c77007319 860 #define TIM_EventSource_CC3 ((uint16_t)0x0008)
mbed_official 52:a51c77007319 861 #define TIM_EventSource_CC4 ((uint16_t)0x0010)
mbed_official 52:a51c77007319 862 #define TIM_EventSource_COM ((uint16_t)0x0020)
mbed_official 52:a51c77007319 863 #define TIM_EventSource_Trigger ((uint16_t)0x0040)
mbed_official 52:a51c77007319 864 #define TIM_EventSource_Break ((uint16_t)0x0080)
mbed_official 52:a51c77007319 865 #define IS_TIM_EVENT_SOURCE(SOURCE) ((((SOURCE) & (uint16_t)0xFF00) == 0x0000) && ((SOURCE) != 0x0000))
mbed_official 52:a51c77007319 866
mbed_official 52:a51c77007319 867 /**
mbed_official 52:a51c77007319 868 * @}
mbed_official 52:a51c77007319 869 */
mbed_official 52:a51c77007319 870
mbed_official 52:a51c77007319 871 /** @defgroup TIM_Update_Source
mbed_official 52:a51c77007319 872 * @{
mbed_official 52:a51c77007319 873 */
mbed_official 52:a51c77007319 874
mbed_official 52:a51c77007319 875 #define TIM_UpdateSource_Global ((uint16_t)0x0000) /*!< Source of update is the counter overflow/underflow
mbed_official 52:a51c77007319 876 or the setting of UG bit, or an update generation
mbed_official 52:a51c77007319 877 through the slave mode controller. */
mbed_official 52:a51c77007319 878 #define TIM_UpdateSource_Regular ((uint16_t)0x0001) /*!< Source of update is counter overflow/underflow. */
mbed_official 52:a51c77007319 879 #define IS_TIM_UPDATE_SOURCE(SOURCE) (((SOURCE) == TIM_UpdateSource_Global) || \
mbed_official 52:a51c77007319 880 ((SOURCE) == TIM_UpdateSource_Regular))
mbed_official 52:a51c77007319 881 /**
mbed_official 52:a51c77007319 882 * @}
mbed_official 52:a51c77007319 883 */
mbed_official 52:a51c77007319 884
mbed_official 52:a51c77007319 885 /** @defgroup TIM_Output_Compare_Preload_State
mbed_official 52:a51c77007319 886 * @{
mbed_official 52:a51c77007319 887 */
mbed_official 52:a51c77007319 888
mbed_official 52:a51c77007319 889 #define TIM_OCPreload_Enable ((uint16_t)0x0008)
mbed_official 52:a51c77007319 890 #define TIM_OCPreload_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 891 #define IS_TIM_OCPRELOAD_STATE(STATE) (((STATE) == TIM_OCPreload_Enable) || \
mbed_official 52:a51c77007319 892 ((STATE) == TIM_OCPreload_Disable))
mbed_official 52:a51c77007319 893 /**
mbed_official 52:a51c77007319 894 * @}
mbed_official 52:a51c77007319 895 */
mbed_official 52:a51c77007319 896
mbed_official 52:a51c77007319 897 /** @defgroup TIM_Output_Compare_Fast_State
mbed_official 52:a51c77007319 898 * @{
mbed_official 52:a51c77007319 899 */
mbed_official 52:a51c77007319 900
mbed_official 52:a51c77007319 901 #define TIM_OCFast_Enable ((uint16_t)0x0004)
mbed_official 52:a51c77007319 902 #define TIM_OCFast_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 903 #define IS_TIM_OCFAST_STATE(STATE) (((STATE) == TIM_OCFast_Enable) || \
mbed_official 52:a51c77007319 904 ((STATE) == TIM_OCFast_Disable))
mbed_official 52:a51c77007319 905
mbed_official 52:a51c77007319 906 /**
mbed_official 52:a51c77007319 907 * @}
mbed_official 52:a51c77007319 908 */
mbed_official 52:a51c77007319 909
mbed_official 52:a51c77007319 910 /** @defgroup TIM_Output_Compare_Clear_State
mbed_official 52:a51c77007319 911 * @{
mbed_official 52:a51c77007319 912 */
mbed_official 52:a51c77007319 913
mbed_official 52:a51c77007319 914 #define TIM_OCClear_Enable ((uint16_t)0x0080)
mbed_official 52:a51c77007319 915 #define TIM_OCClear_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 916 #define IS_TIM_OCCLEAR_STATE(STATE) (((STATE) == TIM_OCClear_Enable) || \
mbed_official 52:a51c77007319 917 ((STATE) == TIM_OCClear_Disable))
mbed_official 52:a51c77007319 918 /**
mbed_official 52:a51c77007319 919 * @}
mbed_official 52:a51c77007319 920 */
mbed_official 52:a51c77007319 921
mbed_official 52:a51c77007319 922 /** @defgroup TIM_Trigger_Output_Source
mbed_official 52:a51c77007319 923 * @{
mbed_official 52:a51c77007319 924 */
mbed_official 52:a51c77007319 925
mbed_official 52:a51c77007319 926 #define TIM_TRGOSource_Reset ((uint16_t)0x0000)
mbed_official 52:a51c77007319 927 #define TIM_TRGOSource_Enable ((uint16_t)0x0010)
mbed_official 52:a51c77007319 928 #define TIM_TRGOSource_Update ((uint16_t)0x0020)
mbed_official 52:a51c77007319 929 #define TIM_TRGOSource_OC1 ((uint16_t)0x0030)
mbed_official 52:a51c77007319 930 #define TIM_TRGOSource_OC1Ref ((uint16_t)0x0040)
mbed_official 52:a51c77007319 931 #define TIM_TRGOSource_OC2Ref ((uint16_t)0x0050)
mbed_official 52:a51c77007319 932 #define TIM_TRGOSource_OC3Ref ((uint16_t)0x0060)
mbed_official 52:a51c77007319 933 #define TIM_TRGOSource_OC4Ref ((uint16_t)0x0070)
mbed_official 52:a51c77007319 934 #define IS_TIM_TRGO_SOURCE(SOURCE) (((SOURCE) == TIM_TRGOSource_Reset) || \
mbed_official 52:a51c77007319 935 ((SOURCE) == TIM_TRGOSource_Enable) || \
mbed_official 52:a51c77007319 936 ((SOURCE) == TIM_TRGOSource_Update) || \
mbed_official 52:a51c77007319 937 ((SOURCE) == TIM_TRGOSource_OC1) || \
mbed_official 52:a51c77007319 938 ((SOURCE) == TIM_TRGOSource_OC1Ref) || \
mbed_official 52:a51c77007319 939 ((SOURCE) == TIM_TRGOSource_OC2Ref) || \
mbed_official 52:a51c77007319 940 ((SOURCE) == TIM_TRGOSource_OC3Ref) || \
mbed_official 52:a51c77007319 941 ((SOURCE) == TIM_TRGOSource_OC4Ref))
mbed_official 52:a51c77007319 942 /**
mbed_official 52:a51c77007319 943 * @}
mbed_official 52:a51c77007319 944 */
mbed_official 52:a51c77007319 945
mbed_official 52:a51c77007319 946 /** @defgroup TIM_Slave_Mode
mbed_official 52:a51c77007319 947 * @{
mbed_official 52:a51c77007319 948 */
mbed_official 52:a51c77007319 949
mbed_official 52:a51c77007319 950 #define TIM_SlaveMode_Reset ((uint16_t)0x0004)
mbed_official 52:a51c77007319 951 #define TIM_SlaveMode_Gated ((uint16_t)0x0005)
mbed_official 52:a51c77007319 952 #define TIM_SlaveMode_Trigger ((uint16_t)0x0006)
mbed_official 52:a51c77007319 953 #define TIM_SlaveMode_External1 ((uint16_t)0x0007)
mbed_official 52:a51c77007319 954 #define IS_TIM_SLAVE_MODE(MODE) (((MODE) == TIM_SlaveMode_Reset) || \
mbed_official 52:a51c77007319 955 ((MODE) == TIM_SlaveMode_Gated) || \
mbed_official 52:a51c77007319 956 ((MODE) == TIM_SlaveMode_Trigger) || \
mbed_official 52:a51c77007319 957 ((MODE) == TIM_SlaveMode_External1))
mbed_official 52:a51c77007319 958 /**
mbed_official 52:a51c77007319 959 * @}
mbed_official 52:a51c77007319 960 */
mbed_official 52:a51c77007319 961
mbed_official 52:a51c77007319 962 /** @defgroup TIM_Master_Slave_Mode
mbed_official 52:a51c77007319 963 * @{
mbed_official 52:a51c77007319 964 */
mbed_official 52:a51c77007319 965
mbed_official 52:a51c77007319 966 #define TIM_MasterSlaveMode_Enable ((uint16_t)0x0080)
mbed_official 52:a51c77007319 967 #define TIM_MasterSlaveMode_Disable ((uint16_t)0x0000)
mbed_official 52:a51c77007319 968 #define IS_TIM_MSM_STATE(STATE) (((STATE) == TIM_MasterSlaveMode_Enable) || \
mbed_official 52:a51c77007319 969 ((STATE) == TIM_MasterSlaveMode_Disable))
mbed_official 52:a51c77007319 970 /**
mbed_official 52:a51c77007319 971 * @}
mbed_official 52:a51c77007319 972 */
mbed_official 52:a51c77007319 973
mbed_official 52:a51c77007319 974 /** @defgroup TIM_Flags
mbed_official 52:a51c77007319 975 * @{
mbed_official 52:a51c77007319 976 */
mbed_official 52:a51c77007319 977
mbed_official 52:a51c77007319 978 #define TIM_FLAG_Update ((uint16_t)0x0001)
mbed_official 52:a51c77007319 979 #define TIM_FLAG_CC1 ((uint16_t)0x0002)
mbed_official 52:a51c77007319 980 #define TIM_FLAG_CC2 ((uint16_t)0x0004)
mbed_official 52:a51c77007319 981 #define TIM_FLAG_CC3 ((uint16_t)0x0008)
mbed_official 52:a51c77007319 982 #define TIM_FLAG_CC4 ((uint16_t)0x0010)
mbed_official 52:a51c77007319 983 #define TIM_FLAG_COM ((uint16_t)0x0020)
mbed_official 52:a51c77007319 984 #define TIM_FLAG_Trigger ((uint16_t)0x0040)
mbed_official 52:a51c77007319 985 #define TIM_FLAG_Break ((uint16_t)0x0080)
mbed_official 52:a51c77007319 986 #define TIM_FLAG_CC1OF ((uint16_t)0x0200)
mbed_official 52:a51c77007319 987 #define TIM_FLAG_CC2OF ((uint16_t)0x0400)
mbed_official 52:a51c77007319 988 #define TIM_FLAG_CC3OF ((uint16_t)0x0800)
mbed_official 52:a51c77007319 989 #define TIM_FLAG_CC4OF ((uint16_t)0x1000)
mbed_official 52:a51c77007319 990 #define IS_TIM_GET_FLAG(FLAG) (((FLAG) == TIM_FLAG_Update) || \
mbed_official 52:a51c77007319 991 ((FLAG) == TIM_FLAG_CC1) || \
mbed_official 52:a51c77007319 992 ((FLAG) == TIM_FLAG_CC2) || \
mbed_official 52:a51c77007319 993 ((FLAG) == TIM_FLAG_CC3) || \
mbed_official 52:a51c77007319 994 ((FLAG) == TIM_FLAG_CC4) || \
mbed_official 52:a51c77007319 995 ((FLAG) == TIM_FLAG_COM) || \
mbed_official 52:a51c77007319 996 ((FLAG) == TIM_FLAG_Trigger) || \
mbed_official 52:a51c77007319 997 ((FLAG) == TIM_FLAG_Break) || \
mbed_official 52:a51c77007319 998 ((FLAG) == TIM_FLAG_CC1OF) || \
mbed_official 52:a51c77007319 999 ((FLAG) == TIM_FLAG_CC2OF) || \
mbed_official 52:a51c77007319 1000 ((FLAG) == TIM_FLAG_CC3OF) || \
mbed_official 52:a51c77007319 1001 ((FLAG) == TIM_FLAG_CC4OF))
mbed_official 52:a51c77007319 1002
mbed_official 52:a51c77007319 1003
mbed_official 52:a51c77007319 1004 #define IS_TIM_CLEAR_FLAG(TIM_FLAG) ((((TIM_FLAG) & (uint16_t)0xE100) == 0x0000) && ((TIM_FLAG) != 0x0000))
mbed_official 52:a51c77007319 1005 /**
mbed_official 52:a51c77007319 1006 * @}
mbed_official 52:a51c77007319 1007 */
mbed_official 52:a51c77007319 1008
mbed_official 52:a51c77007319 1009 /** @defgroup TIM_Input_Capture_Filer_Value
mbed_official 52:a51c77007319 1010 * @{
mbed_official 52:a51c77007319 1011 */
mbed_official 52:a51c77007319 1012
mbed_official 52:a51c77007319 1013 #define IS_TIM_IC_FILTER(ICFILTER) ((ICFILTER) <= 0xF)
mbed_official 52:a51c77007319 1014 /**
mbed_official 52:a51c77007319 1015 * @}
mbed_official 52:a51c77007319 1016 */
mbed_official 52:a51c77007319 1017
mbed_official 52:a51c77007319 1018 /** @defgroup TIM_External_Trigger_Filter
mbed_official 52:a51c77007319 1019 * @{
mbed_official 52:a51c77007319 1020 */
mbed_official 52:a51c77007319 1021
mbed_official 52:a51c77007319 1022 #define IS_TIM_EXT_FILTER(EXTFILTER) ((EXTFILTER) <= 0xF)
mbed_official 52:a51c77007319 1023 /**
mbed_official 52:a51c77007319 1024 * @}
mbed_official 52:a51c77007319 1025 */
mbed_official 52:a51c77007319 1026
mbed_official 52:a51c77007319 1027 /** @defgroup TIM_Legacy
mbed_official 52:a51c77007319 1028 * @{
mbed_official 52:a51c77007319 1029 */
mbed_official 52:a51c77007319 1030
mbed_official 52:a51c77007319 1031 #define TIM_DMABurstLength_1Byte TIM_DMABurstLength_1Transfer
mbed_official 52:a51c77007319 1032 #define TIM_DMABurstLength_2Bytes TIM_DMABurstLength_2Transfers
mbed_official 52:a51c77007319 1033 #define TIM_DMABurstLength_3Bytes TIM_DMABurstLength_3Transfers
mbed_official 52:a51c77007319 1034 #define TIM_DMABurstLength_4Bytes TIM_DMABurstLength_4Transfers
mbed_official 52:a51c77007319 1035 #define TIM_DMABurstLength_5Bytes TIM_DMABurstLength_5Transfers
mbed_official 52:a51c77007319 1036 #define TIM_DMABurstLength_6Bytes TIM_DMABurstLength_6Transfers
mbed_official 52:a51c77007319 1037 #define TIM_DMABurstLength_7Bytes TIM_DMABurstLength_7Transfers
mbed_official 52:a51c77007319 1038 #define TIM_DMABurstLength_8Bytes TIM_DMABurstLength_8Transfers
mbed_official 52:a51c77007319 1039 #define TIM_DMABurstLength_9Bytes TIM_DMABurstLength_9Transfers
mbed_official 52:a51c77007319 1040 #define TIM_DMABurstLength_10Bytes TIM_DMABurstLength_10Transfers
mbed_official 52:a51c77007319 1041 #define TIM_DMABurstLength_11Bytes TIM_DMABurstLength_11Transfers
mbed_official 52:a51c77007319 1042 #define TIM_DMABurstLength_12Bytes TIM_DMABurstLength_12Transfers
mbed_official 52:a51c77007319 1043 #define TIM_DMABurstLength_13Bytes TIM_DMABurstLength_13Transfers
mbed_official 52:a51c77007319 1044 #define TIM_DMABurstLength_14Bytes TIM_DMABurstLength_14Transfers
mbed_official 52:a51c77007319 1045 #define TIM_DMABurstLength_15Bytes TIM_DMABurstLength_15Transfers
mbed_official 52:a51c77007319 1046 #define TIM_DMABurstLength_16Bytes TIM_DMABurstLength_16Transfers
mbed_official 52:a51c77007319 1047 #define TIM_DMABurstLength_17Bytes TIM_DMABurstLength_17Transfers
mbed_official 52:a51c77007319 1048 #define TIM_DMABurstLength_18Bytes TIM_DMABurstLength_18Transfers
mbed_official 52:a51c77007319 1049 /**
mbed_official 52:a51c77007319 1050 * @}
mbed_official 52:a51c77007319 1051 */
mbed_official 52:a51c77007319 1052
mbed_official 52:a51c77007319 1053 /**
mbed_official 52:a51c77007319 1054 * @}
mbed_official 52:a51c77007319 1055 */
mbed_official 52:a51c77007319 1056
mbed_official 52:a51c77007319 1057 /** @defgroup TIM_Exported_Macros
mbed_official 52:a51c77007319 1058 * @{
mbed_official 52:a51c77007319 1059 */
mbed_official 52:a51c77007319 1060
mbed_official 52:a51c77007319 1061 /**
mbed_official 52:a51c77007319 1062 * @}
mbed_official 52:a51c77007319 1063 */
mbed_official 52:a51c77007319 1064
mbed_official 52:a51c77007319 1065 /** @defgroup TIM_Exported_Functions
mbed_official 52:a51c77007319 1066 * @{
mbed_official 52:a51c77007319 1067 */
mbed_official 52:a51c77007319 1068
mbed_official 52:a51c77007319 1069 void TIM_DeInit(TIM_TypeDef* TIMx);
mbed_official 52:a51c77007319 1070 void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct);
mbed_official 52:a51c77007319 1071 void TIM_OC1Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct);
mbed_official 52:a51c77007319 1072 void TIM_OC2Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct);
mbed_official 52:a51c77007319 1073 void TIM_OC3Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct);
mbed_official 52:a51c77007319 1074 void TIM_OC4Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct);
mbed_official 52:a51c77007319 1075 void TIM_ICInit(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct);
mbed_official 52:a51c77007319 1076 void TIM_PWMIConfig(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct);
mbed_official 52:a51c77007319 1077 void TIM_BDTRConfig(TIM_TypeDef* TIMx, TIM_BDTRInitTypeDef *TIM_BDTRInitStruct);
mbed_official 52:a51c77007319 1078 void TIM_TimeBaseStructInit(TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct);
mbed_official 52:a51c77007319 1079 void TIM_OCStructInit(TIM_OCInitTypeDef* TIM_OCInitStruct);
mbed_official 52:a51c77007319 1080 void TIM_ICStructInit(TIM_ICInitTypeDef* TIM_ICInitStruct);
mbed_official 52:a51c77007319 1081 void TIM_BDTRStructInit(TIM_BDTRInitTypeDef* TIM_BDTRInitStruct);
mbed_official 52:a51c77007319 1082 void TIM_Cmd(TIM_TypeDef* TIMx, FunctionalState NewState);
mbed_official 52:a51c77007319 1083 void TIM_CtrlPWMOutputs(TIM_TypeDef* TIMx, FunctionalState NewState);
mbed_official 52:a51c77007319 1084 void TIM_ITConfig(TIM_TypeDef* TIMx, uint16_t TIM_IT, FunctionalState NewState);
mbed_official 52:a51c77007319 1085 void TIM_GenerateEvent(TIM_TypeDef* TIMx, uint16_t TIM_EventSource);
mbed_official 52:a51c77007319 1086 void TIM_DMAConfig(TIM_TypeDef* TIMx, uint16_t TIM_DMABase, uint16_t TIM_DMABurstLength);
mbed_official 52:a51c77007319 1087 void TIM_DMACmd(TIM_TypeDef* TIMx, uint16_t TIM_DMASource, FunctionalState NewState);
mbed_official 52:a51c77007319 1088 void TIM_InternalClockConfig(TIM_TypeDef* TIMx);
mbed_official 52:a51c77007319 1089 void TIM_ITRxExternalClockConfig(TIM_TypeDef* TIMx, uint16_t TIM_InputTriggerSource);
mbed_official 52:a51c77007319 1090 void TIM_TIxExternalClockConfig(TIM_TypeDef* TIMx, uint16_t TIM_TIxExternalCLKSource,
mbed_official 52:a51c77007319 1091 uint16_t TIM_ICPolarity, uint16_t ICFilter);
mbed_official 52:a51c77007319 1092 void TIM_ETRClockMode1Config(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity,
mbed_official 52:a51c77007319 1093 uint16_t ExtTRGFilter);
mbed_official 52:a51c77007319 1094 void TIM_ETRClockMode2Config(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPrescaler,
mbed_official 52:a51c77007319 1095 uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter);
mbed_official 52:a51c77007319 1096 void TIM_ETRConfig(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity,
mbed_official 52:a51c77007319 1097 uint16_t ExtTRGFilter);
mbed_official 52:a51c77007319 1098 void TIM_PrescalerConfig(TIM_TypeDef* TIMx, uint16_t Prescaler, uint16_t TIM_PSCReloadMode);
mbed_official 52:a51c77007319 1099 void TIM_CounterModeConfig(TIM_TypeDef* TIMx, uint16_t TIM_CounterMode);
mbed_official 52:a51c77007319 1100 void TIM_SelectInputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_InputTriggerSource);
mbed_official 52:a51c77007319 1101 void TIM_EncoderInterfaceConfig(TIM_TypeDef* TIMx, uint16_t TIM_EncoderMode,
mbed_official 52:a51c77007319 1102 uint16_t TIM_IC1Polarity, uint16_t TIM_IC2Polarity);
mbed_official 52:a51c77007319 1103 void TIM_ForcedOC1Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction);
mbed_official 52:a51c77007319 1104 void TIM_ForcedOC2Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction);
mbed_official 52:a51c77007319 1105 void TIM_ForcedOC3Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction);
mbed_official 52:a51c77007319 1106 void TIM_ForcedOC4Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction);
mbed_official 52:a51c77007319 1107 void TIM_ARRPreloadConfig(TIM_TypeDef* TIMx, FunctionalState NewState);
mbed_official 52:a51c77007319 1108 void TIM_SelectCOM(TIM_TypeDef* TIMx, FunctionalState NewState);
mbed_official 52:a51c77007319 1109 void TIM_SelectCCDMA(TIM_TypeDef* TIMx, FunctionalState NewState);
mbed_official 52:a51c77007319 1110 void TIM_CCPreloadControl(TIM_TypeDef* TIMx, FunctionalState NewState);
mbed_official 52:a51c77007319 1111 void TIM_OC1PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload);
mbed_official 52:a51c77007319 1112 void TIM_OC2PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload);
mbed_official 52:a51c77007319 1113 void TIM_OC3PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload);
mbed_official 52:a51c77007319 1114 void TIM_OC4PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload);
mbed_official 52:a51c77007319 1115 void TIM_OC1FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast);
mbed_official 52:a51c77007319 1116 void TIM_OC2FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast);
mbed_official 52:a51c77007319 1117 void TIM_OC3FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast);
mbed_official 52:a51c77007319 1118 void TIM_OC4FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast);
mbed_official 52:a51c77007319 1119 void TIM_ClearOC1Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear);
mbed_official 52:a51c77007319 1120 void TIM_ClearOC2Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear);
mbed_official 52:a51c77007319 1121 void TIM_ClearOC3Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear);
mbed_official 52:a51c77007319 1122 void TIM_ClearOC4Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear);
mbed_official 52:a51c77007319 1123 void TIM_OC1PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity);
mbed_official 52:a51c77007319 1124 void TIM_OC1NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity);
mbed_official 52:a51c77007319 1125 void TIM_OC2PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity);
mbed_official 52:a51c77007319 1126 void TIM_OC2NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity);
mbed_official 52:a51c77007319 1127 void TIM_OC3PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity);
mbed_official 52:a51c77007319 1128 void TIM_OC3NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity);
mbed_official 52:a51c77007319 1129 void TIM_OC4PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity);
mbed_official 52:a51c77007319 1130 void TIM_CCxCmd(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_CCx);
mbed_official 52:a51c77007319 1131 void TIM_CCxNCmd(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_CCxN);
mbed_official 52:a51c77007319 1132 void TIM_SelectOCxM(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_OCMode);
mbed_official 52:a51c77007319 1133 void TIM_UpdateDisableConfig(TIM_TypeDef* TIMx, FunctionalState NewState);
mbed_official 52:a51c77007319 1134 void TIM_UpdateRequestConfig(TIM_TypeDef* TIMx, uint16_t TIM_UpdateSource);
mbed_official 52:a51c77007319 1135 void TIM_SelectHallSensor(TIM_TypeDef* TIMx, FunctionalState NewState);
mbed_official 52:a51c77007319 1136 void TIM_SelectOnePulseMode(TIM_TypeDef* TIMx, uint16_t TIM_OPMode);
mbed_official 52:a51c77007319 1137 void TIM_SelectOutputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_TRGOSource);
mbed_official 52:a51c77007319 1138 void TIM_SelectSlaveMode(TIM_TypeDef* TIMx, uint16_t TIM_SlaveMode);
mbed_official 52:a51c77007319 1139 void TIM_SelectMasterSlaveMode(TIM_TypeDef* TIMx, uint16_t TIM_MasterSlaveMode);
mbed_official 52:a51c77007319 1140 void TIM_SetCounter(TIM_TypeDef* TIMx, uint16_t Counter);
mbed_official 52:a51c77007319 1141 void TIM_SetAutoreload(TIM_TypeDef* TIMx, uint16_t Autoreload);
mbed_official 52:a51c77007319 1142 void TIM_SetCompare1(TIM_TypeDef* TIMx, uint16_t Compare1);
mbed_official 52:a51c77007319 1143 void TIM_SetCompare2(TIM_TypeDef* TIMx, uint16_t Compare2);
mbed_official 52:a51c77007319 1144 void TIM_SetCompare3(TIM_TypeDef* TIMx, uint16_t Compare3);
mbed_official 52:a51c77007319 1145 void TIM_SetCompare4(TIM_TypeDef* TIMx, uint16_t Compare4);
mbed_official 52:a51c77007319 1146 void TIM_SetIC1Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC);
mbed_official 52:a51c77007319 1147 void TIM_SetIC2Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC);
mbed_official 52:a51c77007319 1148 void TIM_SetIC3Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC);
mbed_official 52:a51c77007319 1149 void TIM_SetIC4Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC);
mbed_official 52:a51c77007319 1150 void TIM_SetClockDivision(TIM_TypeDef* TIMx, uint16_t TIM_CKD);
mbed_official 52:a51c77007319 1151 uint16_t TIM_GetCapture1(TIM_TypeDef* TIMx);
mbed_official 52:a51c77007319 1152 uint16_t TIM_GetCapture2(TIM_TypeDef* TIMx);
mbed_official 52:a51c77007319 1153 uint16_t TIM_GetCapture3(TIM_TypeDef* TIMx);
mbed_official 52:a51c77007319 1154 uint16_t TIM_GetCapture4(TIM_TypeDef* TIMx);
mbed_official 52:a51c77007319 1155 uint16_t TIM_GetCounter(TIM_TypeDef* TIMx);
mbed_official 52:a51c77007319 1156 uint16_t TIM_GetPrescaler(TIM_TypeDef* TIMx);
mbed_official 52:a51c77007319 1157 FlagStatus TIM_GetFlagStatus(TIM_TypeDef* TIMx, uint16_t TIM_FLAG);
mbed_official 52:a51c77007319 1158 void TIM_ClearFlag(TIM_TypeDef* TIMx, uint16_t TIM_FLAG);
mbed_official 52:a51c77007319 1159 ITStatus TIM_GetITStatus(TIM_TypeDef* TIMx, uint16_t TIM_IT);
mbed_official 52:a51c77007319 1160 void TIM_ClearITPendingBit(TIM_TypeDef* TIMx, uint16_t TIM_IT);
mbed_official 52:a51c77007319 1161
mbed_official 52:a51c77007319 1162 #ifdef __cplusplus
mbed_official 52:a51c77007319 1163 }
mbed_official 52:a51c77007319 1164 #endif
mbed_official 52:a51c77007319 1165
mbed_official 52:a51c77007319 1166 #endif /*__STM32F10x_TIM_H */
mbed_official 52:a51c77007319 1167 /**
mbed_official 52:a51c77007319 1168 * @}
mbed_official 52:a51c77007319 1169 */
mbed_official 52:a51c77007319 1170
mbed_official 52:a51c77007319 1171 /**
mbed_official 52:a51c77007319 1172 * @}
mbed_official 52:a51c77007319 1173 */
mbed_official 52:a51c77007319 1174
mbed_official 52:a51c77007319 1175 /**
mbed_official 52:a51c77007319 1176 * @}
mbed_official 52:a51c77007319 1177 */
mbed_official 52:a51c77007319 1178
mbed_official 84:f54042cbc282 1179 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/