SmartCar-V1/Code/bsp/inc/bsp_usart.h

53 lines
943 B
C
Raw Normal View History

#ifndef __BSP_USART_H__
#define __BSP_USART_H__
#include "stdint.h"
#include "stm32f10x.h"
#define UART1_FIFO_EN 0
#define UART2_FIFO_EN 1
#define UART3_FIFO_EN 0
#if UART1_FIFO_EN == 1
#define UART1_TX_BUF_SIZE 1*1024
#define UART1_RX_BUF_SIZE 1*1024
#endif
#if UART2_FIFO_EN == 1
#define UART2_TX_BUF_SIZE 1*1024
#define UART2_RX_BUF_SIZE 1*1024
#endif
#if UART3_FIFO_EN == 1
#define UART3_TX_BUF_SIZE 1*1024
#define UART3_RX_BUF_SIZE 1*1024
#endif
typedef enum
{
COM_DEBUG = 0,
COM_IR_CONTROLLER,
COM_RECV1,
COM_NUM
}com_type_ENUM;
void bsp_usartTotalInit(void);
void bsp_usart_debug_init(void);
void bsp_usart_IrController_init(void);
uint8_t bsp_usart_IsComRecvChar(com_type_ENUM e_com);
uint8_t bsp_usart_GetComChar(com_type_ENUM e_com, uint8_t *recv_uc);
// void bsp_usart_send_data(usart_type_Enum e_usart_type, uint16_t us_tx_data);
// uint16_t bsp_usart_receive_data(usart_type_Enum e_usart_type);
#endif