C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
PWMgatedMeasure Class Reference

the PWM function used to measure time during which the signal on the channel B as input is HI. More...

#include <hw_pwm.h>

Collaboration diagram for PWMgatedMeasure:
Collaboration graph

Public Member Functions

 PWMgatedMeasure (uint pin_gate, uint resolution_ns, uint measure_duration_us)
 Construct a new PWMgatedMeasure object.
 
float measure_duty_cycle ()
 compute the time the channel B is HI over the time of observation
 
uint16_t count_cycles ()
 gives the number of step while the signal on channel B is HI
 

Detailed Description

the PWM function used to measure time during which the signal on the channel B as input is HI.

Constructor & Destructor Documentation

◆ PWMgatedMeasure()

PWMgatedMeasure::PWMgatedMeasure ( uint pin_gate,
uint resolution_ns,
uint measure_duration_us )

Construct a new PWMgatedMeasure object.

Parameters
pin_gatemust be the channel B of a slice
resolution_nsthe minimum time slot as measure LSB. min = 8ns < step_ns < max = 256 * 8ns = ca 2us
measure_duration_usthe observation duration

Member Function Documentation

◆ count_cycles()

uint16_t PWMgatedMeasure::count_cycles ( )

gives the number of step while the signal on channel B is HI

Returns
uint16_t
Here is the caller graph for this function:

◆ measure_duty_cycle()

float PWMgatedMeasure::measure_duty_cycle ( )

compute the time the channel B is HI over the time of observation

Returns
float
Here is the call graph for this function:

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