my_def.h
上传用户:shyuanyi
上传日期:2008-05-24
资源大小:69k
文件大小:8k
- #ifndef _MY_DEF_H_
- #define _MY_DEF_H_
- /******************************************/
- typedef union
- {
- LWORD ll;
- WORD ii;
- BYTE ch[4];
- }LL_II_CH;
- /******************************************/
- typedef struct
- {
- BYTE event;
- WORD time;
- }TIMER_EVENT;
- #define KEY_SIZE 15
- typedef struct
- {
- BYTE key_buf[KEY_SIZE];
- BYTE KEY_OP;
- long key_val;
- BYTE dot_count;
- BYTE key_count;
- }KEY_STR;
- /*
- #define UART_SIZE 5
- typedef struct
- {
- BYTE head;
- BYTE tail;
- BYTE array[UART_SIZE];
- }QUEUE_UART;
- #define MEMPAGE_SIZE 264
- typedef struct
- {
- BYTE head;
- BYTE tail;
- BYTE buf[MEMPAGE_SIZE];
- }QUEUE_MEMPAGE;
- */
- typedef struct //message
- {
- BYTE Code;
- BYTE Dat;
- }MESSAGE;
- #define MESSAGE_SIZE 5
- typedef struct //message queue
- {
- BYTE head;
- BYTE tail;
- MESSAGE array[MESSAGE_SIZE];
- }QUEUE_MESSAGE;
- /***************************************************/
- extern void Renew_To_AllInit(void);//(内容重置,恢复为初态)
- extern void Init_Sound(void);
- extern bit Sound_Play(BYTE index);
- extern void Sound_Err(BYTE errcod);
- extern void do_buzzer(BYTE count);
- extern void My_Do_Buzzer(BYTE time,BYTE count);
- //extern void Init_Message(void);
- extern void Message_Clear(void);
- extern bit PostMessage(BYTE Code, BYTE Dat);
- extern bit GetMessage(MESSAGE *Message);
- extern void Do_Process(MESSAGE Message);
- extern void SetCurState(BYTE stat); // (状态切换)
- extern BYTE GetCurState(void);
- extern void Init_Timer0(void);
- extern bit Set_TimerEvent(BYTE event,WORD times_20ms);
- extern void Stop_Timer(BYTE evt);
- extern void Stop_All_Timer(void);
- extern BYTE Check_Timer_Event(void);
- extern void Set_Timer20ms(BYTE t20ms);
- extern BYTE Get_Timer20ms(void);
- extern void delay_ms(WORD ms);
- extern void do_nop(BYTE Count);
- //#define UARTBUF_SIZE 180
- extern BYTE xdata uartSbuf[];
- extern void Uart_Init(void);
- extern void UartBuf_Clear(void);
- //extern void Uart_Putc(BYTE ch);//can't use rs485!
- extern bit SendStr(BYTE *ptr,int count);//"BYTE" modiry to "int" by 2004-6-18
- extern bit Check_Uart_Event(void);
- extern void Do_CheckEquip(BYTE dat);
- /*
- extern void Do_SetDinnerParam(void);
- extern void Do_GetDinnerParam(void);
- extern void Do_SetDinnerCardClass_Para(void);
- extern void Do_GetDinnerCardClass_Para(void);
- */
- extern void Do_SetAutoGainCards();
- extern void Do_GetAutoGainCards();
- extern void Do_SetAutoGainParam();
- extern void Do_GetAutoGainParam();
- extern void Do_ReadConData(void);
- extern void Do_SetConRecode(void);
- extern void Do_SetSystemTime(void);
- extern void Do_GetSystemTime(void);
- //extern void Do_SetBh_Money(void);
- //extern void Do_GetBh_Money(void);
- extern void Do_SetNumber(void);
- extern void Do_GetNumber(void);//and 2004-09-5
- extern void Do_ClearConParam(void);
- //extern void Do_SendDcpeoples(void);
- extern void Do_GetConStatusInfo(void);
- extern void Do_GetEquipVersionInfo(void);
- //extern void Do_SetOpUserInfo(void);
- //extern void Do_GetCurOpUserInfo(void);
- //extern void Do_SetLostCardTime(void);
- //extern void Do_GetLossCardsTime(void);
- extern void Do_SendCardStatus(void);
- extern void Do_GetCardStatus(void);
- extern void Init_spi(void);
- //extern BYTE SpiByte_SendReceive(BYTE sdat);
- extern BYTE KeySpiByte_SendReceive(BYTE sdat);
- extern BYTE MemSpiByte_SendReceive(BYTE sdat);
- extern BYTE code D_DISPLAY[];
- extern void Init_KeyLed(void);
- extern BYTE Check_Key_Event(void);
- extern void Display_str(BYTE str[]);
- extern void Do_Led(BYTE led_dat);
- extern void Do_DisLed_Flash(BYTE disflash,BYTE ledflash,BYTE flashtime);
- extern KEY_STR idata thekey;
- extern void KeyVal_Tobuf(void);
- extern void KeyBuf_Clear(bit val_flag);
- extern void Dis_KeyBuf(void);
- extern void Dis_Err(BYTE cod);
- extern void Do_WriteClock(BYTE buf[7]);
- extern void Do_ReadClock(BYTE buf[7]);
- extern void Init_DateIC(void); //DS1302
- extern void DisplayClock(void);
- extern void DisplayDate(void);
- extern bit mymem_ok_flag;
- //extern Card_Info pdata mycard;
- extern Equip_Addr pdata equip_addr;
- //extern Op_User_Info xdata op_user_info;
- //extern Con_param_Info xdata con_param_info;
- extern Myall_SaveData xdata myall_savedata;
- extern SeedCard_Info xdata seedcard_info;
- extern Con_StatusInfo xdata con_statusinfo;
- extern sttOtherTableInfo xdata stOtherTableInfo;
- //extern Dc_Peoples xdata dc_peoples;
- extern BYTE xdata cardstate_time[6];
- extern void Init_Memory(void);
- extern BYTE Memory_Check(void);
- extern BYTE Save_My_All_Data(void);
- extern BYTE Restore_My_All_Data(void);
- extern void DoTest_ArrayRead_Memory(WORD pageaddr);
- extern BYTE Save_ConData_to_Memory(Con_Record *con_record);
- extern BYTE Read_ConData_From_Memory(Con_Record *con_record);
- extern BYTE Del_ConData_From_Memory(Con_Record *con_record);
- extern BYTE Renew_ConData_From_Memory(Con_Record *con_record);
- extern BYTE Saveparam_To_Mem(void);
- extern BYTE ClearConParam_From_Mem(void);//恢复到初始出厂状态。
- //extern BYTE SaveCardClass_To_Mem(Card_Class_Para *card_class);
- //extern BYTE ReadCardClass_from_Mem(Card_Class_Para *card_class);
- //extern BYTE DelAllBh_Money(void);
- //extern BYTE SaveBh_Money_To_Mem(BYTE *Buf,BYTE len);
- //extern BYTE ReadBh_Money_From_Memory(Bh_Money *bh_money,BYTE Cod);
- //extern BYTE SaveCardState_To_Mem(Card_Status *card_status);
- //extern bit Check_LostCard(BYTE *cards);//FindCardState_From_Mem(BYTE *cards);
- //extern BYTE DelCardState_From_Mem(BYTE *cards);
- //===================================================================
- extern void Init_Rfic(void);
- extern BYTE Do_RfIC(long *val,BYTE into_flag);
- extern BYTE Check_Card_Event(BYTE allmode);
- extern BYTE idata Equip_CurStatus;//设备当前状态。
- extern void Check_Power_Event(void);
- extern void Init_Led_Save(void);
- //extern void Dis_ConMode(void);
- extern void Dis_Cellpower_Led(bit ledflag); //0-close;1--open.
- extern void Dis_Comming_Led(bit ledflag); //0-close;1--open.
- extern void Dis_consume_Led(bit ledflag); //0-close;1--open.
- extern void Dis_Balance_Led(bit ledflag); //0-close;1--open.
- extern void Dis_DataFull_Led(bit ledflag); //0-close;1--open.
- //================================================================
- //do_seach.c
- //extern char idata dis_tab_s;
- extern void Dis_Equip_Code(void);
- extern void Dis_Con_Records(void);
- extern void Dis_Test_Data(void);
- //set_para
- //extern bit set_del_enble_flag;
- extern bit my_for_test_bit;
- extern void My_KeyBuf_Clear(void);
- extern bit My_Save_Key(BYTE Key);
- extern bit My_Back_Key(void);
- extern void My_Dis_KeyBuf(void);
- //do_pass
- extern void Clear_PassWord(void);
- extern void Dis_PassWord(void);
- //do_card
- //extern BYTE GetSEEDCardTest(SeedCard_Info *card);
- //extern void Count_Sector_PWD(BYTE pbuf[],BYTE card_snr[4],BYTE sector);
- //lockbell.c
- extern void Init_LockBell(void);
- extern void Dis_Err_Led(bit bOnOff);//0-close;1--open.
- extern void Dis_Con_Led(bit bOnOff); //0-close;1--open.
- extern void Dis_cNumber(BYTE cNumber[3]);
- extern void Dis_Consume_Led(bit ledflag);//0-close;1--open.
- //================================================================
- extern BYTE Do_DisClockEvent_0(BYTE Dat);
- extern BYTE Do_FirstKey_Even_1(BYTE Key);
- extern BYTE Do_NextKey_Even_2(BYTE Key);
- extern BYTE Do_KeyTmierEvent_3(BYTE Dat);
- extern BYTE Do_WaitCardKey_Even_4(BYTE Key);
- extern BYTE Do_WaitCardTmier_Event_5(BYTE Dat);
- extern BYTE Do_TestCardWrite_Event_6(BYTE Dat);
- extern BYTE Do_DisCardVal_Event_7(BYTE Dat);
- extern BYTE Do_CardConsume_Event_8(BYTE Dat);
- extern BYTE Do_CheckCard_Event_9(BYTE dat);
- extern BYTE Do_SearchKey_Even_10(BYTE Key);
- extern BYTE Do_SetParaKey_Even_11(BYTE Key);
- //extern BYTE Do_Uart_Event_12(BYTE dat);
- extern BYTE Do_BhConNextKey_Even_12(BYTE Key);
- extern BYTE Do_PassWordKey_Even_13(BYTE Key);
- /******************************************************************/
- #endif