RISC-V/V003/pwm/generator.h

15 lines
421 B
C
Raw Permalink Normal View History

2024-03-01 17:32:22 +01: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 Generator (const unsigned f) noexcept : OneWay(), base(0u), freq (f) {};
unsigned Send (uint16_t * const ptr, const unsigned len) override;
protected:
uint16_t step ();
};
#endif // GENERATOR_H