#ifndef __RS485_H__
#define __RS485_H__



#include "./SYSTEM/sys/sys.h"
#include "./SYSTEM/delay/delay.h"

#define UART_RX_LEN     (3208)
#define UART_TX_LEN     (8)

typedef struct
{ 
  volatile FlagStatus NewMessageFlag;     //一帧数据接收完整
  volatile uint8_t DR[UART_RX_LEN];       //接收缓存
  volatile uint8_t TDR[UART_TX_LEN];      //发送缓存
} RS485_REGISTER_TYPE;

extern RS485_REGISTER_TYPE RS485REG;




void USART2_Init(void);
void RS485_DMA_init(void);
void RS485_SendBuff(uint8_t *ptr, uint32_t len);


#endif
