From 89e1e67748e681da5f414dc597e89eaee8822817 Mon Sep 17 00:00:00 2001 From: Howard Lovatt Date: Sat, 10 Oct 2020 08:35:50 +1100 Subject: [PATCH] docs/library/pyb.Timer: Document `brk` argument and its constants. --- docs/library/pyb.Timer.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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.