Hello Ajay,
Making use of the SPI peripheral hardware as an SPI master is the easy part. The more difficult part is to understand the exact communications requirements of the SPI slave device, in this case the TLE8104E. I will assume that you will use a relatively fast SPI clock rate, so there is usually little justification in using interrupts for master communications usage.
You will firstly need to initialise the SPI module as a master. In addition to choosing a clock rate that is compatible with the slave, you will also need to select the CPHA and CPOL settings that the slave requires (see the attached file SPI.c, which would be modified to suit).
The attached file SPI.c provides a very simple polling function that provides for simultaneously sending and receiving of a single byte. This is the only communications "driver" that is necessary. You will then need to write additional functions that fulfil the communications details for the specific device, as described in its datasheet, and these would call the SPI_trans() function as required.
For further simplification, you might setup the following macros:
#define DUMMY 0x00
#define SPI_send(x) (void)SPI_trans(x)
#define SPI_recv() SPI_trans(DUMMY) // Received value is returned
Regards,
Mac