Memory Slot Functions

group group_smif_mem_slot_functions

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.

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 peforms 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 strucutre 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 funciton. The cy_stc_smif_context_t context structure returned from Cy_SMIF_Init is passed as a parameter to this function.

note

4-byte addressing mode is set when the memory device supports 3- or 4-byte addressing mode.

Return

The memory slot initialization status.

Parameters
  • 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.

Parameters
  • 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.

note

This function uses the low-level Cy_SMIF_TransmitCommand() API. The Cy_SMIF_TransmitCommand() API works in a blocking mode. In the dual quad mode, this API is called for each memory.

Return

A status of the command transmission.

Parameters
  • 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.

note

This function uses the low-level Cy_SMIF_TransmitCommand() API. Cy_SMIF_TransmitCommand() API works in a blocking mode. In the dual quad mode this API should be called for each memory.

Return

A status of the command transmission.

Parameters
  • 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.

note

In the dual quad mode, this API is called for each memory.

note

Check Rules for PSoC6 QSPI/SMIF Block Usage for any usage restriction

Return

A status of the memory device.

  • True - The device is busy or a timeout occurs.

  • False - The device is not busy.

Parameters
  • 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.

note

In the dual quad mode, this API is called for each memory.

note

Check Rules for PSoC6 QSPI/SMIF Block Usage for any usage restriction

Return

A status of the command.

Parameters
  • 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_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.

note

This function uses the low-level Cy_SMIF_TransmitCommand() API. the Cy_SMIF_TransmitCommand() API works in a blocking mode. In the dual quad mode, this API is called for each memory.

note

Check Rules for PSoC6 QSPI/SMIF Block Usage for any usage restriction

Return

A status of the command reception.

Parameters
  • 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.

note

This function uses the low-level Cy_SMIF_TransmitCommand() API. The Cy_SMIF_TransmitCommand() API works in a blocking mode. In the dual quad mode, this API is called for each memory.

Return

A status of the command transmission.

Parameters
  • 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.

note

This function uses the low-level Cy_SMIF_TransmitCommand() API. Cy_SMIF_TransmitCommand() API works in a blocking mode. In the dual quad mode, this API is called for each memory.

Return

A status of the command transmission.

Parameters
  • 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.

note

This function uses the low-level Cy_SMIF_TransmitCommand() API. The Cy_SMIF_TransmitCommand() API works in a blocking mode. In the dual quad mode, this API is called for each memory.

Return

A status of the command transmission.

Parameters
  • 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.

note

This function uses the Cy_SMIF_TransmitCommand() API. The Cy_SMIF_TransmitCommand() API works in the blocking mode. In the dual quad mode, this API works with both types of memory simultaneously.

Return

A status of a transmission.

Parameters
  • 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.

note

This function uses the Cy_SMIF_TransmitCommand() API. The Cy_SMIF_TransmitCommand() API works in the blocking mode. In the dual quad mode, this API works with both types of memory simultaneously.

note

Check Rules for PSoC6 QSPI/SMIF Block Usage for any usage restriction

Return

A status of the transmission.

Parameters
  • 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.

note

This function is a blocking function and blocks until the structure data is read and returned. This function uses Cy_SMIF_TransmitCommand() If there is no support for SFDP in the memory device, the API returns an error condition. The function requires:

note

The SFDP detect takes into account the types of the SPI supported by the memory device and also the dataSelect option selected to choose which SPI mode (SPI, DSPI, QSPI) to load into the structures. The algorithm prefers QSPI>DSPI>SPI, provided there is support for it in the memory device and the dataSelect selected by the user.

note

4-byte addressing mode is set when the memory device supports 3- or 4-byte addressing mode.

note

When the Erase command is not found the width of the command transfer (cmdWidth) is set to CY_SMIF_WIDTH_NA. When the Program command is not found for 4 byte addressing mode the Program command instruction is set for 1S-1S-1S Protocol mode and 3-byte addressing mode.

