You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#defineTIMER_CHANNELS4// channel5 and channel 6 are not considered here has they don't have gpio output and they don't have interrupt
38
39
@@ -113,6 +114,14 @@ typedef enum {
113
114
FILTER_DTS32_N8, // Sampling rate is DTS/32, n=8 events
114
115
} ChannelInputFilter_t;
115
116
117
+
typedefenum {
118
+
DISABLE_IT, // default
119
+
ENABLE_IT,
120
+
CLEAR_IT,
121
+
CLEAR_AND_ENABLE_IT,
122
+
IS_ENABLE_IT,
123
+
} ChannelITConfig_t;
124
+
116
125
#ifdef __cplusplus
117
126
118
127
#include<functional>
@@ -171,19 +180,29 @@ class HardwareTimer {
171
180
172
181
uint32_tgetTimerClkFreq(); // return timer clock frequency in Hz.
173
182
183
+
#if defined(USE_HALV2_DRIVER)
184
+
staticvoidcaptureCompareCallback(hal_tim_handle_t *htim, hal_tim_channel_t hal_channel); // Generic Capture and Compare callback which will call user callback
185
+
staticvoidupdateCallback(hal_tim_handle_t *htim); // Generic Update (rollover) callback which will call user callback
186
+
#else
174
187
staticvoidcaptureCompareCallback(TIM_HandleTypeDef *htim); // Generic Capture and Compare callback which will call user callback
175
188
staticvoidupdateCallback(TIM_HandleTypeDef *htim); // Generic Update (rollover) callback which will call user callback
176
-
189
+
#endif
177
190
voidupdateRegistersIfNotRunning(TIM_TypeDef *TIMx); // Take into account registers update immediately if timer is not running,
178
191
179
192
boolisRunning(); // return true if HardwareTimer is running
180
193
boolisRunningChannel(uint32_t channel); // return true if channel is running
181
194
182
195
// The following function(s) are available for more advanced timer options
196
+
#if defined(USE_HALV2_DRIVER)
197
+
hal_tim_handle_t *getHandle(); // return the handle address for HAL related configuration
198
+
hal_tim_channel_tgetChannel(uint32_t channel);
199
+
#else
183
200
TIM_HandleTypeDef *getHandle(); // return the handle address for HAL related configuration
0 commit comments