annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_hal_tim.h @ 112:fdf0272e9213 FlipDisplay

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