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