39 lines
622 B
C
39 lines
622 B
C
#ifndef __TIM_H__
|
|
#define __TIM_H__
|
|
|
|
#include "common.h"
|
|
|
|
typedef enum
|
|
{
|
|
CTIM0_P34=0,
|
|
CTIM1_P35,
|
|
CTIM2_P12,
|
|
CTIM3_P04,
|
|
CTIM4_P06,
|
|
}CTIMN_enum;
|
|
|
|
|
|
typedef enum
|
|
{
|
|
TIM_0,
|
|
TIM_1,
|
|
TIM_2,
|
|
TIM_3,
|
|
TIM_4,
|
|
}TIMN_enum;
|
|
|
|
|
|
#define TIM2_CLEAR_FLAG AUXINTIF &= ~0x01;
|
|
#define TIM3_CLEAR_FLAG AUXINTIF &= ~0x02; // 清中断标志
|
|
#define TIM4_CLEAR_FLAG AUXINTIF &= ~0x04; // 清中断标志
|
|
|
|
|
|
void ctimer_count_init(CTIMN_enum tim_n);
|
|
void ctimer_count_clean(CTIMN_enum tim_n);
|
|
uint16 ctimer_count_read(CTIMN_enum tim_n);
|
|
|
|
void pit_timer_ms(TIMN_enum tim_n,uint16 time_ms);
|
|
|
|
|
|
#endif
|