File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1086,6 +1086,17 @@ uint32_t getCCRRegister(stimer_t *obj, uint32_t channel)
1086
1086
return __HAL_TIM_GET_COMPARE (& (obj -> handle ), channel );
1087
1087
}
1088
1088
1089
+ /**
1090
+ * @brief Set the TIM Capture Compare Register value.
1091
+ * @param timer_id : id of the timer
1092
+ * @param prescaler : prescaler value to set for this timer.
1093
+ * @retval None
1094
+ */
1095
+ void setTimerPrescalerRegister (stimer_t * obj , uint32_t prescaler )
1096
+ {
1097
+ __HAL_TIM_SET_PRESCALER (& (obj -> handle ), prescaler );
1098
+ }
1099
+
1089
1100
/**
1090
1101
* @brief Attached an interrupt handler
1091
1102
* @param timer_id : id of the timer
Original file line number Diff line number Diff line change @@ -214,6 +214,7 @@ uint32_t getTimerCounter(stimer_t *obj);
214
214
void setTimerCounter (stimer_t * obj , uint32_t value );
215
215
void setCCRRegister (stimer_t * obj , uint32_t channel , uint32_t value );
216
216
uint32_t getCCRRegister (stimer_t * obj , uint32_t channel );
217
+ void setTimerPrescalerRegister (stimer_t * obj , uint32_t prescaler );
217
218
218
219
uint32_t getTimerIrq (TIM_TypeDef * tim );
219
220
uint8_t getTimerClkSrc (TIM_TypeDef * tim );
You can’t perform that action at this time.
0 commit comments