2024-11-30 10:27:03 +08:00
|
|
|
#ifndef __BSP_USART_H__
|
|
|
|
#define __BSP_USART_H__
|
|
|
|
|
|
|
|
#include "stdint.h"
|
2025-05-08 23:18:49 +08:00
|
|
|
#include "stm32f10x.h"
|
2024-11-30 10:27:03 +08:00
|
|
|
|
2025-05-08 23:18:49 +08:00
|
|
|
#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
|
|
|
|
|
2025-05-10 22:01:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
typedef enum
|
2025-05-08 23:18:49 +08:00
|
|
|
{
|
2025-05-10 22:01:27 +08:00
|
|
|
COM_DEBUG = 0,
|
|
|
|
COM_IR_CONTROLLER,
|
|
|
|
COM_RECV1,
|
|
|
|
COM_NUM
|
|
|
|
}com_type_ENUM;
|
|
|
|
|
|
|
|
|
2025-05-08 23:18:49 +08:00
|
|
|
|
|
|
|
void bsp_usartTotalInit(void);
|
2024-11-30 10:27:03 +08:00
|
|
|
|
2025-05-05 22:37:13 +08:00
|
|
|
void bsp_usart_debug_init(void);
|
2024-11-30 10:27:03 +08:00
|
|
|
|
2025-05-08 23:18:49 +08:00
|
|
|
void bsp_usart_IrController_init(void);
|
2025-05-10 22:01:27 +08:00
|
|
|
|
|
|
|
uint8_t bsp_usart_IsComRecvChar(com_type_ENUM e_com);
|
|
|
|
|
|
|
|
uint8_t bsp_usart_GetComChar(com_type_ENUM e_com, uint8_t *recv_uc);
|
2025-05-05 22:37:13 +08:00
|
|
|
// void bsp_usart_send_data(usart_type_Enum e_usart_type, uint16_t us_tx_data);
|
2024-11-30 10:27:03 +08:00
|
|
|
|
2025-05-05 22:37:13 +08:00
|
|
|
// uint16_t bsp_usart_receive_data(usart_type_Enum e_usart_type);
|
2024-11-30 10:27:03 +08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|