Hello, I'm using the maple as a slave SPI receiver. I want to trigger an interrupt routine when data is received but can't quite work out how to do it, can anyone help?
I've done this:
HardwareSPI(2) spi;
setup()
{
spi.beginSlave();
spi_irq_enable(SPI2, SPI_RXNE_INTERRUPT);
}
void handleSpi()
{
byte b = spi.read();
...
}
So my question is how do I set up my handleSpi
as the interrupt handler?
In the header files I've traced through and found that the nvic_irq_num
for SPI2 is NVIC_SPI2 = 36
but I don't know how to use that to set up an interrupt. Is that even relevant?
Thanks for any help!