8051-ELL库  beta 1.1.6
8051-ELL library API Document Center
STC8x_TIMER.c 文件参考
#include "STC8x_TIMER.h"
STC8x_TIMER.c 的引用(Include)关系图:

宏定义

#define TIMER0_MODE_CFG(mode)   do{TMOD = (TMOD & 0xFC) | (mode);}while(0)
 定时器0工作模式选择宏函数(作用域为本文件)。 更多...
 
#define TIMER1_MODE_CFG(mode)   do{TMOD = (TMOD & 0xCF) | (mode << 4);}while(0)
 定时器1工作模式选择宏函数(作用域为本文件)。 更多...
 
#define TIMER0_TCY_CFG(tCycle)   do{AUXR = (AUXR & 0x7F) | ( !tCycle << 7 );}while(0)
 定时器0指令周期选择宏函数(作用域为本文件)。 更多...
 
#define TIMER1_TCY_CFG(tCycle)   do{AUXR = (AUXR & 0xBF) | ( !tCycle << 6 );}while(0)
 定时器1指令周期选择宏函数(作用域为本文件)。 更多...
 
#define TIMER2_TCY_CFG(tCycle)   do{AUXR = (AUXR & 0xFB) | ( !tCycle << 2 );}while(0)
 定时器2指令周期选择宏函数(作用域为本文件)。 更多...
 
#define TIMER3_TCY_CFG(tCycle)   do{T4T3M = (T4T3M & 0xFD) | ( !tCycle << 1 );}while(0)
 定时器3指令周期选择宏函数(作用域为本文件)。 更多...
 
#define TIMER4_TCY_CFG(tCycle)   do{T4T3M = (T4T3M & 0xDF) | ( !tCycle << 5 );}while(0)
 定时器4指令周期选择宏函数(作用域为本文件)。 更多...
 
#define TIMER0_TIM_CFG(time)
 定时器0定时时间设置函数(作用域为本文件)。 更多...
 
#define TIMER1_TIM_CFG(time)
 定时器1定时时间设置函数(作用域为本文件)。 更多...
 
#define TIMER2_TIM_CFG(time)
 定时器2定时时间设置函数(作用域为本文件)。 更多...
 
#define TIMER3_TIM_CFG(time)
 定时器3定时时间设置函数(作用域为本文件)。 更多...
 
#define TIMER4_TIM_CFG(time)
 定时器3定时时间设置函数(作用域为本文件)。 Timer 3 timing time setting function (scope is this file). 更多...
 

变量

uint32_t G_Time0_CntValue = 0
 
uint32_t G_Time1_CntValue = 0
 

宏定义说明

◆ TIMER0_MODE_CFG

#define TIMER0_MODE_CFG (   mode)    do{TMOD = (TMOD & 0xFC) | (mode);}while(0)

定时器0工作模式选择宏函数(作用域为本文件)。

Timer 0 working mode selection macro function (scope for this file).

参数
[in]mode工作模式。working mode.

◆ TIMER0_TCY_CFG

#define TIMER0_TCY_CFG (   tCycle)    do{AUXR = (AUXR & 0x7F) | ( !tCycle << 7 );}while(0)

定时器0指令周期选择宏函数(作用域为本文件)。

Timer 0 instruction cycle selects macro function (scope is this file).

参数
[in]tCycle指令周期。 instruction cycle.

◆ TIMER0_TIM_CFG

#define TIMER0_TIM_CFG (   time)
值:
do{ \
time = (65536UL - (sysClk_FRE / (1000000UL / time \
* (11 * (!(AUXR & 0x80)) + 1)) ) ); \
G_Time0_CntValue = time; \
}while(0)
sfr AUXR
Definition: STC15x_REG.h:65

定时器0定时时间设置函数(作用域为本文件)。

Timer 0 timing time setting function (scope is this file).

参数
[in]time定时时间。 timing time.

