1
2
3
4
5
6
7
8
9
10
11
12
13
| #ifndef _PWM_H_
| #define _PWM_H_
| #include "gd32e23x_timer.h"
| //1us * 10000 = 10ms
| #define PERIOD_CAP (10000lU)
|
| //48Mzhz / 3000 = 16Khz = 62.5us
| #define PERIOD_CMP (3000u)
|
| void TimerInit(void);
| void SetPwmDuty(uint16_t ch, uint32_t duty);
| void SetPwmPeriod(uint32_t period);
| #endif
|
|