45 lines
1.2 KiB
C
45 lines
1.2 KiB
C
#ifndef _LHL_TIMER_H
|
|
#define _LHL_TIMER_H
|
|
|
|
/*==================================================================================*/
|
|
//系统宏重定义
|
|
/*==================================================================================*/
|
|
#define TIM1 pTIM1
|
|
#define TIM2 pTIM2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//周期定时器---------------------------------------
|
|
void StartTimer1_UIE(u16 uploadCounter);
|
|
void ResetTimer1_UIE(u16 uploadCounter);
|
|
void StartTimer2_UIE(u16 uploadCounter);
|
|
void ResetTimer2_UIE(u16 uploadCounter);
|
|
|
|
//比较定时器---------------------------------------
|
|
void StartTimer1_CC1(u16 uploadCounter);
|
|
void ResetTimer1_CC1(u16 uploadCounter);
|
|
//void StartTimer1_CC2(u16 uploadCounter);
|
|
//void ResetTimer1_CC2(u16 uploadCounter);
|
|
//void StartTimer2_CC1(u16 uploadCounter);
|
|
//void ResetTimer2_CC1(u16 uploadCounter);
|
|
//void StartTimer2_CC2(u16 uploadCounter);
|
|
//void ResetTimer2_CC2(u16 uploadCounter);
|
|
//输出定时器---------------------------------------
|
|
void StartTimer1_PWM(u16 freq_hz , u16 duty);
|
|
void ResetTimer1_PWM(u16 duty);
|
|
|
|
|
|
void StopTimer1(void);
|
|
void StopTimer2(void);
|
|
|
|
|
|
typedef void (*timer_irq_callback_t)(void);
|
|
void Timer_register_irq_callback(TIM_TypeDef *timer, timer_irq_callback_t tim_irq_callback);
|
|
#endif
|
|
|
|
|
|
|