RISC-V/V203/pwm/generator.h

15 lines
431 B
C
Raw Permalink Normal View History

2024-05-07 15:50:51 +02:00
#ifndef GENERATOR_H
#define GENERATOR_H
#include "oneway.h"
/* Něco jako DDS, přesná frekvence není řešena (závisí na TIM1). */
class Generator : public OneWay {
unsigned base, freq;
public:
explicit constexpr Generator (const unsigned f) noexcept : OneWay(), base(0u), freq (f) {};
unsigned Send (uint16_t * const ptr, const unsigned len) override;
protected:
int16_t step ();
};
#endif // GENERATOR_H