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

📄 file.h

📁 本人编写的无线电话程序,给予PIC18C801设计,包括了uCOS的移植以及菜单,自己设计的拼音注入法,完整地一级汉字库,希望对大家有所帮助
💻 H
字号:

#define CALLRECORDNUM	10

#define SMTBLLEN		20
#define SMTBLINDEXLEN   SMTBLLEN+2

#define PHONEBOOKLEN	100

#define RATETBLITEMNUM	100
#define FEETBLLEN		1

#define NUMOFRATETBL	1
//#define FEETBLLEN		150
/*******************************************************************
 * Here are basic structures used in the file definations followed *
 *******************************************************************/
typedef struct PDU_Head_Struct{
	unsigned char PDUHeadLen;			//PDU head length
	unsigned char PDUHead[32];			//PDU head content
}PDU_HEAD;


//Time structure in NM structures
typedef rom struct Time_Struct{                                 /*All the domains are compressed BCD code */
	unsigned char chrYear;
	unsigned char chrMonth;
	unsigned char chrDate;
	unsigned char chrHour;
	unsigned char chrMinute;
	unsigned char chrSecond;
}NM_TIME;


typedef rom struct _CALLRECORD{
	INT8U	head;
	INT8U	len;
	INT8U	num[CALLRECORDNUM][12];
	NM_TIME	time[CALLRECORDNUM];
}CALLRECORDTBL;
//---------------------------------------
typedef rom struct _SM_TBLINDEX_ITEM{
	INT8U	peernum[8];
	INT8U	property;
	NM_TIME	time;
	INT8U	previous;
	INT8U	next;
}SM_TBLINDEX_ITEM;

typedef rom struct _SM_TBLDATA_ITEM{
	INT8U	len;
	INT8U	data[160];
}SM_TBLDATA_ITEM;

typedef rom struct _SM_TBL{
	INT8U	head;
	INT8U	tail;
	INT8U	numofSM;
	SM_TBLINDEX_ITEM index[SMTBLINDEXLEN];
	SM_TBLDATA_ITEM data[SMTBLLEN];
}SM_TBL;
//--------------------------------------
typedef rom struct _PHONEBOOK_ITEM{
	INT16U 	name[10];	//unicode
	INT8U	group;
	INT8U	number[12];	//compressed BCD code
	INT8U	previous;
	INT8U	next;
}PHONEBOOK_ITEM;

typedef rom struct _PHONE_BOOK{
	INT8U	head;
	INT8U	tail;
	PHONEBOOK_ITEM item[PHONEBOOKLEN+2];
}PHONEBOOK;
//----------------------------------------------------------------//
typedef rom struct _NCCSM_Info{
	INT8U Typ_Len;
	INT8U data[32];
}NCCSM_INFO;
//----------------------------------------------------------------//
typedef rom union _HCODE_SEC_ITEM{
	INT8U	b[4];
	INT16U	w[2];
}HCODE_SEC_ITEM;

typedef rom struct _HCODE_ITEM{
	INT8U	subnet;
	INT8U	num;
	HCODE_SEC_ITEM section[20];
}HCODE_ITEM;
//-------------------------------------
// 32 bytes 
typedef rom struct _RATE_TBL_ITEM{
	INT8U	num[8];
	INT16U  Rate1;
	INT16U  ChgTimUnit1;
	INT16U  Duration1;
	INT16U  Rate2;
	INT16U  ChgTimUnit2;
	INT16U  Duration2;
	INT8U	insertion[6];
	INT16U	option;
	INT8U	optarg[4];
}RATE_TBL_ITEM;

typedef rom struct _RATE_TBL{
	NM_TIME	starttime;
	RATE_TBL_ITEM	roaming_rate;
	RATE_TBL_ITEM	call_in_rate;
	INT16U			len;
	RATE_TBL_ITEM	item[RATETBLITEMNUM];
}RATE_TBL;
//----------------------------------------------------------------//
typedef rom struct _FEE_TABLE_ITEM{
	INT8U 	PeerNum[12];                   /*The number of the other side in this session*/
	INT8U 	LocalNum[6];							  /*The number of the local phone(BCD code)*/
	INT8U 	Method;                                                      /*Feature of the call*/
	NM_TIME StartTime;                                               /*The start time of the call*/
	INT16U  Duration;                           /*The duration of the call(Binary,second as unit)*/
	INT16U  Fee;                                        /*The fee of the call(Binary,fen as unit)*/
}FEE_TBL_ITEM;

/*******************************************************************
 * Here we define some file structure that contains different type *
 * of information used by different functions                      *
 *******************************************************************/
/**********************Start of definations*************************/
//-----------------------------------------------------------------//
// File 1: stores local work parameters, used by both pay-phone and//
//         business phone                                          //
//         This length of the file is fixed
//-----------------------------------------------------------------//
typedef rom struct _File_LocalPara{
	INT16U	CtlWord;	//bit0: 1-auto delete SM; 0- not..
	INT8U	PINCode[3];
	INT8U	SelfNum[6];
	INT8U	SpeakerVolume;
	INT8U	LockPassword[4];	//user password, initialized as "0000"
	INT8U	BackLED;
	INT8U	RingType;
	INT8U	ChgStartM;	//How to start charging, according to the signal or delay for a few seconds(ChgArg)
						//it can be NO_CHG, DLY_CHG, SIG_CHG
	INT8U	ChgArg;
}F_LocalPara;
//-----------------------------------------------------------------//
// File 2: stores information of the user, which is applied only on//
//         business phone                                          //
//-----------------------------------------------------------------//
typedef rom struct _file_UserPrivate{
	CALLRECORDTBL	UnAcceptCall;
	CALLRECORDTBL	RecentRxCall;
	CALLRECORDTBL	RecentTxCall;
	SM_TBL		SMTbl[2];	//one for RX and the other for RX
	PHONEBOOK	PhoneBook;
}F_UserPrivate;

//-----------------------------------------------------------------//
// File 3: stores information of Network Control Center, only app- //
//         lied on payphone (or some specially defined business    //
//         phone                                                   //
//-----------------------------------------------------------------//

struct _file_NCC{
	INT8U		NCCModemNum[6];
	INT8U		NCCID[6];
	NCCSM_INFO	NCCSMInfo;
	INT8U		FeeTblUploadTime[2];
};

//-----------------------------------------------------------------//
// File 4: stores information of call process control, used by any //
//         type of phone                                           //
//-----------------------------------------------------------------//

typedef rom struct _file_CallCtl{
	HCODE_ITEM	HCodeTbl[10];
	INT8U		CurRateTbl;
	RATE_TBL	RateTbl[NUMOFRATETBL];
}F_CallCtl;

//-----------------------------------------------------------------//
// File 5: stores information of call record such as number, fee,  //
//         time, duratin and so on. Only applied in payphone	   //
//-----------------------------------------------------------------//

struct _file_FeeRocord{
	INT16U			head;
	INT16U			tail;
	FEE_TBL_ITEM	item[FEETBLLEN];
};

//-----------------------------------------------------------------//
// File 6: stores LAC code information to lock the position of the //
//         phone. Except for special required, this file don't     //
//         used on any type of phone                               //
//-----------------------------------------------------------------//

struct _file_PosLock{
	INT16U LAC_CODE[240];
	INT16U LAC_Limit[16];
};
/**************************End of file definations*******************/

extern INT8U rom localpara_file[];

⌨️ 快捷键说明

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