2024-03-02 15:44:43 +01:00
|
|
|
#include "gpio.h"
|
2024-03-01 14:14:21 +01:00
|
|
|
#include "pwmclass.h"
|
2024-03-01 17:32:22 +01:00
|
|
|
#include "generator.h"
|
2024-03-01 14:14:21 +01:00
|
|
|
//////////////////////////////////////
|
2024-03-01 17:32:22 +01:00
|
|
|
/* Demonstrace PWM s použitím DMA
|
|
|
|
* Generátor je sinus, data se tvoří
|
|
|
|
* v přerušení. Parametry se musí nastavit
|
|
|
|
* ve zdrojácích, je to jen DEMO.
|
|
|
|
* */
|
|
|
|
//////////////////////////////////////
|
|
|
|
static PwmClass pwm;
|
|
|
|
static Generator gen (1u << 16);
|
2024-03-01 14:14:21 +01:00
|
|
|
int main () {
|
2024-03-01 17:32:22 +01:00
|
|
|
pwm.attach(gen);
|
2024-03-01 14:14:21 +01:00
|
|
|
for (;;);
|
|
|
|
return 0;
|
|
|
|
}
|