aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2023-05-22 15:15:13 +0300
committerPetri Savolainen <petri.savolainen@nokia.com>2023-06-08 11:05:46 +0300
commita94dd9160c9f8d30d2eec45fe11a65e5d8adf2e8 (patch)
tree42ce49252593acb3be278a3a19b6ab499d8e32fd
parentb6db9f2bcf367e3a18051360d8b4d7ab0f767760 (diff)
api: timer: clarify base frequency format
Clarify that periodic timer base frequency uses fractional numbers the same way as timer tick info (odp_timer_tick_info_t). Integer part specifies full hertz and fractional part specifies parts of a hertz. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Shijith Thotton <sthotton@marvell.com>
-rw-r--r--include/odp/api/spec/timer_types.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/odp/api/spec/timer_types.h b/include/odp/api/spec/timer_types.h
index 933e3fd87..97b548116 100644
--- a/include/odp/api/spec/timer_types.h
+++ b/include/odp/api/spec/timer_types.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2019-2022, Nokia
+ * Copyright (c) 2019-2023, Nokia
*
* All rights reserved.
*
@@ -102,7 +102,15 @@ typedef struct {
* Periodic timer capability
*/
typedef struct {
- /** Periodic timer pool base frequency in hertz */
+ /**
+ * Periodic timer pool base frequency in hertz
+ *
+ * Base frequency is represented as a fractional number where the fraction part is always
+ * less than one. In other words, the integer part specifies whole hertz whereas
+ * the fraction part specifies parts of a hertz (if any). The fraction part does not
+ * need to be reduced to its lowest terms - e.g. 100.5 Hz may be represented as 100 1/2 Hz,
+ * 100 5/10 Hz, or 100 Hz with some other equivalent fraction part.
+ */
odp_fract_u64_t base_freq_hz;
/** Maximum base frequency multiplier */
@@ -358,7 +366,9 @@ typedef struct {
* Use odp_timer_periodic_capability() to check base frequency support,
* and resulting max_multiplier and resolution values.
*
- * The default value is zero.
+ * Fraction part of the value is always less than one, see
+ * odp_timer_periodic_capability_t::base_freq_hz for details. The default value
+ * is zero.
*
* An example with two timer frequencies:
* base_freq_hz.integer = 33333, .numer = 1, .denom = 3