Support for the generation of PWM signals. For the standard Arduino functionality we use on fixed frequency (defined in the constructor). If you use this API you can define separate frequencies per slice by creating separate instances. More...
#include <PicoPWM.h>
Public Member Functions | |
PicoPWMWriter (uint64_t periodNanoSeconds) | |
Constructor: Defines the length of a full cycle in nanoseconds (mio of seconds) | |
void | begin (pin_size_t pinNumber, uint64_t initialDutyCyleNanoSeconds=0) |
setup a pin for pwm write | |
void | end (pin_size_t pin) |
sets the pin to low | |
float | frequency () |
converts the PWM period to hz | |
float | frequencyTick () |
uint64_t | period () |
provides the full cycle period in nanoseconds | |
float | periodTick () |
void | setDutyCycle (pin_size_t pin, uint64_t dutyCyleNanoSeconds) |
Defines the active period is nanoseconds. | |
virtual void | setupPin (PinInfo *info, pin_size_t pinNumber) |
setup of pin for PWM Output | |
Public Member Functions inherited from pico_arduino::PinSetup | |
virtual bool | usePin (PinInfo *info, pin_size_t pin) |
Protected Member Functions | |
void | logConfig (uint32_t sys_clock_freq, float dividerTick, uint16_t wrap) |
bool | setupConfig () |
provides the configuration - returns true if we have a new configuration | |
Protected Attributes | |
pwm_config | config |
uint64_t | initial_duty_cycle |
bool | is_config_done = false |
uint64_t | period_nano_sec |
PinMode | pin_mode |
PicoPinFunction | pinFunction = PicoPinFunction::instance() |
float | tick_period_nano_sec |
Support for the generation of PWM signals. For the standard Arduino functionality we use on fixed frequency (defined in the constructor). If you use this API you can define separate frequencies per slice by creating separate instances.