-2

I am compiling TFT_eSPI library for Arduino ESP32 in 8 bit parallel mode, When I Compile it in SPI mode then no error occurs, but when I select 8-bit parallel mode in User Setup File, then it shows the error:

c:\Users\yamtech\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32.c: In member function 'uint8_t TFT_eSPI::readByte()':
c:\Users\yamtech\Documents\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP32.c:113:9: error: 'gpio_input_get' was not declared in this scope; did you mean 'gpio_num_t'?
  113 |   reg = gpio_input_get(); // Read three times to allow for bus access time
      |         ^~~~~~~~~~~~~~
      |         gpio_num_t

exit status 1

Compilation error: exit status 1

I already use New Arduino IDE with latest Arduino ESP32 Board by Espressif, but still failure occurs.

Board manager is https://dl.espressif.com/dl/package_esp32_index.json

What i found is that the Newer version of gpio.h does not contain gpio_input_get(), but older version have this function.

7
  • Welcome to SE/Arduino! Please take the tour to learn how this site works, and read "How to Ask" and other pages of the help center. Commented Oct 29, 2024 at 13:16
  • How do you want the issue to be solved? For example, you can patch the library's source yourself, or you can open a ticket in the library's project. If you decided, please come back and edit or delete your question. Commented Oct 29, 2024 at 13:16
  • what is your specific question? ... please add a focused, answerable question to your post
    – jsotola
    Commented Oct 29, 2024 at 14:42
  • My question is very simple, I just want to resolve the gpio_input_get();, which is not defined in the gpio.h, and this function is used in 8-Bit Parallel ESP32 TFT_eSPI library.
    – Adil Ahmed
    Commented Oct 29, 2024 at 15:47
  • 1
    that is just it, you did not ask any questions ... why are you unable to ask what is an alternative of gpio_input_get(); ?
    – jsotola
    Commented Oct 29, 2024 at 23:40

1 Answer 1

1

In the new esp-idf(V5.x), the GPIO construct is not readily available to all users like it used to be. And there is a related issue on the idf GitHub issues 9184.

As per Espressif, it seems that the (lower-level access of) GPIO was never supposed to be available to users. Instead, it is a low-level library which provides fast pin access by using the pin registers directly. The gpio_input_get() works perfectly fine if the ESP32 Arduino framework is using esp-idf v4.x but may not with esp-idf v5.x core. For some reason, Espressif decided to take it out and make it harder for user to use it.

The TFT_eSPI already have a fix on this and to be roll-out in next release. You can read about it at Issue #2628. In the meantime, you could manually replace the file Processors/TFT_eSPI_ESP32.h in the library with the new one which in the nutshell add the following headers to support the lower-level access of GPIO:

#include "soc/spi_reg.h"
#include "driver/spi_master.h"
#include "hal/gpio_ll.h"

There is also a post in Arduino forum claims gpio_input_get() (still) work by using PlatfromIo, I guess it works because PlatformIo has not upgrade to the esp-idf 5.x yet.

1
  • Thank you, you are right gpio_input_get() works perfectly fine if the ESP32 Arduino framework is using esp-idf v4.x,but not works with esp-idf v5.x
    – Adil Ahmed
    Commented Oct 30, 2024 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.