/** ##########################################################################
**     Filename  :
**     Project   :
**     Module    :
**     Processor :
**     Version   : 1.0
**     Compiler  :
**     Date/Time :
**     Abstract  :
**     Contents  :
**     Note      :
**
**     (c) Copyright dmdz Co.,Ltd
**  --------------------------------------------------------------------------
**               R E V I S I O N   H I S T O R Y
**  --------------------------------------------------------------------------
**  Date       Ver   Author             Description

**  -20230602-  --V1.0--  --mingyea---  --修改--

** #########################################################################*/
#ifndef TIM_CFG_H__
#define TIM_CFG_H__

/*---------------------------------------------------------------------------
- I N C L U D E   F I L E S
----------------------------------------------------------------------------*/
#include  "common_types.h"
#include  "cpu.h"

/*---------------------------------------------------------------------------
- D E F I N E S / M A C R O S
----------------------------------------------------------------------------*/
#define TIME_SR_ALLOC() 	CPU_SR_ALLOC()
#define TIME_CRITICAL_ENTER() 	ENTER_CRITICAL()
#define TIME_CRITICAL_EXIT()  	EXIT_CRITICAL()

/*****************普通定時器*******************/

//#define FL_ATIM_ENABLE  // ATIM定时器
#define FL_BSTIM16_ENABLE  //BSTIM16定时器
//#define FL_GPTIM_ENABLE  //GPTIM定时器
//#define FL_GPTIM1_ENABLE  //GPTIM定时器
//#define FL_GPTIM2_ENABLE  //GPTIM定时器
//#define FL_LPTIM16_ENABLE  //LPTIM16定时器---主要用做间隙唤醒
//#define FL_LPTIM32_ENABLE  //LPTIM16定时器

#define FL_ATIM_PWM_FREQ 1000u  //频率
#define FL_ATIM_PWM_DUTY_VALID 250u  //有效占空比
#define FL_ATIM_PWM_DUTY_INIT 0u  //有效占空比--初始值

#define FL_GPTIM_PWM_FREQ 1000u  //频率
#define FL_GPTIM_PWM_DUTY_VALID 250u  //有效占空比

#define FL_GPTIM1_PWM_FREQ 1000u  //频率
#define FL_GPTIM1_PWM_DUTY_VALID 250u  //有效占空比

#define FL_GPTIM2_PWM_FREQ 1000u  //频率
#define FL_GPTIM2_PWM_DUTY_VALID 250u  //有效占空比

#define FL_LPT32_PWM_FREQ 3000u  //频率 是1k
#define FL_LPT32_PWM_DUTY_VALID 250u  //有效占空比


//#define TIM_CFG_DEBUG_DISP_EN  //辅助调试

/*---------------------------------------------------------------------------
- T Y P E   D E F I N I T I O N S
----------------------------------------------------------------------------*/


/*---------------------------------------------------------------------------
- G L O B A L   V A R I A B L E S
- only configuration table allowed here,variables are not allowed!
----------------------------------------------------------------------------*/


/*---------------------------------------------------------------------------
- C O N S T A N T S
----------------------------------------------------------------------------*/
#ifdef FL_ATIM_ENABLE
extern const FL_ATIM_InitTypeDef  g_atimer0_Config0 ;
extern const FL_ATIM_OC_InitTypeDef g_atmer0_ch1_InitStructer ;
extern const FL_ATIM_OC_InitTypeDef g_atmer0_ch2_InitStructer ;
extern const FL_ATIM_OC_InitTypeDef g_atmer0_ch3_InitStructer ;
extern const FL_ATIM_OC_InitTypeDef g_atmer0_ch4_InitStructer ;
extern const FL_ATIM_BDTR_InitTypeDef g_atimer0_bdtr_config;
#endif



#ifdef FL_BSTIM16_ENABLE
extern const FL_BSTIM16_InitTypeDef  g_TimerBase_InitStruct ;
#endif


#ifdef FL_GPTIM_ENABLE
/**
 *
 */
extern const FL_GPTIM_InitTypeDef g_gptim_init_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim_ch1_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim_ch2_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim_ch3_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim_ch4_cfg ;

#endif

#ifdef FL_GPTIM1_ENABLE


extern const FL_GPTIM_InitTypeDef g_gptim1_init_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim1_ch1_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim1_ch2_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim1_ch3_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim1_ch4_cfg ;

#endif


extern const FL_GPTIM_InitTypeDef g_gptim2_init_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim2_ch1_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim2_ch2_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim2_ch3_cfg ;
extern const FL_GPTIM_OC_InitTypeDef g_gptim2_ch4_cfg ;


#ifdef FL_LPTIM16_ENABLE
extern const FL_LPTIM16_InitTypeDef g_lptim16_cfg_tab ;

#endif



extern const FL_LPTIM32_InitTypeDef g_lptim32_cfg_tab ;
extern const FL_LPTIM32_OC_InitTypeDef g_lpt32_ch1_cfg ;
extern const FL_LPTIM32_OC_InitTypeDef g_lpt32_ch2_cfg ;
extern const FL_LPTIM32_OC_InitTypeDef g_lpt32_ch3_cfg ;
extern const FL_LPTIM32_OC_InitTypeDef g_lpt32_ch4_cfg ;



/*---------------------------------------------------------------------------
- F U N C T I O N   P R O T O T Y P E
----------------------------------------------------------------------------*/







#endif   /* __TIM_CFG_H__ */
