/* Disables the SPI module. 
This function will disable the SPI module. */
void spi_disable(struct spi_module *const module)
/* Disables the SPI module. 
This function will disable the SPI module. */
void spi_disable(struct spi_module *const module)
{
	Spi *const spi_module = (module->hw);
#  if SPI_CALLBACK_MODE == true
	if(spi_module == SPI0) {
		NVIC_DisableIRQ(SPI0_RX_IRQn);
		NVIC_DisableIRQ(SPI0_TX_IRQn);
	} else if(spi_module == SPI1) {
		NVIC_DisableIRQ(SPI1_RX_IRQn);
		NVIC_DisableIRQ(SPI1_TX_IRQn);
	}
#  endif
	spi_module->SPI_MODULE_ENABLE.reg = (0x0ul << SPI_MODULE_ENABLE_ENABLE_Pos);
	_spi_clock_disable(module);
}