samd/machine_pwm: Add init() method to PWM and simplify the PWM code.

The PWM.init() method has been added.  Calling init() without arguments
restarts a PWM channel stopped with deinit().  Otherwise single parameters
except for "device=n" can be changed again.  The device can only be
specified once, either in the constructor or the first init() call.

Also simplify get_pwm_config() and get_adc_config(), and shrink the PWM
object.
This commit is contained in:
robert-hh
2023-02-24 14:51:36 +01:00
committed by Damien George
parent 9c7ad68165
commit 250757716a
4 changed files with 118 additions and 136 deletions

View File

@@ -191,7 +191,7 @@ It supports all basic methods listed for that class. ::
PWM Constructor
```````````````
.. class:: PWM(dest, freq, duty_u16, duty_ns, *, invert, device)
.. class:: PWM(dest, *, freq, duty_u16, duty_ns, invert, device)
:noindex:
Construct and return a new PWM object using the following parameters: