Files
wideband/firmware/pwm.h
Matthew Kennedy ca50ee30f0 format IO
2026-04-10 13:35:51 -07:00

26 lines
449 B
C++

#pragma once
#include <cstdint>
/* for PWMConfig */
#include "hal.h"
struct PWMDriver;
class Pwm
{
public:
Pwm(PWMDriver& driver);
void Start(const PWMConfig& config);
void SetDuty(int channel, float duty);
float GetLastDuty(int channel);
private:
PWMDriver* const m_driver;
// const uint8_t m_channel;
/* const */ uint32_t m_counterFrequency;
/* const */ uint16_t m_counterPeriod;
float m_dutyFloat[4];
};