45 lines
472 B
C
45 lines
472 B
C
#ifndef _UART_BOARD_H
|
|
#define _UART_BOARD_H
|
|
#include <stdint.h>
|
|
|
|
|
|
typedef enum UartId_t
|
|
{
|
|
LpUart1,
|
|
LpUart2,
|
|
Uart1,
|
|
Uart2,
|
|
Uart3,
|
|
Uart4,
|
|
Uart5,
|
|
Uart6,
|
|
}UartId_t;
|
|
|
|
|
|
typedef enum UartPara_t{
|
|
_8N1,
|
|
_8E1,
|
|
_8O1,
|
|
_7O1,
|
|
_7E1,
|
|
_7N1,
|
|
}UartPara_t;
|
|
|
|
typedef struct UartDrv_t
|
|
{
|
|
UartId_t Id;// 串口号
|
|
uint32_t BaudRate;// 波特率
|
|
UartPara_t Para; // 数据位
|
|
char * rx_buffer;
|
|
uint16_t rx_size;
|
|
uint32_t rx_ready;// 接受完成等待处理
|
|
}UartDrv_t;
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|