@@ -26,12 +26,14 @@ class TimerF4xx final : public Timer {
2626 * @param[in] timerPeripheral the timer peripheral to use.
2727 * @param[in] clockPeriod the clock period in ticks (ms when using AUTO_PRESCALER). An interrupt will be triggered
2828 * at this frequency.
29- * @param[in] configuration the configuration tells the timer how to configure itself. Defaults to @ref TimerF4xx::defaultConfig.
29+ * @param[in] configuration the configuration tells the timer how to configure itself. Defaults to @ref
30+ * TimerF4xx::defaultConfig.
3031 * @param[in] clockPrescaler the prescaler that the clock will use. If clockPrescaler is set to @ref AUTO_PRESCALER,
3132 * this function will calculate its own prescaler value.
3233 */
33- explicit TimerF4xx (TIM_TypeDef* timerPeripheral, uint32_t clockPeriod, const TimerConfiguration_t& configuration = defaultConfig,
34- uint32_t clockPrescaler = AUTO_PRESCALER );
34+ explicit TimerF4xx (TIM_TypeDef* timerPeripheral, uint32_t clockPeriod,
35+ const TimerConfiguration_t& configuration = defaultConfig,
36+ uint32_t clockPrescaler = AUTO_PRESCALER );
3537
3638 /* *
3739 * Starts the given timer and registers the given interrupt pointer to trigger when the timer overflows
@@ -65,6 +67,7 @@ class TimerF4xx final : public Timer {
6567 * own prescaler.
6668 */
6769 void setPeriod (uint32_t clockPeriod, uint32_t clockPrescaler = AUTO_PRESCALER ) override ;
70+
6871protected:
6972 /* *
7073 * Pointer to the halTimer struct stored in the global array in Timerf4xx.cpp
@@ -91,15 +94,14 @@ class TimerF4xx final : public Timer {
9194 * this function will calculate its own prescaler value.
9295 */
9396 void initTimer (TIM_TypeDef* timerPeripheral, uint32_t clockPeriod, uint32_t clockPrescaler);
97+
9498private:
95- static constexpr TimerConfiguration_t defaultConfig = {
96- TIM_COUNTERMODE_UP ,
97- TIM_CLOCKDIVISION_DIV1 ,
98- TIM_AUTORELOAD_PRELOAD_ENABLE ,
99- TIM_CLOCKSOURCE_INTERNAL ,
100- TIM_TRGO_RESET ,
101- TIM_MASTERSLAVEMODE_DISABLE
102- };
99+ static constexpr TimerConfiguration_t defaultConfig = {TIM_COUNTERMODE_UP ,
100+ TIM_CLOCKDIVISION_DIV1 ,
101+ TIM_AUTORELOAD_PRELOAD_ENABLE ,
102+ TIM_CLOCKSOURCE_INTERNAL ,
103+ TIM_TRGO_RESET ,
104+ TIM_MASTERSLAVEMODE_DISABLE };
103105};
104106} // namespace core::dev
105107
0 commit comments