/* Function for configuring SPI slave module. 
This function will configure the SPI slave module with the SERCOM module to be used and pinmux settings  */
static void configure_spi(void)
/* Function for configuring SPI slave module. 
This function will configure the SPI slave module with the SERCOM module to be used and pinmux settings  */
static void configure_spi(void)
{
	struct spi_config config_spi;
	spi_get_config_defaults(&config_spi);
	config_spi.mode = SPI_MODE_SLAVE;
	config_spi.mux_setting = BOOT_SPI_MUX;
	config_spi.mode_specific.slave.preload_enable = true;
	config_spi.mode_specific.slave.frame_format = SPI_FRAME_FORMAT_SPI_FRAME;
	config_spi.pinmux_pad0 = BOOT_SPI_PAD0;
	config_spi.pinmux_pad1 = BOOT_SPI_PAD1;
	config_spi.pinmux_pad2 = BOOT_SPI_PAD2;
	config_spi.pinmux_pad3 = BOOT_SPI_PAD3;
	spi_init(&slave, BOOT_SERCOM, &config_spi);
	spi_enable(&slave);
}