how to configure pins for peripherals?

johnabel
Posts: 46
Joined: Sun Mar 26, 2017 5:06 pm

how to configure pins for peripherals?

Postby johnabel » Tue May 02, 2017 8:38 pm

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?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: how to configure pins for peripherals?

Postby WiFive » Wed May 03, 2017 3:56 am

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

johnabel
Posts: 46
Joined: Sun Mar 26, 2017 5:06 pm

Re: how to configure pins for peripherals?

Postby johnabel » Wed May 03, 2017 4:38 am

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.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: how to configure pins for peripherals?

Postby WiFive » Wed May 03, 2017 4:40 am


johnabel
Posts: 46
Joined: Sun Mar 26, 2017 5:06 pm

Re: how to configure pins for peripherals?

Postby johnabel » Wed May 03, 2017 7:28 pm

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"

johnabel
Posts: 46
Joined: Sun Mar 26, 2017 5:06 pm

Re: how to configure pins for peripherals?

Postby johnabel » Wed May 03, 2017 8:30 pm

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

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: how to configure pins for peripherals?

Postby WiFive » Thu May 04, 2017 3:17 am

I knew you could do it!

Who is online

Users browsing this forum: MicroController, noweare and 180 guests