/* Resets the SPI module. 
This function will reset the SPI module to its power on default values and disable it. */
void spi_reset(struct spi_module *const module)
/* Resets the SPI module. 
This function will reset the SPI module to its power on default values and disable it. */
void spi_reset(struct spi_module *const module)
{
	Assert(module);
	Assert(module->hw);
	SercomSpi *const spi_module = &(module->hw->SPI);
	spi_disable(module);
	while (spi_is_syncing(module)) {
	}
	spi_module->CTRLA.reg |= SERCOM_SPI_CTRLA_SWRST;
}