#ifndef __BL2101_TIMER_H__
#define	__BL2101_TIMER_H__

#include "BL2101.h"

#define  TIMER_LOW16BIT    0            //低16位定时器
#define  TIMER_HIGH16BIT   1            //高16位定时器
#define  TIMER_32BIT       2            //32位定时器

void TIMER_Init(uint8_t mode,uint32_t period,uint8_t int_en);    //定时器初始化

void TIMER_Start(uint8_t mode);                                  //启动定时器
void TIMER_Stop(uint8_t mode);                                   //停止定时器

void TIMER_SetPeriod(uint8_t mode,uint32_t period);              //设置定时器周期值
uint32_t TIMER_GetPeriod(uint8_t mode);                          //获取定时器周期值

uint32_t TIMER_GetCurValue(uint8_t mode);                        //获取定时器当前值

void TIMER_INTEn(uint8_t mode);                                  //定时器中断使能
void TIMER_INTDis(uint8_t mode);                                 //定时器中断禁能
void TIMER_INTClr(uint8_t mode);                                 //定时器中断清除
uint8_t TIMER_INTStat(uint8_t mode);                             //获取定时器中断状态

#endif //__BL2101_TIMER_H__
