tao_z
2021-07-10 4a89e24804b91902def506a9e898293fa36ccb59
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef _PWM_H_
#define _PWM_H_
#include "gd32e23x_timer.h"
//100us * 30000 = 3s
#define PERIOD_CAP (30000U)
 
//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);
 
extern void StartSpeedTime(void);
extern void StopSpeedTime(void);
extern void stop_pwm_output(void);
extern void TIMER2_IRQHandler_CallBack(void);
extern uint32_t GetSpeedTimerOutcnt(void);
#endif