typedef struct
{
uint16 baudRate;
}halUARTCfg_t;
.configured – Set by the function when the port is setup correctly and read to be used.
当串口准备好时由函数设置。
串口的速率
.flowControl – UART flow control can be set as TRUE or FALSE. TRUE value will
enable flow control and FALSE value will disable flow control.
流控制,TRUE 允许对串口进行流控制;FALSE不允许对串口进行流控制
.flowControlThreshold – Number of bytes left before Rx buffer reaches maxRxBufSize.
When Rx buffer reaches this number (maxRxBufSize – flowControlThreshold) and flowControl is
TRUE, a callback will be sent back to the application with HAL_UART_RX_ABOUT_FULL
event.
在RX缓存达到maxRxBufSize之前还有多少字节空余。当到达maxRxBufSize – flowControlThreshold时并且流控制打开时,会触发相应的应用事件:HAL_UART_RX_ABOUT_FULL
.idleTimeout – Rx timeout period in milliseconds. If Rx buffer haven’t got new data for idleTimout amount of time, a callback will be issued to the application with
HAL_UART_RX_TIMEOUT event. The application can choose to read everything from the Rx
buffer or just partial of it.
如果在idleTimout 时间内RX还没有得到新的数据,将会触发相应的事件HAL_UART_RX_TIMEOUT ,这时应用可以选择读出所有RX的值或者一部分。
.rx – Contains halUARTBufControl_t structure that used to manipulate Rx buffer
包含 halUARTBufControl_t 数据结构用于控制RX缓存
.tx – Contains halUARTBufControl_t structure that used to manipulate Tx buffer
包含halUARTBufControl_t 数据结构用于控制TX缓存
typedef struct
{
}halUARTBufControl_t;
maxBufSize – holds maximum size of the Rx/Tx buffer that the UART can hold at a
time. When this number is reached, HAL_UART_RX_FULL or HAL_UART_TX_FULL
will be sent back to the application as an event through the callback system.
*pBuffer – pointer to the buffer that contains the Rx data
指向接收字节的缓冲区
.intEnable – enable/disable interrupt. It can be set as TRUE or FALSE. TRUE value will
enable the interrupt and FALSE value will disable the interrupt.
串口中断使能
callBackFunc –
回调函数,应用层可以根据RX、TX出发的不同事件进行处理。