1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- /********************************************************************************
- * File Name: Serial.h
- * Function Describe: Header file for Serial.c
- * Explain:
- * Writer: ShiLiangWen
- * Date: 2015-1-30
- *******************************************************************************/
- #ifndef _Serial_H__
- #define _Serial_H__
- /***************************************************************************/
- #include <rtl.h>
- #define COM_SEL_MCU 0
- #define COM_SEL_GPS 1
- #define COM_SEL_MODEM 2
- typedef enum {INF = 0, DEBUG =1} TRACE_TYPE;
- #define UART1_RX_BUFFER_SIZE 200
- #define UART2_RX_BUFFER_SIZE (1024+20) //(IAP_RX_BUF+20)//+ZIPRECVU:1,256,xxx
- #define UART3_RX_BUFFER_SIZE 200
- extern unsigned char RxBuffer1[];
- extern unsigned char TxBuffer1[];
- extern unsigned short g_usUart1RecvLen;
- extern unsigned char RxBuffer2[];
- extern unsigned char TxBuffer2[];
- extern unsigned short g_usRx2Len;
- extern unsigned char g_ucUARTSel;
- extern unsigned char g_ucUART1RxMode;
- void Uart1Init(void);
- void Uart2Init(void);
- void UART1RxTxISRHandler(void);//串口1中断中回调此函数
- void UART2RxTxISRHandler(void);//串口2中断中回调此函数
- void SlwTrace(TRACE_TYPE type,char *buf,char );
- void ComSelect(unsigned char sel);
- void Uart1Send(char *txbuf,int len);
- void Uart2Send(unsigned char *txbuf,int len);
- void Uart1RxEnable(int en);
- void Uart1RecvProcess(void);
- void Uart2RecvProcess(void);
- //通过DMA发送
- void USART1_Send(char *pbuffer, unsigned short size);
- void USART1_SendWaitCompleted(void);
- void USART2_Send(char *pbuffer, unsigned short size);
- void USART2_SendWaitCompleted(void);
- void Uart3Init(void);
- void UART3RxTxISRHandler(void);
- extern unsigned short g_usRx3Len;
- extern unsigned short rx3_ct;
- extern unsigned char RxBuffer3[UART3_RX_BUFFER_SIZE];
- /***************************************************************************/
- #endif
|