36
36
#define TIMER_CHANNELS 4 // channel5 and channel 6 are not considered here has they don't have gpio output and they don't have interrupt
37
37
38
38
typedef enum {
39
- TIMER_DISABLED, // == TIM_OCMODE_TIMING no output, useful for only-interrupt
39
+ TIMER_OUTPUT_DISABLED, // == TIM_OCMODE_TIMING no output, useful for only-interrupt
40
40
// Output Compare
41
- TIMER_OUTPUT_COMPARE, // == Obsolete, use TIMER_DISABLED instead. Kept for compatibility reason
42
41
TIMER_OUTPUT_COMPARE_ACTIVE, // == TIM_OCMODE_ACTIVE pin is set high when counter == channel compare
43
42
TIMER_OUTPUT_COMPARE_INACTIVE, // == TIM_OCMODE_INACTIVE pin is set low when counter == channel compare
44
43
TIMER_OUTPUT_COMPARE_TOGGLE, // == TIM_OCMODE_TOGGLE pin toggles when counter == channel compare
@@ -60,6 +59,10 @@ typedef enum {
60
59
TIMER_NOT_USED = 0xFFFF // This must be the last item of this enum
61
60
} TimerModes_t;
62
61
62
+ // Backward compatibility
63
+ #define TIMER_DISABLED TIMER_OUTPUT_DISABLED
64
+ #define TIMER_OUTPUT_COMPARE TIMER_OUTPUT_DISABLED
65
+
63
66
typedef enum {
64
67
TICK_FORMAT, // default
65
68
MICROSEC_FORMAT,
@@ -177,10 +180,10 @@ class HardwareTimer {
177
180
178
181
// The following function(s) are available for more advanced timer options
179
182
TIM_HandleTypeDef *getHandle (); // return the handle address for HAL related configuration
180
- int getChannel (uint32_t channel);
181
- int getLLChannel (uint32_t channel);
182
- int getIT (uint32_t channel);
183
- int getAssociatedChannel (uint32_t channel);
183
+ uint32_t getChannel (uint32_t channel);
184
+ uint32_t getLLChannel (uint32_t channel);
185
+ uint32_t getIT (uint32_t channel);
186
+ uint32_t getAssociatedChannel (uint32_t channel);
184
187
185
188
private:
186
189
// Store for each channel if regular, complementary or both are used
0 commit comments