driver: fix timer driver initialization sequence to not trigger interrupt immediately

add timer_hal_reset_periph()
fix timer_init() to reset timer counter during init
This commit is contained in:
Alex Lisitsyn
2021-09-16 19:45:33 +08:00
parent dc71fa895d
commit c5d0d89508
4 changed files with 55 additions and 4 deletions

View File

@@ -59,6 +59,15 @@ void timer_hal_init(timer_hal_context_t *hal, timer_group_t group_num, timer_idx
*/
void timer_hal_get_status_reg_mask_bit(timer_hal_context_t *hal, uint32_t *status_reg, uint32_t *mask_bit);
/**
* @brief Reset timer peripheral
*
* @param hal Context of the HAL layer
*
* @return None
*/
void timer_hal_reset_periph(timer_hal_context_t *hal);
/**
* @brief Set timer clock prescale value
*