#ifndef __USART_H
#define __USART_H
#include "stdio.h"	
#include "stm32f4xx_conf.h"
#include "sys.h" 
 
//////////////////////////////////////////////////////////////////////////////////	 
// Ghz ljw 23.4.28 串口 升级版
////////////////////////////////////////////////////////////////////////////////// 	
#define USART_REC_LEN 		16392 //8192 //16392//(16 * 1024 + 8)//16392// //定义最大接收字节数 16K
#define EN_USART6_RX 			1		//使能（1）/禁止（0）串口1接收

extern u8  USART_RX_BUF[USART_REC_LEN]; //接收缓冲,最大USART_REC_LEN个字节.末字节为换行符 

#define USART_SENDBACK_BUF_MAXBYTES 2048
#define USART_SENDBACK_BUF_MAXBYTES_LAST (2048+128)

extern u8  USART_WR_BUF[USART_SENDBACK_BUF_MAXBYTES];
extern u8  USART_WR_BUF_LAST[USART_SENDBACK_BUF_MAXBYTES_LAST];
//extern u8 CH_Data_Rev_done;
//extern u8 AD5668_Data_Rev_done;
//extern u8 PE43711_Data_Rev_done;
//extern u8 CD4094_Data_Rev_done;
//extern u8 Data_wrong;
////如果想串口中断接收，请不要注释以下宏定义
extern void uart_init(u32 bound);
extern void USART6_Send(u8 cmd,int sendLength,u8 bIsContentBitInverted_SendBack);

#define UsartMaxPackageCount 20
extern u16 Usart_RecvedPackage[UsartMaxPackageCount];
extern u8  Usart_RecvedPackageIndex;
extern u8  Usart_ProcessPackageIndex;
extern void USART6_CommunicateReset(void);
#endif


