/** * \brief Configures a QSPI peripheral as specified. The configuration can be computed * using several macros (see \ref spi_configuration_macros). * * \param qspi Pointer to an Qspi instance. * \param id Peripheral ID of the QSPI. * \param configuration Value of the QSPI configuration register. */ extern void QSPI_Configure( Qspi* qspi, uint32_t dwConfiguration ) { qspi->QSPI_CR = QSPI_CR_QSPIDIS ; /* Execute a software reset of the QSPI twice */ QSPI_SwReset(qspi); qspi->QSPI_MR = dwConfiguration ; }
/** * \brief Configures QSPI/SPI * * \param pQspi Pointer to an Qspi instance. * \param Mode Mode for QSPI or SPI * \param dwConfiguration Config of SPI or QSPI mode */ QspidStatus_t QSPI_ConfigureInterface(Qspid_t *pQspid, QspiMode_t Mode, uint32_t dwConfiguration) { pQspid->pQspiHw = QSPI; pQspid->qspiId = ID_QSPI; QSPI_Disable(pQspid->pQspiHw); QSPI_SwReset(pQspid->pQspiHw); QSPI_ConfigureMode(pQspid->pQspiHw, Mode); QSPI_Configure(pQspid->pQspiHw, dwConfiguration); return QSPI_SUCCESS; }