Need help porting SPI Slave code from an ESP8266 to a ESP32-C5

jcracine_cimeq
Posts: 2
Joined: Mon Jul 13, 2026 3:22 pm

Need help porting SPI Slave code from an ESP8266 to a ESP32-C5

Postby jcracine_cimeq » Mon Jul 13, 2026 4:01 pm

Hi,
I need help understanding some informations reguarding a project I'm refactoring to update the MCU. The code was originally written using the Arduino framework for ESP8266 and is using the SPI Slave library. In the process, I've discovered that the SPISlave library was dependant on the HSPI slave and wrote information directly into the ESP8266's registers.

I knew beforehand that the ESP32-C5 only supported FSPI, but some functions are absent, notably the "setStatus" function. I also noticed that less callbacks are available since status-related functions are missing. Previously, you could hook callbacks when receiving and sending data, and also when updating and sending the SPI status. From what i saw, now you can only hook callbacks before and after a SPI transmission is queued.

So, I have a couple questions:
  • Is it possible for the current SPI Slave API to still be interrupt based, like it used to be for the 8266? So that I don't have to poll on the flag to see if I have an incoming transmission?
  • Was the status register sent after the data before? If so, could i just queue two transmissions with different callbacks?
  • I assume that before, the data was sent as soon as the registers were updated. So I imagine that I would need to trigger the transmission immediately after queuing it.
Here is the source for the ESP8266 library.
Here is the source for the ESP32 library.

Thank you again for your help.

jcracine_cimeq
Posts: 2
Joined: Mon Jul 13, 2026 3:22 pm

Re: Need help porting SPI Slave code from an ESP8266 to a ESP32-C5

Postby jcracine_cimeq » Mon Jul 20, 2026 2:10 pm

I found this resource explaining the behaviour of the ESP8266 while acting as a SPI Slave. I'm trying to see if I can replicate or mock this behavior while using a ESP32-C5, either using the provided Arduino library or pure ESP-IDF.

MicroController
Posts: 2693
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Need help porting SPI Slave code from an ESP8266 to a ESP32-C5

Postby MicroController » Tue Jul 21, 2026 7:45 pm


Who is online

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