|
ELEC-C7222
Libraries for ELEC C7222 Course Work
|
Simple PWM output wrapper with period and duty cycle configuration. More...


Go to the source code of this file.
Classes | |
| class | c7222::PwmOut |
| Output-only PWM wrapper with period and duty configuration. More... | |
| struct | c7222::PwmOut::Config |
| Configuration structure for PWM output setup. More... | |
Namespaces | |
| namespace | c7222 |
| C7222 course abstractions namespace. | |
Simple PWM output wrapper with period and duty cycle configuration.
This class provides a minimal PWM interface focused on:
Platform-specific behavior (Pico):
PwmOut objects for the same pin asserts in debug builds.Enable(false)), the pin function is returned to GPIO_FUNC_SIO so it can be used as a normal GPIO again.GPIO_FUNC_SIO and ownership is released.Edge cases and usage notes:
Led) at the same time. To switch from PWM to LED control, call Enable(false) (or destroy the PwmOut) before constructing a Led on the same pin.Enable(true) or Configure(...) to reapply the PWM configuration.Example: basic PWM output
Example: release PWM and reconfigure LED on same pin