Search found 2 matches

by iakihsoug
Mon Oct 18, 2021 6:31 am
Forum: ESP-IDF
Topic: How to get UART_NUM via uart_driver_install
Replies: 1
Views: 1458

How to get UART_NUM via uart_driver_install

When I use uart_driver_install with two uart like:
uart_driver_install(UART_NUM_0, BUF_SIZE * 2, BUF_SIZE * 2, 20, &uart_queue, 0);
uart_driver_install(UART_NUM_1, BUF_SIZE * 2, BUF_SIZE * 2, 20, &uart_queue, 0);

can I get uart_num in uart_queue?
by iakihsoug
Mon Oct 18, 2021 4:32 am
Forum: ESP-IDF 中文讨论版
Topic: 关于uart_driver_install
Replies: 0
Views: 1452

关于uart_driver_install

我希望从某个UART_NUM接收到的数据返回到这个UART_NUM中去,他们共用同一个队列
请问是否可以在uart_driver_install的queue中,获取到具体的UART_NUM?
uart_driver_install(UART_NUM0, BUF_SIZE * 2, BUF_SIZE * 2, 20, &uart_queue, 0);
uart_driver_install(UART_NUM1, BUF_SIZE * 2, BUF_SIZE * 2, 20, &uart_queue, 0);
如果不行的话,是否有其他的实现方式?
谢谢