Return

A status of the transmission.

Parameters
  • 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.

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.

Return

The status of the operation. CY_SMIF_SUCCESS - Memory is ready to accept new commands. CY_SMIF_EXCEED_TIMEOUT - Memory is busy.

Function Usage

    /* Scenario:  Wait until the erase operation is completed.
     * The SMIF/QSPI configuration tool generates the smifBlockConfig structure 
     * needed for the memslot level API usage. 
     */

    cy_stc_smif_context_t SMIF_context;  /* This is a shared context structure.
                                          * It must be global
                                          */
    #define TIMEOUT         (10000UL)    /* 10 msec timeout */

    /* Wait until the erase operation is completed or a timeout occurs */
    if (CY_SMIF_SUCCESS != Cy_SMIF_MemIsReady(SMIF, smifBlockConfig.memConfig[0], TIMEOUT, &SMIF_context))
    {
        /* Insert error handling */
    }

Parameters
  • 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.

Return

The status of the operation. See cy_en_smif_status_t.

Function Usage

    /* Scenario:  Check whether Quad mode (1-1-4 or 1-4-4 modes) is enabled. If Quad mode is disabled, 
     * then enable it to use all the four I/Os during communication.
     * The SMIF/QSPI configuration tool generates the smifBlockConfig structure 
     * needed for the memslot level API usage. 
     */

    cy_stc_smif_context_t SMIF_context;  /* This is a shared context structure.
                                          * It must be global
                                          */
    /* Timeout in microseconds to apply while polling the memory for its ready status after quad
     * enable command has been sent out. Quad enable is a non-volatile write.
     */
    #define QUAD_ENABLE_TIMEOUT    (5000UL)  /* 5 miliseconds */
    bool isQuadEnabled = false;

    /* Check whether Quad mode is enabled */
    if (CY_SMIF_SUCCESS != Cy_SMIF_MemIsQuadEnabled(SMIF, smifBlockConfig.memConfig[0], &isQuadEnabled, &SMIF_context))
    {
        /* Insert error handling */
    }
    
    if (!isQuadEnabled)
    {
        /* Enable Quad Mode */
        if (CY_SMIF_SUCCESS != Cy_SMIF_MemEnableQuadMode(SMIF, smifBlockConfig.memConfig[0], QUAD_ENABLE_TIMEOUT, &SMIF_context))
        {
            /* Insert error handling */
        }
    }

Parameters
  • 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.

Return

The status of the operation. See cy_en_smif_status_t.

Function Usage

See Cy_SMIF_MemIsQuadEnabled usage.

Parameters
  • 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.

Return

The status of the operation. See cy_en_smif_status_t.

Function Usage

    /* Scenario:  Read 64 bytes of data from the external memory into the rxBuffer array.
     * The SMIF/QSPI configuration tool generates the smifBlockConfig structure 
     * needed for the memslot level API usage. 
     */
    #define READ_PACKET_SIZE         (64U)    /* Data Buffer size */
    cy_stc_smif_context_t SMIF_context;  /* This is a shared context structure.
                                          * It must be global
                                          */
    uint32_t extMemAddress = 0x00UL;     /* Address = 0x00000000 (4 bytes) */
    uint8_t rxBuffer[READ_PACKET_SIZE];

    /* Read data from the external memory */
    if (CY_SMIF_SUCCESS != Cy_SMIF_MemRead(SMIF, smifBlockConfig.memConfig[0], extMemAddress, rxBuffer, READ_PACKET_SIZE, &SMIF_context))
    {
        /* Insert error handling */
    }

Parameters
  • 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.

  • 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.

Return

The status of the operation. See cy_en_smif_status_t.

