Page 1 of 1

uart uart_set_pin forces me to set rts and cts, how to avoid losing gpio?

Posted: Thu Aug 17, 2017 8:11 pm
by LEMAOR
My application requires me to use serial communication to talk with a DFplayer module, which i have managed to run properly with arduino using TX and Rx.

Another situation of my application is that im using most of the GPIOs with none to spare,

the issue is when i try to start implement the uart,following the example i see the function to set the gpio pins i see that i am forced to set pins for rts and cts.

Seeing the example, i see this line:

Code: Select all

uart_set_pin(EX_UART_NUM, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
and following to \uart.c :

Code: Select all

esp_err_t uart_set_pin(uart_port_t uart_num, int tx_io_num, int rx_io_num, int rts_io_num, int cts_io_num)
i really have no pins to spare on rts and cts, is there a way i can avoid setting this pins like so?

can they be redeclared as outputs later? am i missing something?

Re: uart uart_set_pin forces me to set rts and cts, how to avoid losing gpio?

Posted: Fri Aug 18, 2017 11:26 am
by ESP_Sprite
No need to. You can pass UART_PIN_NO_CHANGE as the pin number for the pins you do not want to use, and the uart code will not claim a GPIO for those.

Re: uart uart_set_pin forces me to set rts and cts, how to avoid losing gpio?

Posted: Thu Feb 21, 2019 4:25 pm
by raoloka
  1. That's somewhat nebulous. So, looking at the code, I have no way of knowing whether the "default" hardware flow control pins are used for UART or not when the UART is in use. Can someone clarify?
  2.    - Thanks,
  3.     - Rao.