-->
Page 1 of 1

Enable/Disable internal pullup resistors?

PostPosted: Wed Dec 03, 2014 1:09 am
by GeoNomad
I see reference to macros that can enable or disable internal pullup or pulldown resistors.

However, the only place I find that is on the UART.

Has anyone tried to change the configuration on other GPIO pins?

Nothing in user_plug.c but the macros do show up in uart.c.


Please refer to \user\ user_plug.c。
5.1.1. PIN setting macro
 PIN_PULLUP_DIS(PIN_NAME)
Disable pin pull up
 PIN_PULLUP_EN(PIN_NAME)
Enable pin pull up
 PIN_PULLDWN_DIS(PIN_NAME)
Disable pin pull down
 PIN_PULLDWN_EN(PIN_NAME)
Enable pin pull down
 PIN_FUNC_SELECT(PIN_NAME, FUNC)
Select pin function
Example:PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12);
Use MTDI pin as GPIO12。

Re: Enable/Disable internal pullup resistors?

PostPosted: Wed Dec 03, 2014 6:48 am
by erl
I do this in my driver for the DS18B20 one-wire temperature sensor in the Frankenstein hardware. See:

https://github.com/nekromant/esp8266-fr ... _ds18b20.c

In the ds_init function.

Happy hacking!

Re: Enable/Disable internal pullup resistors?

PostPosted: Wed Dec 03, 2014 9:51 am
by GeoNomad
erl wrote:I do this in my driver for the DS18B20 one-wire temperature sensor in the Frankenstein hardware. See:

https://github.com/nekromant/esp8266-fr ... _ds18b20.c

In the ds_init function.

Happy hacking!


Awesome!

Thank you for the quick reply.

And for sharing that very useful code with us.