Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
110:165afa46840b
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 110:165afa46840b 1 /**
Kojto 110:165afa46840b 2 ******************************************************************************
Kojto 110:165afa46840b 3 * @file stm32f4xx_hal_tim.h
Kojto 110:165afa46840b 4 * @author MCD Application Team
Kojto 110:165afa46840b 5 * @version V1.4.1
Kojto 110:165afa46840b 6 * @date 09-October-2015
Kojto 110:165afa46840b 7 * @brief Header file of TIM HAL module.
Kojto 110:165afa46840b 8 ******************************************************************************
Kojto 110:165afa46840b 9 * @attention
Kojto 110:165afa46840b 10 *
Kojto 110:165afa46840b 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 110:165afa46840b 12 *
Kojto 110:165afa46840b 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 110:165afa46840b 14 * are permitted provided that the following conditions are met:
Kojto 110:165afa46840b 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 110:165afa46840b 16 * this list of conditions and the following disclaimer.
Kojto 110:165afa46840b 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 110:165afa46840b 18 * this list of conditions and the following disclaimer in the documentation
Kojto 110:165afa46840b 19 * and/or other materials provided with the distribution.
Kojto 110:165afa46840b 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 110:165afa46840b 21 * may be used to endorse or promote products derived from this software
Kojto 110:165afa46840b 22 * without specific prior written permission.
Kojto 110:165afa46840b 23 *
Kojto 110:165afa46840b 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 110:165afa46840b 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 110:165afa46840b 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 110:165afa46840b 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 110:165afa46840b 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 110:165afa46840b 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 110:165afa46840b 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 110:165afa46840b 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 110:165afa46840b 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 110:165afa46840b 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 110:165afa46840b 34 *
Kojto 110:165afa46840b 35 ******************************************************************************
Kojto 110:165afa46840b 36 */
Kojto 110:165afa46840b 37
Kojto 110:165afa46840b 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 110:165afa46840b 39 #ifndef __STM32F4xx_HAL_TIM_H
Kojto 110:165afa46840b 40 #define __STM32F4xx_HAL_TIM_H
Kojto 110:165afa46840b 41
Kojto 110:165afa46840b 42 #ifdef __cplusplus
Kojto 110:165afa46840b 43 extern "C" {
Kojto 110:165afa46840b 44 #endif
Kojto 110:165afa46840b 45
Kojto 110:165afa46840b 46 /* Includes ------------------------------------------------------------------*/
Kojto 110:165afa46840b 47 #include "stm32f4xx_hal_def.h"
Kojto 110:165afa46840b 48
Kojto 110:165afa46840b 49 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 110:165afa46840b 50 * @{
Kojto 110:165afa46840b 51 */
Kojto 110:165afa46840b 52
Kojto 110:165afa46840b 53 /** @addtogroup TIM
Kojto 110:165afa46840b 54 * @{
Kojto 110:165afa46840b 55 */
Kojto 110:165afa46840b 56
Kojto 110:165afa46840b 57 /* Exported types ------------------------------------------------------------*/
Kojto 110:165afa46840b 58 /** @defgroup TIM_Exported_Types TIM Exported Types
Kojto 110:165afa46840b 59 * @{
Kojto 110:165afa46840b 60 */
Kojto 110:165afa46840b 61
Kojto 110:165afa46840b 62 /**
Kojto 110:165afa46840b 63 * @brief TIM Time base Configuration Structure definition
Kojto 110:165afa46840b 64 */
Kojto 110:165afa46840b 65 typedef struct
Kojto 110:165afa46840b 66 {
Kojto 110:165afa46840b 67 uint32_t Prescaler; /*!< Specifies the prescaler value used to divide the TIM clock.
Kojto 110:165afa46840b 68 This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
Kojto 110:165afa46840b 69
Kojto 110:165afa46840b 70 uint32_t CounterMode; /*!< Specifies the counter mode.
Kojto 110:165afa46840b 71 This parameter can be a value of @ref TIM_Counter_Mode */
Kojto 110:165afa46840b 72
Kojto 110:165afa46840b 73 uint32_t Period; /*!< Specifies the period value to be loaded into the active
Kojto 110:165afa46840b 74 Auto-Reload Register at the next update event.
Kojto 110:165afa46840b 75 This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */
Kojto 110:165afa46840b 76
Kojto 110:165afa46840b 77 uint32_t ClockDivision; /*!< Specifies the clock division.
Kojto 110:165afa46840b 78 This parameter can be a value of @ref TIM_ClockDivision */
Kojto 110:165afa46840b 79
Kojto 110:165afa46840b 80 uint32_t RepetitionCounter; /*!< Specifies the repetition counter value. Each time the RCR downcounter
Kojto 110:165afa46840b 81 reaches zero, an update event is generated and counting restarts
Kojto 110:165afa46840b 82 from the RCR value (N).
Kojto 110:165afa46840b 83 This means in PWM mode that (N+1) corresponds to:
Kojto 110:165afa46840b 84 - the number of PWM periods in edge-aligned mode
Kojto 110:165afa46840b 85 - the number of half PWM period in center-aligned mode
Kojto 110:165afa46840b 86 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF.
Kojto 110:165afa46840b 87 @note This parameter is valid only for TIM1 and TIM8. */
Kojto 110:165afa46840b 88 } TIM_Base_InitTypeDef;
Kojto 110:165afa46840b 89
Kojto 110:165afa46840b 90 /**
Kojto 110:165afa46840b 91 * @brief TIM Output Compare Configuration Structure definition
Kojto 110:165afa46840b 92 */
Kojto 110:165afa46840b 93
Kojto 110:165afa46840b 94 typedef struct
Kojto 110:165afa46840b 95 {
Kojto 110:165afa46840b 96 uint32_t OCMode; /*!< Specifies the TIM mode.
Kojto 110:165afa46840b 97 This parameter can be a value of @ref TIM_Output_Compare_and_PWM_modes */
Kojto 110:165afa46840b 98
Kojto 110:165afa46840b 99 uint32_t Pulse; /*!< Specifies the pulse value to be loaded into the Capture Compare Register.
Kojto 110:165afa46840b 100 This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
Kojto 110:165afa46840b 101
Kojto 110:165afa46840b 102 uint32_t OCPolarity; /*!< Specifies the output polarity.
Kojto 110:165afa46840b 103 This parameter can be a value of @ref TIM_Output_Compare_Polarity */
Kojto 110:165afa46840b 104
Kojto 110:165afa46840b 105 uint32_t OCNPolarity; /*!< Specifies the complementary output polarity.
Kojto 110:165afa46840b 106 This parameter can be a value of @ref TIM_Output_Compare_N_Polarity
Kojto 110:165afa46840b 107 @note This parameter is valid only for TIM1 and TIM8. */
Kojto 110:165afa46840b 108
Kojto 110:165afa46840b 109 uint32_t OCFastMode; /*!< Specifies the Fast mode state.
Kojto 110:165afa46840b 110 This parameter can be a value of @ref TIM_Output_Fast_State
Kojto 110:165afa46840b 111 @note This parameter is valid only in PWM1 and PWM2 mode. */
Kojto 110:165afa46840b 112
Kojto 110:165afa46840b 113
Kojto 110:165afa46840b 114 uint32_t OCIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state.
Kojto 110:165afa46840b 115 This parameter can be a value of @ref TIM_Output_Compare_Idle_State
Kojto 110:165afa46840b 116 @note This parameter is valid only for TIM1 and TIM8. */
Kojto 110:165afa46840b 117
Kojto 110:165afa46840b 118 uint32_t OCNIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state.
Kojto 110:165afa46840b 119 This parameter can be a value of @ref TIM_Output_Compare_N_Idle_State
Kojto 110:165afa46840b 120 @note This parameter is valid only for TIM1 and TIM8. */
Kojto 110:165afa46840b 121 } TIM_OC_InitTypeDef;
Kojto 110:165afa46840b 122
Kojto 110:165afa46840b 123 /**
Kojto 110:165afa46840b 124 * @brief TIM One Pulse Mode Configuration Structure definition
Kojto 110:165afa46840b 125 */
Kojto 110:165afa46840b 126 typedef struct
Kojto 110:165afa46840b 127 {
Kojto 110:165afa46840b 128 uint32_t OCMode; /*!< Specifies the TIM mode.
Kojto 110:165afa46840b 129 This parameter can be a value of @ref TIM_Output_Compare_and_PWM_modes */
Kojto 110:165afa46840b 130
Kojto 110:165afa46840b 131 uint32_t Pulse; /*!< Specifies the pulse value to be loaded into the Capture Compare Register.
Kojto 110:165afa46840b 132 This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
Kojto 110:165afa46840b 133
Kojto 110:165afa46840b 134 uint32_t OCPolarity; /*!< Specifies the output polarity.
Kojto 110:165afa46840b 135 This parameter can be a value of @ref TIM_Output_Compare_Polarity */
Kojto 110:165afa46840b 136
Kojto 110:165afa46840b 137 uint32_t OCNPolarity; /*!< Specifies the complementary output polarity.
Kojto 110:165afa46840b 138 This parameter can be a value of @ref TIM_Output_Compare_N_Polarity
Kojto 110:165afa46840b 139 @note This parameter is valid only for TIM1 and TIM8. */
Kojto 110:165afa46840b 140
Kojto 110:165afa46840b 141 uint32_t OCIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state.
Kojto 110:165afa46840b 142 This parameter can be a value of @ref TIM_Output_Compare_Idle_State
Kojto 110:165afa46840b 143 @note This parameter is valid only for TIM1 and TIM8. */
Kojto 110:165afa46840b 144
Kojto 110:165afa46840b 145 uint32_t OCNIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state.
Kojto 110:165afa46840b 146 This parameter can be a value of @ref TIM_Output_Compare_N_Idle_State
Kojto 110:165afa46840b 147 @note This parameter is valid only for TIM1 and TIM8. */
Kojto 110:165afa46840b 148
Kojto 110:165afa46840b 149 uint32_t ICPolarity; /*!< Specifies the active edge of the input signal.
Kojto 110:165afa46840b 150 This parameter can be a value of @ref TIM_Input_Capture_Polarity */
Kojto 110:165afa46840b 151
Kojto 110:165afa46840b 152 uint32_t ICSelection; /*!< Specifies the input.
Kojto 110:165afa46840b 153 This parameter can be a value of @ref TIM_Input_Capture_Selection */
Kojto 110:165afa46840b 154
Kojto 110:165afa46840b 155 uint32_t ICFilter; /*!< Specifies the input capture filter.
Kojto 110:165afa46840b 156 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
Kojto 110:165afa46840b 157 } TIM_OnePulse_InitTypeDef;
Kojto 110:165afa46840b 158
Kojto 110:165afa46840b 159
Kojto 110:165afa46840b 160 /**
Kojto 110:165afa46840b 161 * @brief TIM Input Capture Configuration Structure definition
Kojto 110:165afa46840b 162 */
Kojto 110:165afa46840b 163
Kojto 110:165afa46840b 164 typedef struct
Kojto 110:165afa46840b 165 {
Kojto 110:165afa46840b 166 uint32_t ICPolarity; /*!< Specifies the active edge of the input signal.
Kojto 110:165afa46840b 167 This parameter can be a value of @ref TIM_Input_Capture_Polarity */
Kojto 110:165afa46840b 168
Kojto 110:165afa46840b 169 uint32_t ICSelection; /*!< Specifies the input.
Kojto 110:165afa46840b 170 This parameter can be a value of @ref TIM_Input_Capture_Selection */
Kojto 110:165afa46840b 171
Kojto 110:165afa46840b 172 uint32_t ICPrescaler; /*!< Specifies the Input Capture Prescaler.
Kojto 110:165afa46840b 173 This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
Kojto 110:165afa46840b 174
Kojto 110:165afa46840b 175 uint32_t ICFilter; /*!< Specifies the input capture filter.
Kojto 110:165afa46840b 176 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
Kojto 110:165afa46840b 177 } TIM_IC_InitTypeDef;
Kojto 110:165afa46840b 178
Kojto 110:165afa46840b 179 /**
Kojto 110:165afa46840b 180 * @brief TIM Encoder Configuration Structure definition
Kojto 110:165afa46840b 181 */
Kojto 110:165afa46840b 182
Kojto 110:165afa46840b 183 typedef struct
Kojto 110:165afa46840b 184 {
Kojto 110:165afa46840b 185 uint32_t EncoderMode; /*!< Specifies the active edge of the input signal.
Kojto 110:165afa46840b 186 This parameter can be a value of @ref TIM_Encoder_Mode */
Kojto 110:165afa46840b 187
Kojto 110:165afa46840b 188 uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal.
Kojto 110:165afa46840b 189 This parameter can be a value of @ref TIM_Input_Capture_Polarity */
Kojto 110:165afa46840b 190
Kojto 110:165afa46840b 191 uint32_t IC1Selection; /*!< Specifies the input.
Kojto 110:165afa46840b 192 This parameter can be a value of @ref TIM_Input_Capture_Selection */
Kojto 110:165afa46840b 193
Kojto 110:165afa46840b 194 uint32_t IC1Prescaler; /*!< Specifies the Input Capture Prescaler.
Kojto 110:165afa46840b 195 This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
Kojto 110:165afa46840b 196
Kojto 110:165afa46840b 197 uint32_t IC1Filter; /*!< Specifies the input capture filter.
Kojto 110:165afa46840b 198 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
Kojto 110:165afa46840b 199
Kojto 110:165afa46840b 200 uint32_t IC2Polarity; /*!< Specifies the active edge of the input signal.
Kojto 110:165afa46840b 201 This parameter can be a value of @ref TIM_Input_Capture_Polarity */
Kojto 110:165afa46840b 202
Kojto 110:165afa46840b 203 uint32_t IC2Selection; /*!< Specifies the input.
Kojto 110:165afa46840b 204 This parameter can be a value of @ref TIM_Input_Capture_Selection */
Kojto 110:165afa46840b 205
Kojto 110:165afa46840b 206 uint32_t IC2Prescaler; /*!< Specifies the Input Capture Prescaler.
Kojto 110:165afa46840b 207 This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
Kojto 110:165afa46840b 208
Kojto 110:165afa46840b 209 uint32_t IC2Filter; /*!< Specifies the input capture filter.
Kojto 110:165afa46840b 210 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
Kojto 110:165afa46840b 211 } TIM_Encoder_InitTypeDef;
Kojto 110:165afa46840b 212
Kojto 110:165afa46840b 213 /**
Kojto 110:165afa46840b 214 * @brief Clock Configuration Handle Structure definition
Kojto 110:165afa46840b 215 */
Kojto 110:165afa46840b 216 typedef struct
Kojto 110:165afa46840b 217 {
Kojto 110:165afa46840b 218 uint32_t ClockSource; /*!< TIM clock sources.
Kojto 110:165afa46840b 219 This parameter can be a value of @ref TIM_Clock_Source */
Kojto 110:165afa46840b 220 uint32_t ClockPolarity; /*!< TIM clock polarity.
Kojto 110:165afa46840b 221 This parameter can be a value of @ref TIM_Clock_Polarity */
Kojto 110:165afa46840b 222 uint32_t ClockPrescaler; /*!< TIM clock prescaler.
Kojto 110:165afa46840b 223 This parameter can be a value of @ref TIM_Clock_Prescaler */
Kojto 110:165afa46840b 224 uint32_t ClockFilter; /*!< TIM clock filter.
Kojto 110:165afa46840b 225 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
Kojto 110:165afa46840b 226 }TIM_ClockConfigTypeDef;
Kojto 110:165afa46840b 227
Kojto 110:165afa46840b 228 /**
Kojto 110:165afa46840b 229 * @brief Clear Input Configuration Handle Structure definition
Kojto 110:165afa46840b 230 */
Kojto 110:165afa46840b 231 typedef struct
Kojto 110:165afa46840b 232 {
Kojto 110:165afa46840b 233 uint32_t ClearInputState; /*!< TIM clear Input state.
Kojto 110:165afa46840b 234 This parameter can be ENABLE or DISABLE */
Kojto 110:165afa46840b 235 uint32_t ClearInputSource; /*!< TIM clear Input sources.
Kojto 110:165afa46840b 236 This parameter can be a value of @ref TIM_ClearInput_Source */
Kojto 110:165afa46840b 237 uint32_t ClearInputPolarity; /*!< TIM Clear Input polarity.
Kojto 110:165afa46840b 238 This parameter can be a value of @ref TIM_ClearInput_Polarity */
Kojto 110:165afa46840b 239 uint32_t ClearInputPrescaler; /*!< TIM Clear Input prescaler.
Kojto 110:165afa46840b 240 This parameter can be a value of @ref TIM_ClearInput_Prescaler */
Kojto 110:165afa46840b 241 uint32_t ClearInputFilter; /*!< TIM Clear Input filter.
Kojto 110:165afa46840b 242 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
Kojto 110:165afa46840b 243 }TIM_ClearInputConfigTypeDef;
Kojto 110:165afa46840b 244
Kojto 110:165afa46840b 245 /**
Kojto 110:165afa46840b 246 * @brief TIM Slave configuration Structure definition
Kojto 110:165afa46840b 247 */
Kojto 110:165afa46840b 248 typedef struct {
Kojto 110:165afa46840b 249 uint32_t SlaveMode; /*!< Slave mode selection
Kojto 110:165afa46840b 250 This parameter can be a value of @ref TIM_Slave_Mode */
Kojto 110:165afa46840b 251 uint32_t InputTrigger; /*!< Input Trigger source
Kojto 110:165afa46840b 252 This parameter can be a value of @ref TIM_Trigger_Selection */
Kojto 110:165afa46840b 253 uint32_t TriggerPolarity; /*!< Input Trigger polarity
Kojto 110:165afa46840b 254 This parameter can be a value of @ref TIM_Trigger_Polarity */
Kojto 110:165afa46840b 255 uint32_t TriggerPrescaler; /*!< Input trigger prescaler
Kojto 110:165afa46840b 256 This parameter can be a value of @ref TIM_Trigger_Prescaler */
Kojto 110:165afa46840b 257 uint32_t TriggerFilter; /*!< Input trigger filter
Kojto 110:165afa46840b 258 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
Kojto 110:165afa46840b 259
Kojto 110:165afa46840b 260 }TIM_SlaveConfigTypeDef;
Kojto 110:165afa46840b 261
Kojto 110:165afa46840b 262 /**
Kojto 110:165afa46840b 263 * @brief HAL State structures definition
Kojto 110:165afa46840b 264 */
Kojto 110:165afa46840b 265 typedef enum
Kojto 110:165afa46840b 266 {
Kojto 110:165afa46840b 267 HAL_TIM_STATE_RESET = 0x00, /*!< Peripheral not yet initialized or disabled */
Kojto 110:165afa46840b 268 HAL_TIM_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */
Kojto 110:165afa46840b 269 HAL_TIM_STATE_BUSY = 0x02, /*!< An internal process is ongoing */
Kojto 110:165afa46840b 270 HAL_TIM_STATE_TIMEOUT = 0x03, /*!< Timeout state */
Kojto 110:165afa46840b 271 HAL_TIM_STATE_ERROR = 0x04 /*!< Reception process is ongoing */
Kojto 110:165afa46840b 272 }HAL_TIM_StateTypeDef;
Kojto 110:165afa46840b 273
Kojto 110:165afa46840b 274 /**
Kojto 110:165afa46840b 275 * @brief HAL Active channel structures definition
Kojto 110:165afa46840b 276 */
Kojto 110:165afa46840b 277 typedef enum
Kojto 110:165afa46840b 278 {
Kojto 110:165afa46840b 279 HAL_TIM_ACTIVE_CHANNEL_1 = 0x01, /*!< The active channel is 1 */
Kojto 110:165afa46840b 280 HAL_TIM_ACTIVE_CHANNEL_2 = 0x02, /*!< The active channel is 2 */
Kojto 110:165afa46840b 281 HAL_TIM_ACTIVE_CHANNEL_3 = 0x04, /*!< The active channel is 3 */
Kojto 110:165afa46840b 282 HAL_TIM_ACTIVE_CHANNEL_4 = 0x08, /*!< The active channel is 4 */
Kojto 110:165afa46840b 283 HAL_TIM_ACTIVE_CHANNEL_CLEARED = 0x00 /*!< All active channels cleared */
Kojto 110:165afa46840b 284 }HAL_TIM_ActiveChannel;
Kojto 110:165afa46840b 285
Kojto 110:165afa46840b 286 /**
Kojto 110:165afa46840b 287 * @brief TIM Time Base Handle Structure definition
Kojto 110:165afa46840b 288 */
Kojto 110:165afa46840b 289 typedef struct
Kojto 110:165afa46840b 290 {
Kojto 110:165afa46840b 291 TIM_TypeDef *Instance; /*!< Register base address */
Kojto 110:165afa46840b 292 TIM_Base_InitTypeDef Init; /*!< TIM Time Base required parameters */
Kojto 110:165afa46840b 293 HAL_TIM_ActiveChannel Channel; /*!< Active channel */
Kojto 110:165afa46840b 294 DMA_HandleTypeDef *hdma[7]; /*!< DMA Handlers array
Kojto 110:165afa46840b 295 This array is accessed by a @ref DMA_Handle_index */
Kojto 110:165afa46840b 296 HAL_LockTypeDef Lock; /*!< Locking object */
Kojto 110:165afa46840b 297 __IO HAL_TIM_StateTypeDef State; /*!< TIM operation state */
Kojto 110:165afa46840b 298 }TIM_HandleTypeDef;
Kojto 110:165afa46840b 299 /**
Kojto 110:165afa46840b 300 * @}
Kojto 110:165afa46840b 301 */
Kojto 110:165afa46840b 302
Kojto 110:165afa46840b 303 /* Exported constants --------------------------------------------------------*/
Kojto 110:165afa46840b 304 /** @defgroup TIM_Exported_Constants TIM Exported Constants
Kojto 110:165afa46840b 305 * @{
Kojto 110:165afa46840b 306 */
Kojto 110:165afa46840b 307
Kojto 110:165afa46840b 308 /** @defgroup TIM_Input_Channel_Polarity TIM Input Channel Polarity
Kojto 110:165afa46840b 309 * @{
Kojto 110:165afa46840b 310 */
Kojto 110:165afa46840b 311 #define TIM_INPUTCHANNELPOLARITY_RISING ((uint32_t)0x00000000) /*!< Polarity for TIx source */
Kojto 110:165afa46840b 312 #define TIM_INPUTCHANNELPOLARITY_FALLING (TIM_CCER_CC1P) /*!< Polarity for TIx source */
Kojto 110:165afa46840b 313 #define TIM_INPUTCHANNELPOLARITY_BOTHEDGE (TIM_CCER_CC1P | TIM_CCER_CC1NP) /*!< Polarity for TIx source */
Kojto 110:165afa46840b 314 /**
Kojto 110:165afa46840b 315 * @}
Kojto 110:165afa46840b 316 */
Kojto 110:165afa46840b 317
Kojto 110:165afa46840b 318 /** @defgroup TIM_ETR_Polarity TIM ETR Polarity
Kojto 110:165afa46840b 319 * @{
Kojto 110:165afa46840b 320 */
Kojto 110:165afa46840b 321 #define TIM_ETRPOLARITY_INVERTED (TIM_SMCR_ETP) /*!< Polarity for ETR source */
Kojto 110:165afa46840b 322 #define TIM_ETRPOLARITY_NONINVERTED ((uint32_t)0x0000) /*!< Polarity for ETR source */
Kojto 110:165afa46840b 323 /**
Kojto 110:165afa46840b 324 * @}
Kojto 110:165afa46840b 325 */
Kojto 110:165afa46840b 326
Kojto 110:165afa46840b 327 /** @defgroup TIM_ETR_Prescaler TIM ETR Prescaler
Kojto 110:165afa46840b 328 * @{
Kojto 110:165afa46840b 329 */
Kojto 110:165afa46840b 330 #define TIM_ETRPRESCALER_DIV1 ((uint32_t)0x0000) /*!< No prescaler is used */
Kojto 110:165afa46840b 331 #define TIM_ETRPRESCALER_DIV2 (TIM_SMCR_ETPS_0) /*!< ETR input source is divided by 2 */
Kojto 110:165afa46840b 332 #define TIM_ETRPRESCALER_DIV4 (TIM_SMCR_ETPS_1) /*!< ETR input source is divided by 4 */
Kojto 110:165afa46840b 333 #define TIM_ETRPRESCALER_DIV8 (TIM_SMCR_ETPS) /*!< ETR input source is divided by 8 */
Kojto 110:165afa46840b 334 /**
Kojto 110:165afa46840b 335 * @}
Kojto 110:165afa46840b 336 */
Kojto 110:165afa46840b 337
Kojto 110:165afa46840b 338 /** @defgroup TIM_Counter_Mode TIM Counter Mode
Kojto 110:165afa46840b 339 * @{
Kojto 110:165afa46840b 340 */
Kojto 110:165afa46840b 341 #define TIM_COUNTERMODE_UP ((uint32_t)0x0000)
Kojto 110:165afa46840b 342 #define TIM_COUNTERMODE_DOWN TIM_CR1_DIR
Kojto 110:165afa46840b 343 #define TIM_COUNTERMODE_CENTERALIGNED1 TIM_CR1_CMS_0
Kojto 110:165afa46840b 344 #define TIM_COUNTERMODE_CENTERALIGNED2 TIM_CR1_CMS_1
Kojto 110:165afa46840b 345 #define TIM_COUNTERMODE_CENTERALIGNED3 TIM_CR1_CMS
Kojto 110:165afa46840b 346 /**
Kojto 110:165afa46840b 347 * @}
Kojto 110:165afa46840b 348 */
Kojto 110:165afa46840b 349
Kojto 110:165afa46840b 350 /** @defgroup TIM_ClockDivision TIM Clock Division
Kojto 110:165afa46840b 351 * @{
Kojto 110:165afa46840b 352 */
Kojto 110:165afa46840b 353 #define TIM_CLOCKDIVISION_DIV1 ((uint32_t)0x0000)
Kojto 110:165afa46840b 354 #define TIM_CLOCKDIVISION_DIV2 (TIM_CR1_CKD_0)
Kojto 110:165afa46840b 355 #define TIM_CLOCKDIVISION_DIV4 (TIM_CR1_CKD_1)
Kojto 110:165afa46840b 356 /**
Kojto 110:165afa46840b 357 * @}
Kojto 110:165afa46840b 358 */
Kojto 110:165afa46840b 359
Kojto 110:165afa46840b 360 /** @defgroup TIM_Output_Compare_and_PWM_modes TIM Output Compare and PWM modes
Kojto 110:165afa46840b 361 * @{
Kojto 110:165afa46840b 362 */
Kojto 110:165afa46840b 363 #define TIM_OCMODE_TIMING ((uint32_t)0x0000)
Kojto 110:165afa46840b 364 #define TIM_OCMODE_ACTIVE (TIM_CCMR1_OC1M_0)
Kojto 110:165afa46840b 365 #define TIM_OCMODE_INACTIVE (TIM_CCMR1_OC1M_1)
Kojto 110:165afa46840b 366 #define TIM_OCMODE_TOGGLE (TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_1)
Kojto 110:165afa46840b 367 #define TIM_OCMODE_PWM1 (TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2)
Kojto 110:165afa46840b 368 #define TIM_OCMODE_PWM2 (TIM_CCMR1_OC1M)
Kojto 110:165afa46840b 369 #define TIM_OCMODE_FORCED_ACTIVE (TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2)
Kojto 110:165afa46840b 370 #define TIM_OCMODE_FORCED_INACTIVE (TIM_CCMR1_OC1M_2)
Kojto 110:165afa46840b 371
Kojto 110:165afa46840b 372 /**
Kojto 110:165afa46840b 373 * @}
Kojto 110:165afa46840b 374 */
Kojto 110:165afa46840b 375
Kojto 110:165afa46840b 376 /** @defgroup TIM_Output_Fast_State TIM Output Fast State
Kojto 110:165afa46840b 377 * @{
Kojto 110:165afa46840b 378 */
Kojto 110:165afa46840b 379 #define TIM_OCFAST_DISABLE ((uint32_t)0x0000)
Kojto 110:165afa46840b 380 #define TIM_OCFAST_ENABLE (TIM_CCMR1_OC1FE)
Kojto 110:165afa46840b 381 /**
Kojto 110:165afa46840b 382 * @}
Kojto 110:165afa46840b 383 */
Kojto 110:165afa46840b 384
Kojto 110:165afa46840b 385 /** @defgroup TIM_Output_Compare_Polarity TIM Output Compare Polarity
Kojto 110:165afa46840b 386 * @{
Kojto 110:165afa46840b 387 */
Kojto 110:165afa46840b 388 #define TIM_OCPOLARITY_HIGH ((uint32_t)0x0000)
Kojto 110:165afa46840b 389 #define TIM_OCPOLARITY_LOW (TIM_CCER_CC1P)
Kojto 110:165afa46840b 390 /**
Kojto 110:165afa46840b 391 * @}
Kojto 110:165afa46840b 392 */
Kojto 110:165afa46840b 393
Kojto 110:165afa46840b 394 /** @defgroup TIM_Output_Compare_N_Polarity TIM Output CompareN Polarity
Kojto 110:165afa46840b 395 * @{
Kojto 110:165afa46840b 396 */
Kojto 110:165afa46840b 397 #define TIM_OCNPOLARITY_HIGH ((uint32_t)0x0000)
Kojto 110:165afa46840b 398 #define TIM_OCNPOLARITY_LOW (TIM_CCER_CC1NP)
Kojto 110:165afa46840b 399 /**
Kojto 110:165afa46840b 400 * @}
Kojto 110:165afa46840b 401 */
Kojto 110:165afa46840b 402
Kojto 110:165afa46840b 403 /** @defgroup TIM_Output_Compare_Idle_State TIM Output Compare Idle State
Kojto 110:165afa46840b 404 * @{
Kojto 110:165afa46840b 405 */
Kojto 110:165afa46840b 406 #define TIM_OCIDLESTATE_SET (TIM_CR2_OIS1)
Kojto 110:165afa46840b 407 #define TIM_OCIDLESTATE_RESET ((uint32_t)0x0000)
Kojto 110:165afa46840b 408 /**
Kojto 110:165afa46840b 409 * @}
Kojto 110:165afa46840b 410 */
Kojto 110:165afa46840b 411
Kojto 110:165afa46840b 412 /** @defgroup TIM_Output_Compare_N_Idle_State TIM Output Compare N Idle State
Kojto 110:165afa46840b 413 * @{
Kojto 110:165afa46840b 414 */
Kojto 110:165afa46840b 415 #define TIM_OCNIDLESTATE_SET (TIM_CR2_OIS1N)
Kojto 110:165afa46840b 416 #define TIM_OCNIDLESTATE_RESET ((uint32_t)0x0000)
Kojto 110:165afa46840b 417 /**
Kojto 110:165afa46840b 418 * @}
Kojto 110:165afa46840b 419 */
Kojto 110:165afa46840b 420
Kojto 110:165afa46840b 421 /** @defgroup TIM_Channel TIM Channel
Kojto 110:165afa46840b 422 * @{
Kojto 110:165afa46840b 423 */
Kojto 110:165afa46840b 424 #define TIM_CHANNEL_1 ((uint32_t)0x0000)
Kojto 110:165afa46840b 425 #define TIM_CHANNEL_2 ((uint32_t)0x0004)
Kojto 110:165afa46840b 426 #define TIM_CHANNEL_3 ((uint32_t)0x0008)
Kojto 110:165afa46840b 427 #define TIM_CHANNEL_4 ((uint32_t)0x000C)
Kojto 110:165afa46840b 428 #define TIM_CHANNEL_ALL ((uint32_t)0x0018)
Kojto 110:165afa46840b 429
Kojto 110:165afa46840b 430 /**
Kojto 110:165afa46840b 431 * @}
Kojto 110:165afa46840b 432 */
Kojto 110:165afa46840b 433
Kojto 110:165afa46840b 434 /** @defgroup TIM_Input_Capture_Polarity TIM Input Capture Polarity
Kojto 110:165afa46840b 435 * @{
Kojto 110:165afa46840b 436 */
Kojto 110:165afa46840b 437 #define TIM_ICPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING
Kojto 110:165afa46840b 438 #define TIM_ICPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING
Kojto 110:165afa46840b 439 #define TIM_ICPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE
Kojto 110:165afa46840b 440 /**
Kojto 110:165afa46840b 441 * @}
Kojto 110:165afa46840b 442 */
Kojto 110:165afa46840b 443
Kojto 110:165afa46840b 444 /** @defgroup TIM_Input_Capture_Selection TIM Input Capture Selection
Kojto 110:165afa46840b 445 * @{
Kojto 110:165afa46840b 446 */
Kojto 110:165afa46840b 447 #define TIM_ICSELECTION_DIRECTTI (TIM_CCMR1_CC1S_0) /*!< TIM Input 1, 2, 3 or 4 is selected to be
Kojto 110:165afa46840b 448 connected to IC1, IC2, IC3 or IC4, respectively */
Kojto 110:165afa46840b 449 #define TIM_ICSELECTION_INDIRECTTI (TIM_CCMR1_CC1S_1) /*!< TIM Input 1, 2, 3 or 4 is selected to be
Kojto 110:165afa46840b 450 connected to IC2, IC1, IC4 or IC3, respectively */
Kojto 110:165afa46840b 451 #define TIM_ICSELECTION_TRC (TIM_CCMR1_CC1S) /*!< TIM Input 1, 2, 3 or 4 is selected to be connected to TRC */
Kojto 110:165afa46840b 452
Kojto 110:165afa46840b 453 /**
Kojto 110:165afa46840b 454 * @}
Kojto 110:165afa46840b 455 */
Kojto 110:165afa46840b 456
Kojto 110:165afa46840b 457 /** @defgroup TIM_Input_Capture_Prescaler TIM Input Capture Prescaler
Kojto 110:165afa46840b 458 * @{
Kojto 110:165afa46840b 459 */
Kojto 110:165afa46840b 460 #define TIM_ICPSC_DIV1 ((uint32_t)0x0000) /*!< Capture performed each time an edge is detected on the capture input */
Kojto 110:165afa46840b 461 #define TIM_ICPSC_DIV2 (TIM_CCMR1_IC1PSC_0) /*!< Capture performed once every 2 events */
Kojto 110:165afa46840b 462 #define TIM_ICPSC_DIV4 (TIM_CCMR1_IC1PSC_1) /*!< Capture performed once every 4 events */
Kojto 110:165afa46840b 463 #define TIM_ICPSC_DIV8 (TIM_CCMR1_IC1PSC) /*!< Capture performed once every 8 events */
Kojto 110:165afa46840b 464 /**
Kojto 110:165afa46840b 465 * @}
Kojto 110:165afa46840b 466 */
Kojto 110:165afa46840b 467
Kojto 110:165afa46840b 468 /** @defgroup TIM_One_Pulse_Mode TIM One Pulse Mode
Kojto 110:165afa46840b 469 * @{
Kojto 110:165afa46840b 470 */
Kojto 110:165afa46840b 471 #define TIM_OPMODE_SINGLE (TIM_CR1_OPM)
Kojto 110:165afa46840b 472 #define TIM_OPMODE_REPETITIVE ((uint32_t)0x0000)
Kojto 110:165afa46840b 473 /**
Kojto 110:165afa46840b 474 * @}
Kojto 110:165afa46840b 475 */
Kojto 110:165afa46840b 476
Kojto 110:165afa46840b 477 /** @defgroup TIM_Encoder_Mode TIM Encoder Mode
Kojto 110:165afa46840b 478 * @{
Kojto 110:165afa46840b 479 */
Kojto 110:165afa46840b 480 #define TIM_ENCODERMODE_TI1 (TIM_SMCR_SMS_0)
Kojto 110:165afa46840b 481 #define TIM_ENCODERMODE_TI2 (TIM_SMCR_SMS_1)
Kojto 110:165afa46840b 482 #define TIM_ENCODERMODE_TI12 (TIM_SMCR_SMS_1 | TIM_SMCR_SMS_0)
Kojto 110:165afa46840b 483
Kojto 110:165afa46840b 484 /**
Kojto 110:165afa46840b 485 * @}
Kojto 110:165afa46840b 486 */
Kojto 110:165afa46840b 487
Kojto 110:165afa46840b 488 /** @defgroup TIM_Interrupt_definition TIM Interrupt definition
Kojto 110:165afa46840b 489 * @{
Kojto 110:165afa46840b 490 */
Kojto 110:165afa46840b 491 #define TIM_IT_UPDATE (TIM_DIER_UIE)
Kojto 110:165afa46840b 492 #define TIM_IT_CC1 (TIM_DIER_CC1IE)
Kojto 110:165afa46840b 493 #define TIM_IT_CC2 (TIM_DIER_CC2IE)
Kojto 110:165afa46840b 494 #define TIM_IT_CC3 (TIM_DIER_CC3IE)
Kojto 110:165afa46840b 495 #define TIM_IT_CC4 (TIM_DIER_CC4IE)
Kojto 110:165afa46840b 496 #define TIM_IT_COM (TIM_DIER_COMIE)
Kojto 110:165afa46840b 497 #define TIM_IT_TRIGGER (TIM_DIER_TIE)
Kojto 110:165afa46840b 498 #define TIM_IT_BREAK (TIM_DIER_BIE)
Kojto 110:165afa46840b 499 /**
Kojto 110:165afa46840b 500 * @}
Kojto 110:165afa46840b 501 */
Kojto 110:165afa46840b 502
Kojto 110:165afa46840b 503 /** @defgroup TIM_Commutation_Source TIM Commutation Source
Kojto 110:165afa46840b 504 * @{
Kojto 110:165afa46840b 505 */
Kojto 110:165afa46840b 506 #define TIM_COMMUTATION_TRGI (TIM_CR2_CCUS)
Kojto 110:165afa46840b 507 #define TIM_COMMUTATION_SOFTWARE ((uint32_t)0x0000)
Kojto 110:165afa46840b 508 /**
Kojto 110:165afa46840b 509 * @}
Kojto 110:165afa46840b 510 */
Kojto 110:165afa46840b 511
Kojto 110:165afa46840b 512 /** @defgroup TIM_DMA_sources TIM DMA sources
Kojto 110:165afa46840b 513 * @{
Kojto 110:165afa46840b 514 */
Kojto 110:165afa46840b 515 #define TIM_DMA_UPDATE (TIM_DIER_UDE)
Kojto 110:165afa46840b 516 #define TIM_DMA_CC1 (TIM_DIER_CC1DE)
Kojto 110:165afa46840b 517 #define TIM_DMA_CC2 (TIM_DIER_CC2DE)
Kojto 110:165afa46840b 518 #define TIM_DMA_CC3 (TIM_DIER_CC3DE)
Kojto 110:165afa46840b 519 #define TIM_DMA_CC4 (TIM_DIER_CC4DE)
Kojto 110:165afa46840b 520 #define TIM_DMA_COM (TIM_DIER_COMDE)
Kojto 110:165afa46840b 521 #define TIM_DMA_TRIGGER (TIM_DIER_TDE)
Kojto 110:165afa46840b 522 /**
Kojto 110:165afa46840b 523 * @}
Kojto 110:165afa46840b 524 */
Kojto 110:165afa46840b 525
Kojto 110:165afa46840b 526 /** @defgroup TIM_Event_Source TIM Event Source
Kojto 110:165afa46840b 527 * @{
Kojto 110:165afa46840b 528 */
Kojto 110:165afa46840b 529 #define TIM_EVENTSOURCE_UPDATE TIM_EGR_UG
Kojto 110:165afa46840b 530 #define TIM_EVENTSOURCE_CC1 TIM_EGR_CC1G
Kojto 110:165afa46840b 531 #define TIM_EVENTSOURCE_CC2 TIM_EGR_CC2G
Kojto 110:165afa46840b 532 #define TIM_EVENTSOURCE_CC3 TIM_EGR_CC3G
Kojto 110:165afa46840b 533 #define TIM_EVENTSOURCE_CC4 TIM_EGR_CC4G
Kojto 110:165afa46840b 534 #define TIM_EVENTSOURCE_COM TIM_EGR_COMG
Kojto 110:165afa46840b 535 #define TIM_EVENTSOURCE_TRIGGER TIM_EGR_TG
Kojto 110:165afa46840b 536 #define TIM_EVENTSOURCE_BREAK TIM_EGR_BG
Kojto 110:165afa46840b 537
Kojto 110:165afa46840b 538 /**
Kojto 110:165afa46840b 539 * @}
Kojto 110:165afa46840b 540 */
Kojto 110:165afa46840b 541
Kojto 110:165afa46840b 542 /** @defgroup TIM_Flag_definition TIM Flag definition
Kojto 110:165afa46840b 543 * @{
Kojto 110:165afa46840b 544 */
Kojto 110:165afa46840b 545 #define TIM_FLAG_UPDATE (TIM_SR_UIF)
Kojto 110:165afa46840b 546 #define TIM_FLAG_CC1 (TIM_SR_CC1IF)
Kojto 110:165afa46840b 547 #define TIM_FLAG_CC2 (TIM_SR_CC2IF)
Kojto 110:165afa46840b 548 #define TIM_FLAG_CC3 (TIM_SR_CC3IF)
Kojto 110:165afa46840b 549 #define TIM_FLAG_CC4 (TIM_SR_CC4IF)
Kojto 110:165afa46840b 550 #define TIM_FLAG_COM (TIM_SR_COMIF)
Kojto 110:165afa46840b 551 #define TIM_FLAG_TRIGGER (TIM_SR_TIF)
Kojto 110:165afa46840b 552 #define TIM_FLAG_BREAK (TIM_SR_BIF)
Kojto 110:165afa46840b 553 #define TIM_FLAG_CC1OF (TIM_SR_CC1OF)
Kojto 110:165afa46840b 554 #define TIM_FLAG_CC2OF (TIM_SR_CC2OF)
Kojto 110:165afa46840b 555 #define TIM_FLAG_CC3OF (TIM_SR_CC3OF)
Kojto 110:165afa46840b 556 #define TIM_FLAG_CC4OF (TIM_SR_CC4OF)
Kojto 110:165afa46840b 557 /**
Kojto 110:165afa46840b 558 * @}
Kojto 110:165afa46840b 559 */
Kojto 110:165afa46840b 560
Kojto 110:165afa46840b 561 /** @defgroup TIM_Clock_Source TIM Clock Source
Kojto 110:165afa46840b 562 * @{
Kojto 110:165afa46840b 563 */
Kojto 110:165afa46840b 564 #define TIM_CLOCKSOURCE_ETRMODE2 (TIM_SMCR_ETPS_1)
Kojto 110:165afa46840b 565 #define TIM_CLOCKSOURCE_INTERNAL (TIM_SMCR_ETPS_0)
Kojto 110:165afa46840b 566 #define TIM_CLOCKSOURCE_ITR0 ((uint32_t)0x0000)
Kojto 110:165afa46840b 567 #define TIM_CLOCKSOURCE_ITR1 (TIM_SMCR_TS_0)
Kojto 110:165afa46840b 568 #define TIM_CLOCKSOURCE_ITR2 (TIM_SMCR_TS_1)
Kojto 110:165afa46840b 569 #define TIM_CLOCKSOURCE_ITR3 (TIM_SMCR_TS_0 | TIM_SMCR_TS_1)
Kojto 110:165afa46840b 570 #define TIM_CLOCKSOURCE_TI1ED (TIM_SMCR_TS_2)
Kojto 110:165afa46840b 571 #define TIM_CLOCKSOURCE_TI1 (TIM_SMCR_TS_0 | TIM_SMCR_TS_2)
Kojto 110:165afa46840b 572 #define TIM_CLOCKSOURCE_TI2 (TIM_SMCR_TS_1 | TIM_SMCR_TS_2)
Kojto 110:165afa46840b 573 #define TIM_CLOCKSOURCE_ETRMODE1 (TIM_SMCR_TS)
Kojto 110:165afa46840b 574 /**
Kojto 110:165afa46840b 575 * @}
Kojto 110:165afa46840b 576 */
Kojto 110:165afa46840b 577
Kojto 110:165afa46840b 578 /** @defgroup TIM_Clock_Polarity TIM Clock Polarity
Kojto 110:165afa46840b 579 * @{
Kojto 110:165afa46840b 580 */
Kojto 110:165afa46840b 581 #define TIM_CLOCKPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED /*!< Polarity for ETRx clock sources */
Kojto 110:165afa46840b 582 #define TIM_CLOCKPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED /*!< Polarity for ETRx clock sources */
Kojto 110:165afa46840b 583 #define TIM_CLOCKPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING /*!< Polarity for TIx clock sources */
Kojto 110:165afa46840b 584 #define TIM_CLOCKPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING /*!< Polarity for TIx clock sources */
Kojto 110:165afa46840b 585 #define TIM_CLOCKPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE /*!< Polarity for TIx clock sources */
Kojto 110:165afa46840b 586 /**
Kojto 110:165afa46840b 587 * @}
Kojto 110:165afa46840b 588 */
Kojto 110:165afa46840b 589
Kojto 110:165afa46840b 590 /** @defgroup TIM_Clock_Prescaler TIM Clock Prescaler
Kojto 110:165afa46840b 591 * @{
Kojto 110:165afa46840b 592 */
Kojto 110:165afa46840b 593 #define TIM_CLOCKPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1 /*!< No prescaler is used */
Kojto 110:165afa46840b 594 #define TIM_CLOCKPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2 /*!< Prescaler for External ETR Clock: Capture performed once every 2 events. */
Kojto 110:165afa46840b 595 #define TIM_CLOCKPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4 /*!< Prescaler for External ETR Clock: Capture performed once every 4 events. */
Kojto 110:165afa46840b 596 #define TIM_CLOCKPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8 /*!< Prescaler for External ETR Clock: Capture performed once every 8 events. */
Kojto 110:165afa46840b 597 /**
Kojto 110:165afa46840b 598 * @}
Kojto 110:165afa46840b 599 */
Kojto 110:165afa46840b 600
Kojto 110:165afa46840b 601 /** @defgroup TIM_ClearInput_Source TIM Clear Input Source
Kojto 110:165afa46840b 602 * @{
Kojto 110:165afa46840b 603 */
Kojto 110:165afa46840b 604 #define TIM_CLEARINPUTSOURCE_ETR ((uint32_t)0x0001)
Kojto 110:165afa46840b 605 #define TIM_CLEARINPUTSOURCE_NONE ((uint32_t)0x0000)
Kojto 110:165afa46840b 606 /**
Kojto 110:165afa46840b 607 * @}
Kojto 110:165afa46840b 608 */
Kojto 110:165afa46840b 609
Kojto 110:165afa46840b 610 /** @defgroup TIM_ClearInput_Polarity TIM Clear Input Polarity
Kojto 110:165afa46840b 611 * @{
Kojto 110:165afa46840b 612 */
Kojto 110:165afa46840b 613 #define TIM_CLEARINPUTPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED /*!< Polarity for ETRx pin */
Kojto 110:165afa46840b 614 #define TIM_CLEARINPUTPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED /*!< Polarity for ETRx pin */
Kojto 110:165afa46840b 615 /**
Kojto 110:165afa46840b 616 * @}
Kojto 110:165afa46840b 617 */
Kojto 110:165afa46840b 618
Kojto 110:165afa46840b 619 /** @defgroup TIM_ClearInput_Prescaler TIM Clear Input Prescaler
Kojto 110:165afa46840b 620 * @{
Kojto 110:165afa46840b 621 */
Kojto 110:165afa46840b 622 #define TIM_CLEARINPUTPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1 /*!< No prescaler is used */
Kojto 110:165afa46840b 623 #define TIM_CLEARINPUTPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2 /*!< Prescaler for External ETR pin: Capture performed once every 2 events. */
Kojto 110:165afa46840b 624 #define TIM_CLEARINPUTPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4 /*!< Prescaler for External ETR pin: Capture performed once every 4 events. */
Kojto 110:165afa46840b 625 #define TIM_CLEARINPUTPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8 /*!< Prescaler for External ETR pin: Capture performed once every 8 events. */
Kojto 110:165afa46840b 626 /**
Kojto 110:165afa46840b 627 * @}
Kojto 110:165afa46840b 628 */
Kojto 110:165afa46840b 629
Kojto 110:165afa46840b 630 /** @defgroup TIM_OSSR_Off_State_Selection_for_Run_mode_state TIM OSSR OffState Selection for Run mode state
Kojto 110:165afa46840b 631 * @{
Kojto 110:165afa46840b 632 */
Kojto 110:165afa46840b 633 #define TIM_OSSR_ENABLE (TIM_BDTR_OSSR)
Kojto 110:165afa46840b 634 #define TIM_OSSR_DISABLE ((uint32_t)0x0000)
Kojto 110:165afa46840b 635 /**
Kojto 110:165afa46840b 636 * @}
Kojto 110:165afa46840b 637 */
Kojto 110:165afa46840b 638
Kojto 110:165afa46840b 639 /** @defgroup TIM_OSSI_Off_State_Selection_for_Idle_mode_state TIM OSSI OffState Selection for Idle mode state
Kojto 110:165afa46840b 640 * @{
Kojto 110:165afa46840b 641 */
Kojto 110:165afa46840b 642 #define TIM_OSSI_ENABLE (TIM_BDTR_OSSI)
Kojto 110:165afa46840b 643 #define TIM_OSSI_DISABLE ((uint32_t)0x0000)
Kojto 110:165afa46840b 644 /**
Kojto 110:165afa46840b 645 * @}
Kojto 110:165afa46840b 646 */
Kojto 110:165afa46840b 647
Kojto 110:165afa46840b 648 /** @defgroup TIM_Lock_level TIM Lock level
Kojto 110:165afa46840b 649 * @{
Kojto 110:165afa46840b 650 */
Kojto 110:165afa46840b 651 #define TIM_LOCKLEVEL_OFF ((uint32_t)0x0000)
Kojto 110:165afa46840b 652 #define TIM_LOCKLEVEL_1 (TIM_BDTR_LOCK_0)
Kojto 110:165afa46840b 653 #define TIM_LOCKLEVEL_2 (TIM_BDTR_LOCK_1)
Kojto 110:165afa46840b 654 #define TIM_LOCKLEVEL_3 (TIM_BDTR_LOCK)
Kojto 110:165afa46840b 655 /**
Kojto 110:165afa46840b 656 * @}
Kojto 110:165afa46840b 657 */
Kojto 110:165afa46840b 658 /** @defgroup TIM_Break_Input_enable_disable TIM Break Input State
Kojto 110:165afa46840b 659 * @{
Kojto 110:165afa46840b 660 */
Kojto 110:165afa46840b 661 #define TIM_BREAK_ENABLE (TIM_BDTR_BKE)
Kojto 110:165afa46840b 662 #define TIM_BREAK_DISABLE ((uint32_t)0x0000)
Kojto 110:165afa46840b 663 /**
Kojto 110:165afa46840b 664 * @}
Kojto 110:165afa46840b 665 */
Kojto 110:165afa46840b 666
Kojto 110:165afa46840b 667 /** @defgroup TIM_Break_Polarity TIM Break Polarity
Kojto 110:165afa46840b 668 * @{
Kojto 110:165afa46840b 669 */
Kojto 110:165afa46840b 670 #define TIM_BREAKPOLARITY_LOW ((uint32_t)0x0000)
Kojto 110:165afa46840b 671 #define TIM_BREAKPOLARITY_HIGH (TIM_BDTR_BKP)
Kojto 110:165afa46840b 672 /**
Kojto 110:165afa46840b 673 * @}
Kojto 110:165afa46840b 674 */
Kojto 110:165afa46840b 675
Kojto 110:165afa46840b 676 /** @defgroup TIM_AOE_Bit_Set_Reset TIM AOE Bit State
Kojto 110:165afa46840b 677 * @{
Kojto 110:165afa46840b 678 */
Kojto 110:165afa46840b 679 #define TIM_AUTOMATICOUTPUT_ENABLE (TIM_BDTR_AOE)
Kojto 110:165afa46840b 680 #define TIM_AUTOMATICOUTPUT_DISABLE ((uint32_t)0x0000)
Kojto 110:165afa46840b 681 /**
Kojto 110:165afa46840b 682 * @}
Kojto 110:165afa46840b 683 */
Kojto 110:165afa46840b 684
Kojto 110:165afa46840b 685 /** @defgroup TIM_Master_Mode_Selection TIM Master Mode Selection
Kojto 110:165afa46840b 686 * @{
Kojto 110:165afa46840b 687 */
Kojto 110:165afa46840b 688 #define TIM_TRGO_RESET ((uint32_t)0x0000)
Kojto 110:165afa46840b 689 #define TIM_TRGO_ENABLE (TIM_CR2_MMS_0)
Kojto 110:165afa46840b 690 #define TIM_TRGO_UPDATE (TIM_CR2_MMS_1)
Kojto 110:165afa46840b 691 #define TIM_TRGO_OC1 ((TIM_CR2_MMS_1 | TIM_CR2_MMS_0))
Kojto 110:165afa46840b 692 #define TIM_TRGO_OC1REF (TIM_CR2_MMS_2)
Kojto 110:165afa46840b 693 #define TIM_TRGO_OC2REF ((TIM_CR2_MMS_2 | TIM_CR2_MMS_0))
Kojto 110:165afa46840b 694 #define TIM_TRGO_OC3REF ((TIM_CR2_MMS_2 | TIM_CR2_MMS_1))
Kojto 110:165afa46840b 695 #define TIM_TRGO_OC4REF ((TIM_CR2_MMS_2 | TIM_CR2_MMS_1 | TIM_CR2_MMS_0))
Kojto 110:165afa46840b 696 /**
Kojto 110:165afa46840b 697 * @}
Kojto 110:165afa46840b 698 */
Kojto 110:165afa46840b 699
Kojto 110:165afa46840b 700 /** @defgroup TIM_Slave_Mode TIM Slave Mode
Kojto 110:165afa46840b 701 * @{
Kojto 110:165afa46840b 702 */
Kojto 110:165afa46840b 703 #define TIM_SLAVEMODE_DISABLE ((uint32_t)0x0000)
Kojto 110:165afa46840b 704 #define TIM_SLAVEMODE_RESET ((uint32_t)0x0004)
Kojto 110:165afa46840b 705 #define TIM_SLAVEMODE_GATED ((uint32_t)0x0005)
Kojto 110:165afa46840b 706 #define TIM_SLAVEMODE_TRIGGER ((uint32_t)0x0006)
Kojto 110:165afa46840b 707 #define TIM_SLAVEMODE_EXTERNAL1 ((uint32_t)0x0007)
Kojto 110:165afa46840b 708 /**
Kojto 110:165afa46840b 709 * @}
Kojto 110:165afa46840b 710 */
Kojto 110:165afa46840b 711
Kojto 110:165afa46840b 712 /** @defgroup TIM_Master_Slave_Mode TIM Master Slave Mode
Kojto 110:165afa46840b 713 * @{
Kojto 110:165afa46840b 714 */
Kojto 110:165afa46840b 715 #define TIM_MASTERSLAVEMODE_ENABLE ((uint32_t)0x0080)
Kojto 110:165afa46840b 716 #define TIM_MASTERSLAVEMODE_DISABLE ((uint32_t)0x0000)
Kojto 110:165afa46840b 717 /**
Kojto 110:165afa46840b 718 * @}
Kojto 110:165afa46840b 719 */
Kojto 110:165afa46840b 720
Kojto 110:165afa46840b 721 /** @defgroup TIM_Trigger_Selection TIM Trigger Selection
Kojto 110:165afa46840b 722 * @{
Kojto 110:165afa46840b 723 */
Kojto 110:165afa46840b 724 #define TIM_TS_ITR0 ((uint32_t)0x0000)
Kojto 110:165afa46840b 725 #define TIM_TS_ITR1 ((uint32_t)0x0010)
Kojto 110:165afa46840b 726 #define TIM_TS_ITR2 ((uint32_t)0x0020)
Kojto 110:165afa46840b 727 #define TIM_TS_ITR3 ((uint32_t)0x0030)
Kojto 110:165afa46840b 728 #define TIM_TS_TI1F_ED ((uint32_t)0x0040)
Kojto 110:165afa46840b 729 #define TIM_TS_TI1FP1 ((uint32_t)0x0050)
Kojto 110:165afa46840b 730 #define TIM_TS_TI2FP2 ((uint32_t)0x0060)
Kojto 110:165afa46840b 731 #define TIM_TS_ETRF ((uint32_t)0x0070)
Kojto 110:165afa46840b 732 #define TIM_TS_NONE ((uint32_t)0xFFFF)
Kojto 110:165afa46840b 733 /**
Kojto 110:165afa46840b 734 * @}
Kojto 110:165afa46840b 735 */
Kojto 110:165afa46840b 736
Kojto 110:165afa46840b 737 /** @defgroup TIM_Trigger_Polarity TIM Trigger Polarity
Kojto 110:165afa46840b 738 * @{
Kojto 110:165afa46840b 739 */
Kojto 110:165afa46840b 740 #define TIM_TRIGGERPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED /*!< Polarity for ETRx trigger sources */
Kojto 110:165afa46840b 741 #define TIM_TRIGGERPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED /*!< Polarity for ETRx trigger sources */
Kojto 110:165afa46840b 742 #define TIM_TRIGGERPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING /*!< Polarity for TIxFPx or TI1_ED trigger sources */
Kojto 110:165afa46840b 743 #define TIM_TRIGGERPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING /*!< Polarity for TIxFPx or TI1_ED trigger sources */
Kojto 110:165afa46840b 744 #define TIM_TRIGGERPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE /*!< Polarity for TIxFPx or TI1_ED trigger sources */
Kojto 110:165afa46840b 745 /**
Kojto 110:165afa46840b 746 * @}
Kojto 110:165afa46840b 747 */
Kojto 110:165afa46840b 748
Kojto 110:165afa46840b 749 /** @defgroup TIM_Trigger_Prescaler TIM Trigger Prescaler
Kojto 110:165afa46840b 750 * @{
Kojto 110:165afa46840b 751 */
Kojto 110:165afa46840b 752 #define TIM_TRIGGERPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1 /*!< No prescaler is used */
Kojto 110:165afa46840b 753 #define TIM_TRIGGERPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2 /*!< Prescaler for External ETR Trigger: Capture performed once every 2 events. */
Kojto 110:165afa46840b 754 #define TIM_TRIGGERPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4 /*!< Prescaler for External ETR Trigger: Capture performed once every 4 events. */
Kojto 110:165afa46840b 755 #define TIM_TRIGGERPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8 /*!< Prescaler for External ETR Trigger: Capture performed once every 8 events. */
Kojto 110:165afa46840b 756 /**
Kojto 110:165afa46840b 757 * @}
Kojto 110:165afa46840b 758 */
Kojto 110:165afa46840b 759
Kojto 110:165afa46840b 760
Kojto 110:165afa46840b 761 /** @defgroup TIM_TI1_Selection TIM TI1 Selection
Kojto 110:165afa46840b 762 * @{
Kojto 110:165afa46840b 763 */
Kojto 110:165afa46840b 764 #define TIM_TI1SELECTION_CH1 ((uint32_t)0x0000)
Kojto 110:165afa46840b 765 #define TIM_TI1SELECTION_XORCOMBINATION (TIM_CR2_TI1S)
Kojto 110:165afa46840b 766 /**
Kojto 110:165afa46840b 767 * @}
Kojto 110:165afa46840b 768 */
Kojto 110:165afa46840b 769
Kojto 110:165afa46840b 770 /** @defgroup TIM_DMA_Base_address TIM DMA Base address
Kojto 110:165afa46840b 771 * @{
Kojto 110:165afa46840b 772 */
Kojto 110:165afa46840b 773 #define TIM_DMABASE_CR1 (0x00000000)
Kojto 110:165afa46840b 774 #define TIM_DMABASE_CR2 (0x00000001)
Kojto 110:165afa46840b 775 #define TIM_DMABASE_SMCR (0x00000002)
Kojto 110:165afa46840b 776 #define TIM_DMABASE_DIER (0x00000003)
Kojto 110:165afa46840b 777 #define TIM_DMABASE_SR (0x00000004)
Kojto 110:165afa46840b 778 #define TIM_DMABASE_EGR (0x00000005)
Kojto 110:165afa46840b 779 #define TIM_DMABASE_CCMR1 (0x00000006)
Kojto 110:165afa46840b 780 #define TIM_DMABASE_CCMR2 (0x00000007)
Kojto 110:165afa46840b 781 #define TIM_DMABASE_CCER (0x00000008)
Kojto 110:165afa46840b 782 #define TIM_DMABASE_CNT (0x00000009)
Kojto 110:165afa46840b 783 #define TIM_DMABASE_PSC (0x0000000A)
Kojto 110:165afa46840b 784 #define TIM_DMABASE_ARR (0x0000000B)
Kojto 110:165afa46840b 785 #define TIM_DMABASE_RCR (0x0000000C)
Kojto 110:165afa46840b 786 #define TIM_DMABASE_CCR1 (0x0000000D)
Kojto 110:165afa46840b 787 #define TIM_DMABASE_CCR2 (0x0000000E)
Kojto 110:165afa46840b 788 #define TIM_DMABASE_CCR3 (0x0000000F)
Kojto 110:165afa46840b 789 #define TIM_DMABASE_CCR4 (0x00000010)
Kojto 110:165afa46840b 790 #define TIM_DMABASE_BDTR (0x00000011)
Kojto 110:165afa46840b 791 #define TIM_DMABASE_DCR (0x00000012)
Kojto 110:165afa46840b 792 #define TIM_DMABASE_OR (0x00000013)
Kojto 110:165afa46840b 793 /**
Kojto 110:165afa46840b 794 * @}
Kojto 110:165afa46840b 795 */
Kojto 110:165afa46840b 796
Kojto 110:165afa46840b 797 /** @defgroup TIM_DMA_Burst_Length TIM DMA Burst Length
Kojto 110:165afa46840b 798 * @{
Kojto 110:165afa46840b 799 */
Kojto 110:165afa46840b 800 #define TIM_DMABURSTLENGTH_1TRANSFER (0x00000000)
Kojto 110:165afa46840b 801 #define TIM_DMABURSTLENGTH_2TRANSFERS (0x00000100)
Kojto 110:165afa46840b 802 #define TIM_DMABURSTLENGTH_3TRANSFERS (0x00000200)
Kojto 110:165afa46840b 803 #define TIM_DMABURSTLENGTH_4TRANSFERS (0x00000300)
Kojto 110:165afa46840b 804 #define TIM_DMABURSTLENGTH_5TRANSFERS (0x00000400)
Kojto 110:165afa46840b 805 #define TIM_DMABURSTLENGTH_6TRANSFERS (0x00000500)
Kojto 110:165afa46840b 806 #define TIM_DMABURSTLENGTH_7TRANSFERS (0x00000600)
Kojto 110:165afa46840b 807 #define TIM_DMABURSTLENGTH_8TRANSFERS (0x00000700)
Kojto 110:165afa46840b 808 #define TIM_DMABURSTLENGTH_9TRANSFERS (0x00000800)
Kojto 110:165afa46840b 809 #define TIM_DMABURSTLENGTH_10TRANSFERS (0x00000900)
Kojto 110:165afa46840b 810 #define TIM_DMABURSTLENGTH_11TRANSFERS (0x00000A00)
Kojto 110:165afa46840b 811 #define TIM_DMABURSTLENGTH_12TRANSFERS (0x00000B00)
Kojto 110:165afa46840b 812 #define TIM_DMABURSTLENGTH_13TRANSFERS (0x00000C00)
Kojto 110:165afa46840b 813 #define TIM_DMABURSTLENGTH_14TRANSFERS (0x00000D00)
Kojto 110:165afa46840b 814 #define TIM_DMABURSTLENGTH_15TRANSFERS (0x00000E00)
Kojto 110:165afa46840b 815 #define TIM_DMABURSTLENGTH_16TRANSFERS (0x00000F00)
Kojto 110:165afa46840b 816 #define TIM_DMABURSTLENGTH_17TRANSFERS (0x00001000)
Kojto 110:165afa46840b 817 #define TIM_DMABURSTLENGTH_18TRANSFERS (0x00001100)
Kojto 110:165afa46840b 818 /**
Kojto 110:165afa46840b 819 * @}
Kojto 110:165afa46840b 820 */
Kojto 110:165afa46840b 821
Kojto 110:165afa46840b 822 /** @defgroup DMA_Handle_index DMA Handle index
Kojto 110:165afa46840b 823 * @{
Kojto 110:165afa46840b 824 */
Kojto 110:165afa46840b 825 #define TIM_DMA_ID_UPDATE ((uint16_t) 0x0) /*!< Index of the DMA handle used for Update DMA requests */
Kojto 110:165afa46840b 826 #define TIM_DMA_ID_CC1 ((uint16_t) 0x1) /*!< Index of the DMA handle used for Capture/Compare 1 DMA requests */
Kojto 110:165afa46840b 827 #define TIM_DMA_ID_CC2 ((uint16_t) 0x2) /*!< Index of the DMA handle used for Capture/Compare 2 DMA requests */
Kojto 110:165afa46840b 828 #define TIM_DMA_ID_CC3 ((uint16_t) 0x3) /*!< Index of the DMA handle used for Capture/Compare 3 DMA requests */
Kojto 110:165afa46840b 829 #define TIM_DMA_ID_CC4 ((uint16_t) 0x4) /*!< Index of the DMA handle used for Capture/Compare 4 DMA requests */
Kojto 110:165afa46840b 830 #define TIM_DMA_ID_COMMUTATION ((uint16_t) 0x5) /*!< Index of the DMA handle used for Commutation DMA requests */
Kojto 110:165afa46840b 831 #define TIM_DMA_ID_TRIGGER ((uint16_t) 0x6) /*!< Index of the DMA handle used for Trigger DMA requests */
Kojto 110:165afa46840b 832 /**
Kojto 110:165afa46840b 833 * @}
Kojto 110:165afa46840b 834 */
Kojto 110:165afa46840b 835
Kojto 110:165afa46840b 836 /** @defgroup Channel_CC_State Channel CC State
Kojto 110:165afa46840b 837 * @{
Kojto 110:165afa46840b 838 */
Kojto 110:165afa46840b 839 #define TIM_CCx_ENABLE ((uint32_t)0x0001)
Kojto 110:165afa46840b 840 #define TIM_CCx_DISABLE ((uint32_t)0x0000)
Kojto 110:165afa46840b 841 #define TIM_CCxN_ENABLE ((uint32_t)0x0004)
Kojto 110:165afa46840b 842 #define TIM_CCxN_DISABLE ((uint32_t)0x0000)
Kojto 110:165afa46840b 843 /**
Kojto 110:165afa46840b 844 * @}
Kojto 110:165afa46840b 845 */
Kojto 110:165afa46840b 846
Kojto 110:165afa46840b 847 /**
Kojto 110:165afa46840b 848 * @}
Kojto 110:165afa46840b 849 */
Kojto 110:165afa46840b 850
Kojto 110:165afa46840b 851 /* Exported macro ------------------------------------------------------------*/
Kojto 110:165afa46840b 852 /** @defgroup TIM_Exported_Macros TIM Exported Macros
Kojto 110:165afa46840b 853 * @{
Kojto 110:165afa46840b 854 */
Kojto 110:165afa46840b 855 /** @brief Reset TIM handle state
Kojto 110:165afa46840b 856 * @param __HANDLE__: TIM handle
Kojto 110:165afa46840b 857 * @retval None
Kojto 110:165afa46840b 858 */
Kojto 110:165afa46840b 859 #define __HAL_TIM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_TIM_STATE_RESET)
Kojto 110:165afa46840b 860
Kojto 110:165afa46840b 861 /**
Kojto 110:165afa46840b 862 * @brief Enable the TIM peripheral.
Kojto 110:165afa46840b 863 * @param __HANDLE__: TIM handle
Kojto 110:165afa46840b 864 * @retval None
Kojto 110:165afa46840b 865 */
Kojto 110:165afa46840b 866 #define __HAL_TIM_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1|=(TIM_CR1_CEN))
Kojto 110:165afa46840b 867
Kojto 110:165afa46840b 868 /**
Kojto 110:165afa46840b 869 * @brief Enable the TIM main Output.
Kojto 110:165afa46840b 870 * @param __HANDLE__: TIM handle
Kojto 110:165afa46840b 871 * @retval None
Kojto 110:165afa46840b 872 */
Kojto 110:165afa46840b 873 #define __HAL_TIM_MOE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->BDTR|=(TIM_BDTR_MOE))
Kojto 110:165afa46840b 874
Kojto 110:165afa46840b 875
Kojto 110:165afa46840b 876 /**
Kojto 110:165afa46840b 877 * @brief Disable the TIM peripheral.
Kojto 110:165afa46840b 878 * @param __HANDLE__: TIM handle
Kojto 110:165afa46840b 879 * @retval None
Kojto 110:165afa46840b 880 */
Kojto 110:165afa46840b 881 #define __HAL_TIM_DISABLE(__HANDLE__) \
Kojto 110:165afa46840b 882 do { \
Kojto 110:165afa46840b 883 if (((__HANDLE__)->Instance->CCER & TIM_CCER_CCxE_MASK) == 0) \
Kojto 110:165afa46840b 884 { \
Kojto 110:165afa46840b 885 if(((__HANDLE__)->Instance->CCER & TIM_CCER_CCxNE_MASK) == 0) \
Kojto 110:165afa46840b 886 { \
Kojto 110:165afa46840b 887 (__HANDLE__)->Instance->CR1 &= ~(TIM_CR1_CEN); \
Kojto 110:165afa46840b 888 } \
Kojto 110:165afa46840b 889 } \
Kojto 110:165afa46840b 890 } while(0)
Kojto 110:165afa46840b 891
Kojto 110:165afa46840b 892 /* The Main Output of a timer instance is disabled only if all the CCx and CCxN
Kojto 110:165afa46840b 893 channels have been disabled */
Kojto 110:165afa46840b 894 /**
Kojto 110:165afa46840b 895 * @brief Disable the TIM main Output.
Kojto 110:165afa46840b 896 * @param __HANDLE__: TIM handle
Kojto 110:165afa46840b 897 * @retval None
Kojto 110:165afa46840b 898 */
Kojto 110:165afa46840b 899 #define __HAL_TIM_MOE_DISABLE(__HANDLE__) \
Kojto 110:165afa46840b 900 do { \
Kojto 110:165afa46840b 901 if (((__HANDLE__)->Instance->CCER & TIM_CCER_CCxE_MASK) == 0) \
Kojto 110:165afa46840b 902 { \
Kojto 110:165afa46840b 903 if(((__HANDLE__)->Instance->CCER & TIM_CCER_CCxNE_MASK) == 0) \
Kojto 110:165afa46840b 904 { \
Kojto 110:165afa46840b 905 (__HANDLE__)->Instance->BDTR &= ~(TIM_BDTR_MOE); \
Kojto 110:165afa46840b 906 } \
Kojto 110:165afa46840b 907 } \
Kojto 110:165afa46840b 908 } while(0)
Kojto 110:165afa46840b 909
Kojto 110:165afa46840b 910 #define __HAL_TIM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DIER |= (__INTERRUPT__))
Kojto 110:165afa46840b 911 #define __HAL_TIM_ENABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->DIER |= (__DMA__))
Kojto 110:165afa46840b 912 #define __HAL_TIM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DIER &= ~(__INTERRUPT__))
Kojto 110:165afa46840b 913 #define __HAL_TIM_DISABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->DIER &= ~(__DMA__))
Kojto 110:165afa46840b 914 #define __HAL_TIM_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR &(__FLAG__)) == (__FLAG__))
Kojto 110:165afa46840b 915 #define __HAL_TIM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__))
Kojto 110:165afa46840b 916
Kojto 110:165afa46840b 917 #define __HAL_TIM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->DIER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
Kojto 110:165afa46840b 918 #define __HAL_TIM_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->SR = ~(__INTERRUPT__))
Kojto 110:165afa46840b 919
Kojto 110:165afa46840b 920 #define __HAL_TIM_IS_TIM_COUNTING_DOWN(__HANDLE__) (((__HANDLE__)->Instance->CR1 &(TIM_CR1_DIR)) == (TIM_CR1_DIR))
Kojto 110:165afa46840b 921 #define __HAL_TIM_SET_PRESCALER(__HANDLE__, __PRESC__) ((__HANDLE__)->Instance->PSC = (__PRESC__))
Kojto 110:165afa46840b 922
Kojto 110:165afa46840b 923 #define TIM_SET_ICPRESCALERVALUE(__HANDLE__, __CHANNEL__, __ICPSC__) \
Kojto 110:165afa46840b 924 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= (__ICPSC__)) :\
Kojto 110:165afa46840b 925 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= ((__ICPSC__) << 8)) :\
Kojto 110:165afa46840b 926 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= (__ICPSC__)) :\
Kojto 110:165afa46840b 927 ((__HANDLE__)->Instance->CCMR2 |= ((__ICPSC__) << 8)))
Kojto 110:165afa46840b 928
Kojto 110:165afa46840b 929 #define TIM_RESET_ICPRESCALERVALUE(__HANDLE__, __CHANNEL__) \
Kojto 110:165afa46840b 930 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= (uint16_t)~TIM_CCMR1_IC1PSC) :\
Kojto 110:165afa46840b 931 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= (uint16_t)~TIM_CCMR1_IC2PSC) :\
Kojto 110:165afa46840b 932 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= (uint16_t)~TIM_CCMR2_IC3PSC) :\
Kojto 110:165afa46840b 933 ((__HANDLE__)->Instance->CCMR2 &= (uint16_t)~TIM_CCMR2_IC4PSC))
Kojto 110:165afa46840b 934
Kojto 110:165afa46840b 935 #define TIM_SET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__, __POLARITY__) \
Kojto 110:165afa46840b 936 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER |= (__POLARITY__)) :\
Kojto 110:165afa46840b 937 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER |= ((__POLARITY__) << 4)) :\
Kojto 110:165afa46840b 938 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER |= ((__POLARITY__) << 8)) :\
Kojto 110:165afa46840b 939 ((__HANDLE__)->Instance->CCER |= (((__POLARITY__) << 12) & TIM_CCER_CC4P)))
Kojto 110:165afa46840b 940
Kojto 110:165afa46840b 941 #define TIM_RESET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__) \
Kojto 110:165afa46840b 942 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC1P | TIM_CCER_CC1NP)) :\
Kojto 110:165afa46840b 943 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC2P | TIM_CCER_CC2NP)) :\
Kojto 110:165afa46840b 944 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC3P | TIM_CCER_CC3NP)) :\
Kojto 110:165afa46840b 945 ((__HANDLE__)->Instance->CCER &= (uint16_t)~TIM_CCER_CC4P))
Kojto 110:165afa46840b 946
Kojto 110:165afa46840b 947 /**
Kojto 110:165afa46840b 948 * @brief Sets the TIM Capture Compare Register value on runtime without
Kojto 110:165afa46840b 949 * calling another time ConfigChannel function.
Kojto 110:165afa46840b 950 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 951 * @param __CHANNEL__ : TIM Channels to be configured.
Kojto 110:165afa46840b 952 * This parameter can be one of the following values:
Kojto 110:165afa46840b 953 * @arg TIM_CHANNEL_1: TIM Channel 1 selected
Kojto 110:165afa46840b 954 * @arg TIM_CHANNEL_2: TIM Channel 2 selected
Kojto 110:165afa46840b 955 * @arg TIM_CHANNEL_3: TIM Channel 3 selected
Kojto 110:165afa46840b 956 * @arg TIM_CHANNEL_4: TIM Channel 4 selected
Kojto 110:165afa46840b 957 * @param __COMPARE__: specifies the Capture Compare register new value.
Kojto 110:165afa46840b 958 * @retval None
Kojto 110:165afa46840b 959 */
Kojto 110:165afa46840b 960 #define __HAL_TIM_SET_COMPARE(__HANDLE__, __CHANNEL__, __COMPARE__) \
Kojto 110:165afa46840b 961 (*(__IO uint32_t *)(&((__HANDLE__)->Instance->CCR1) + ((__CHANNEL__) >> 2)) = (__COMPARE__))
Kojto 110:165afa46840b 962
Kojto 110:165afa46840b 963 /**
Kojto 110:165afa46840b 964 * @brief Gets the TIM Capture Compare Register value on runtime
Kojto 110:165afa46840b 965 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 966 * @param __CHANNEL__ : TIM Channel associated with the capture compare register
Kojto 110:165afa46840b 967 * This parameter can be one of the following values:
Kojto 110:165afa46840b 968 * @arg TIM_CHANNEL_1: get capture/compare 1 register value
Kojto 110:165afa46840b 969 * @arg TIM_CHANNEL_2: get capture/compare 2 register value
Kojto 110:165afa46840b 970 * @arg TIM_CHANNEL_3: get capture/compare 3 register value
Kojto 110:165afa46840b 971 * @arg TIM_CHANNEL_4: get capture/compare 4 register value
Kojto 110:165afa46840b 972 * @retval None
Kojto 110:165afa46840b 973 */
Kojto 110:165afa46840b 974 #define __HAL_TIM_GET_COMPARE(__HANDLE__, __CHANNEL__) \
Kojto 110:165afa46840b 975 (*(__IO uint32_t *)(&((__HANDLE__)->Instance->CCR1) + ((__CHANNEL__) >> 2)))
Kojto 110:165afa46840b 976
Kojto 110:165afa46840b 977 /**
Kojto 110:165afa46840b 978 * @brief Sets the TIM Counter Register value on runtime.
Kojto 110:165afa46840b 979 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 980 * @param __COUNTER__: specifies the Counter register new value.
Kojto 110:165afa46840b 981 * @retval None
Kojto 110:165afa46840b 982 */
Kojto 110:165afa46840b 983 #define __HAL_TIM_SET_COUNTER(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->CNT = (__COUNTER__))
Kojto 110:165afa46840b 984
Kojto 110:165afa46840b 985 /**
Kojto 110:165afa46840b 986 * @brief Gets the TIM Counter Register value on runtime.
Kojto 110:165afa46840b 987 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 988 * @retval None
Kojto 110:165afa46840b 989 */
Kojto 110:165afa46840b 990 #define __HAL_TIM_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->CNT)
Kojto 110:165afa46840b 991
Kojto 110:165afa46840b 992 /**
Kojto 110:165afa46840b 993 * @brief Sets the TIM Autoreload Register value on runtime without calling
Kojto 110:165afa46840b 994 * another time any Init function.
Kojto 110:165afa46840b 995 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 996 * @param __AUTORELOAD__: specifies the Counter register new value.
Kojto 110:165afa46840b 997 * @retval None
Kojto 110:165afa46840b 998 */
Kojto 110:165afa46840b 999 #define __HAL_TIM_SET_AUTORELOAD(__HANDLE__, __AUTORELOAD__) \
Kojto 110:165afa46840b 1000 do{ \
Kojto 110:165afa46840b 1001 (__HANDLE__)->Instance->ARR = (__AUTORELOAD__); \
Kojto 110:165afa46840b 1002 (__HANDLE__)->Init.Period = (__AUTORELOAD__); \
Kojto 110:165afa46840b 1003 } while(0)
Kojto 110:165afa46840b 1004 /**
Kojto 110:165afa46840b 1005 * @brief Gets the TIM Autoreload Register value on runtime
Kojto 110:165afa46840b 1006 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 1007 * @retval None
Kojto 110:165afa46840b 1008 */
Kojto 110:165afa46840b 1009 #define __HAL_TIM_GET_AUTORELOAD(__HANDLE__) ((__HANDLE__)->Instance->ARR)
Kojto 110:165afa46840b 1010
Kojto 110:165afa46840b 1011 /**
Kojto 110:165afa46840b 1012 * @brief Sets the TIM Clock Division value on runtime without calling
Kojto 110:165afa46840b 1013 * another time any Init function.
Kojto 110:165afa46840b 1014 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 1015 * @param __CKD__: specifies the clock division value.
Kojto 110:165afa46840b 1016 * This parameter can be one of the following value:
Kojto 110:165afa46840b 1017 * @arg TIM_CLOCKDIVISION_DIV1
Kojto 110:165afa46840b 1018 * @arg TIM_CLOCKDIVISION_DIV2
Kojto 110:165afa46840b 1019 * @arg TIM_CLOCKDIVISION_DIV4
Kojto 110:165afa46840b 1020 * @retval None
Kojto 110:165afa46840b 1021 */
Kojto 110:165afa46840b 1022 #define __HAL_TIM_SET_CLOCKDIVISION(__HANDLE__, __CKD__) \
Kojto 110:165afa46840b 1023 do{ \
Kojto 110:165afa46840b 1024 (__HANDLE__)->Instance->CR1 &= (uint16_t)(~TIM_CR1_CKD); \
Kojto 110:165afa46840b 1025 (__HANDLE__)->Instance->CR1 |= (__CKD__); \
Kojto 110:165afa46840b 1026 (__HANDLE__)->Init.ClockDivision = (__CKD__); \
Kojto 110:165afa46840b 1027 } while(0)
Kojto 110:165afa46840b 1028 /**
Kojto 110:165afa46840b 1029 * @brief Gets the TIM Clock Division value on runtime
Kojto 110:165afa46840b 1030 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 1031 * @retval None
Kojto 110:165afa46840b 1032 */
Kojto 110:165afa46840b 1033 #define __HAL_TIM_GET_CLOCKDIVISION(__HANDLE__) ((__HANDLE__)->Instance->CR1 & TIM_CR1_CKD)
Kojto 110:165afa46840b 1034
Kojto 110:165afa46840b 1035 /**
Kojto 110:165afa46840b 1036 * @brief Sets the TIM Input Capture prescaler on runtime without calling
Kojto 110:165afa46840b 1037 * another time HAL_TIM_IC_ConfigChannel() function.
Kojto 110:165afa46840b 1038 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 1039 * @param __CHANNEL__ : TIM Channels to be configured.
Kojto 110:165afa46840b 1040 * This parameter can be one of the following values:
Kojto 110:165afa46840b 1041 * @arg TIM_CHANNEL_1: TIM Channel 1 selected
Kojto 110:165afa46840b 1042 * @arg TIM_CHANNEL_2: TIM Channel 2 selected
Kojto 110:165afa46840b 1043 * @arg TIM_CHANNEL_3: TIM Channel 3 selected
Kojto 110:165afa46840b 1044 * @arg TIM_CHANNEL_4: TIM Channel 4 selected
Kojto 110:165afa46840b 1045 * @param __ICPSC__: specifies the Input Capture4 prescaler new value.
Kojto 110:165afa46840b 1046 * This parameter can be one of the following values:
Kojto 110:165afa46840b 1047 * @arg TIM_ICPSC_DIV1: no prescaler
Kojto 110:165afa46840b 1048 * @arg TIM_ICPSC_DIV2: capture is done once every 2 events
Kojto 110:165afa46840b 1049 * @arg TIM_ICPSC_DIV4: capture is done once every 4 events
Kojto 110:165afa46840b 1050 * @arg TIM_ICPSC_DIV8: capture is done once every 8 events
Kojto 110:165afa46840b 1051 * @retval None
Kojto 110:165afa46840b 1052 */
Kojto 110:165afa46840b 1053 #define __HAL_TIM_SET_ICPRESCALER(__HANDLE__, __CHANNEL__, __ICPSC__) \
Kojto 110:165afa46840b 1054 do{ \
Kojto 110:165afa46840b 1055 TIM_RESET_ICPRESCALERVALUE((__HANDLE__), (__CHANNEL__)); \
Kojto 110:165afa46840b 1056 TIM_SET_ICPRESCALERVALUE((__HANDLE__), (__CHANNEL__), (__ICPSC__)); \
Kojto 110:165afa46840b 1057 } while(0)
Kojto 110:165afa46840b 1058
Kojto 110:165afa46840b 1059 /**
Kojto 110:165afa46840b 1060 * @brief Gets the TIM Input Capture prescaler on runtime
Kojto 110:165afa46840b 1061 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 1062 * @param __CHANNEL__ : TIM Channels to be configured.
Kojto 110:165afa46840b 1063 * This parameter can be one of the following values:
Kojto 110:165afa46840b 1064 * @arg TIM_CHANNEL_1: get input capture 1 prescaler value
Kojto 110:165afa46840b 1065 * @arg TIM_CHANNEL_2: get input capture 2 prescaler value
Kojto 110:165afa46840b 1066 * @arg TIM_CHANNEL_3: get input capture 3 prescaler value
Kojto 110:165afa46840b 1067 * @arg TIM_CHANNEL_4: get input capture 4 prescaler value
Kojto 110:165afa46840b 1068 * @retval None
Kojto 110:165afa46840b 1069 */
Kojto 110:165afa46840b 1070 #define __HAL_TIM_GET_ICPRESCALER(__HANDLE__, __CHANNEL__) \
Kojto 110:165afa46840b 1071 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 & TIM_CCMR1_IC1PSC) :\
Kojto 110:165afa46840b 1072 ((__CHANNEL__) == TIM_CHANNEL_2) ? (((__HANDLE__)->Instance->CCMR1 & TIM_CCMR1_IC2PSC) >> 8) :\
Kojto 110:165afa46840b 1073 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 & TIM_CCMR2_IC3PSC) :\
Kojto 110:165afa46840b 1074 (((__HANDLE__)->Instance->CCMR2 & TIM_CCMR2_IC4PSC)) >> 8)
Kojto 110:165afa46840b 1075
Kojto 110:165afa46840b 1076 /**
Kojto 110:165afa46840b 1077 * @brief Set the Update Request Source (URS) bit of the TIMx_CR1 register
Kojto 110:165afa46840b 1078 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 1079 * @note When the USR bit of the TIMx_CR1 register is set, only counter
Kojto 110:165afa46840b 1080 * overflow/underflow generates an update interrupt or DMA request (if
Kojto 110:165afa46840b 1081 * enabled)
Kojto 110:165afa46840b 1082 * @retval None
Kojto 110:165afa46840b 1083 */
Kojto 110:165afa46840b 1084 #define __HAL_TIM_URS_ENABLE(__HANDLE__) \
Kojto 110:165afa46840b 1085 ((__HANDLE__)->Instance->CR1|= (TIM_CR1_URS))
Kojto 110:165afa46840b 1086
Kojto 110:165afa46840b 1087 /**
Kojto 110:165afa46840b 1088 * @brief Reset the Update Request Source (URS) bit of the TIMx_CR1 register
Kojto 110:165afa46840b 1089 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 1090 * @note When the USR bit of the TIMx_CR1 register is reset, any of the
Kojto 110:165afa46840b 1091 * following events generate an update interrupt or DMA request (if
Kojto 110:165afa46840b 1092 * enabled):
Kojto 110:165afa46840b 1093 * – Counter overflow/underflow
Kojto 110:165afa46840b 1094 * – Setting the UG bit
Kojto 110:165afa46840b 1095 * – Update generation through the slave mode controller
Kojto 110:165afa46840b 1096 * @retval None
Kojto 110:165afa46840b 1097 */
Kojto 110:165afa46840b 1098 #define __HAL_TIM_URS_DISABLE(__HANDLE__) \
Kojto 110:165afa46840b 1099 ((__HANDLE__)->Instance->CR1&=~(TIM_CR1_URS))
Kojto 110:165afa46840b 1100
Kojto 110:165afa46840b 1101 /**
Kojto 110:165afa46840b 1102 * @brief Sets the TIM Capture x input polarity on runtime.
Kojto 110:165afa46840b 1103 * @param __HANDLE__: TIM handle.
Kojto 110:165afa46840b 1104 * @param __CHANNEL__: TIM Channels to be configured.
Kojto 110:165afa46840b 1105 * This parameter can be one of the following values:
Kojto 110:165afa46840b 1106 * @arg TIM_CHANNEL_1: TIM Channel 1 selected
Kojto 110:165afa46840b 1107 * @arg TIM_CHANNEL_2: TIM Channel 2 selected
Kojto 110:165afa46840b 1108 * @arg TIM_CHANNEL_3: TIM Channel 3 selected
Kojto 110:165afa46840b 1109 * @arg TIM_CHANNEL_4: TIM Channel 4 selected
Kojto 110:165afa46840b 1110 * @param __POLARITY__: Polarity for TIx source
Kojto 110:165afa46840b 1111 * @arg TIM_INPUTCHANNELPOLARITY_RISING: Rising Edge
Kojto 110:165afa46840b 1112 * @arg TIM_INPUTCHANNELPOLARITY_FALLING: Falling Edge
Kojto 110:165afa46840b 1113 * @arg TIM_INPUTCHANNELPOLARITY_BOTHEDGE: Rising and Falling Edge
Kojto 110:165afa46840b 1114 * @note The polarity TIM_INPUTCHANNELPOLARITY_BOTHEDGE is not authorized for TIM Channel 4.
Kojto 110:165afa46840b 1115 * @retval None
Kojto 110:165afa46840b 1116 */
Kojto 110:165afa46840b 1117 #define __HAL_TIM_SET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__, __POLARITY__) \
Kojto 110:165afa46840b 1118 do{ \
Kojto 110:165afa46840b 1119 TIM_RESET_CAPTUREPOLARITY((__HANDLE__), (__CHANNEL__)); \
Kojto 110:165afa46840b 1120 TIM_SET_CAPTUREPOLARITY((__HANDLE__), (__CHANNEL__), (__POLARITY__)); \
Kojto 110:165afa46840b 1121 }while(0)
Kojto 110:165afa46840b 1122 /**
Kojto 110:165afa46840b 1123 * @}
Kojto 110:165afa46840b 1124 */
Kojto 110:165afa46840b 1125
Kojto 110:165afa46840b 1126 /* Include TIM HAL Extension module */
Kojto 110:165afa46840b 1127 #include "stm32f4xx_hal_tim_ex.h"
Kojto 110:165afa46840b 1128
Kojto 110:165afa46840b 1129 /* Exported functions --------------------------------------------------------*/
Kojto 110:165afa46840b 1130 /** @addtogroup TIM_Exported_Functions
Kojto 110:165afa46840b 1131 * @{
Kojto 110:165afa46840b 1132 */
Kojto 110:165afa46840b 1133
Kojto 110:165afa46840b 1134 /** @addtogroup TIM_Exported_Functions_Group1
Kojto 110:165afa46840b 1135 * @{
Kojto 110:165afa46840b 1136 */
Kojto 110:165afa46840b 1137
Kojto 110:165afa46840b 1138 /* Time Base functions ********************************************************/
Kojto 110:165afa46840b 1139 HAL_StatusTypeDef HAL_TIM_Base_Init(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1140 HAL_StatusTypeDef HAL_TIM_Base_DeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1141 void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1142 void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1143 /* Blocking mode: Polling */
Kojto 110:165afa46840b 1144 HAL_StatusTypeDef HAL_TIM_Base_Start(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1145 HAL_StatusTypeDef HAL_TIM_Base_Stop(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1146 /* Non-Blocking mode: Interrupt */
Kojto 110:165afa46840b 1147 HAL_StatusTypeDef HAL_TIM_Base_Start_IT(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1148 HAL_StatusTypeDef HAL_TIM_Base_Stop_IT(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1149 /* Non-Blocking mode: DMA */
Kojto 110:165afa46840b 1150 HAL_StatusTypeDef HAL_TIM_Base_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length);
Kojto 110:165afa46840b 1151 HAL_StatusTypeDef HAL_TIM_Base_Stop_DMA(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1152 /**
Kojto 110:165afa46840b 1153 * @}
Kojto 110:165afa46840b 1154 */
Kojto 110:165afa46840b 1155
Kojto 110:165afa46840b 1156 /** @addtogroup TIM_Exported_Functions_Group2
Kojto 110:165afa46840b 1157 * @{
Kojto 110:165afa46840b 1158 */
Kojto 110:165afa46840b 1159 /* Timer Output Compare functions **********************************************/
Kojto 110:165afa46840b 1160 HAL_StatusTypeDef HAL_TIM_OC_Init(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1161 HAL_StatusTypeDef HAL_TIM_OC_DeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1162 void HAL_TIM_OC_MspInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1163 void HAL_TIM_OC_MspDeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1164 /* Blocking mode: Polling */
Kojto 110:165afa46840b 1165 HAL_StatusTypeDef HAL_TIM_OC_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1166 HAL_StatusTypeDef HAL_TIM_OC_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1167 /* Non-Blocking mode: Interrupt */
Kojto 110:165afa46840b 1168 HAL_StatusTypeDef HAL_TIM_OC_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1169 HAL_StatusTypeDef HAL_TIM_OC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1170 /* Non-Blocking mode: DMA */
Kojto 110:165afa46840b 1171 HAL_StatusTypeDef HAL_TIM_OC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
Kojto 110:165afa46840b 1172 HAL_StatusTypeDef HAL_TIM_OC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1173
Kojto 110:165afa46840b 1174 /**
Kojto 110:165afa46840b 1175 * @}
Kojto 110:165afa46840b 1176 */
Kojto 110:165afa46840b 1177
Kojto 110:165afa46840b 1178 /** @addtogroup TIM_Exported_Functions_Group3
Kojto 110:165afa46840b 1179 * @{
Kojto 110:165afa46840b 1180 */
Kojto 110:165afa46840b 1181 /* Timer PWM functions *********************************************************/
Kojto 110:165afa46840b 1182 HAL_StatusTypeDef HAL_TIM_PWM_Init(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1183 HAL_StatusTypeDef HAL_TIM_PWM_DeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1184 void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1185 void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1186 /* Blocking mode: Polling */
Kojto 110:165afa46840b 1187 HAL_StatusTypeDef HAL_TIM_PWM_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1188 HAL_StatusTypeDef HAL_TIM_PWM_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1189 /* Non-Blocking mode: Interrupt */
Kojto 110:165afa46840b 1190 HAL_StatusTypeDef HAL_TIM_PWM_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1191 HAL_StatusTypeDef HAL_TIM_PWM_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1192 /* Non-Blocking mode: DMA */
Kojto 110:165afa46840b 1193 HAL_StatusTypeDef HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
Kojto 110:165afa46840b 1194 HAL_StatusTypeDef HAL_TIM_PWM_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1195
Kojto 110:165afa46840b 1196 /**
Kojto 110:165afa46840b 1197 * @}
Kojto 110:165afa46840b 1198 */
Kojto 110:165afa46840b 1199
Kojto 110:165afa46840b 1200 /** @addtogroup TIM_Exported_Functions_Group4
Kojto 110:165afa46840b 1201 * @{
Kojto 110:165afa46840b 1202 */
Kojto 110:165afa46840b 1203 /* Timer Input Capture functions ***********************************************/
Kojto 110:165afa46840b 1204 HAL_StatusTypeDef HAL_TIM_IC_Init(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1205 HAL_StatusTypeDef HAL_TIM_IC_DeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1206 void HAL_TIM_IC_MspInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1207 void HAL_TIM_IC_MspDeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1208 /* Blocking mode: Polling */
Kojto 110:165afa46840b 1209 HAL_StatusTypeDef HAL_TIM_IC_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1210 HAL_StatusTypeDef HAL_TIM_IC_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1211 /* Non-Blocking mode: Interrupt */
Kojto 110:165afa46840b 1212 HAL_StatusTypeDef HAL_TIM_IC_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1213 HAL_StatusTypeDef HAL_TIM_IC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1214 /* Non-Blocking mode: DMA */
Kojto 110:165afa46840b 1215 HAL_StatusTypeDef HAL_TIM_IC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
Kojto 110:165afa46840b 1216 HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1217
Kojto 110:165afa46840b 1218 /**
Kojto 110:165afa46840b 1219 * @}
Kojto 110:165afa46840b 1220 */
Kojto 110:165afa46840b 1221
Kojto 110:165afa46840b 1222 /** @addtogroup TIM_Exported_Functions_Group5
Kojto 110:165afa46840b 1223 * @{
Kojto 110:165afa46840b 1224 */
Kojto 110:165afa46840b 1225 /* Timer One Pulse functions ***************************************************/
Kojto 110:165afa46840b 1226 HAL_StatusTypeDef HAL_TIM_OnePulse_Init(TIM_HandleTypeDef *htim, uint32_t OnePulseMode);
Kojto 110:165afa46840b 1227 HAL_StatusTypeDef HAL_TIM_OnePulse_DeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1228 void HAL_TIM_OnePulse_MspInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1229 void HAL_TIM_OnePulse_MspDeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1230 /* Blocking mode: Polling */
Kojto 110:165afa46840b 1231 HAL_StatusTypeDef HAL_TIM_OnePulse_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
Kojto 110:165afa46840b 1232 HAL_StatusTypeDef HAL_TIM_OnePulse_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
Kojto 110:165afa46840b 1233
Kojto 110:165afa46840b 1234 /* Non-Blocking mode: Interrupt */
Kojto 110:165afa46840b 1235 HAL_StatusTypeDef HAL_TIM_OnePulse_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
Kojto 110:165afa46840b 1236 HAL_StatusTypeDef HAL_TIM_OnePulse_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
Kojto 110:165afa46840b 1237
Kojto 110:165afa46840b 1238 /**
Kojto 110:165afa46840b 1239 * @}
Kojto 110:165afa46840b 1240 */
Kojto 110:165afa46840b 1241
Kojto 110:165afa46840b 1242 /** @addtogroup TIM_Exported_Functions_Group6
Kojto 110:165afa46840b 1243 * @{
Kojto 110:165afa46840b 1244 */
Kojto 110:165afa46840b 1245 /* Timer Encoder functions *****************************************************/
Kojto 110:165afa46840b 1246 HAL_StatusTypeDef HAL_TIM_Encoder_Init(TIM_HandleTypeDef *htim, TIM_Encoder_InitTypeDef* sConfig);
Kojto 110:165afa46840b 1247 HAL_StatusTypeDef HAL_TIM_Encoder_DeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1248 void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1249 void HAL_TIM_Encoder_MspDeInit(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1250 /* Blocking mode: Polling */
Kojto 110:165afa46840b 1251 HAL_StatusTypeDef HAL_TIM_Encoder_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1252 HAL_StatusTypeDef HAL_TIM_Encoder_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1253 /* Non-Blocking mode: Interrupt */
Kojto 110:165afa46840b 1254 HAL_StatusTypeDef HAL_TIM_Encoder_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1255 HAL_StatusTypeDef HAL_TIM_Encoder_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1256 /* Non-Blocking mode: DMA */
Kojto 110:165afa46840b 1257 HAL_StatusTypeDef HAL_TIM_Encoder_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData1, uint32_t *pData2, uint16_t Length);
Kojto 110:165afa46840b 1258 HAL_StatusTypeDef HAL_TIM_Encoder_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1259
Kojto 110:165afa46840b 1260 /**
Kojto 110:165afa46840b 1261 * @}
Kojto 110:165afa46840b 1262 */
Kojto 110:165afa46840b 1263
Kojto 110:165afa46840b 1264 /** @addtogroup TIM_Exported_Functions_Group7
Kojto 110:165afa46840b 1265 * @{
Kojto 110:165afa46840b 1266 */
Kojto 110:165afa46840b 1267 /* Interrupt Handler functions **********************************************/
Kojto 110:165afa46840b 1268 void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1269
Kojto 110:165afa46840b 1270 /**
Kojto 110:165afa46840b 1271 * @}
Kojto 110:165afa46840b 1272 */
Kojto 110:165afa46840b 1273
Kojto 110:165afa46840b 1274 /** @addtogroup TIM_Exported_Functions_Group8
Kojto 110:165afa46840b 1275 * @{
Kojto 110:165afa46840b 1276 */
Kojto 110:165afa46840b 1277 /* Control functions *********************************************************/
Kojto 110:165afa46840b 1278 HAL_StatusTypeDef HAL_TIM_OC_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef* sConfig, uint32_t Channel);
Kojto 110:165afa46840b 1279 HAL_StatusTypeDef HAL_TIM_PWM_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef* sConfig, uint32_t Channel);
Kojto 110:165afa46840b 1280 HAL_StatusTypeDef HAL_TIM_IC_ConfigChannel(TIM_HandleTypeDef *htim, TIM_IC_InitTypeDef* sConfig, uint32_t Channel);
Kojto 110:165afa46840b 1281 HAL_StatusTypeDef HAL_TIM_OnePulse_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OnePulse_InitTypeDef* sConfig, uint32_t OutputChannel, uint32_t InputChannel);
Kojto 110:165afa46840b 1282 HAL_StatusTypeDef HAL_TIM_ConfigOCrefClear(TIM_HandleTypeDef *htim, TIM_ClearInputConfigTypeDef * sClearInputConfig, uint32_t Channel);
Kojto 110:165afa46840b 1283 HAL_StatusTypeDef HAL_TIM_ConfigClockSource(TIM_HandleTypeDef *htim, TIM_ClockConfigTypeDef * sClockSourceConfig);
Kojto 110:165afa46840b 1284 HAL_StatusTypeDef HAL_TIM_ConfigTI1Input(TIM_HandleTypeDef *htim, uint32_t TI1_Selection);
Kojto 110:165afa46840b 1285 HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchronization(TIM_HandleTypeDef *htim, TIM_SlaveConfigTypeDef * sSlaveConfig);
Kojto 110:165afa46840b 1286 HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchronization_IT(TIM_HandleTypeDef *htim, TIM_SlaveConfigTypeDef * sSlaveConfig);
Kojto 110:165afa46840b 1287 HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, uint32_t BurstRequestSrc, \
Kojto 110:165afa46840b 1288 uint32_t *BurstBuffer, uint32_t BurstLength);
Kojto 110:165afa46840b 1289 HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStop(TIM_HandleTypeDef *htim, uint32_t BurstRequestSrc);
Kojto 110:165afa46840b 1290 HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, uint32_t BurstRequestSrc, \
Kojto 110:165afa46840b 1291 uint32_t *BurstBuffer, uint32_t BurstLength);
Kojto 110:165afa46840b 1292 HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStop(TIM_HandleTypeDef *htim, uint32_t BurstRequestSrc);
Kojto 110:165afa46840b 1293 HAL_StatusTypeDef HAL_TIM_GenerateEvent(TIM_HandleTypeDef *htim, uint32_t EventSource);
Kojto 110:165afa46840b 1294 uint32_t HAL_TIM_ReadCapturedValue(TIM_HandleTypeDef *htim, uint32_t Channel);
Kojto 110:165afa46840b 1295
Kojto 110:165afa46840b 1296 /**
Kojto 110:165afa46840b 1297 * @}
Kojto 110:165afa46840b 1298 */
Kojto 110:165afa46840b 1299
Kojto 110:165afa46840b 1300 /** @addtogroup TIM_Exported_Functions_Group9
Kojto 110:165afa46840b 1301 * @{
Kojto 110:165afa46840b 1302 */
Kojto 110:165afa46840b 1303 /* Callback in non blocking modes (Interrupt and DMA) *************************/
Kojto 110:165afa46840b 1304 void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1305 void HAL_TIM_OC_DelayElapsedCallback(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1306 void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1307 void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1308 void HAL_TIM_TriggerCallback(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1309 void HAL_TIM_ErrorCallback(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1310
Kojto 110:165afa46840b 1311 /**
Kojto 110:165afa46840b 1312 * @}
Kojto 110:165afa46840b 1313 */
Kojto 110:165afa46840b 1314
Kojto 110:165afa46840b 1315 /** @addtogroup TIM_Exported_Functions_Group10
Kojto 110:165afa46840b 1316 * @{
Kojto 110:165afa46840b 1317 */
Kojto 110:165afa46840b 1318 /* Peripheral State functions **************************************************/
Kojto 110:165afa46840b 1319 HAL_TIM_StateTypeDef HAL_TIM_Base_GetState(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1320 HAL_TIM_StateTypeDef HAL_TIM_OC_GetState(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1321 HAL_TIM_StateTypeDef HAL_TIM_PWM_GetState(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1322 HAL_TIM_StateTypeDef HAL_TIM_IC_GetState(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1323 HAL_TIM_StateTypeDef HAL_TIM_OnePulse_GetState(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1324 HAL_TIM_StateTypeDef HAL_TIM_Encoder_GetState(TIM_HandleTypeDef *htim);
Kojto 110:165afa46840b 1325
Kojto 110:165afa46840b 1326 /**
Kojto 110:165afa46840b 1327 * @}
Kojto 110:165afa46840b 1328 */
Kojto 110:165afa46840b 1329
Kojto 110:165afa46840b 1330 /**
Kojto 110:165afa46840b 1331 * @}
Kojto 110:165afa46840b 1332 */
Kojto 110:165afa46840b 1333
Kojto 110:165afa46840b 1334 /* Private macros ------------------------------------------------------------*/
Kojto 110:165afa46840b 1335 /** @defgroup TIM_Private_Macros TIM Private Macros
Kojto 110:165afa46840b 1336 * @{
Kojto 110:165afa46840b 1337 */
Kojto 110:165afa46840b 1338
Kojto 110:165afa46840b 1339 /** @defgroup TIM_IS_TIM_Definitions TIM Private macros to check input parameters
Kojto 110:165afa46840b 1340 * @{
Kojto 110:165afa46840b 1341 */
Kojto 110:165afa46840b 1342 #define IS_TIM_COUNTER_MODE(MODE) (((MODE) == TIM_COUNTERMODE_UP) || \
Kojto 110:165afa46840b 1343 ((MODE) == TIM_COUNTERMODE_DOWN) || \
Kojto 110:165afa46840b 1344 ((MODE) == TIM_COUNTERMODE_CENTERALIGNED1) || \
Kojto 110:165afa46840b 1345 ((MODE) == TIM_COUNTERMODE_CENTERALIGNED2) || \
Kojto 110:165afa46840b 1346 ((MODE) == TIM_COUNTERMODE_CENTERALIGNED3))
Kojto 110:165afa46840b 1347
Kojto 110:165afa46840b 1348 #define IS_TIM_CLOCKDIVISION_DIV(DIV) (((DIV) == TIM_CLOCKDIVISION_DIV1) || \
Kojto 110:165afa46840b 1349 ((DIV) == TIM_CLOCKDIVISION_DIV2) || \
Kojto 110:165afa46840b 1350 ((DIV) == TIM_CLOCKDIVISION_DIV4))
Kojto 110:165afa46840b 1351
Kojto 110:165afa46840b 1352 #define IS_TIM_PWM_MODE(MODE) (((MODE) == TIM_OCMODE_PWM1) || \
Kojto 110:165afa46840b 1353 ((MODE) == TIM_OCMODE_PWM2))
Kojto 110:165afa46840b 1354
Kojto 110:165afa46840b 1355 #define IS_TIM_OC_MODE(MODE) (((MODE) == TIM_OCMODE_TIMING) || \
Kojto 110:165afa46840b 1356 ((MODE) == TIM_OCMODE_ACTIVE) || \
Kojto 110:165afa46840b 1357 ((MODE) == TIM_OCMODE_INACTIVE) || \
Kojto 110:165afa46840b 1358 ((MODE) == TIM_OCMODE_TOGGLE) || \
Kojto 110:165afa46840b 1359 ((MODE) == TIM_OCMODE_FORCED_ACTIVE) || \
Kojto 110:165afa46840b 1360 ((MODE) == TIM_OCMODE_FORCED_INACTIVE))
Kojto 110:165afa46840b 1361
Kojto 110:165afa46840b 1362 #define IS_TIM_FAST_STATE(STATE) (((STATE) == TIM_OCFAST_DISABLE) || \
Kojto 110:165afa46840b 1363 ((STATE) == TIM_OCFAST_ENABLE))
Kojto 110:165afa46840b 1364
Kojto 110:165afa46840b 1365 #define IS_TIM_OC_POLARITY(POLARITY) (((POLARITY) == TIM_OCPOLARITY_HIGH) || \
Kojto 110:165afa46840b 1366 ((POLARITY) == TIM_OCPOLARITY_LOW))
Kojto 110:165afa46840b 1367
Kojto 110:165afa46840b 1368 #define IS_TIM_OCN_POLARITY(POLARITY) (((POLARITY) == TIM_OCNPOLARITY_HIGH) || \
Kojto 110:165afa46840b 1369 ((POLARITY) == TIM_OCNPOLARITY_LOW))
Kojto 110:165afa46840b 1370
Kojto 110:165afa46840b 1371 #define IS_TIM_OCIDLE_STATE(STATE) (((STATE) == TIM_OCIDLESTATE_SET) || \
Kojto 110:165afa46840b 1372 ((STATE) == TIM_OCIDLESTATE_RESET))
Kojto 110:165afa46840b 1373
Kojto 110:165afa46840b 1374 #define IS_TIM_OCNIDLE_STATE(STATE) (((STATE) == TIM_OCNIDLESTATE_SET) || \
Kojto 110:165afa46840b 1375 ((STATE) == TIM_OCNIDLESTATE_RESET))
Kojto 110:165afa46840b 1376
Kojto 110:165afa46840b 1377 #define IS_TIM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
Kojto 110:165afa46840b 1378 ((CHANNEL) == TIM_CHANNEL_2) || \
Kojto 110:165afa46840b 1379 ((CHANNEL) == TIM_CHANNEL_3) || \
Kojto 110:165afa46840b 1380 ((CHANNEL) == TIM_CHANNEL_4) || \
Kojto 110:165afa46840b 1381 ((CHANNEL) == TIM_CHANNEL_ALL))
Kojto 110:165afa46840b 1382
Kojto 110:165afa46840b 1383 #define IS_TIM_OPM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
Kojto 110:165afa46840b 1384 ((CHANNEL) == TIM_CHANNEL_2))
Kojto 110:165afa46840b 1385
Kojto 110:165afa46840b 1386 #define IS_TIM_COMPLEMENTARY_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
Kojto 110:165afa46840b 1387 ((CHANNEL) == TIM_CHANNEL_2) || \
Kojto 110:165afa46840b 1388 ((CHANNEL) == TIM_CHANNEL_3))
Kojto 110:165afa46840b 1389
Kojto 110:165afa46840b 1390 #define IS_TIM_IC_POLARITY(POLARITY) (((POLARITY) == TIM_ICPOLARITY_RISING) || \
Kojto 110:165afa46840b 1391 ((POLARITY) == TIM_ICPOLARITY_FALLING) || \
Kojto 110:165afa46840b 1392 ((POLARITY) == TIM_ICPOLARITY_BOTHEDGE))
Kojto 110:165afa46840b 1393
Kojto 110:165afa46840b 1394 #define IS_TIM_IC_SELECTION(SELECTION) (((SELECTION) == TIM_ICSELECTION_DIRECTTI) || \
Kojto 110:165afa46840b 1395 ((SELECTION) == TIM_ICSELECTION_INDIRECTTI) || \
Kojto 110:165afa46840b 1396 ((SELECTION) == TIM_ICSELECTION_TRC))
Kojto 110:165afa46840b 1397
Kojto 110:165afa46840b 1398 #define IS_TIM_IC_PRESCALER(PRESCALER) (((PRESCALER) == TIM_ICPSC_DIV1) || \
Kojto 110:165afa46840b 1399 ((PRESCALER) == TIM_ICPSC_DIV2) || \
Kojto 110:165afa46840b 1400 ((PRESCALER) == TIM_ICPSC_DIV4) || \
Kojto 110:165afa46840b 1401 ((PRESCALER) == TIM_ICPSC_DIV8))
Kojto 110:165afa46840b 1402
Kojto 110:165afa46840b 1403 #define IS_TIM_OPM_MODE(MODE) (((MODE) == TIM_OPMODE_SINGLE) || \
Kojto 110:165afa46840b 1404 ((MODE) == TIM_OPMODE_REPETITIVE))
Kojto 110:165afa46840b 1405
Kojto 110:165afa46840b 1406 #define IS_TIM_DMA_SOURCE(SOURCE) ((((SOURCE) & 0xFFFF80FF) == 0x00000000) && ((SOURCE) != 0x00000000))
Kojto 110:165afa46840b 1407
Kojto 110:165afa46840b 1408 #define IS_TIM_ENCODER_MODE(MODE) (((MODE) == TIM_ENCODERMODE_TI1) || \
Kojto 110:165afa46840b 1409 ((MODE) == TIM_ENCODERMODE_TI2) || \
Kojto 110:165afa46840b 1410 ((MODE) == TIM_ENCODERMODE_TI12))
Kojto 110:165afa46840b 1411
Kojto 110:165afa46840b 1412 #define IS_TIM_EVENT_SOURCE(SOURCE) ((((SOURCE) & 0xFFFFFF00) == 0x00000000) && ((SOURCE) != 0x00000000))
Kojto 110:165afa46840b 1413
Kojto 110:165afa46840b 1414 #define IS_TIM_CLOCKSOURCE(CLOCK) (((CLOCK) == TIM_CLOCKSOURCE_INTERNAL) || \
Kojto 110:165afa46840b 1415 ((CLOCK) == TIM_CLOCKSOURCE_ETRMODE2) || \
Kojto 110:165afa46840b 1416 ((CLOCK) == TIM_CLOCKSOURCE_ITR0) || \
Kojto 110:165afa46840b 1417 ((CLOCK) == TIM_CLOCKSOURCE_ITR1) || \
Kojto 110:165afa46840b 1418 ((CLOCK) == TIM_CLOCKSOURCE_ITR2) || \
Kojto 110:165afa46840b 1419 ((CLOCK) == TIM_CLOCKSOURCE_ITR3) || \
Kojto 110:165afa46840b 1420 ((CLOCK) == TIM_CLOCKSOURCE_TI1ED) || \
Kojto 110:165afa46840b 1421 ((CLOCK) == TIM_CLOCKSOURCE_TI1) || \
Kojto 110:165afa46840b 1422 ((CLOCK) == TIM_CLOCKSOURCE_TI2) || \
Kojto 110:165afa46840b 1423 ((CLOCK) == TIM_CLOCKSOURCE_ETRMODE1))
Kojto 110:165afa46840b 1424
Kojto 110:165afa46840b 1425 #define IS_TIM_CLOCKPOLARITY(POLARITY) (((POLARITY) == TIM_CLOCKPOLARITY_INVERTED) || \
Kojto 110:165afa46840b 1426 ((POLARITY) == TIM_CLOCKPOLARITY_NONINVERTED) || \
Kojto 110:165afa46840b 1427 ((POLARITY) == TIM_CLOCKPOLARITY_RISING) || \
Kojto 110:165afa46840b 1428 ((POLARITY) == TIM_CLOCKPOLARITY_FALLING) || \
Kojto 110:165afa46840b 1429 ((POLARITY) == TIM_CLOCKPOLARITY_BOTHEDGE))
Kojto 110:165afa46840b 1430
Kojto 110:165afa46840b 1431 #define IS_TIM_CLOCKPRESCALER(PRESCALER) (((PRESCALER) == TIM_CLOCKPRESCALER_DIV1) || \
Kojto 110:165afa46840b 1432 ((PRESCALER) == TIM_CLOCKPRESCALER_DIV2) || \
Kojto 110:165afa46840b 1433 ((PRESCALER) == TIM_CLOCKPRESCALER_DIV4) || \
Kojto 110:165afa46840b 1434 ((PRESCALER) == TIM_CLOCKPRESCALER_DIV8))
Kojto 110:165afa46840b 1435
Kojto 110:165afa46840b 1436 #define IS_TIM_CLOCKFILTER(ICFILTER) ((ICFILTER) <= 0xF)
Kojto 110:165afa46840b 1437
Kojto 110:165afa46840b 1438 #define IS_TIM_CLEARINPUT_SOURCE(SOURCE) (((SOURCE) == TIM_CLEARINPUTSOURCE_NONE) || \
Kojto 110:165afa46840b 1439 ((SOURCE) == TIM_CLEARINPUTSOURCE_ETR))
Kojto 110:165afa46840b 1440
Kojto 110:165afa46840b 1441 #define IS_TIM_CLEARINPUT_POLARITY(POLARITY) (((POLARITY) == TIM_CLEARINPUTPOLARITY_INVERTED) || \
Kojto 110:165afa46840b 1442 ((POLARITY) == TIM_CLEARINPUTPOLARITY_NONINVERTED))
Kojto 110:165afa46840b 1443
Kojto 110:165afa46840b 1444 #define IS_TIM_CLEARINPUT_PRESCALER(PRESCALER) (((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV1) || \
Kojto 110:165afa46840b 1445 ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV2) || \
Kojto 110:165afa46840b 1446 ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV4) || \
Kojto 110:165afa46840b 1447 ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV8))
Kojto 110:165afa46840b 1448
Kojto 110:165afa46840b 1449 #define IS_TIM_CLEARINPUT_FILTER(ICFILTER) ((ICFILTER) <= 0xF)
Kojto 110:165afa46840b 1450
Kojto 110:165afa46840b 1451 #define IS_TIM_OSSR_STATE(STATE) (((STATE) == TIM_OSSR_ENABLE) || \
Kojto 110:165afa46840b 1452 ((STATE) == TIM_OSSR_DISABLE))
Kojto 110:165afa46840b 1453
Kojto 110:165afa46840b 1454 #define IS_TIM_OSSI_STATE(STATE) (((STATE) == TIM_OSSI_ENABLE) || \
Kojto 110:165afa46840b 1455 ((STATE) == TIM_OSSI_DISABLE))
Kojto 110:165afa46840b 1456
Kojto 110:165afa46840b 1457 #define IS_TIM_LOCK_LEVEL(LEVEL) (((LEVEL) == TIM_LOCKLEVEL_OFF) || \
Kojto 110:165afa46840b 1458 ((LEVEL) == TIM_LOCKLEVEL_1) || \
Kojto 110:165afa46840b 1459 ((LEVEL) == TIM_LOCKLEVEL_2) || \
Kojto 110:165afa46840b 1460 ((LEVEL) == TIM_LOCKLEVEL_3))
Kojto 110:165afa46840b 1461
Kojto 110:165afa46840b 1462 #define IS_TIM_BREAK_STATE(STATE) (((STATE) == TIM_BREAK_ENABLE) || \
Kojto 110:165afa46840b 1463 ((STATE) == TIM_BREAK_DISABLE))
Kojto 110:165afa46840b 1464
Kojto 110:165afa46840b 1465 #define IS_TIM_BREAK_POLARITY(POLARITY) (((POLARITY) == TIM_BREAKPOLARITY_LOW) || \
Kojto 110:165afa46840b 1466 ((POLARITY) == TIM_BREAKPOLARITY_HIGH))
Kojto 110:165afa46840b 1467
Kojto 110:165afa46840b 1468 #define IS_TIM_AUTOMATIC_OUTPUT_STATE(STATE) (((STATE) == TIM_AUTOMATICOUTPUT_ENABLE) || \
Kojto 110:165afa46840b 1469 ((STATE) == TIM_AUTOMATICOUTPUT_DISABLE))
Kojto 110:165afa46840b 1470
Kojto 110:165afa46840b 1471 #define IS_TIM_TRGO_SOURCE(SOURCE) (((SOURCE) == TIM_TRGO_RESET) || \
Kojto 110:165afa46840b 1472 ((SOURCE) == TIM_TRGO_ENABLE) || \
Kojto 110:165afa46840b 1473 ((SOURCE) == TIM_TRGO_UPDATE) || \
Kojto 110:165afa46840b 1474 ((SOURCE) == TIM_TRGO_OC1) || \
Kojto 110:165afa46840b 1475 ((SOURCE) == TIM_TRGO_OC1REF) || \
Kojto 110:165afa46840b 1476 ((SOURCE) == TIM_TRGO_OC2REF) || \
Kojto 110:165afa46840b 1477 ((SOURCE) == TIM_TRGO_OC3REF) || \
Kojto 110:165afa46840b 1478 ((SOURCE) == TIM_TRGO_OC4REF))
Kojto 110:165afa46840b 1479
Kojto 110:165afa46840b 1480 #define IS_TIM_SLAVE_MODE(MODE) (((MODE) == TIM_SLAVEMODE_DISABLE) || \
Kojto 110:165afa46840b 1481 ((MODE) == TIM_SLAVEMODE_GATED) || \
Kojto 110:165afa46840b 1482 ((MODE) == TIM_SLAVEMODE_RESET) || \
Kojto 110:165afa46840b 1483 ((MODE) == TIM_SLAVEMODE_TRIGGER) || \
Kojto 110:165afa46840b 1484 ((MODE) == TIM_SLAVEMODE_EXTERNAL1))
Kojto 110:165afa46840b 1485
Kojto 110:165afa46840b 1486 #define IS_TIM_MSM_STATE(STATE) (((STATE) == TIM_MASTERSLAVEMODE_ENABLE) || \
Kojto 110:165afa46840b 1487 ((STATE) == TIM_MASTERSLAVEMODE_DISABLE))
Kojto 110:165afa46840b 1488
Kojto 110:165afa46840b 1489 #define IS_TIM_TRIGGER_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \
Kojto 110:165afa46840b 1490 ((SELECTION) == TIM_TS_ITR1) || \
Kojto 110:165afa46840b 1491 ((SELECTION) == TIM_TS_ITR2) || \
Kojto 110:165afa46840b 1492 ((SELECTION) == TIM_TS_ITR3) || \
Kojto 110:165afa46840b 1493 ((SELECTION) == TIM_TS_TI1F_ED) || \
Kojto 110:165afa46840b 1494 ((SELECTION) == TIM_TS_TI1FP1) || \
Kojto 110:165afa46840b 1495 ((SELECTION) == TIM_TS_TI2FP2) || \
Kojto 110:165afa46840b 1496 ((SELECTION) == TIM_TS_ETRF))
Kojto 110:165afa46840b 1497
Kojto 110:165afa46840b 1498 #define IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \
Kojto 110:165afa46840b 1499 ((SELECTION) == TIM_TS_ITR1) || \
Kojto 110:165afa46840b 1500 ((SELECTION) == TIM_TS_ITR2) || \
Kojto 110:165afa46840b 1501 ((SELECTION) == TIM_TS_ITR3) || \
Kojto 110:165afa46840b 1502 ((SELECTION) == TIM_TS_NONE))
Kojto 110:165afa46840b 1503 #define IS_TIM_TRIGGERPOLARITY(POLARITY) (((POLARITY) == TIM_TRIGGERPOLARITY_INVERTED ) || \
Kojto 110:165afa46840b 1504 ((POLARITY) == TIM_TRIGGERPOLARITY_NONINVERTED) || \
Kojto 110:165afa46840b 1505 ((POLARITY) == TIM_TRIGGERPOLARITY_RISING ) || \
Kojto 110:165afa46840b 1506 ((POLARITY) == TIM_TRIGGERPOLARITY_FALLING ) || \
Kojto 110:165afa46840b 1507 ((POLARITY) == TIM_TRIGGERPOLARITY_BOTHEDGE ))
Kojto 110:165afa46840b 1508
Kojto 110:165afa46840b 1509 #define IS_TIM_TRIGGERPRESCALER(PRESCALER) (((PRESCALER) == TIM_TRIGGERPRESCALER_DIV1) || \
Kojto 110:165afa46840b 1510 ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV2) || \
Kojto 110:165afa46840b 1511 ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV4) || \
Kojto 110:165afa46840b 1512 ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV8))
Kojto 110:165afa46840b 1513
Kojto 110:165afa46840b 1514 #define IS_TIM_TRIGGERFILTER(ICFILTER) ((ICFILTER) <= 0xF)
Kojto 110:165afa46840b 1515
Kojto 110:165afa46840b 1516 #define IS_TIM_TI1SELECTION(TI1SELECTION) (((TI1SELECTION) == TIM_TI1SELECTION_CH1) || \
Kojto 110:165afa46840b 1517 ((TI1SELECTION) == TIM_TI1SELECTION_XORCOMBINATION))
Kojto 110:165afa46840b 1518
Kojto 110:165afa46840b 1519 #define IS_TIM_DMA_BASE(BASE) (((BASE) == TIM_DMABASE_CR1) || \
Kojto 110:165afa46840b 1520 ((BASE) == TIM_DMABASE_CR2) || \
Kojto 110:165afa46840b 1521 ((BASE) == TIM_DMABASE_SMCR) || \
Kojto 110:165afa46840b 1522 ((BASE) == TIM_DMABASE_DIER) || \
Kojto 110:165afa46840b 1523 ((BASE) == TIM_DMABASE_SR) || \
Kojto 110:165afa46840b 1524 ((BASE) == TIM_DMABASE_EGR) || \
Kojto 110:165afa46840b 1525 ((BASE) == TIM_DMABASE_CCMR1) || \
Kojto 110:165afa46840b 1526 ((BASE) == TIM_DMABASE_CCMR2) || \
Kojto 110:165afa46840b 1527 ((BASE) == TIM_DMABASE_CCER) || \
Kojto 110:165afa46840b 1528 ((BASE) == TIM_DMABASE_CNT) || \
Kojto 110:165afa46840b 1529 ((BASE) == TIM_DMABASE_PSC) || \
Kojto 110:165afa46840b 1530 ((BASE) == TIM_DMABASE_ARR) || \
Kojto 110:165afa46840b 1531 ((BASE) == TIM_DMABASE_RCR) || \
Kojto 110:165afa46840b 1532 ((BASE) == TIM_DMABASE_CCR1) || \
Kojto 110:165afa46840b 1533 ((BASE) == TIM_DMABASE_CCR2) || \
Kojto 110:165afa46840b 1534 ((BASE) == TIM_DMABASE_CCR3) || \
Kojto 110:165afa46840b 1535 ((BASE) == TIM_DMABASE_CCR4) || \
Kojto 110:165afa46840b 1536 ((BASE) == TIM_DMABASE_BDTR) || \
Kojto 110:165afa46840b 1537 ((BASE) == TIM_DMABASE_DCR) || \
Kojto 110:165afa46840b 1538 ((BASE) == TIM_DMABASE_OR))
Kojto 110:165afa46840b 1539
Kojto 110:165afa46840b 1540 #define IS_TIM_DMA_LENGTH(LENGTH) (((LENGTH) == TIM_DMABURSTLENGTH_1TRANSFER) || \
Kojto 110:165afa46840b 1541 ((LENGTH) == TIM_DMABURSTLENGTH_2TRANSFERS) || \
Kojto 110:165afa46840b 1542 ((LENGTH) == TIM_DMABURSTLENGTH_3TRANSFERS) || \
Kojto 110:165afa46840b 1543 ((LENGTH) == TIM_DMABURSTLENGTH_4TRANSFERS) || \
Kojto 110:165afa46840b 1544 ((LENGTH) == TIM_DMABURSTLENGTH_5TRANSFERS) || \
Kojto 110:165afa46840b 1545 ((LENGTH) == TIM_DMABURSTLENGTH_6TRANSFERS) || \
Kojto 110:165afa46840b 1546 ((LENGTH) == TIM_DMABURSTLENGTH_7TRANSFERS) || \
Kojto 110:165afa46840b 1547 ((LENGTH) == TIM_DMABURSTLENGTH_8TRANSFERS) || \
Kojto 110:165afa46840b 1548 ((LENGTH) == TIM_DMABURSTLENGTH_9TRANSFERS) || \
Kojto 110:165afa46840b 1549 ((LENGTH) == TIM_DMABURSTLENGTH_10TRANSFERS) || \
Kojto 110:165afa46840b 1550 ((LENGTH) == TIM_DMABURSTLENGTH_11TRANSFERS) || \
Kojto 110:165afa46840b 1551 ((LENGTH) == TIM_DMABURSTLENGTH_12TRANSFERS) || \
Kojto 110:165afa46840b 1552 ((LENGTH) == TIM_DMABURSTLENGTH_13TRANSFERS) || \
Kojto 110:165afa46840b 1553 ((LENGTH) == TIM_DMABURSTLENGTH_14TRANSFERS) || \
Kojto 110:165afa46840b 1554 ((LENGTH) == TIM_DMABURSTLENGTH_15TRANSFERS) || \
Kojto 110:165afa46840b 1555 ((LENGTH) == TIM_DMABURSTLENGTH_16TRANSFERS) || \
Kojto 110:165afa46840b 1556 ((LENGTH) == TIM_DMABURSTLENGTH_17TRANSFERS) || \
Kojto 110:165afa46840b 1557 ((LENGTH) == TIM_DMABURSTLENGTH_18TRANSFERS))
Kojto 110:165afa46840b 1558
Kojto 110:165afa46840b 1559 #define IS_TIM_IC_FILTER(ICFILTER) ((ICFILTER) <= 0xF)
Kojto 110:165afa46840b 1560 /**
Kojto 110:165afa46840b 1561 * @}
Kojto 110:165afa46840b 1562 */
Kojto 110:165afa46840b 1563
Kojto 110:165afa46840b 1564 /** @defgroup TIM_Mask_Definitions TIM Mask Definition
Kojto 110:165afa46840b 1565 * @{
Kojto 110:165afa46840b 1566 */
Kojto 110:165afa46840b 1567 /* The counter of a timer instance is disabled only if all the CCx and CCxN
Kojto 110:165afa46840b 1568 channels have been disabled */
Kojto 110:165afa46840b 1569 #define TIM_CCER_CCxE_MASK ((uint32_t)(TIM_CCER_CC1E | TIM_CCER_CC2E | TIM_CCER_CC3E | TIM_CCER_CC4E))
Kojto 110:165afa46840b 1570 #define TIM_CCER_CCxNE_MASK ((uint32_t)(TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE))
Kojto 110:165afa46840b 1571 /**
Kojto 110:165afa46840b 1572 * @}
Kojto 110:165afa46840b 1573 */
Kojto 110:165afa46840b 1574
Kojto 110:165afa46840b 1575 /**
Kojto 110:165afa46840b 1576 * @}
Kojto 110:165afa46840b 1577 */
Kojto 110:165afa46840b 1578
Kojto 110:165afa46840b 1579 /* Private functions ---------------------------------------------------------*/
Kojto 110:165afa46840b 1580 /** @defgroup TIM_Private_Functions TIM Private Functions
Kojto 110:165afa46840b 1581 * @{
Kojto 110:165afa46840b 1582 */
Kojto 110:165afa46840b 1583 void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure);
Kojto 110:165afa46840b 1584 void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, uint32_t TIM_ICFilter);
Kojto 110:165afa46840b 1585 void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config);
Kojto 110:165afa46840b 1586 void TIM_DMADelayPulseCplt(DMA_HandleTypeDef *hdma);
Kojto 110:165afa46840b 1587 void TIM_DMAError(DMA_HandleTypeDef *hdma);
Kojto 110:165afa46840b 1588 void TIM_DMACaptureCplt(DMA_HandleTypeDef *hdma);
Kojto 110:165afa46840b 1589 void TIM_CCxChannelCmd(TIM_TypeDef* TIMx, uint32_t Channel, uint32_t ChannelState);
Kojto 110:165afa46840b 1590 /**
Kojto 110:165afa46840b 1591 * @}
Kojto 110:165afa46840b 1592 */
Kojto 110:165afa46840b 1593
Kojto 110:165afa46840b 1594 /**
Kojto 110:165afa46840b 1595 * @}
Kojto 110:165afa46840b 1596 */
Kojto 110:165afa46840b 1597
Kojto 110:165afa46840b 1598 /**
Kojto 110:165afa46840b 1599 * @}
Kojto 110:165afa46840b 1600 */
Kojto 110:165afa46840b 1601
Kojto 110:165afa46840b 1602 #ifdef __cplusplus
Kojto 110:165afa46840b 1603 }
Kojto 110:165afa46840b 1604 #endif
Kojto 110:165afa46840b 1605
Kojto 110:165afa46840b 1606 #endif /* __STM32F4xx_HAL_TIM_H */
Kojto 110:165afa46840b 1607
Kojto 110:165afa46840b 1608 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/