| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- /**
- * @file commution.h
- * @version V1.0.0
- * @author jaise
- * @date 2023-8-16 09:35:55
- * @brief This file contains ...
- *
- * @copyright Copyright(C) 2022 Fortior Technology Co., Ltd. All rights reserved.
- */
- #ifndef __COMMUTION_H__
- #define __COMMUTION_H__
- // Include external header file.
- #if (Uart_COMMUNICATION==0)
- #define RX_LEN 20
- #define TX_LEN 20
- #elif (Uart_COMMUNICATION==1)
- #define RX_LEN 23
- #define TX_LEN 23
- #endif
- #define RX_ZHENTOU 0x00
- #define TX_ZHENTOU 0x95
- #define RX_LEN1 8
- #define TX_LEN1 11
- #define RX_ZHENTOU1 0x81
- #define TX_ZHENTOU1 0x28
- #define T_mreset 5000 //5000ms
- #define T_mrxerr 180 //180s
- #define T_mchgerr 120 //120s
- #define T_mtxcyc 230 //230ms
- #define T_mcomcyc 500 //500ms
- #define T_mfrmwt 25 //25ms
- #define T_mwtchg 50 //50ms
- #define evnodd 0 //0: ????1:???
- typedef union
- {
- uint8 DATA00;
- struct
- {
- uint8 DATA0 : 1; //DATA1.0
- uint8 DATA1 : 1; //DATA1.1
- uint8 DATA2 : 1; //DATA1.2
- uint8 DATA3 : 1; //DATA1.3
- uint8 DATA4 : 1; //DATA1.4
- uint8 DATA5 : 1; //DATA1.5
- uint8 DATA6 : 1; //DATA1.6
- uint8 DATA7 : 1; //DATA1.7
- } bf;
- }ddatet00;
- //????typedef struct
- typedef union
- {
- uint8 DATAT00;
- struct
- {
- uint8 DATA0 : 1; //DATA1.0
- uint8 DATA1 : 1; //DATA1.1
- uint8 DATA2 : 1; //DATA1.2
- uint8 DATA3 : 1; //DATA1.3
- uint8 DATA4 : 1; //DATA1.4
- uint8 DATA5 : 1; //DATA1.5
- uint8 DATA6 : 1; //DATA1.6
- uint8 DATA7 : 1; //DATA1.7
- } bf;
- }MCUART_Rec00;
-
- typedef struct
- {
- uint8 R_DATA[42];
- uint8 T_DATA[42];
- int16 uarttimejishu;
- uint8 recive_lenth;
- uint16 Uart_Tmreset;
- uint16 Uart_Tmcomcyc;
- uint8 Uart_Recivetime;
- uint8 Oder;
- uint8 Recive_Flag;
-
-
- uint8 recive_sussf_falg;
- uint8 send_start_falg;
- uint8 sussf_falg;
- uint8 sendflag;
- uint8 ResponseFlag;
- uint16 time_cnt;
- uint16 time_shuju;
-
- uint8 UartReadTemp;
- uint8 UartReadCnt;
- uint8 TxCnt;
- uint8 send_delay_time;
-
- uint16 YaJI_Speed;
- uint16 FengSpeed;
- int16 PengZhangFa;
- int16 PengZhangFa_ACT;
- uint8 u1IduRevDataCnt;
- }MCUART;
- extern MCUART xdata Uart;
- extern uint8 BBC(uint8* puchMsg, uint8 usDataLen);
- extern unsigned char u1_cnt_idu_comm_task;
- extern MCUART_Rec00 xdata Uart_Rec_DATA00;
- extern MCUART_Rec00 xdata Uart_Rec_DATA01;
- extern MCUART_Rec00 xdata Uart_Rec_DATA02;
- extern MCUART_Rec00 xdata Uart_Rec_DATA03;
- extern MCUART_Rec00 xdata Uart_Rec_DATA04;
- extern MCUART_Rec00 xdata Uart_Rec_DATA05;
- extern MCUART_Rec00 xdata Uart_Rec_DATA06;
- extern MCUART_Rec00 xdata Uart_Rec_DATA09;
- extern MCUART_Rec00 xdata Uart_Rec_DATA10;
- extern MCUART_Rec00 xdata Uart_Rec_DATA12;
- extern MCUART_Rec00 xdata Uart_Rec_DATA13;
- extern MCUART_Rec00 xdata Uart_Rec_DATA14;
- extern MCUART_Rec00 xdata Uart_Rec_DATA15;
- extern void UartRecive1(void);
- extern void UartSend1(void);
- extern void UartDealResponse1(void);
- extern void UartDealResponse2(void);
- extern void Uart_Int01(void);
- extern void Uart_Int02(void);
- extern void Uart_Int_Finsh(void);
- extern void Uart_Run01(void);
- extern void Uart_Run02(void);
- extern void Uart_Run03(void);
- #endif
|