www.pudn.com > 24C02-external-I2C-bus-EEPROM-.rar > hc595.h, change:2013-03-21,size:881b


#ifndef __HC595_H__ 
#define __HC595_H__ 
 
#include "stc12le5a60s2.h" 
 
//HC595接口定义 
 sbit 			HC595_DAT		=	P4^4;	   //HC595串行数据线 
 sbit 			HC595_SCK		=	P4^5;	   //HC595移位时钟线 
 sbit 			HC595_RCK		=	P4^6;	   //HC595锁存时钟线 
 sbit 			HC595_OE		=	P3^7;	   //HC595输出允许线 
 
 //端口操作定义 
 #define 		SET	   			1			   //高电平 
 #define 		CLR	   			0			   //低电平 
 
 #define		HC595_DAT_Clr()	{HC595_DAT=CLR;}  
 #define		HC595_DAT_Set()	{HC595_DAT=SET;} 
 
 #define		HC595_SCK_Clr()	{HC595_SCK=CLR;}  
 #define		HC595_SCK_Set()	{HC595_SCK=SET;} 
 
 #define		HC595_RCK_Clr()	{HC595_RCK=CLR;}  
 #define		HC595_RCK_Set()	{HC595_RCK=SET;} 
 
 #define		HC595_OE_Clr()	{HC595_OE=CLR;}  
 #define		HC595_OE_Set()	{HC595_OE=SET;} 
 
 
 //外部函数 
 void HC595_Init(void); 
 void LED_Display(void); 
 void ToDisplayCorrect(void); 
 void ToDisplayError(void); 
 
#endif