ADuCM4050 SPI External loopback mode

I need some sample code to:

1. Accept incoming data on SPI DIN

2. Store the SPI DIN in a buffer on the ADuCM4050. Verify buffer content using IAR workbench

3. Externally Loop back the SPI DIN to the DOUT pin again (looped back to another SPI peripheral)

4. The ADuCM4050 also needs to be configured to accept a clock input at 12 MHz from the connected SPI device.

I have studied the spi_loopback.c file and associated header files.

I have been unsuccessful in several attempts to modify this code to produce something like 1-4 described above.

Can you please provide some sample code?