File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 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)
10861086 return __HAL_TIM_GET_COMPARE (& (obj -> handle ), channel );
10871087}
10881088
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+
10891100/**
10901101 * @brief Attached an interrupt handler
10911102 * @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);
214214void setTimerCounter (stimer_t * obj , uint32_t value );
215215void setCCRRegister (stimer_t * obj , uint32_t channel , uint32_t value );
216216uint32_t getCCRRegister (stimer_t * obj , uint32_t channel );
217+ void setTimerPrescalerRegister (stimer_t * obj , uint32_t prescaler );
217218
218219uint32_t getTimerIrq (TIM_TypeDef * tim );
219220uint8_t getTimerClkSrc (TIM_TypeDef * tim );
You can’t perform that action at this time.
0 commit comments