annotate f103c8/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h @ 4:ca4f5b55b391

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