This section describes the differences between OSPI APIs of MCU+ SDK and Processor SDK RTOS (PDK). This can be used as a migration aid when moving from Processor SDK RTOS (PDK) to MCU+ SDK.
In MCU+ SDK, the OSPI module provides higher level driver APIs.Refer OSPI for more details. From the user point of view, higher level API usage is same as in PDK.APIs name begins with OSPI_
instead of SPI_
.
There are changes in API names, structure names and macro names. The changes in function names are listed below.
PDK | MCU+ SDK | Remarks |
---|---|---|
SPI_init | OSPI_init | API rename |
None | OSPI_deinit | In MCU+SDK, this API can be used to de-initializes the OSPI module |
SPI_open | OSPI_open | API rename |
SPI_Params_init | OSPI_Params_init | API rename |
SPI_close | OSPI_close | API rename |
SPI_close | OSPI_close | API rename |
SPI_serviceISR | None | In MCU+SDK, ISR is handled inside the driver. |
SPI_transfer | None | In MCU+SDK, SPI_transfer is separated into sub APIs OSPI_readDirect, OSPI_writeDirect, OSPI_readIndirect, OSPI_writeIndirect |
SPI_transferCancel | None | In MCU+SDK, API is not supported. |
SPI_control | None | In MCU+SDK, SPI_control is separated into sub APIs OSPI_readCmd, OSPI_writeCmd, OSPI_enableDdrRdCmds and so on. API are listed below. |
None | OSPI_getHandle | In MCU+SDK, this API can be used to return the handle of an open OSPI Instance from the instance index |
None | OSPI_readDirect | In MCU+SDK, this API can be used to perform direct reads from the flash using DAC controller |
None | OSPI_readIndirect | In MCU+SDK, this API can be used to perform indirect reads from the flash using INDAC controller |
None | OSPI_writeDirect | In MCU+SDK, this API can be used to perform direct writes to the flash using DAC controller |
None | OSPI_writeIndirect | In MCU+SDK, this API can be used to perform indirect writes to the flash using INDAC controller |
None | OSPI_readCmd | In MCU+SDK, this API can be used to send specific commands and receive related data from flash |
None | OSPI_writeCmd | In MCU+SDK, this API can be used to send specific commands and related data to flash |
None | OSPI_Transaction_init | In MCU+SDK, this API can be used to initialize the OSPI_Transaction structure |
None | OSPI_ReadCmdParams_init | In MCU+SDK, this API can be used to initialize the OSPI_ReadCmdParams structure |
None | OSPI_WriteCmdParams_init | In MCU+SDK, this API can be used to initialize the OSPI_WriteCmdParams structure |
None | OSPI_isDacEnable | In MCU+SDK, this API can be used to check if the Direct Access Controller is enabled |
None | OSPI_isDmaEnable | In MCU+SDK, this API can be used to check if DMA is enabled for reads |
None | OSPI_isIntrEnable | In MCU+SDK, this API can be used to check if interrupts are enabled |
None | OSPI_isPhyEnable | In MCU+SDK, this API can be used to check if the OSPI PHY controller is enabled |
None | OSPI_isDtrEnable | In MCU+SDK, this API can be used to check if the Dual Transfer Rate is enabled |
None | OSPI_enableDDR | In MCU+SDK, this API can be used to enable the Dual Data Rate (DDR) |
None | OSPI_enableSDR | In MCU+SDK, this API can be used to enable the Single Data Rate (SDR) |
None | OSPI_enableDdrRdCmds | In MCU+SDK, this API can be used to set DDR bit in INSTR_RD register for RD commands |
None | OSPI_setRdDataCaptureDelay | In MCU+SDK, this API can be used to set read data capture cycles in the OSPI controller |
None | OSPI_setNumAddrBytes | In MCU+SDK, this API can be used to set the number of bytes used to send address while reading or writing to flash memory |
None | OSPI_setDeviceSize | In MCU+SDK, this API can be used to set the block size and page size of the flash to the device size register in OSPI |
None | OSPI_setCmdDummyCycles | In MCU+SDK, this API can be used to set appropriate dummy cycles to be used while sending STIG commands to flash |
None | OSPI_setReadDummyCycles | In MCU+SDK, this API can be used to set appropriate dummy cycles for flash read |
None | OSPI_setPhyEnableSuccess | In MCU+SDK, this API can be used to set the phyEnableSuccess field in OSPI_Object. Has to be called from flash driver |
None | OSPI_getPhyEnableSuccess | In MCU+SDK, this API can be used to fetch the phyEnableSuccess field in OSPI_Object. |
None | OSPI_cmdModeBitSet | In MCU+SDK, this API can be used to set command mode bit |
None | OSPI_rdModeBitSet | In MCU+SDK, this API can be used to set Read mode bit |
None | OSPI_setDualOpCodeMode | In MCU+SDK, this API can be used to set OSPI controller to use dual byte opcodes |
None | OSPI_setXferOpCodes | In MCU+SDK, this API can be used to set the opcodes for reading and page programming the flash |
None | OSPI_setCmdExtType | In MCU+SDK, this API can be used to set the type of command extension used in dual byte opcode mode |
None | OSPI_enableDacMode | In MCU+SDK, this API can be used to enable the Direct Access Mode |
None | OSPI_disableDacMode | In MCU+SDK, this API can be used to disable the Direct Access Mode |
None | OSPI_getFlashDataBaseAddr | In MCU+SDK, this API can be used to get the SOC mapped data base address of the flash |
None | OSPI_phyTuneDDR | In MCU+SDK, this API can be used to tune the OSPI PHY for DDR mode to set optimal PHY parameters |
None | OSPI_phyTuneGrapher | In MCU+SDK, this API takes a 4x128x128 array and fills it with TX RX DLL data for graphing purpose |
None | OSPI_phyGetTuningData | In MCU+SDK, this API can be used to return the address to the attack vector buf required for tuning the PHY |
None | OSPI_phyReadAttackVector | In MCU+SDK, this API can be used to check if the attack vector, or the data used for tuning the PHY is present at an offset in the flash |
None | OSPI_enablePhy | In MCU+SDK, this API can be used to enable the PHY |
None | OSPI_disablePhy | In MCU+SDK, this API can be used to disable the PHY |
None | OSPI_enablePhyPipeline | In MCU+SDK, this API can be used to enable the PHY Pipeline |
None | OSPI_disablePhyPipeline | In MCU+SDK, this API can be used to disable the PHY Pipeline |
None | OSPI_norFlashInit1s1s1s | In MCU+SDK, this API can be used to initialize the NOR flash to work in 1-1-1 mode |
None | OSPI_norFlashReadId | In MCU+SDK, this API can be used to read the JEDEC ID from the NOR flash connected to the OSPI peripheral |
None | OSPI_norFlashWrite | In MCU+SDK, this API can be used to write data to the flash at a specified offset |
None | OSPI_norFlashRead | In MCU+SDK, this API can be used to read data from the flash from a specified offset |
None | OSPI_norFlashReadSfdp | In MCU+SDK, this API can be used to read SFDP table from the flash from a specified offset |
None | OSPI_norFlashErase | In MCU+SDK, this API can be used to erase 1 block of data starting from a provided address |