timer_counter.h

来自「单片机制作PLC」· C头文件 代码 · 共 22 行

H
22
字号
#ifndef	 _TIMER_COUNTER_H
#define  _TIMER_COUNTER_H

typedef unsigned char Bit; 

extern struct  tim
{
	Bit DT;	 	 		     //定时器逻辑位(溢出标志)
	unsigned int K;		   	 //初值
	unsigned int TC;		 //定时器计数器	,TC和K值相等是称为溢出
	Bit ST;		 			 //触发启动标志
} timer[10];

extern struct  ct
{
	Bit Cnt;	 	 		//计数器逻辑位(溢出标志)
	unsigned int PV;		//初值
	unsigned int CT;		//计数器
	Bit RST;		 		//复位标志
} counter[10];

#endif 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?