rt-thread/bsp/essemi/es8p508x/libraries/Library/Source/lib_timer.c

570 lines
18 KiB
C
Raw Normal View History

2019-11-07 10:00:14 +08:00
/***************************************************************
*Copyright (C), 2017, Shanghai Eastsoft Microelectronics Co., Ltd
*<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> lib_timer.c
*<EFBFBD><EFBFBD> <EFBFBD>ߣ<EFBFBD> Liut
*<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> V1.00
*<EFBFBD><EFBFBD> <EFBFBD>ڣ<EFBFBD> 2017/07/14
*<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*<EFBFBD><EFBFBD> ע<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ES8P508xоƬ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧϰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾʹ<EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD>ջ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD>κη<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ρ<EFBFBD>
***************************************************************/
#include "lib_timer.h"
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_BaseInit
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3 <EFBFBD><EFBFBD>TIM_BaseInitStruct<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_BaseInit(T16N_TypeDef* T16Nx,TIM_BaseInitStruType* TIM_BaseInitStruct)
{
T16Nx->CON0.CS = TIM_BaseInitStruct->TIM_ClkS;
T16Nx->CON0.SYNC = TIM_BaseInitStruct->TIM_SYNC;
T16Nx->CON0.EDGE = TIM_BaseInitStruct->TIM_EDGE;
T16Nx->CON0.MOD = TIM_BaseInitStruct->TIM_Mode;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_BaseInit
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0 <EFBFBD><EFBFBD>TIM_BaseInitStruct<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T32Nx_BaseInit(T32N_TypeDef* T32Nx,TIM_BaseInitStruType* TIM_BaseInitStruct)
{
T32Nx->CON0.CS = TIM_BaseInitStruct->TIM_ClkS;
T32Nx->CON0.SYNC = TIM_BaseInitStruct->TIM_SYNC;
T32Nx->CON0.EDGE = TIM_BaseInitStruct->TIM_EDGE;
T32Nx->CON0.MOD = TIM_BaseInitStruct->TIM_Mode;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_CapInit
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD>׽<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3<EFBFBD><EFBFBD> TIM_CapInitStruct<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_CapInit(T16N_TypeDef* T16Nx,TIM_CapInitStruType* TIM_CapInitStruct)
{
T16Nx->CON1.CAPPE = TIM_CapInitStruct->TIM_CapRise;
T16Nx->CON1.CAPNE = TIM_CapInitStruct->TIM_CapFall;
T16Nx->CON1.CAPIS0 = TIM_CapInitStruct->TIM_CapIS0;
T16Nx->CON1.CAPIS1 = TIM_CapInitStruct->TIM_CapIS1;
T16Nx->CON1.CAPT = TIM_CapInitStruct->TIM_CapTime;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_CapInit
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD>׽<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0<EFBFBD><EFBFBD> TIM_CapInitStruct<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T32Nx_CapInit(T32N_TypeDef* T32Nx,TIM_CapInitStruType* TIM_CapInitStruct)
{
T32Nx->CON1.CAPPE = TIM_CapInitStruct->TIM_CapRise;
T32Nx->CON1.CAPNE = TIM_CapInitStruct->TIM_CapFall;
T32Nx->CON1.CAPIS0 = TIM_CapInitStruct->TIM_CapIS0;
T32Nx->CON1.CAPIS1 = TIM_CapInitStruct->TIM_CapIS1;
T32Nx->CON1.CAPT = TIM_CapInitStruct->TIM_CapTime;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_MATxITConfig
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nxƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3<EFBFBD><EFBFBD> Type<EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD>ģʽ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_MAT0ITConfig(T16N_TypeDef* T16Nx,TIM_TYPE_MATCON Type)
{
T16Nx->CON0.MAT0S = Type;
}
void T16Nx_MAT1ITConfig(T16N_TypeDef* T16Nx,TIM_TYPE_MATCON Type)
{
T16Nx->CON0.MAT1S = Type;
}
void T16Nx_MAT2ITConfig(T16N_TypeDef* T16Nx,TIM_TYPE_MATCON Type)
{
T16Nx->CON0.MAT2S = Type;
}
void T16Nx_MAT3ITConfig(T16N_TypeDef* T16Nx,TIM_TYPE_MATCON Type)
{
T16Nx->CON0.MAT3S = Type;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_MATxITConfig
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nxƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0<EFBFBD><EFBFBD> Type<EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD>ģʽ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T32Nx_MAT0ITConfig(T32N_TypeDef* T32Nx,TIM_TYPE_MATCON Type)
{
T32Nx->CON0.MAT0S = Type;
}
void T32Nx_MAT1ITConfig(T32N_TypeDef* T32Nx,TIM_TYPE_MATCON Type)
{
T32Nx->CON0.MAT1S = Type;
}
void T32Nx_MAT2ITConfig(T32N_TypeDef* T32Nx,TIM_TYPE_MATCON Type)
{
T32Nx->CON0.MAT2S = Type;
}
void T32Nx_MAT3ITConfig(T32N_TypeDef* T32Nx,TIM_TYPE_MATCON Type)
{
T32Nx->CON0.MAT3S = Type;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_MATxOutxConfig
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nxƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿ڵ<EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3 <EFBFBD><EFBFBD> Type<EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿ڵĹ<EFBFBD><EFBFBD><EFBFBD>ģʽ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_MAT0Out0Config(T16N_TypeDef* T16Nx,TIM_TYPE_MATOUT Type)
{
T16Nx->CON2.MOM0 = Type;
}
void T16Nx_MAT1Out0Config(T16N_TypeDef* T16Nx,TIM_TYPE_MATOUT Type)
{
T16Nx->CON2.MOM1 = Type;
}
void T16Nx_MAT2Out1Config(T16N_TypeDef* T16Nx,TIM_TYPE_MATOUT Type)
{
T16Nx->CON2.MOM2 = Type;
}
void T16Nx_MAT3Out1Config(T16N_TypeDef* T16Nx,TIM_TYPE_MATOUT Type)
{
T16Nx->CON2.MOM3 = Type;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_MATxOutxConfig
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nxƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿ڵ<EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0 <EFBFBD><EFBFBD> Type<EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿ڵĹ<EFBFBD><EFBFBD><EFBFBD>ģʽ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T32Nx_MAT0Out0Config(T32N_TypeDef* T32Nx,TIM_TYPE_MATOUT Type)
{
T32Nx->CON2.MOM0 = Type;
}
void T32Nx_MAT1Out0Config(T32N_TypeDef* T32Nx,TIM_TYPE_MATOUT Type)
{
T32Nx->CON2.MOM1 = Type;
}
void T32Nx_MAT2Out1Config(T32N_TypeDef* T32Nx,TIM_TYPE_MATOUT Type)
{
T32Nx->CON2.MOM2 = Type;
}
void T32Nx_MAT3Out1Config(T32N_TypeDef* T32Nx,TIM_TYPE_MATOUT Type)
{
T32Nx->CON2.MOM3 = Type;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_ITConfig
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N<EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3<EFBFBD><EFBFBD> Type<EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> NewState<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>/ʧ<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_ITConfig(T16N_TypeDef* T16Nx,TIM_TYPE_IT Type,TYPE_FUNCEN NewState)
{
if (NewState != DISABLE)
T16Nx->IE.Word |= (uint32_t)Type;
else
T16Nx->IE.Word &= (~(uint32_t)Type);
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_ITConfig
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N<EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0<EFBFBD><EFBFBD> Type<EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> NewState<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>/ʧ<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T32Nx_ITConfig(T32N_TypeDef* T32Nx,TIM_TYPE_IT Type,TYPE_FUNCEN NewState)
{
if (NewState != DISABLE)
T32Nx->IE.Word|= (uint32_t)Type;
else
T32Nx->IE.Word &= (~(uint32_t)Type);
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_PWMOutConfig
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0OUT0,T16N1OUT0<EFBFBD><EFBFBD>T16N2OUT0<EFBFBD><EFBFBD>T16N3OUT0 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD>ԭ<EFBFBD><EFBFBD>Ϊʹ<EFBFBD><EFBFBD>uart<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>uartͬʱʹ<EFBFBD>á<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_PWMOutConfig(T16N_TypeDef* T16Nx,T16Nx_PWMInitStruType* T16Nx_PWMInitStruct)
{
T16Nx->CON2.MOE0 = T16Nx_PWMInitStruct->T16Nx_MOE0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>0<EFBFBD>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>
T16Nx->CON2.MOE1 = T16Nx_PWMInitStruct->T16Nx_MOE1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>1<EFBFBD>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>
T16Nx->CON2.POL0 = T16Nx_PWMInitStruct->T16Nx_POL0; //<2F><><EFBFBD><EFBFBD>T16NxOut0<74><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
T16Nx->CON2.POL1 = T16Nx_PWMInitStruct->T16Nx_POL1; //<2F><><EFBFBD><EFBFBD>T16NxOut1<74><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_PWMBK_Config
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PWMɲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3 ,Type <EFBFBD><EFBFBD><EFBFBD><EFBFBD>PWMɲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_PWMBK_Config(T16N_TypeDef* T16Nx,T16Nx_PWMBK_Type* type)
{
T16Nx->CON2.PBKL0 = type->T16Nx_PWMBKL0; //PWMͨ<4D><CDA8><30><C9B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽѡ<C6BD><D1A1>
T16Nx->CON2.PBKL1 = type->T16Nx_PWMBKL1; //PWMͨ<4D><CDA8><31><C9B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽѡ<C6BD><D1A1>
T16Nx->CON2.PBKS = type->T16Nx_PWMBKS; //PWM<57>ź<EFBFBD>Դѡ<D4B4><D1A1>
T16Nx->CON2.PBKPS = type->T16Nx_PWMBKPS; //PWMͨ<4D><CDA8>ɲ<EFBFBD><C9B2><EFBFBD>źż<C5BA><C5BC><EFBFBD>ѡ<EFBFBD><D1A1>
T16Nx->CON2.PBKEN = type->T16Nx_PWMBKEN; //PWMͨ<4D><CDA8>ɲ<EFBFBD><C9B2>ʹ<EFBFBD><CAB9>
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_TRG_Config
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N ADC<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_TRG_Config(T16N_TypeDef* T16Nx,T16Nx_PWMTRG_type Type,TYPE_FUNCEN NewState)
{
if(Type == T16Nx_MAT0)
T16Nx->TRG.MAT0TAR = 1;
else if(Type == T16Nx_MAT1)
T16Nx->TRG.MAT1TAR = 1;
else if(Type == T16Nx_MAT2)
T16Nx->TRG.MAT2TAR = 1;
else if(Type == T16Nx_MAT3)
T16Nx->TRG.MAT3TAR = 1;
T16Nx->TRG.OVTAR = NewState;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_GetPWMBKF
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡPWMBKFɲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>PWMBKF<EFBFBD><EFBFBD>־λ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>SET<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD>RESET<EFBFBD><EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
FlagStatus T16Nx_GetPWMBKF(T16N_TypeDef* T16Nx)
{
if(T16Nx->CON2.PBKF == 1)
return SET;
else
return RESET;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_ResetPWMBKF
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>PWMBKF<EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PWM<EFBFBD>˿ڻָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>shuc
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_ResetPWMBKF(T16N_TypeDef* T16Nx)
{
T16Nx->CON2.PBKF = 1;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_SetCNT
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3<EFBFBD><EFBFBD> Value<EFBFBD><EFBFBD>16λ<EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_SetCNT(T16N_TypeDef* T16Nx,uint16_t Value)
{
T16Nx->CNT.CNT = Value;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_SetCNT
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0<EFBFBD><EFBFBD> Value<EFBFBD><EFBFBD>32λ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>16λʱ<EFBFBD>Ҷ<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T32Nx_SetCNT(T32N_TypeDef* T32Nx,uint32_t Value)
{
T32Nx->CNT.CNT = Value;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_SetPRECNT
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3 <EFBFBD><EFBFBD> Value<EFBFBD><EFBFBD>8λ<EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_SetPRECNT(T16N_TypeDef* T16Nx,uint8_t Value)
{
T16Nx->PRECNT.PRECNT = Value;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_SetPRECNT
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0<EFBFBD><EFBFBD> Value<EFBFBD><EFBFBD>8λ<EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T32Nx_SetPRECNT(T32N_TypeDef* T32Nx,uint8_t Value)
{
T32Nx->PRECNT.PRECNT = Value - 1;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_SetPREMAT
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3<EFBFBD><EFBFBD> Value<EFBFBD><EFBFBD>8λ<EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_SetPREMAT(T16N_TypeDef* T16Nx,uint8_t Value)
{
T16Nx->PREMAT.PREMAT = Value - 1;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_SetPREMAT
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> Value<EFBFBD><EFBFBD>8λ<EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T32Nx_SetPREMAT(T32N_TypeDef* T32Nx,uint8_t Value)
{
T32Nx->PREMAT.PREMAT = Value - 1;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_SetMATx
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3<EFBFBD><EFBFBD> MATx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>TIM_MAT0/1/2/3 <EFBFBD><EFBFBD> Value<EFBFBD><EFBFBD>16λ<EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_SetMAT0(T16N_TypeDef* T16Nx,uint16_t Value)
{
T16Nx->MAT0.MAT0 = Value;
}
void T16Nx_SetMAT1(T16N_TypeDef* T16Nx,uint16_t Value)
{
T16Nx->MAT1.MAT1 = Value;
}
void T16Nx_SetMAT2(T16N_TypeDef* T16Nx,uint16_t Value)
{
T16Nx->MAT2.MAT2 = Value;
}
void T16Nx_SetMAT3(T16N_TypeDef* T16Nx,uint16_t Value)
{
T16Nx->MAT3.MAT3 = Value;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_SetMATx
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0<EFBFBD><EFBFBD> MATx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>TIM_MAT0/1/2/3 <EFBFBD><EFBFBD> Value<EFBFBD><EFBFBD>32λ<EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T32Nx_SetMAT0(T32N_TypeDef* T32Nx,uint32_t Value)
{
T32Nx->MAT0.MAT0 = Value;
}
void T32Nx_SetMAT1(T32N_TypeDef* T32Nx,uint32_t Value)
{
T32Nx->MAT1.MAT1 = Value;
}
void T32Nx_SetMAT2(T32N_TypeDef* T32Nx,uint32_t Value)
{
T32Nx->MAT2.MAT2 = Value;
}
void T32Nx_SetMAT3(T32N_TypeDef* T32Nx,uint32_t Value)
{
T32Nx->MAT3.MAT3 = Value;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_GetMATx
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡƥ<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>16λ<EFBFBD><EFBFBD>ֵ
***************************************************************/
uint16_t T16Nx_GetMAT0(T16N_TypeDef* T16Nx)
{
return (T16Nx->MAT0.MAT0);
}
uint16_t T16Nx_GetMAT1(T16N_TypeDef* T16Nx)
{
return (T16Nx->MAT1.MAT1);
}
uint16_t T16Nx_GetMAT2(T16N_TypeDef* T16Nx)
{
return (T16Nx->MAT2.MAT2);
}
uint16_t T16Nx_GetMAT3(T16N_TypeDef* T16Nx)
{
return (T16Nx->MAT3.MAT3);
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_GetMATx
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡƥ<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0/3 MATx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>TIM_MAT0/1/2/3
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>32λ<EFBFBD><EFBFBD>ֵ
***************************************************************/
uint32_t T32Nx_GetMAT0(T32N_TypeDef* T32Nx)
{
return (T32Nx->MAT0.MAT0);
}
uint32_t T32Nx_GetMAT1(T32N_TypeDef* T32Nx)
{
return (T32Nx->MAT1.MAT1);
}
uint32_t T32Nx_GetMAT2(T32N_TypeDef* T32Nx)
{
return (T32Nx->MAT2.MAT2);
}
uint32_t T32Nx_GetMAT3(T32N_TypeDef* T32Nx)
{
return (T32Nx->MAT3.MAT3);
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_GetCNT
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>16λ<EFBFBD><EFBFBD>ֵ
***************************************************************/
uint16_t T16Nx_GetCNT(T16N_TypeDef* T16Nx)
{
return (T16Nx->CNT.CNT);
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_GetCNT
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0/3<EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>16/32λ<EFBFBD><EFBFBD>ֵ
***************************************************************/
uint32_t T32Nx_GetCNT(T32N_TypeDef* T32Nx)
{
return (T32Nx->CNT.CNT);
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_GetPRECNT
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡԤ<EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>8λ<EFBFBD><EFBFBD>ֵ
***************************************************************/
uint8_t T16Nx_GetPRECNT(T16N_TypeDef* T16Nx)
{
return (uint8_t)(T16Nx->PRECNT.PRECNT);
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_GetPRECNT
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡԤ<EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>ֵ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>8λ<EFBFBD><EFBFBD>ֵ
***************************************************************/
uint8_t T32Nx_GetPRECNT(T32N_TypeDef* T32Nx)
{
return (uint8_t)(T32Nx->PRECNT.PRECNT);
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_GetFlagStatus
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3<EFBFBD><EFBFBD> TIM_Flag<EFBFBD><EFBFBD><EFBFBD>жϱ<EFBFBD>־λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>RESET/SET
***************************************************************/
FlagStatus T16Nx_GetFlagStatus(T16N_TypeDef* T16Nx,TIM_TYPE_IF TIM_Flag)
{
FlagStatus bitstatus = RESET;
if((T16Nx->IF.Word & (uint32_t)TIM_Flag) != (uint32_t)RESET)
bitstatus = SET;
else
bitstatus = RESET;
return bitstatus;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_GetFlagStatus
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0<EFBFBD><EFBFBD><EFBFBD><EFBFBD> TIM_Flag<EFBFBD><EFBFBD><EFBFBD>жϱ<EFBFBD>־λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>RESET/SET
***************************************************************/
FlagStatus T32Nx_GetFlagStatus(T32N_TypeDef* T32Nx,TIM_TYPE_IF TIM_Flag)
{
FlagStatus bitstatus = RESET;
if((T32Nx->IF.Word & (uint32_t)TIM_Flag) != (uint32_t)RESET)
bitstatus = SET;
else
bitstatus = RESET;
return bitstatus;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_GetITStatus
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡָ<EFBFBD><EFBFBD><EFBFBD>жϱ<EFBFBD>־λ,δʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ж<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SET
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3<EFBFBD><EFBFBD> TIM_Flag<EFBFBD><EFBFBD><EFBFBD>жϱ<EFBFBD>־λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>RESET/SET
***************************************************************/
ITStatus T16Nx_GetITStatus(T16N_TypeDef* T16Nx,TIM_TYPE_IT TIM_Flag)
{
ITStatus bitstatus = RESET;
uint32_t itstatus = 0x0, itenable = 0x0;
itstatus = T16Nx->IF.Word & (uint32_t)TIM_Flag;
itenable = T16Nx->IE.Word & (uint32_t)TIM_Flag;
if ((itstatus != (uint32_t)RESET) && (itenable != (uint32_t)RESET))
bitstatus = SET;
else
bitstatus = RESET;
return bitstatus;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_GetITStatus
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡָ<EFBFBD><EFBFBD><EFBFBD>жϱ<EFBFBD>־λ,δʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ж<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SET
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0<EFBFBD><EFBFBD> TIM_Flag<EFBFBD><EFBFBD><EFBFBD>жϱ<EFBFBD>־λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>RESET/SET
***************************************************************/
ITStatus T32Nx_GetITStatus(T32N_TypeDef* T32Nx,TIM_TYPE_IT TIM_Flag)
{
ITStatus bitstatus = RESET;
uint32_t itstatus = 0x0, itenable = 0x0;
itstatus = T32Nx->IF.Word & (uint32_t)TIM_Flag;
itenable = T32Nx->IE.Word & (uint32_t)TIM_Flag;
if ((itstatus != (uint32_t)RESET) && (itenable != (uint32_t)RESET))
bitstatus = SET;
else
bitstatus = RESET;
return bitstatus;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16Nx_ClearIFPendingBit
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>жϱ<EFBFBD>־λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T16Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T16N0/1/2/3<EFBFBD><EFBFBD> TIM_Flag<EFBFBD><EFBFBD><EFBFBD>жϱ<EFBFBD>־λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T16Nx_ClearIFPendingBit(T16N_TypeDef* T16Nx,TIM_TYPE_IF TIM_Flag)
{
T16Nx->IF.Word = (uint32_t)TIM_Flag;
}
/***************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32Nx_ClearIFPendingBit
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>жϱ<EFBFBD>־λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>T32Nx<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T32N0<EFBFBD><EFBFBD> TIM_Flag<EFBFBD><EFBFBD><EFBFBD>жϱ<EFBFBD>־λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
***************************************************************/
void T32Nx_ClearIFPendingBit(T32N_TypeDef* T32Nx,TIM_TYPE_IF TIM_Flag)
{
T32Nx->IF.Word = (uint32_t)TIM_Flag;
}
/*************************END OF FILE**********************/