#pragma once
#include <Arduino.h>

struct ActualPwm { uint32_t requestedHz; uint32_t actualHz; float actualDutyPct; uint8_t bits; };

class PwmGenerator {
 public:
  void begin();
  bool start(uint32_t frequencyHz, uint8_t dutyPct, ActualPwm &actual);
  void stop();
  bool running() const { return running_; }
 private:
  bool running_ = false;
};
