Page 1 of 1

How assign a given pin to another pin?

Posted: Tue Aug 04, 2020 7:29 am
by prem111
How to assign a pin to another pin. Eg. wants to access pin 23 via pin 20. How to do it ?

Re: How assign a given pin to another pin?

Posted: Tue Aug 04, 2020 7:36 am
by ESP_Sprite
You can't route pins to pins; you can route functions to pins. For instance, if you do not like the default UART or SPI pins, you can use the GPIO matrix (usually indirectly, using an argument to the driver initialization call) to re-route it to a different GPIO. For GPIO pins used as GPIO pins, you just change the pin definition itself.

Can you tell us a bit more about why you'd want to do this? As it is, your question sounds like an XY problem.

Re: How assign a given pin to another pin?

Posted: Tue Aug 04, 2020 8:20 am
by prem111
Yes. I want to define gpio 12 to be gpio 14.

Re: How assign a given pin to another pin?

Posted: Tue Aug 04, 2020 11:17 am
by ESP_Sprite
For what reason? In which codebase?