Serial.h 910 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __SERIAL_H_
  2. #define __SERIAL_H_
  3. typedef enum {INF = 0, DEBUG =1} TRACE_TYPE;
  4. #define COM_SEL_MCU 0
  5. #define COM_SEL_GPS 1
  6. #define COM_SEL_MODEM 2
  7. #define UART1_RX_BUFFER_SIZE 200
  8. #define UART2_RX_BUFFER_SIZE (512+30) //(IAP_RX_BUF+20)//+ZIPRECVU:1,256,xxx //512+30
  9. #define UART3_RX_BUFFER_SIZE 300
  10. extern unsigned short g_usUart1RecvLen;
  11. extern unsigned char RxBuffer1[UART1_RX_BUFFER_SIZE];
  12. void Uart1Init(void);
  13. void Uart1RxEnable(int en);
  14. void SlwTrace(TRACE_TYPE type,char *buf,char needEnd);
  15. void UART1RxTxISRHandler(void);
  16. extern unsigned short rx1_ct;
  17. void Uart2Init(void);
  18. void UART2RxTxISRHandler(void);
  19. void Uart2Send(unsigned char *txbuf,unsigned short len);
  20. void Uart2RecvProcess(void);
  21. extern unsigned short g_usUart3RecvLen;
  22. extern unsigned char RxBuffer3[UART3_RX_BUFFER_SIZE];
  23. void Uart3Init(void);
  24. void UART3RxTxISRHandler(void);
  25. void ComSelect(unsigned char sel);
  26. #endif