|
Pico-Arduino
|
This is an even more powerfull PWM API where we can specify a user defined input range and the cycle frequency in hz. More...
#include <PicoPWM.h>
Public Member Functions | |
| PicoPWM (uint64_t frequency, uint64_t maxValue) | |
| Default constructor. | |
| ~PicoPWM () | |
| Destructor. | |
| void | begin (pin_size_t pin, PinMode pinMode=OUTPUT) |
| setup a pin for pwm read or write | |
| void | begin (pin_size_t pin, uint64_t initalValue) |
| setup a pin for pwm write | |
| void | end (pin_size_t pin) |
| sets the pin to low | |
| uint64_t | frequency () |
| Provides the frequncy in hz which was specified in the constructor. | |
| uint64_t | period () |
| Provides the full cycle period in nanoseconds. | |
| uint64_t | read (pin_size_t pin) |
| Reads the active period in the value range from 0 to maxValue. | |
| float | readPercent (pin_size_t pin) |
| Provides the duty cyle in percent. | |
| void | write (pin_size_t pin, uint64_t value) |
| Defines the active period in the value range from 0 to maxValue. | |
Protected Member Functions | |
| uint64_t | dutyCycleToValue (uint64_t dutyCycle) |
| uint64_t | valueToDutyCycle (uint64_t value) |
| converts an input value to the duty cycle in nanosec | |
Protected Attributes | |
| int64_t | max_value |
| PicoPWMNano * | nano |
| uint64_t | period_nano_sec |
This is an even more powerfull PWM API where we can specify a user defined input range and the cycle frequency in hz.