From 871ea468993d8caf98cd51ae342af47daca53796 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 10 Jan 2016 23:54:34 +0200 Subject: [PATCH] Timer: frequency keyword is "freq", 2 mandatory modes are PERIODIC and ONESHOT. --- Hardware-API.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Hardware-API.md b/Hardware-API.md index 28d8572..b75e2ea 100644 --- a/Hardware-API.md +++ b/Hardware-API.md @@ -370,7 +370,9 @@ The `Timer` class provide access to the hardware timers of the SoC. It allows to Constructor: -`timer = Timer(id, mode=Timer.PERIODIC, *, frequency, period_ns, counter_config=(prescaler, period_counts))` +`timer = Timer(id, mode=Timer.PERIODIC, *, freq, period_ns, counter_config=(prescaler, period_counts))` + +* mode: mandatory values: Timer.PERIODIC, Timer.ONESHOT, other: hardware-specific, subject to further standardization. Since timers are used for various applications, many of which require high accuracy, having 3 ways of setting the timer frequency (freq itself, period in us or ns, and period in timer counts together with the prescaler) it's important. Having period in time units also helps readability and ease of use. @@ -389,7 +391,7 @@ Timer methods: - `timer.init()` re-init. - `timer.deinit()` disables the Timer and all it's channels. - `timer.counter()` gets or sets the value of the timer counter. -- `timer.time()` gets or sets the current timer time (in ns or us, TBD). Only makes sense in PERIODIC or ONE_SHOT_MODE. +- `timer.time()` gets or sets the current timer time (in ns or us, TBD). Only makes sense in PERIODIC or ONESHOT. - `timer.period()` gets or sets the timer period in ns or us. - `timer.counter_config()` gets or sets the `(prescaler, period_counts)` tuple. - `timer.frequency()` gets or sets the timer frequency/frequencies.