#ifndef _APP_TIMER_H_
#define _APP_TIMER_H_
#include <stdint.h>
#include <drv/common.h>

#define TIMER_CORE_TIMEOUT (500)

typedef struct user_timer
{
    unsigned int power_on_timer_1s;            // 芯片上电时间，1秒累加一次
    unsigned short  tick_100us;
    unsigned char  f_100us_irq;
    unsigned char  f_500us_irq;
    unsigned char  f_1ms_irq;
    unsigned char  f_10ms_irq;
    unsigned char  f_100ms_irq;
	unsigned char  f_500ms_irq;
    unsigned char  f_1s_irq;
}user_timer_struct;


/**
  \brief       Initialize TIMER Interface. 1. Initializes the resources needed for the TIMER interface
  \param[in]   t_index         timer index
  \param[in]   t_param.........1: repeat  0: once
  \return      error code \ref csi_error_t
*/
csi_error_t app_timer_init(unsigned char t_index, unsigned char t_param, unsigned int times);
void app_timer_start(unsigned char t_index);
void app_timer_stop(unsigned char t_index);
/*
 *   时钟相关的处理，在主循环中执行
 * 	 会因其它处理delay
 */
void app_user_timer_process(void);

#endif