adafruit / TFTLCD-Library

Arduino library for 8-bit TFT LCDs such as ILI9325, ILI9328, etc
http://www.ladyada.net/products/tfttouchbreakout/ and http://www.ladyada.net/products/tfttouchshield
314 stars 259 forks source link

Esp32 #31

Open DvDriel opened 5 years ago

DvDriel commented 5 years ago

Dear Adafruit,

I added esp32 support for the 8-bit interface on the Adafruit TFT breakout board. Maybe someone will have some use of it? Anyway, thanks for your awesome products!

Cheers,

Daan

wizwik commented 3 years ago

Hi Daan:
I notice that there was a delay of 10 uSec is built into the write routine in an ESP32. I wondered how long it would take to write all the bits from a custom list. The result was 2 uSec. So by reducing the delay slightly you should get the same performance. I tested it with this code. int my_byte=0x55,bit_msk; bit_msk=1; // bit zero bool bit_val; uint32_t start_time; start_time=micros(); // Get the start time for(i=0;i<8;i++){ // Eight bits bit_val=(bool)my_byte&bit_msk; // Get the bit digitalWrite(pin_lst[4],bit_val); bit_msk<<=1; // Shift it

}

I also wrote code to change the pin direction and based on the same list. Note that it does not need any special instructions and all you have to do is load the pin list. I am going to try and incorporate it into you code to see if I can get it to work. Regards

abrender commented 1 year ago

@DvDriel I noticed that as written, the code will result in an error: 'result' is used uninitialized in this function [-Werror=uninitialized]

I think that the first result |= might have to be changed to result = in the read8inline funcition?

    #define read8inline(result) { \
       RD_ACTIVE;                 \
       DELAY7;                    \
       result = ((GPIO.in & 0b00000000000000000000000000111100) >> 2); \ // <--------- Change this line from "|=" to "="
       result |= ((GPIO.in & 0b00000000000001111000000000000000) >> 11); \
       RD_IDLE; }