◆ TIMER1_MODE_CFG

#define TIMER1_MODE_CFG (   mode)    do{TMOD = (TMOD & 0xCF) | (mode << 4);}while(0)

定时器1工作模式选择宏函数(作用域为本文件)。

Timer 1 working mode selection macro function (scope for this file).

参数
[in]mode工作模式。working mode.

◆ TIMER1_TCY_CFG

#define TIMER1_TCY_CFG (   tCycle)    do{AUXR = (AUXR & 0xBF) | ( !tCycle << 6 );}while(0)

定时器1指令周期选择宏函数(作用域为本文件)。

Timer 1 instruction cycle selects macro function (scope is this file).

参数
[in]tCycle指令周期。 instruction cycle.

◆ TIMER1_TIM_CFG

#define TIMER1_TIM_CFG (   time)
值:
do{ \
time = (65536UL - (sysClk_FRE / (1000000UL / time \
* (11 * (!(AUXR & 0x40)) + 1)) ) ); \
G_Time1_CntValue = time; \
}while(0)

定时器1定时时间设置函数(作用域为本文件)。

Timer 1 timing time setting function (scope is this file).

参数
[in]time定时时间。 timing time.

◆ TIMER2_TCY_CFG

#define TIMER2_TCY_CFG (   tCycle)    do{AUXR = (AUXR & 0xFB) | ( !tCycle << 2 );}while(0)

定时器2指令周期选择宏函数(作用域为本文件)。

Timer 2 instruction cycle selects macro function (scope is this file).

参数
[in]tCycle指令周期。 instruction cycle.

◆ TIMER2_TIM_CFG

#define TIMER2_TIM_CFG (   time)
值:
do{ \
time = (65536UL - (sysClk_FRE / (1000000UL / time \
* (11 * (!(AUXR & 0x04)) + 1)) ) ); \
}while(0)

定时器2定时时间设置函数(作用域为本文件)。

Timer 2 timing time setting function (scope is this file).

参数
[in]time定时时间。 timing time.

◆ TIMER3_TCY_CFG

#define TIMER3_TCY_CFG (   tCycle)    do{T4T3M = (T4T3M & 0xFD) | ( !tCycle << 1 );}while(0)

定时器3指令周期选择宏函数(作用域为本文件)。

Timer 3 instruction cycle selects macro function (scope is this file).

参数
[in]tCycle指令周期。 instruction cycle.

◆ TIMER3_TIM_CFG

#define TIMER3_TIM_CFG (   time)
值:
do{ \
time = (65536UL - (sysClk_FRE / (1000000UL / time \
* (11 * (!(T4T3M & 0x02)) + 1)) ) ); \
}while(0)
sfr T4T3M
Definition: STC15x_REG.h:621

定时器3定时时间设置函数(作用域为本文件)。

Timer 3 timing time setting function (scope is this file).

参数
[in]time定时时间。 timing time.

◆ TIMER4_TCY_CFG

#define TIMER4_TCY_CFG (   tCycle)    do{T4T3M = (T4T3M & 0xDF) | ( !tCycle << 5 );}while(0)

定时器4指令周期选择宏函数(作用域为本文件)。

Timer 4 instruction cycle selects macro function (scope is this file).

参数
[in]tCycle指令周期 instruction cycle.

◆ TIMER4_TIM_CFG

#define TIMER4_TIM_CFG (   time)
值:
do{ \
time = (65536UL - (sysClk_FRE / (1000000UL / time \
* (11 * (!(T4T3M & 0x20)) + 1)) ) ); \
}while(0)

定时器3定时时间设置函数(作用域为本文件)。 Timer 3 timing time setting function (scope is this file).

参数
[in]time定时时间。 timing time.

变量说明

◆ G_Time0_CntValue

uint32_t G_Time0_CntValue = 0

◆ G_Time1_CntValue

uint32_t G_Time1_CntValue = 0