-
Notifications
You must be signed in to change notification settings - Fork 295
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
Fix SPI configuration for ESP32C3 and ESP32S2 #145
Conversation
ESP32-C3 and ESP32-S2 do not have VSPI or HSPI
Thanks for the request @arktrin, it does look good to me, I've also requested a review from @tore-espressif . |
Hello @arktrin , thank you very much for your contribution. Yes, the SPI naming is a little messy. I think we might unify it across targets (esp32, s2, s3, c3...) and use basic SPI names. This would make it future-proof and a lot easier in Let me know what you think |
Hello @tore-espressif ! I do agree that SPI names (HSPI, VSPI, FSPI) are kind of confusing. So you won't approve my pull request? I did not get it :) Despite of .../hal/spi_types.h I still cannot find any reference on HSPI for ESP32-S2 in the datasheet. |
Hi, thanks for the quick response. Yeah, I wouldn't recommend merging in this form. So the question is whether you are willing to 'bring this to perfection' (using cc @C47D |
Ok, I will do it. |
@tore-espressif I've replaced specific SPI names with SPIx_HOST. Tested on my ESP32-C3 + ST7789 display board. |
Great work, let's wait for @C47D and we can merge. @C47D : In retrospect, the idea with |
@tore-espressif I agree, I was asking @kisvegabor about the same thing last weekend. Some of the commits that went into master I was able to cherry pick them into devel, but not all. I think we could try the trunk based development technique as we now, thanks to your work, have some kind of CI. Should we create a ticket for this (merging devel into master)? @arktrin changes look good, we can merge. Can you merge it @tore-espressif? |
Created #146 to track this. Merging now |
This breaks scenario when SPI is shared for display and touch. (some HSPI and VSPI macros were not renamed) |
Looks like #147 is not going to be happened. I can try to fix here other HSPI and VSPI macros issue. Will it work as previously when PR is already merged and closed? Or should open new PR ? |
We can cherry-pick this commit d0eca96 in new PR |
Well, this story is still not finished yet :(
As of online documentation on ESP32-C3:
So at least there is no such thing as SPI3 and
As of spi_types.h from esp-idf there is no such thing as SPI0 or SPI0_HOST. And definitely SPI1 can't work as a general purpose SPI controller now. Sorry for not testing all the cases, but please don't revert this PR. |
Don't worry, thanks for reporting the problem, so if I understand it correctly, the C3 only have one SPI (SPI2) for user usage? |
Yeah, looks like that. I've tried to set SPI3_HOST for SPI bus and got:
I wonder where is SPI0_HOST or something related to SPI0 for ESP32-C3. |
@arktrin I've created a new issue to keep track of this. |
ESP32-C3 and ESP32-S2 don't have VSPI or HSPI. Also ESP32-C3 don't have any specific name for SPIs.