⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.h

📁 这个是一个带有IC卡
💻 H
字号:


#ifdef __SRC
	 #define EXTERN
#else
	 #define EXTERN		extern
#endif




#define TRUE  1
#define FALSE 0



///////////////////////////卡的类型//////////////////////////////////
#define PROD_CARD         0            	//货物标签卡
#define ADMI_CARD         3            	//管理员卡
#define DELI_CARD		2				//发货者卡
#define RECV_CARD		1				//接收者卡


#define BIAOSHI_ERR     1                 //标识错误 1
#define QIXIAN_ERR     	2                //期限错误 2

#define WARING_TYPE_NO     		0   //没有警告
#define WARING_TYPE_OUT_TIME    1	//货物已经超出保质期
#define WARING_TYPE_SECUR     	2   //安全
#define WARING_TYPE_FULL     	3   //安全


#define LNMAX							32

#define GUIGENUM                      5//规格的型号数
#define RECVIDINDEXNUM                100//简单索引的最大容量

#define ADMIHISNUM                    20//管理员的记录条数
#define MACHHISNUM                    20
#define DELIHISNUM                    500   
 
#define PINBASE                       198265
#define PINWEISHU                     6//密码的位数为6位       
/////////////////////////////变量和结构体////////////////////////////////

typedef struct
{
	uint16 year;
	uint8 month;
	uint8 day;
	uint8 hour;
	uint8 minute;
	uint8 second;
}TIME;//时间结构的数据结构定义

typedef struct 
{
	uint32 ProductBarCode;//tiao xing ma
	uint8 Weight;//unit of 100g;0 means <100g,255 means >25.4kg;123 means  12.3kg=<x<12.4kg
	uint8 Height;//unit of centimeter
	uint8 Width;//unit of centimeter
	uint8 Depth;//unit of centimeter
	TIME StoreTime;//保存时间,产品的质保时间
	TIME ArriveTime;//产品要求到中转站的时间
}PPT;//产品的属性结构

typedef struct
{
	uint8 	TypeofCard;//use ProductCard or DeliveryCard;//用来表识是什么卡送进来的
	uint32 	ProductCardID;
	uint32  ReceiverCardID;
	uint32  DeliveryID;//as tagProductCard
	uint32  DeliveryPouintID;
	PPT     ProductProperty;
	TIME    ArriveTime;//货物到中转站的时间
}PR;//产品需要记录的结构

typedef  struct
{
	uint8 Height;//unit of centimeter
	uint8 Width;//unit of centimeter
	uint8 Depth;//unit of centimeter
}GZRJ;//阁子的容积结构

typedef struct
{
	uint8 	Use_Flg;//是否被使用了的标志,为1表示已经被使用
	GZRJ 	GeZiRongJi;//阁子的容积
	PR		ProductRecord;//产品的记录

}GEZI;//阁子的结构体



struct StructTermilog
{
	uint32  TermilogID;//本机器的ID号
	TIME  	TermilogSetuptime;//setup the lattice time;
	TIME  	TermilogRunTime;//the start time of one run sequnce from reset;
	
	uint8  	StoreProductNum;//0=empty;=LN means full;
	uint8  	Waring_Type;//报警的类型//0=no warning;1=product out of time;2=termilog security warning
	GEZI 	GeZiList[LNMAX]; 
};
struct RecvIndexList
{
	uint16 Index;
	uint32 ID;
};
struct GuiGeList
{
	uint8 GuigeNum;
	uint8 Depth;
	uint8 Width;
	uint8 Height;
};

struct tagAdminHistoryFormat
{
	TIME 	OpenTime;
	uint8 	LatticeID;//from 1 toLatticeNum;0 means open all lattice;
};

struct tagMachineHistoryFormat
{
	uint8  waringtype;
				
/* bOPName define as
	LOWM low memory;
	RUNT start machine
	OUTT some product outof time;
*/
	TIME time;
};


struct tagDeliveryHistoryFormat
{	
	uint8 	TypeofCard;
	uint32 	DeliveryID;///此次送货的ID号
	uint32 	DeliveryPouintID;//发货的机具号码
	//TIME 	tDeliveryTime;
	TIME 	ReceiveTime;//at the door open;
	uint32 	RecvCardID;//may be the card of lAdminCardID;
};//这个记录是在接货员把货物接了以后再记录的

struct BaoZhiTimeOut
{
	uint8 FLG_TimeOut;//为1表示过期了,为0表示没有过期
	uint8 FLG_record;//为1表示被记录下来了,为0表示还没有被记录下来
};
EXTERN void DealWithMifareCard(void);
EXTERN void ShowMainPic(void);
EXTERN void ReadAndDisplayTime(void);
EXTERN void CheckAndDisplayOutTimeIfo(void);
EXTERN void CheckAndDealDataTransMode(void);

EXTERN void EnablePCF8563_IIC_INT(void);

EXTERN void DisablePCF8563_IIC_INT(void);

EXTERN void Delay_n100MS(uint32  dly);
EXTERN void Delay_n10MS(uint32  dly);
EXTERN void Modify_pin(uint32 id,uint8 * p);
//计算并且修改密码放到缓存中
EXTERN void  ClrPinBuf(uint8 * p);
//清除密码缓存区
EXTERN uint8 Check_Pin(uint8 x,uint8 y,uint8 * p);

EXTERN void  MaoPaoPaiXu(uint8 * p,uint8 Count);
EXTERN uint8 Compare_vol(uint8 G_a,uint8 G_b,uint8 G_c,uint8 P_x,uint8 P_y,uint8 P_z);


#undef EXTERN

⌨️ 快捷键说明

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