Per the ESP32 Pico D4 datasheet, peripherals are the same as the original ESP32.
And per the linked ESP32 datasheet, more details can be found in the ESP32 Technical Manual:
ESP32 integrates four SPI controllers which can be used to communicate with external devices that use the SPI protocol. ... The SPI signal buses consist of D, Q, CS0-CS2, CLK, WP, and HD signals, as Table 7-1 shows.
(page 117)
and
The SPI controller supports four-line full-duplex/half-duplex communication (MOSI, MISO, CS, and CLK lines) and three-line half-duplex-only communication (DATA, CS, and CLK lines) in GP-SPI mode. In QSPI mode, an SPI controller accesses the flash or SRAM by using signal buses D, Q, CS0 ~ CS2, CLK, WP, and HD as a four-bit parallel SPI bus. The mapping between SPI bus signals and pin function signals under different communication modes is shown in Table 7-1.
But per the board design:
Pin |
Function |
I018 |
LoRa NSS/SEL |
IO5 |
LoRa SCK |
IO27 |
LoRa MOSI/SDI |
IO19 |
LoRa MISO/SDO |
IO26 |
LoRa DI0/IO0 |
IO13 |
SD CS |
IO2 |
SD MISO |
IO15 |
SD MOSI |
IO14 |
SD SCK |
IO12 |
SD DATA2 |
IO4 |
SD DATA2 |
If you take a look at the IO pad summary (technical manual, page 57), note that IO12
through IO15
are multiplexed (shared) pins; the SD card is using them, so the HSPI periperhal is unavailable. In other words, both the on-board LoRa module and the on-board SD card use SPI interfaces already.
But wait, there's more!
The Pico D4 is a module which contains a ESP32 microcontroller along with some supporting circuitry. There is a flash memory unit within the metal canister, connected to the ESP32 using (you guessed it) QSPI. (Specifically, SD_DATA_0
, SD_DATA_1
, SD_CLK
and SD_CMD
.) These signals are also multiplexed with the SPI peripheral (see, again, the pad summary, specifically GPIO6
through GPIO11
.
In other words, of your four SPI peripherals:
- one is in use for the LoRa module (VSPI)
- one is in use for the SD card (HSPI)
- one is in use for the flash memory (SPI0)
leaving one (SPI1) left for you to use.
... except:
Controllers SPI0 and SPI1 share one signal bus through an arbiter; the signals of the shared bus start with ”SPI”. Controllers SPI2 and SPI3 use signal buses starting with ”HSPI” and ”VSPI” respectively.
SP1 uses the same pin connections as SPI0, and on your board, those pins are only connected to the SPI flash inside the metal canister. In other words, even though there's an unused SPI peripheral on your chip, the actual signals aren't exposed on your board.
Sorry.