Pico-Arduino
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PicoPWMReader Class Reference

PWM class which supports the input of PWM signals. More...

#include <PicoPWM.h>

Inheritance diagram for PicoPWMReader:
PinSetup

Public Member Functions

 PicoPWMReader (uint64_t periodNanoSeconds)
 Constructor: Defines the length of a full cycle in nanoseconds (mio of seconds). This is used as mesurement period. More...
 
void begin (pin_size_t pinNumber)
 setup a pin for pwm write
 
virtual void setupPin (PinInfo *info, pin_size_t pinNumber)
 setup of pin for PWM Input
 
void end (pin_size_t pin)
 sets the pin to low
 
uint64_t measureDutyCycle (uint gpio)
 measures the duty cycle (active period) in nanoseconds - only the PWM B pins can be used as inputs!
 
float measureDutyCyclePercent (uint gpio)
 provides the duty cycle in percent
 
uint64_t period ()
 provides the full cycle period in nanoseconds
 
- Public Member Functions inherited from PinSetup
virtual bool usePin (PinInfo *info, pin_size_t pin)
 

Protected Member Functions

bool setupConfig ()
 provides the configuration - returns true if we have a new configuration
 
void logConfig (uint32_t sys_clock_freq, uint16_t wrap)
 
uint64_t count (uint slice_num, int repeat)
 

Protected Attributes

PicoPinFunction pinFunction = PicoPinFunction::instance()
 
PinMode pin_mode
 
pwm_config config
 
uint64_t period_nano_sec
 
uint64_t max_ticks_per_period
 
float tick_period_nano_sec
 
bool is_config_done = false
 

Detailed Description

PWM class which supports the input of PWM signals.

Constructor & Destructor Documentation

◆ PicoPWMReader()

PicoPWMReader::PicoPWMReader ( uint64_t  periodNanoSeconds)
inline

Constructor: Defines the length of a full cycle in nanoseconds (mio of seconds). This is used as mesurement period.

Parameters
periodNanoSeconds

The documentation for this class was generated from the following file: