tao_z
2021-06-24 bc6c916bff0b8d342c1cd62da73a2a09f18d22a8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef _PWM_H_
#define _PWM_H_
#include "gd32e23x_timer.h"
//100us * 300 = 30ms
#define PERIOD_CAP (300U)
 
//64Mzhz / 4000 = 16Khz = 62.5us
#define PERIOD_CMP (4000u)
 
void TimerInit(void);
void SetPwmDuty(uint16_t ch, uint32_t duty);
void SetPwmPeriod(uint32_t period);
 
extern void StartSpeedTime(void);
extern void StopSpeedTime(void);
extern void stop_pwm_output(void);
#endif