Function Usage

    /* Scenario:  Write 64 bytes of data from the txBuffer array into the external memory.
     * The SMIF/QSPI configuration tool generates the smifBlockConfig structure 
     * needed for the memslot level API usage. 
     */
    #define WRITE_PACKET_SIZE         (64U)    /* Data Buffer size */
    cy_stc_smif_context_t SMIF_context;  /* This is a shared context structure.
                                          * It must be global
                                          */
    uint32_t extMemAddress = 0x00UL;     /* Address = 0x00000000 */
    uint8_t txBuffer[WRITE_PACKET_SIZE];

    /* Write data into the external memory */
    if (CY_SMIF_SUCCESS != Cy_SMIF_MemWrite(SMIF, smifBlockConfig.memConfig[0], extMemAddress, txBuffer, WRITE_PACKET_SIZE, &SMIF_context))
    {
        /* Insert error handling */
    }

Parameters
  • base: Holds the base address of the SMIF block registers.

  • memConfig: The memory device configuration.

  • address: The address to write data at.

  • 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.

note

Memories like hybrid have sectors of different sizes.
Check the adress and length parameters before calling this function.

Return

The status of the operation. See cy_en_smif_status_t.

Function Usage

    /* Scenario:  Erase one sector of the external memory.
     * The SMIF/QSPI configuration tool generates the smifBlockConfig structure 
     * needed for the memslot level API usage. 
     */
    cy_stc_smif_context_t SMIF_context;  /* This is a shared context structure.
                                          * It must be global
                                          */
    uint32_t extMemAddress = 0x00UL;     /* Address = 0x00000000 */
    uint32_t length = smifBlockConfig.memConfig[0]->deviceCfg->eraseSize;   /* The sector size */

    /* Erase a sector of the external memory */
    if (CY_SMIF_SUCCESS != Cy_SMIF_MemEraseSector(SMIF, smifBlockConfig.memConfig[0], extMemAddress, length, &SMIF_context))
    {
        /* Insert error handling */
    }

Parameters
  • 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 should be aligned with the start address of the sector.

  • length: The size of data to erase. The length should be equal to the sum of all sectors length to be erased. Otherwise, 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.

Return

The status of the operation. See cy_en_smif_status_t.

Function Usage

    /* Scenario:  Erase the entire chip.
     * The SMIF/QSPI configuration tool generates the smifBlockConfig structure 
     * needed for the memslot level API usage. 
     */
    cy_stc_smif_context_t SMIF_context;  /* This is a shared context structure.
                                          * It must be global
                                          */

    /* Erase the entire chip */
    if (CY_SMIF_SUCCESS != Cy_SMIF_MemEraseChip(SMIF, smifBlockConfig.memConfig[0], &SMIF_context))
    {
        /* Insert error handling */
    }

Parameters
  • 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.

note

This function is valid for the memories with hybrid sectors.

Return

A status of the region location.

Function Usage

    /* Scenario: Get the erase size for a specific region.
     * Erase one sector of the external memory.
     * The SMIF/QSPI configuration tool generates the smifBlockConfig structure 
     * needed for the memslot level API usage. 
     */

    cy_stc_smif_hybrid_region_info_t *currentRegionInfo = NULL; /* The pointer to the structure
                                                                 * which defines the region
                                                                 * we are searching for.*/

    cy_stc_smif_context_t SMIF_context;                         /* This is a shared context structure.
                                                                 * It must be global
                                                                 */

    uint32_t regionAddress = 0x00UL; /* The address for which a region is searched */

    /* Update the currentRegion with a pointer to the region the address belongs to */
    Cy_SMIF_MemLocateHybridRegion(smifBlockConfig.memConfig[0], &currentRegionInfo, regionAddress);

    /* Populate the erase size and erase time from the region structure */
    uint32_t regionEraseSize = currentRegionInfo->eraseSize;

    /* Erase a sector of the external memory */
    if (CY_SMIF_SUCCESS != Cy_SMIF_MemEraseSector(SMIF, smifBlockConfig.memConfig[0], regionAddress, regionEraseSize, &SMIF_context))
    {
        /* Insert error handling */
    }

Parameters
  • 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.