Left for archival purposes.

User avatar
By GeoNomad
#3926 I don't see a method to change the pullup and pulldown configuration of the GPIOs.

Perhaps these can be added with additional constants to the gpio.mode() function.

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。

A use example is shown in erl's

https://github.com/nekromant/esp8266-frankenstein/blob/master/src/cmd_ds18b20.c
User avatar
By ucy74
#4154 You can have three states:

output 1 or 0
Code: Select allgpio.mode(8,gpio.OUTPUT)
gpio.write(8,gpio.HIGH)
gpio.write(8,gpio.LOW)

input with pullup
Code: Select allgpio.mode(9,gpio.INPUT)
gpio.write(9,gpio.HIGH)

input without pullup
Code: Select allgpio.mode(9,gpio.INPUT)
gpio.write(9,gpio.LOW)


Interesting will be how to get information is specific GPIO pin configured as INPUT or OUTPUT
User avatar
By zeroday
#4169
GeoNomad wrote:I don't see a method to change the pullup and pulldown configuration of the GPIOs.

Perhaps these can be added with additional constants to the gpio.mode() function.

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。

A use example is shown in erl's

https://github.com/nekromant/esp8266-frankenstein/blob/master/src/cmd_ds18b20.c


Change log:
2014-12-07
    1, add ow(1-wire module), from arduino, and use same api.
    2, add an 18b20 1-wire example.
    3, change net.socket.send() payload max len from 256 to 1460.
    4, modify gpio.mode() api, add internal pullup/float para.