SPI as an interrupt-driven slave
Posted: Sat Mar 09, 2024 1:55 pm
I need to migrate from Arduino Uno to ESP32 an application where the SPI subsystem is used as an interrupt-driven slave:
void setup()
{
…
SPCR=bit(SPE);
SPI.attachInterrupt();
}
ISR (SPI_STC_vect)
{
spi_dat=SPDR;
}
These instructions generate compilation error because are tied to Arduino Uno hardware (SPI Control and Data registers) and compiler (ISR).
Is it possible to substitute them via the class library provided by ESP32 environment ?
void setup()
{
…
SPCR=bit(SPE);
SPI.attachInterrupt();
}
ISR (SPI_STC_vect)
{
spi_dat=SPDR;
}
These instructions generate compilation error because are tied to Arduino Uno hardware (SPI Control and Data registers) and compiler (ISR).
Is it possible to substitute them via the class library provided by ESP32 environment ?