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:
Wed Apr 13 12:29:27 2016 +0000
Revision:
120:2eb10e18b8d7
Parent:
116:c0f6e94411f5
V1.1

Who changed what in which revision?

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