/*
 *  Author :CuCo
 *  Date 2021-04-16 18:22:55
 *  LastEditors :CuCo
 *  LastEditTime 2021-06-09 10:00:14
 *  FilePath \ChipON-RT-Thread-Nano-KF32A152\BSP\Usart.h
 * Copyright (C) 2021 CuCo. All rights reserved.
 */

#ifndef _USART_H_
#define _USART_H_
//#include  "stdio.h"

#define USART0_STREAM                     ((STREAM *)0x40000980UL)
#define USART1_STREAM                     ((STREAM *)0x40000A00UL)
#define USART2_STREAM                     ((STREAM *)0x40000A80UL)
#define USART3_STREAM                     ((STREAM *)0x40000B00UL)
#define USART4_STREAM                     ((STREAM *)0x40000B80UL)

#define USART5_STREAM                     ((STREAM *)0x40001E80UL)
#define USART6_STREAM                     ((STREAM *)0x40001F00UL)
#define USART7_STREAM                     ((STREAM *)0x40001F80UL)

extern void GPIO_USART2();
extern void USART_Async_config(USART_SFRmap *USARTx);//串口异步全双工配置
extern void USART_Sync_config(USART_SFRmap* USARTx);//串口半双工同步配置
extern void USART_ReceiveInt_config(USART_SFRmap *USARTx,InterruptIndex Peripheral);//串口接收中断使能
extern void USART_Send(USART_SFRmap* USARTx, uint8_t* Databuf, uint32_t length);//串口发送函数

#define	INV_MSG_DISABLE

#if defined(INV_MSG_DISABLE)
#define MY_MSG(...) (void)0
#else
#define MY_MSG(...) fprintf(USART2_STREAM, __VA_ARGS__)

#endif


#endif /* USART_H_ */
