I'm trying to get a value from a GPIO during the boot stage to decide which partition I would like to jump into.
I've tried to include driver/gpio.h and link driver/gpio.c but it compiled failed with cannot find GPIO in gpio.o
so I've checked rom/gpio.h and find there are a not documented function GPIO_INPUT_GET which I can use.
but I can only get 1 from this function no matter how I tried.
So is there any way I can get a valid value from a GPIO here(in application I use it with input mode and pulldown set to true).
Is there anyway to get access to GPIO input value in boot loader_start.c?
Re: Is there anyway to get access to GPIO input value in boot loader_start.c?
Hi Tim,
You can use the GPIO_INPUT_GET(N) macro to read a GPIO input pin via ROM code functions:
https://github.com/espressif/esp-idf/bl ... gpio.h#L64
It's also possible to read the GPIO registers directly, but there's not much point unless you need very fast reads in a tight loop.
You can use the GPIO_INPUT_GET(N) macro to read a GPIO input pin via ROM code functions:
https://github.com/espressif/esp-idf/bl ... gpio.h#L64
It's also possible to read the GPIO registers directly, but there's not much point unless you need very fast reads in a tight loop.
Re: Is there anyway to get access to GPIO input value in boot loader_start.c?
Didn't noticed that, that's really helpful, thx very much
Who is online
Users browsing this forum: No registered users and 89 guests