How assign a given pin to another pin?

prem111
Posts: 3
Joined: Wed Mar 25, 2020 3:39 pm

How assign a given pin to another pin?

Postby prem111 » Tue Aug 04, 2020 7:29 am

How to assign a pin to another pin. Eg. wants to access pin 23 via pin 20. How to do it ?

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

Re: How assign a given pin to another pin?

Postby ESP_Sprite » Tue Aug 04, 2020 7:36 am

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.

prem111
Posts: 3
Joined: Wed Mar 25, 2020 3:39 pm

Re: How assign a given pin to another pin?

Postby prem111 » Tue Aug 04, 2020 8:20 am

Yes. I want to define gpio 12 to be gpio 14.

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

Re: How assign a given pin to another pin?

Postby ESP_Sprite » Tue Aug 04, 2020 11:17 am

For what reason? In which codebase?

Who is online

Users browsing this forum: Bing [Bot] and 109 guests