mbed library sources modified for open wear

Dependents:   openwear-lifelogger-example

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Jan 27 14:30:07 2014 +0000
Revision:
76:aeb1df146756
Child:
106:ced8cbb51063
Synchronized with git revision a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd

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

Add NUCLEO_L152RE

Who changed what in which revision?

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