summaryrefslogtreecommitdiffstatshomepage
path: root/docs/library
diff options
context:
space:
mode:
authorHoward Lovatt <howard.lovatt@gmail.com>2020-10-10 08:35:50 +1100
committerDamien George <damien@micropython.org>2022-06-21 14:22:50 +1000
commit89e1e67748e681da5f414dc597e89eaee8822817 (patch)
treeafe92b6f90f629a85ceac6750154167095af005b /docs/library
parenta565811f23c675ccbeed636c065828cdaf5fa96a (diff)
downloadmicropython-89e1e67748e681da5f414dc597e89eaee8822817.tar.gz
micropython-89e1e67748e681da5f414dc597e89eaee8822817.zip
docs/library/pyb.Timer: Document `brk` argument and its constants.
Diffstat (limited to 'docs/library')
-rw-r--r--docs/library/pyb.Timer.rst14
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/library/pyb.Timer.rst b/docs/library/pyb.Timer.rst
index cc7a01f580..639ae1dcd1 100644
--- a/docs/library/pyb.Timer.rst
+++ b/docs/library/pyb.Timer.rst
@@ -62,7 +62,7 @@ Constructors
Methods
-------
-.. method:: Timer.init(*, freq, prescaler, period, mode=Timer.UP, div=1, callback=None, deadtime=0)
+.. method:: Timer.init(*, freq, prescaler, period, mode=Timer.UP, div=1, callback=None, deadtime=0, brk=Timer.BRK_OFF)
Initialise the timer. Initialisation must be either by frequency (in Hz)
or by prescaler and period::
@@ -107,6 +107,12 @@ Methods
measures ticks of ``source_freq`` divided by ``div`` clock ticks.
``deadtime`` is only available on timers 1 and 8.
+ - ``brk`` - specifies if the break mode is used to kill the output of
+ the PWM when the ``BRK_IN`` input is asserted. The value of this
+ argument determines if break is enabled and what the polarity is, and
+ can be one of ``Timer.BRK_OFF``, ``Timer.BRK_LOW`` or
+ ``Timer.BRK_HIGH``.
+
You must either specify freq or both of period and prescaler.
.. method:: Timer.deinit()
@@ -271,3 +277,9 @@ Constants
Timer.CENTER
Configures the timer to count Up, Down, or from 0 to ARR and then back down to 0.
+
+.. data:: Timer.BRK_OFF
+ Timer.BRK_LOW
+ Timer.BRK_HIGH
+
+ Configures the break mode when passed to the ``brk`` keyword argument.