tao_z
2021-06-27 b34d5dbff89fd992af8196c747e18a8933d0c729
USR/INC/pwm.h
@@ -1,13 +1,17 @@
#ifndef _PWM_H_
#define _PWM_H_
#include "gd32e23x_timer.h"
//1us * 10000 = 10ms
#define PERIOD_CAP (10000lU)
//100us * 300 = 30ms
#define PERIOD_CAP (300U)
//48Mzhz / 3000 = 16Khz = 62.5us
#define PERIOD_CMP (3000u)
//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