gptimer: add API to get captured count value

This commit is contained in:
morris
2022-07-13 13:17:32 +08:00
parent e06c230a1d
commit 995b89fbb6
15 changed files with 171 additions and 86 deletions

View File

@@ -22,3 +22,9 @@ void timer_hal_set_counter_value(timer_hal_context_t *hal, uint64_t load_val)
// restore the previous reload value
timer_ll_set_reload_value(hal->dev, hal->timer_id, old_reload);
}
uint64_t timer_hal_capture_and_get_counter_value(timer_hal_context_t *hal)
{
timer_ll_trigger_soft_capture(hal->dev, hal->timer_id);
return timer_ll_get_counter_value(hal->dev, hal->timer_id);
}