Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Esp32 #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Esp32 #31

wants to merge 4 commits into from

Conversation

DvDriel
Copy link

@DvDriel DvDriel commented Sep 17, 2018

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
Copy link

wizwik commented Aug 14, 2020

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
Copy link

@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; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants