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