Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys/ztimer: make use of periph_timer_query_freqs #20582

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Apr 15, 2024

  1. drivers/periph_timer: add timer_get_closest_freq

    Add an API to search for the frequency supported by a timer that
    is closest to the given target frequency.
    
    This is in fact non-trivial to get right, as pre-scaler registers can
    be 16 bit or even 32 bit in size, making a naive loop over all possible
    pre-scalers too expensive (computationally).
    maribu committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    027147b View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. Configuration menu
    Copy the full SHA
    555ab6a View commit details
    Browse the repository at this point in the history
  2. sys/ztimer: make use of periph_timer_query_freqs

    This makes use of the `periph_timer_query_freqs` feature:
    
    1. It does choose the closest frequency supported before calling
       timer_init() in the ztimer_periph_timer backend.
    2. It does make use of the actually chosen frequency when using
       `ztimer_convert_frac`.
    3. It does `assert()` the frequency is within 5% of the specified when
       no frequency conversion is performed or `ztimer_convert_shift_up`
       is used.
    maribu committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    889c261 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4933b9b View commit details
    Browse the repository at this point in the history