Browse Source

docs/library/pyb.Timer: Document `brk` argument and its constants.

pull/9310/head
Howard Lovatt 4 years ago
committed by Damien George
parent
commit
89e1e67748
  1. 14
      docs/library/pyb.Timer.rst

14
docs/library/pyb.Timer.rst

@ -62,7 +62,7 @@ Constructors
Methods 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) Initialise the timer. Initialisation must be either by frequency (in Hz)
or by prescaler and period:: or by prescaler and period::
@ -107,6 +107,12 @@ Methods
measures ticks of ``source_freq`` divided by ``div`` clock ticks. measures ticks of ``source_freq`` divided by ``div`` clock ticks.
``deadtime`` is only available on timers 1 and 8. ``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. You must either specify freq or both of period and prescaler.
.. method:: Timer.deinit() .. method:: Timer.deinit()
@ -271,3 +277,9 @@ Constants
Timer.CENTER Timer.CENTER
Configures the timer to count Up, Down, or from 0 to ARR and then back down to 0. 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.

Loading…
Cancel
Save