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

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

#include <PicoPWM.h>

Inheritance diagram for pico_arduino::PicoPWMReader:
pico_arduino::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
 
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
 
virtual void setupPin (PinInfo *info, pin_size_t pinNumber)
 setup of pin for PWM Input
 
- Public Member Functions inherited from pico_arduino::PinSetup
virtual bool usePin (PinInfo *info, pin_size_t pin)
 

Protected Member Functions

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

Protected Attributes

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

Detailed Description

PWM class which supports the input of PWM signals.

Constructor & Destructor Documentation

◆ PicoPWMReader()

pico_arduino::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: