Closed
Description
Since we talked about PWM:
It seems that the ports behave different with respect to PWM. The esp32 and mimxrt ports start as soon as the PWM object is instantiated, albeit with different frequencies. The rp2, SAMD and ESP8266 ports for instance require frequency an duty cycle to be set for providing output. The nrf implementation looks kind of broken, being not able to change frequency or period and requiring period to be set even if freq was provided. No machine.PWM at the STM32 port. Not to forget the little things like no keyword arguments at the RP2 PWM constructor. Seems it's time to tidy up things. I can work on that topic, but first of all we should agree on a behavior. So the kind of common behavior would be:
- No output until freq (or period) and duty cycle are set.
- The constructor accepts keyword arguments.
- deinit() stops the PWM but does not release the PWM object, and init() or setting a new freq/duty cycle restarts it again.
Fix the nrf port.Looks too strange.- Adapt the quickref doc examples to set freq and duty_u16.