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

LEMAOR
Posts: 6
Joined: Thu Aug 17, 2017 7:51 pm

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

Postby LEMAOR » Thu Aug 17, 2017 8:11 pm

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?

ESP_Sprite
Posts: 9772
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Fri Aug 18, 2017 11:26 am

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.

raoloka
Posts: 2
Joined: Mon Feb 11, 2019 11:22 pm

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

Postby raoloka » Thu Feb 21, 2019 4:25 pm

  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.

Who is online

Users browsing this forum: No registered users and 69 guests