Anyone know what BRK_OFF etc. in Timer do?

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
hlovatt
Posts: 68
Joined: Thu Aug 15, 2019 3:52 am
Location: Sydney

Anyone know what BRK_OFF etc. in Timer do?

Post by hlovatt » Fri Jul 03, 2020 1:59 am

Hi,

Does anyone know what BRK_OFF, BRK_LOW, and BRK_HIGH do in the Timer class, they are undocumented? To which methods are they arguments?

Thanks,

Howard.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Anyone know what BRK_OFF etc. in Timer do?

Post by jimmo » Fri Jul 03, 2020 5:48 am

hlovatt wrote:
Fri Jul 03, 2020 1:59 am
Does anyone know what BRK_OFF, BRK_LOW, and BRK_HIGH do in the Timer class, they are undocumented? To which methods are they arguments?
From stm32/timer.c -- it applies to both timer.init() and the Timer() constructor.

Code: Select all

///   - `brk` - specifies if the break mode is used to kill the output of
///       the PWM when the BRK_IN input is asserted. The polarity set how the
///       BRK_IN input is triggered. It can be set to `BRK_OFF`, `BRK_LOW`
///       and `BRK_HIGH`.
For some historical context here, originally the stm32 documentation was generated automatically from these comments in the code. At some point instead the docs started being maintained separately, so these comments pre-date that. It looks like when the break mode support was added, it was mistakenly documented inline but not explicitly in the docs for pyb.Timer.

These old inline documentation comments should really be deleted I think...


hlovatt
Posts: 68
Joined: Thu Aug 15, 2019 3:52 am
Location: Sydney

Re: Anyone know what BRK_OFF etc. in Timer do?

Post by hlovatt » Fri Jul 03, 2020 6:11 am

Thanks, have submitted a pull request.

Post Reply