PIN latch functionality for ESP32

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
PRosenb
Posts: 6
Joined: Sun Jul 05, 2020 1:18 pm

Re: PIN latch functionality for ESP32

Post by PRosenb » Mon Jul 06, 2020 4:44 pm

I confirm that this sequence also works on my ESP32 :-).
Although it's not very intuitive unfortunately because the pin needs to be `init()` again and it also uses the wording `PULL_HOLD` instead of `HOLD`..

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: PIN latch functionality for ESP32

Post by Roberthh » Mon Jul 06, 2020 4:49 pm

I agree, that specifying the hold function with the pull keyword is misleading. The pull option and the hold option are completely separate topics. so maybe adding a hold keyword may be better - or the hold method.

Edit: I wonder why it work at your site with rtc_gpio_hold_en. In my test, both calls were pretty simlar. Once called, calls to change the output state were ignored and did effective only after disabling the hold.

PRosenb
Posts: 6
Joined: Sun Jul 05, 2020 1:18 pm

Re: PIN latch functionality for ESP32

Post by PRosenb » Mon Jul 06, 2020 5:05 pm

It worked with `rtc_gpio_hold_en()` because it called them right before/after setting the pin state.

Code: Select all

esp32.rtc_gpio_hold_dis(led_pin)
led_pin.on()
esp32.rtc_gpio_hold_en(led_pin)

Post Reply