Functions | |
cy_en_smif_status_t | Cy_SMIF_MemInit (SMIF_Type *base, cy_stc_smif_block_config_t const *blockConfig, cy_stc_smif_context_t *context) |
This function initializes the slots of the memory device in the SMIF configuration. More... | |
void | Cy_SMIF_MemDeInit (SMIF_Type *base) |
This function de-initializes all slave slots of the memory device to their default values. More... | |
cy_en_smif_status_t | Cy_SMIF_MemCmdWriteEnable (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, cy_stc_smif_context_t const *context) |
This function sends the Write Enable command to the memory device. More... | |
cy_en_smif_status_t | Cy_SMIF_MemCmdWriteDisable (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, cy_stc_smif_context_t const *context) |
This function sends a Write Disable command to the memory device. More... | |
bool | Cy_SMIF_MemIsBusy (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, cy_stc_smif_context_t const *context) |
This function checks if the status of the memory device is busy. More... | |
cy_en_smif_status_t | Cy_SMIF_MemQuadEnable (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, cy_stc_smif_context_t const *context) |
This function enables the memory device for the quad mode of operation. More... | |
cy_en_smif_status_t | Cy_SMIF_MemOctalEnable (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, cy_en_smif_data_rate_t dataRate, cy_stc_smif_context_t const *context) |
This function enables the memory device for the octal mode of operation. More... | |
cy_en_smif_status_t | Cy_SMIF_MemCmdReadStatus (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, uint8_t *status, uint8_t command, cy_stc_smif_context_t const *context) |
This function reads the status register. More... | |
cy_en_smif_status_t | Cy_SMIF_MemCmdWriteStatus (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, void const *status, uint8_t command, cy_stc_smif_context_t const *context) |
This function writes the status register. More... | |
cy_en_smif_status_t | Cy_SMIF_MemCmdChipErase (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, cy_stc_smif_context_t const *context) |
This function performs a chip erase of the external memory. More... | |
cy_en_smif_status_t | Cy_SMIF_MemCmdSectorErase (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, uint8_t const *sectorAddr, cy_stc_smif_context_t const *context) |
This function performs a block Erase of the external memory. More... | |
cy_en_smif_status_t | Cy_SMIF_MemCmdProgram (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, uint8_t const *addr, uint8_t const *writeBuff, uint32_t size, cy_smif_event_cb_t cmdCompleteCb, cy_stc_smif_context_t *context) |
This function performs the Program operation. More... | |
cy_en_smif_status_t | Cy_SMIF_MemCmdRead (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, uint8_t const *addr, uint8_t *readBuff, uint32_t size, cy_smif_event_cb_t cmdCompleteCb, cy_stc_smif_context_t *context) |
This function performs the Read operation. More... | |
cy_en_smif_status_t | Cy_SMIF_MemSfdpDetect (SMIF_Type *base, cy_stc_smif_mem_device_cfg_t *device, cy_en_smif_slave_select_t slaveSelect, cy_en_smif_data_select_t dataSelect, cy_stc_smif_context_t *context) |
This function detects the device signature for SFDP devices. More... | |
void | Cy_SMIF_Reset_Memory (SMIF_Type *base, cy_en_smif_slave_select_t slaveSelect) |
This function is the weak implementation for resetting the memory. More... | |
cy_en_smif_status_t | Cy_SMIF_MemInitSfdpMode (SMIF_Type *base, const cy_stc_smif_mem_config_t *memCfg, cy_en_smif_txfr_width_t maxdataWidth, cy_en_smif_qer_t qer_id, cy_stc_smif_context_t *context) |
This function can be used for any preferred data width based command instruction set from SFDP Buffer. More... | |
cy_en_smif_status_t | Cy_SMIF_MemIsReady (SMIF_Type *base, cy_stc_smif_mem_config_t const *memConfig, uint32_t timeoutUs, cy_stc_smif_context_t const *context) |
Polls the memory device to check whether it is ready to accept new commands or not until either it is ready or the retries have exceeded the limit. More... | |
cy_en_smif_status_t | Cy_SMIF_MemIsQuadEnabled (SMIF_Type *base, cy_stc_smif_mem_config_t const *memConfig, bool *isQuadEnabled, cy_stc_smif_context_t const *context) |
Checks whether the QE (Quad Enable) bit is set or not in the configuration register of the memory. More... | |
cy_en_smif_status_t | Cy_SMIF_MemEnableQuadMode (SMIF_Type *base, cy_stc_smif_mem_config_t const *memConfig, uint32_t timeoutUs, cy_stc_smif_context_t const *context) |
Sets the QE (QUAD Enable) bit in the external memory configuration register to enable quad SPI mode. More... | |
cy_en_smif_status_t | Cy_SMIF_MemRead (SMIF_Type *base, cy_stc_smif_mem_config_t const *memConfig, uint32_t address, uint8_t rxBuffer[], uint32_t length, cy_stc_smif_context_t const *context) |
Reads data from the external memory and blocks until the read transfer is complete or a timeout occurs. More... | |
cy_en_smif_status_t | Cy_SMIF_MemWrite (SMIF_Type *base, cy_stc_smif_mem_config_t const *memConfig, uint32_t address, uint8_t const txBuffer[], uint32_t length, cy_stc_smif_context_t const *context) |
This function writes data to the external memory. More... | |
cy_en_smif_status_t | Cy_SMIF_MemEraseSector (SMIF_Type *base, cy_stc_smif_mem_config_t const *memConfig, uint32_t address, uint32_t length, cy_stc_smif_context_t const *context) |
Erases a block/sector of the external memory. More... | |
cy_en_smif_status_t | Cy_SMIF_MemEraseChip (SMIF_Type *base, cy_stc_smif_mem_config_t const *memConfig, cy_stc_smif_context_t const *context) |
Erases the entire chip of the external memory. More... | |
cy_en_smif_status_t | Cy_SMIF_MemLocateHybridRegion (cy_stc_smif_mem_config_t const *memDevice, cy_stc_smif_hybrid_region_info_t **regionInfo, uint32_t address) |
This function locates the region structure by the address which belongs to it. More... | |
void | Cy_SMIF_SetReadyPollingDelay (uint16_t pollTimeoutUs, cy_stc_smif_context_t *context) |
This function sets the polling delay in micro seconds to check memory device availability. More... | |
cy_en_smif_status_t | Cy_SMIF_MemCmdPowerDown (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, cy_stc_smif_context_t const *context) |
This function sends a Power-down command to the selected memory device in Single SPI mode. More... | |
cy_en_smif_status_t | Cy_SMIF_MemCmdReleasePowerDown (SMIF_Type *base, cy_stc_smif_mem_config_t const *memDevice, cy_stc_smif_context_t const *context) |
This function sends a Release Power-down command to the selected memory device in Single SPI mode. More... | |
void | Cy_SMIF_MemEnableFWCalibarion (SMIF_Type *base, cy_en_smif_slave_select_t slave) |
This function enables Firmware Calibration mode for the device. More... | |
void | Cy_SMIF_MemDisableFWCalibarion (SMIF_Type *base, cy_en_smif_slave_select_t slave) |
This function disables Firmware Calibration mode for the device. More... | |
cy_en_smif_status_t | Cy_SMIF_SetSelectedDelayTapSel (SMIF_Type *base, cy_en_smif_slave_select_t slave, cy_en_smif_mem_data_line_t data_line, uint8_t tapSel) |
This function sets delay tap for a particular data line. More... | |
uint8_t | Cy_SMIF_GetSelectedDelayTapSel (SMIF_Type *base, cy_en_smif_slave_select_t slave, cy_en_smif_mem_data_line_t data_line) |
This function gets delay tap set for a particular data line. More... | |
cy_en_smif_status_t | Cy_SMIF_MemGetSDLTap (SMIF_Type *base, const cy_stc_smif_mem_config_t *memConfig, uint8_t *posTap, uint8_t *negTap) |
This function retreives the Slave Delay Line (SDL) Tap in use. More... | |
cy_en_smif_status_t | Cy_SMIF_MemSetSDLTap (SMIF_Type *base, const cy_stc_smif_mem_config_t *memConfig, uint8_t posTap, uint8_t negTap) |
This function sets the Slave Delay Line (SDL) tap ranging from 0 to 15. More... | |
cy_en_smif_status_t | Cy_SMIF_MemCalibrateSDL (SMIF_Type *base, const cy_stc_smif_mem_config_t *memConfig, uint32_t calibrationDataOffsetAddress, cy_stc_smif_context_t *context) |
This function takes an offset address as input to perform read/write test and assign best possible Slave Delay Line (SDL) tap. More... | |
cy_en_smif_status_t Cy_SMIF_MemInit | ( | SMIF_Type * | base, |
cy_stc_smif_block_config_t const * | blockConfig, | ||
cy_stc_smif_context_t * | context | ||
) |
This function initializes the slots of the memory device in the SMIF configuration.
This function must be called when a memory device is required to be used in memory-mapped (XIP) mode. This function can also be called instead of calling Cy_SMIF_MemSfdpDetect when SFDP auto-discovery is enabled. Note that this function performs SFDP on all the external memories whereas Cy_SMIF_MemSfdpDetect performs it only on one memory that is specified through the arguments. This function configures the SMIF device slot registers with the configuration from cy_stc_smif_mem_config_t structure which is a member of the cy_stc_smif_block_config_t structure. If SFDP discovery is enabled in the configuration structure through autoDetectSfdp field, this function calls Cy_SMIF_MemSfdpDetect function for each memory, fills the structures with the discovered parameters, and configures the SMIF device slot registers accordingly. Cy_SMIF_Init must have been called prior to calling this function. The cy_stc_smif_context_t context structure returned from Cy_SMIF_Init is passed as a parameter to this function.
base | The address of the slave-slot device register to initialize. |
blockConfig | The configuration structure array that configures the SMIF memory device to be mapped into the PSoC memory map. cy_stc_smif_mem_config_t |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_SMIF_MemDeInit | ( | SMIF_Type * | base | ) |
This function de-initializes all slave slots of the memory device to their default values.
base | Holds the base address of the SMIF block registers. |
cy_en_smif_status_t Cy_SMIF_MemCmdWriteEnable | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function sends the Write Enable command to the memory device.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemCmdWriteDisable | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function sends a Write Disable command to the memory device.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
bool Cy_SMIF_MemIsBusy | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function checks if the status of the memory device is busy.
This is done by reading the status register and the corresponding bit (stsRegBusyMask). This function is a blocking function until the status register from the memory is read.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemQuadEnable | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function enables the memory device for the quad mode of operation.
This command must be executed before sending quad SPI commands to the memory device.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemOctalEnable | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
cy_en_smif_data_rate_t | dataRate, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function enables the memory device for the octal mode of operation.
This command must be executed before sending octal SPI commands to the memory device.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
dataRate | Specifies the data rate to enable (SDR/DDR). |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemCmdReadStatus | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
uint8_t * | status, | ||
uint8_t | command, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function reads the status register.
This function is a blocking function, it will block the execution flow until the status register is read.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
status | The status register value returned by the external memory. |
command | The command required to read the status/configuration register. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemCmdWriteStatus | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
void const * | status, | ||
uint8_t | command, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function writes the status register.
This is a blocking function, it will block the execution flow until the command transmission is completed.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
status | The status to write into the status register. |
command | The command to write into the status/configuration register. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemCmdChipErase | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function performs a chip erase of the external memory.
The Write Enable command is called before this API.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemCmdSectorErase | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
uint8_t const * | sectorAddr, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function performs a block Erase of the external memory.
The Write Enable command is called before this API.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
sectorAddr | The sector address to erase. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemCmdProgram | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
uint8_t const * | addr, | ||
uint8_t const * | writeBuff, | ||
uint32_t | size, | ||
cy_smif_event_cb_t | cmdCompleteCb, | ||
cy_stc_smif_context_t * | context | ||
) |
This function performs the Program operation.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
addr | The address to program. |
writeBuff | The pointer to the data to program. If this pointer is a NULL, then the function does not enable the interrupt. This use case is typically used when the FIFO is handled outside the interrupt and is managed in either a polling-based code or a DMA. The user would handle the FIFO management in a DMA or a polling-based code. If the user provides a NULL pointer in this function and does not handle the FIFO transaction, this could either stall or timeout the operation Cy_SMIF_TransmitData(). |
size | The size of data to program. The user must ensure that the data size does not exceed the page size. |
cmdCompleteCb | The callback function to call after the transfer completion. NULL interpreted as no callback. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemCmdRead | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
uint8_t const * | addr, | ||
uint8_t * | readBuff, | ||
uint32_t | size, | ||
cy_smif_event_cb_t | cmdCompleteCb, | ||
cy_stc_smif_context_t * | context | ||
) |
This function performs the Read operation.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
addr | The address to read. |
readBuff | The pointer to the variable where the read data is stored. If this pointer is a NULL, then the function does not enable the interrupt. This use case is typically used when the FIFO is handled outside the interrupt and is managed in either a polling-based code or a DMA. The user would handle the FIFO management in a DMA or a polling-based code. If the user provides a NULL pointer in this function and does not handle the FIFO transaction, this could either stall or timeout the operation Cy_SMIF_TransmitData(). |
size | The size of data to read. |
cmdCompleteCb | The callback function to call after the transfer completion. NULL interpreted as no callback. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemSfdpDetect | ( | SMIF_Type * | base, |
cy_stc_smif_mem_device_cfg_t * | device, | ||
cy_en_smif_slave_select_t | slaveSelect, | ||
cy_en_smif_data_select_t | dataSelect, | ||
cy_stc_smif_context_t * | context | ||
) |
This function detects the device signature for SFDP devices.
Refer to the SFDP spec (JESD216B) for details. The function asks the device using an SPI and then populates the relevant parameters for cy_stc_smif_mem_device_cfg_t.
base | Holds the base address of the SMIF block registers. |
device | The device structure instance declared by the user. This is where the detected parameters are stored and returned. |
slaveSelect | The slave select line for the device. |
dataSelect | The data line selection options for a slave device. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_SMIF_Reset_Memory | ( | SMIF_Type * | base, |
cy_en_smif_slave_select_t | slaveSelect | ||
) |
This function is the weak implementation for resetting the memory.
base | Holds the base address of the SMIF block registers. |
slaveSelect | Denotes the number of the slave device to which reset has to be applied for. |
cy_en_smif_status_t Cy_SMIF_MemInitSfdpMode | ( | SMIF_Type * | base, |
const cy_stc_smif_mem_config_t * | memCfg, | ||
cy_en_smif_txfr_width_t | maxdataWidth, | ||
cy_en_smif_qer_t | qer_id, | ||
cy_stc_smif_context_t * | context | ||
) |
This function can be used for any preferred data width based command instruction set from SFDP Buffer.
base | Holds the base address of the SMIF block registers. |
memCfg | The memory configuration structure that configures the SMIF memory device to map into the device memory map. cy_stc_smif_mem_config_t |
maxdataWidth | maximum data width available on physical interface. |
qer_id | Quad enable requirement ID specifically used for SFDP 1.0 compliant devices where Quad mode is available for use, but SFDP basic flash parameter table does not specify quad mode enable instruction. In other cases, this can be passed as CY_SMIF_SFDP_QER_0. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemIsReady | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memConfig, | ||
uint32_t | timeoutUs, | ||
cy_stc_smif_context_t const * | context | ||
) |
Polls the memory device to check whether it is ready to accept new commands or not until either it is ready or the retries have exceeded the limit.
This is a blocking function, it will block the execution flow until the command transmission is completed.
base | Holds the base address of the SMIF block registers. |
memConfig | The memory device configuration. |
timeoutUs | The timeout value in microseconds to apply while polling the memory. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemIsQuadEnabled | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memConfig, | ||
bool * | isQuadEnabled, | ||
cy_stc_smif_context_t const * | context | ||
) |
Checks whether the QE (Quad Enable) bit is set or not in the configuration register of the memory.
This is a blocking function, it will block the execution flow until the command transmission is completed.
base | Holds the base address of the SMIF block registers. |
memConfig | The memory device configuration. |
isQuadEnabled | This parameter is updated to indicate whether quad mode is enabled (true) or not (false). The value is valid only when the function returns CY_SMIF_SUCCESS. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemEnableQuadMode | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memConfig, | ||
uint32_t | timeoutUs, | ||
cy_stc_smif_context_t const * | context | ||
) |
Sets the QE (QUAD Enable) bit in the external memory configuration register to enable quad SPI mode.
This is a blocking function, it will block the execution flow until the command transmission is completed.
base | Holds the base address of the SMIF block registers. |
memConfig | The memory device configuration. |
timeoutUs | The timeout value in microseconds to apply while polling the memory. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemRead | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memConfig, | ||
uint32_t | address, | ||
uint8_t | rxBuffer[], | ||
uint32_t | length, | ||
cy_stc_smif_context_t const * | context | ||
) |
Reads data from the external memory and blocks until the read transfer is complete or a timeout occurs.
This is a blocking function, it will block the execution flow until the command transmission is completed.
base | Holds the base address of the SMIF block registers. |
memConfig | The memory device configuration. |
address | The address to read data from. |
rxBuffer | The buffer for storing the read data. In case of Octal DDR, address must be an even address. |
length | The size of data to read. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemWrite | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memConfig, | ||
uint32_t | address, | ||
uint8_t const | txBuffer[], | ||
uint32_t | length, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function writes data to the external memory.
This is a blocking function, it will block the execution flow until the command transmission is completed.
base | Holds the base address of the SMIF block registers. |
memConfig | The memory device configuration. |
address | The address to write data at. In case of Octal DDR, address must be an even address. |
txBuffer | The buffer holding the data to write in the external memory. |
length | The size of data to write. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemEraseSector | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memConfig, | ||
uint32_t | address, | ||
uint32_t | length, | ||
cy_stc_smif_context_t const * | context | ||
) |
Erases a block/sector of the external memory.
This is a blocking function, it will block the execution flow until the command transmission is completed.
base | Holds the base address of the SMIF block registers. |
memConfig | The memory device configuration. |
address | The address of the block to be erased. The address will be aligned to the start address of the sector in which address is located. |
length | The length of data to erase. The length will be aligned to the sector boundary where end address is located. If length exceeds memory size API returns CY_SMIF_BAD_PARAM without performing erase operation. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemEraseChip | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memConfig, | ||
cy_stc_smif_context_t const * | context | ||
) |
Erases the entire chip of the external memory.
This is a blocking function, it will block the execution flow until the command transmission is completed.
base | Holds the base address of the SMIF block registers. |
memConfig | The memory device configuration. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemLocateHybridRegion | ( | cy_stc_smif_mem_config_t const * | memDevice, |
cy_stc_smif_hybrid_region_info_t ** | regionInfo, | ||
uint32_t | address | ||
) |
This function locates the region structure by the address which belongs to it.
memDevice | The memory device configuration. |
regionInfo | Places a hybrid region configuration structure that contains the region specific parameters. See cy_stc_smif_hybrid_region_info_t for reference. |
address | The address for which a region is searched. |
void Cy_SMIF_SetReadyPollingDelay | ( | uint16_t | pollTimeoutUs, |
cy_stc_smif_context_t * | context | ||
) |
This function sets the polling delay in micro seconds to check memory device availability.
By default polling delay is set to 0.
pollTimeoutUs | Specifies the polling timeout value in micro seconds. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemCmdPowerDown | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function sends a Power-down command to the selected memory device in Single SPI mode.
Please note that, once Cy_SMIF_MemCmdPowerDown is issued, external memory will not respond to any other command except Cy_SMIF_MemCmdReleasePowerDown.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_smif_status_t Cy_SMIF_MemCmdReleasePowerDown | ( | SMIF_Type * | base, |
cy_stc_smif_mem_config_t const * | memDevice, | ||
cy_stc_smif_context_t const * | context | ||
) |
This function sends a Release Power-down command to the selected memory device in Single SPI mode.
base | Holds the base address of the SMIF block registers. |
memDevice | The device to which the command is sent. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_SMIF_MemEnableFWCalibarion | ( | SMIF_Type * | base, |
cy_en_smif_slave_select_t | slave | ||
) |
This function enables Firmware Calibration mode for the device.
Once firmware calibration mode is enabled, user can add delay taps for selected data line using Cy_SMIF_GetSelectedDelayTapSel
base | Holds the base address of the SMIF block registers. |
slave | Holds the slave select line for which delay tap setting should be applied for. |
void Cy_SMIF_MemDisableFWCalibarion | ( | SMIF_Type * | base, |
cy_en_smif_slave_select_t | slave | ||
) |
This function disables Firmware Calibration mode for the device.
base | Holds the base address of the SMIF block registers. |
slave | Holds the slave select line for which delay tap setting should be applied for. |
cy_en_smif_status_t Cy_SMIF_SetSelectedDelayTapSel | ( | SMIF_Type * | base, |
cy_en_smif_slave_select_t | slave, | ||
cy_en_smif_mem_data_line_t | data_line, | ||
uint8_t | tapSel | ||
) |
This function sets delay tap for a particular data line.
Cy_SMIF_MemEnableFWCalibarion should be called to get this setting into effect.
base | Holds the base address of the SMIF block registers. |
slave | Holds the slave select line for which delay tap setting should be applied for. |
data_line | Holds the data line for which delay tap setting should be applied for. |
tapSel | tap selection value (0-15) where lower nibble indicates the delay tap setting for positive clock phase and higher nibble indicates the setting for negative clock phase delay tap selection. |
uint8_t Cy_SMIF_GetSelectedDelayTapSel | ( | SMIF_Type * | base, |
cy_en_smif_slave_select_t | slave, | ||
cy_en_smif_mem_data_line_t | data_line | ||
) |
This function gets delay tap set for a particular data line.
base | Holds the base address of the SMIF block registers. |
slave | Holds the slave select line for which delay tap setting should be retrieved. |
data_line | Holds the data line for which delay tap setting should be retrieved. |
cy_en_smif_status_t Cy_SMIF_MemGetSDLTap | ( | SMIF_Type * | base, |
const cy_stc_smif_mem_config_t * | memConfig, | ||
uint8_t * | posTap, | ||
uint8_t * | negTap | ||
) |
This function retreives the Slave Delay Line (SDL) Tap in use.
base | Holds the base address of the SMIF block registers. |
memConfig | The device for which SDL tap value has to be retreived. |
posTap | Returns positive delay tap value set. |
negTap | Returns negative delay tap value set. |
cy_en_smif_status_t Cy_SMIF_MemSetSDLTap | ( | SMIF_Type * | base, |
const cy_stc_smif_mem_config_t * | memConfig, | ||
uint8_t | posTap, | ||
uint8_t | negTap | ||
) |
This function sets the Slave Delay Line (SDL) tap ranging from 0 to 15.
base | Holds the base address of the SMIF block registers. |
memConfig | The device for which SDL tap value has to be set. |
posTap | Positive delay tap value to be set. |
negTap | Negative delay tap value to be set. |
modify anything in this structure.
cy_en_smif_status_t Cy_SMIF_MemCalibrateSDL | ( | SMIF_Type * | base, |
const cy_stc_smif_mem_config_t * | memConfig, | ||
uint32_t | calibrationDataOffsetAddress, | ||
cy_stc_smif_context_t * | context | ||
) |
This function takes an offset address as input to perform read/write test and assign best possible Slave Delay Line (SDL) tap.
In case of flash memory, the sector where the address falls in would be erased to perform write operation of calibration pattern.
base | Holds the base address of the SMIF block registers. |
memConfig | The device to which calibration of SDL tap |
calibrationDataOffsetAddress | Offset address in the memory to which calibration pattern would be written and read back to identify the best possible SDL tap. |
context | This is the pointer to the context structure cy_stc_smif_context_t allocated by the user. The structure is used during the SMIF operation for internal configuration and data retention. The user must not modify anything in this structure. |