SPI interfaces

zliudr
Posts: 360
Joined: Thu Oct 03, 2019 5:15 am

SPI interfaces

Postby zliudr » Tue Nov 05, 2019 4:45 am

I read from the data sheet that there are 4 SPI interfaces. I assume that one is used by FLASH (internal or external?). That leaves 3? What about the pSRAM and external FLASH (on WROOM or WROVER modules)? How many are left? I'm reading an SPI sample program that displays an image to an LCD. It calls spi_bus_initialize().

I found the reference:

https://docs.espressif.com/projects/esp ... _config_ti

There seems to be no mention of WHICH SPI interface is being used in the call, only the pins the interface uses. My goal is to read files in from say an SPI interfaced sd card and flash the content to an atmega328 via SPI interface.

If I run spi_bus_initialize() AFTER I initialized and mounted sd card (SPI interface), will the spi_bus_initialize() mess up the sd card access? I'm used to each SPI bus with a different name such as SPI0, SPI1 etc.

Thank you!

zliudr
Posts: 360
Joined: Thu Oct 03, 2019 5:15 am

Re: SPI interfaces

Postby zliudr » Tue Nov 05, 2019 6:13 am

According to this, only spi2 and spi3 are available. I imagine spi0 and spi1 are used for ram and flash.

https://docs.espressif.com/projects/esp ... ster.html#

Now after digging into sdspi_host.h, I found the default setting is to use HSPI (SPI2) on SD card. It seems that it won't be able to support threaded calls to HSPI while the sd card so mounted so I'm only able to use VSPI (SPI3) for actual SPI devices other than sd card. Hope it is going to work out.

Who is online

Users browsing this forum: Google [Bot] and 126 guests