I'm writing code for interrupt based SPI comm between three boards consisting of LPC54628 in Master-Slave configuration in Keil IDE without using the SDK drivers (I'm trying to directly access and modify target registers while avoiding the use of drivers as much as possible to keep the code simple).
After the master LPC54628 asserts slave-select for one of the slave boards, it is supposed to send an address on MOSI line (0xADDRESS).
The slave LPC54628 configured in interrupt mode should go to ISR when Rx FIFO becomes non-empty (one entry) and check the received byte against its hard-coded address.
If they match, the slave LPC54628 should send two bytes of data (status of some Digital Input pins) to the Master controller.
My understanding about SPI is that when a slave is receiving some data from Master, the slave has to send out some data called DummyData in SDK examples back to the master. Is it correct? If yes, which function in the SDK example (SPI_INTERRUPT_B2B_SLAVE) ensures so? I can only see a function
being defined in Slave_Init(), but cannot locate the part of the code which sends out the DummyData while a byte is being received from the Master. Can someone help me with this?
This is regarding ISR. When the Rx FIFO becomes non-empty, an interrupt is to be generated which causes the program to loop to ISR for the SPI (Flexcomm3). In SDK examples
performs the functions of the ISR which is defined as
#define SPI_SLAVE_IRQHandler FLEXCOMM3_IRQHandler.
My question is this:
When I am writing a code without using the inbuilt SDK drivers (essentially starting from scratch with only the automatically added device files such as LPC54628.h and startup files), how do I tell the IDE (Keil/uVision) what my ISR is? If I just define a function with the name
and write the ISR code inside it, will the code work?
Please note: Right now I do not have access to LPC54628 board. Will take a 2-3 weeks for it to reach me. So I'm trying to keep the code ready by the time the boards become available to me.
Thanks in advance.