This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
HAL_UART_DMA_IDLE这个参数具体是什么作用,参数的值大小设置有没有限制?在低波特率的时候,一帧数据被拆分成好几次传输,网上有人说可以修改这个参数,但是没看明天它的具体作用。
您可以看一下
#define HAL_UART_DMA_IDLE (1 * HAL_UART_MSECS_TO_TICKS)
且
dmaCfg.rxTick = HAL_UART_DMA_IDLE;
在串口配置中,有 uartConfig.idleTimeout = SERIAL_APP_IDLE; // 这个参数主要用于串口接收中,在串口接收到数据开始算起,如果经过idleTimeout ms的时间还没有接收到新的数据,那么就会调用callback函数,并返回事件HAL_UART_RX_TIMEOUT,用于回调函数中进行具体的判断。
在协议栈安装文件夹内的 HAL Driver API.pdf内有相关说明
config.idleTimeout – This parameter indicates rx timeout period in milliseconds. If Rx buffer hasn’t received 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 a part of it. This parameter is supported only by MSP platforms. For CC2530 platforms, this parameter is replaced with compile flag HAL_UART_ISR_IDLE (in case interrupt is used) or HAL_UART_DMA_IDLE (in case DMA is used).