Reading through the "PWM how to do it yourself" page, what is described is a software approach.
Is analogWrite(pin, level, {freq:}) the high-level interface to STM32 hardware PWM? I.e., control of frequency via the options parameter, and duty cycle via the level/value parameter?
So, a 1000Hz, 25% duty-cycle waveform is produced, entirely without any code running but simply via the hardware (after Espruino sets it up from the analogWrite call) with analogWrite(pin, 0.25, {freq:1000})? Once done on a board that supports hardware PWM, like the Pico, the MCU is generating that waveform all on its own, the Espruino main loop just idling, right?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Reading through the "PWM how to do it yourself" page, what is described is a software approach.
Is analogWrite(pin, level, {freq:}) the high-level interface to STM32 hardware PWM? I.e., control of frequency via the options parameter, and duty cycle via the level/value parameter?
So, a 1000Hz, 25% duty-cycle waveform is produced, entirely without any code running but simply via the hardware (after Espruino sets it up from the analogWrite call) with analogWrite(pin, 0.25, {freq:1000})? Once done on a board that supports hardware PWM, like the Pico, the MCU is generating that waveform all on its own, the Espruino main loop just idling, right?