Page 1 of 1

how to configure pins for peripherals?

Posted: Tue May 02, 2017 8:38 pm
by johnabel
A quick one, I know how to set GPIO pins but how to set them to work as PWM outputs or UART?
According to the datasheet, any GPIO can be PWM or UART. How to do that?

Re: how to configure pins for peripherals?

Posted: Wed May 03, 2017 3:56 am
by WiFive
This sounds like an arduino question and if so it should be in the arduino forum.

Maybe check this example and look for other examples on github.
https://github.com/jkb-git/ESP32Servo

Re: how to configure pins for peripherals?

Posted: Wed May 03, 2017 4:38 am
by johnabel
Thanks, WiFive, but I'm not using Arduino but the ESP IDF. If that is possible with Arduino I suppose there is a way with the native IDF.

Re: how to configure pins for peripherals?

Posted: Wed May 03, 2017 4:40 am
by WiFive

Re: how to configure pins for peripherals?

Posted: Wed May 03, 2017 7:28 pm
by johnabel
Thanks WiFive, I have had a quick browse at the examples without luck but will carry on. I expect somebody (or myself) to come with a more valuable answer to improve the forum with valuable questions and answers, otherwise it will be a useless collection of "it's out there, go find it"

Re: how to configure pins for peripherals?

Posted: Wed May 03, 2017 8:30 pm
by johnabel
I was interested in configuring PWM and UART.
The PWM is well hidden in the ledc.c/h files. The example peripherals/leds is actually what I was looking for.
The peripherals\uart_echo example shows how to configure pins for the UART

Re: how to configure pins for peripherals?

Posted: Thu May 04, 2017 3:17 am
by WiFive
I knew you could do it!