Skip to content

Commit 89e1e67

Browse files
hlovattdpgeorge
authored andcommitted
docs/library/pyb.Timer: Document brk argument and its constants.
1 parent a565811 commit 89e1e67

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Diff for: docs/library/pyb.Timer.rst

+13-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Constructors
6262
Methods
6363
-------
6464

65-
.. method:: Timer.init(*, freq, prescaler, period, mode=Timer.UP, div=1, callback=None, deadtime=0)
65+
.. method:: Timer.init(*, freq, prescaler, period, mode=Timer.UP, div=1, callback=None, deadtime=0, brk=Timer.BRK_OFF)
6666

6767
Initialise the timer. Initialisation must be either by frequency (in Hz)
6868
or by prescaler and period::
@@ -107,6 +107,12 @@ Methods
107107
measures ticks of ``source_freq`` divided by ``div`` clock ticks.
108108
``deadtime`` is only available on timers 1 and 8.
109109

110+
- ``brk`` - specifies if the break mode is used to kill the output of
111+
the PWM when the ``BRK_IN`` input is asserted. The value of this
112+
argument determines if break is enabled and what the polarity is, and
113+
can be one of ``Timer.BRK_OFF``, ``Timer.BRK_LOW`` or
114+
``Timer.BRK_HIGH``.
115+
110116
You must either specify freq or both of period and prescaler.
111117

112118
.. method:: Timer.deinit()
@@ -271,3 +277,9 @@ Constants
271277
Timer.CENTER
272278

273279
Configures the timer to count Up, Down, or from 0 to ARR and then back down to 0.
280+
281+
.. data:: Timer.BRK_OFF
282+
Timer.BRK_LOW
283+
Timer.BRK_HIGH
284+
285+
Configures the break mode when passed to the ``brk`` keyword argument.

0 commit comments

Comments
 (0)