#ifndef _BSP_USART_H
#define _BSP_USART_H
#include "bsp.h"
#define UARTTEST 1
#define WiRELESSINIT {\
GPIO_Init(GPIOD,GPIO_Pin_0,GPIO_Mode_Out_PP_Low_Slow);\
GPIO_Init(GPIOD,GPIO_Pin_1,GPIO_Mode_Out_PP_Low_Slow);\
}
#define ConfigMode1 {\
GPIO_WriteBit(GPIOD,GPIO_Pin_0,RESET);\
GPIO_WriteBit(GPIOD,GPIO_Pin_1,SET);\
}

#define ConfigMode2 {\
GPIO_WriteBit(GPIOD,GPIO_Pin_0,RESET);\
GPIO_WriteBit(GPIOD,GPIO_Pin_1,RESET);\
}

#define ConfigMode3 {\
GPIO_WriteBit(GPIOD,GPIO_Pin_0,SET);\
GPIO_WriteBit(GPIOD,GPIO_Pin_1,SET);\
}

enum
{
	winit_start = 0,
	winit_cmd_send = 1,
	winit_delay = 2,
	winit_ing = 3,
	winit_ok = 4,
	winit_error = 5
};
enum
{
	init_start = 0,
	init_cmd_send = 1,
	init_delay = 2,
	init_ing = 3,
	init_ok = 4,
	init_error = 5
};
struct WIRELESS_INIT
{
    bool InitFlag;
    uint32_t SendDelay;
    uint32_t InitDelay;
};

#define WIRELESS_INIT_DEFAULT {\
FALSE,\
0,\
0\
}
extern struct WIRELESS_INIT wireless_init;
extern uint8_t UartRecLen;
extern uint8_t UartRecBuff[25];
extern uint8_t UartTimeOut;
void bsp_usart_init(void);
void UartTest(void);
void UsartPrint(uint8_t *data,uint32_t len);
void UartRecDeal(void);
void HostPCSend(void);
static void WirelessInit(struct WIRELESS_INIT *WirelessInitCp,uint8_t *wireless,uint8_t num);





#endif