Can someone to explain me this behaviour?
Posted: Fri Dec 29, 2023 10:23 am
The code
Result GPIO_NUM_5
Result GPIO_NUM_2
Chip is ESP32-WROVER-B
- gpio_config_t io_conf = {};
- gpio_num_t gpio_test_pin = GPIO_NUM_5;
- io_conf.intr_type = GPIO_INTR_DISABLE;
- io_conf.mode = GPIO_MODE_INPUT_OUTPUT_OD;
- io_conf.pin_bit_mask = BIT64(gpio_test_pin);
- io_conf.pull_down_en = 1;
- io_conf.pull_up_en = 1;
- gpio_config(&io_conf);
- gpio_dump_io_configuration(stdout, BIT64(gpio_test_pin));
- ESP_LOGW("MUXREG", "%lX = %lx", GPIO_PIN_MUX_REG[gpio_test_pin], READ_PERI_REG(GPIO_PIN_MUX_REG[gpio_test_pin]));
- gpio_pullup_en(gpio_test_pin);
- gpio_pulldown_en(gpio_test_pin);
- ESP_LOGW("MUXREG", "%lX = %lx", GPIO_PIN_MUX_REG[gpio_test_pin], READ_PERI_REG(GPIO_PIN_MUX_REG[gpio_test_pin]));
- gpio_dump_io_configuration(stdout, BIT64(gpio_test_pin));
- REG_SET_BIT(GPIO_PIN_MUX_REG[gpio_test_pin], FUN_PU);
- gpio_dump_io_configuration(stdout, BIT64(gpio_test_pin));
- I (400) gpio: GPIO[5]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 1| Intr:0
- ================IO DUMP Start================
- IO[5] -
- Pullup: 1, Pulldown: 1, DriveCap: 2
- InputEn: 1, OutputEn: 1, OpenDrain: 1
- FuncSel: 2 (GPIO)
- GPIO Matrix SigOut ID: 256 (simple GPIO output)
- GPIO Matrix SigIn ID: (simple GPIO input)
- SleepSelEn: 0
- =================IO DUMP End==================
- W (430) MUXREG: 3FF4906C = 2b80
- W (440) MUXREG: 3FF4906C = 2b80
- ================IO DUMP Start================
- IO[5] -
- Pullup: 1, Pulldown: 1, DriveCap: 2
- InputEn: 1, OutputEn: 1, OpenDrain: 1
- FuncSel: 2 (GPIO)
- GPIO Matrix SigOut ID: 256 (simple GPIO output)
- GPIO Matrix SigIn ID: (simple GPIO input)
- SleepSelEn: 0
- =================IO DUMP End==================
- ================IO DUMP Start================
- IO[5] -
- Pullup: 1, Pulldown: 1, DriveCap: 2
- InputEn: 1, OutputEn: 1, OpenDrain: 1
- FuncSel: 2 (GPIO)
- GPIO Matrix SigOut ID: 256 (simple GPIO output)
- GPIO Matrix SigIn ID: (simple GPIO input)
- SleepSelEn: 0
- =================IO DUMP End==================
- I (400) gpio: GPIO[2]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 1| Intr:0
- ================IO DUMP Start================
- IO[2] -
- Pullup: 0, Pulldown: 1, DriveCap: 2
- InputEn: 1, OutputEn: 1, OpenDrain: 1
- FuncSel: 2 (GPIO)
- GPIO Matrix SigOut ID: 256 (simple GPIO output)
- GPIO Matrix SigIn ID: (simple GPIO input)
- SleepSelEn: 0
- =================IO DUMP End==================
- W (430) MUXREG: 3FF49040 = 2a80
- W (440) MUXREG: 3FF49040 = 2a80
- ================IO DUMP Start================
- IO[2] -
- Pullup: 0, Pulldown: 1, DriveCap: 2
- InputEn: 1, OutputEn: 1, OpenDrain: 1
- FuncSel: 2 (GPIO)
- GPIO Matrix SigOut ID: 256 (simple GPIO output)
- GPIO Matrix SigIn ID: (simple GPIO input)
- SleepSelEn: 0
- =================IO DUMP End==================
- ================IO DUMP Start================
- IO[2] -
- Pullup: 1, Pulldown: 1, DriveCap: 2
- InputEn: 1, OutputEn: 1, OpenDrain: 1
- FuncSel: 2 (GPIO)
- GPIO Matrix SigOut ID: 256 (simple GPIO output)
- GPIO Matrix SigIn ID: (simple GPIO input)
- SleepSelEn: 0
- =================IO DUMP End==================