cy_smif_8h

Provides an API declaration of the Cypress SMIF driver.

Version

2.20

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
Copyright

Copyright 2016-2021 Cypress Semiconductor Corporation SPDX-License-Identifier: Apache-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Defines

CY_SMIF_DRV_VERSION_MAJOR

The driver major version.

CY_SMIF_DRV_VERSION_MINOR

The driver minor version.

CY_SMIF_WAIT_1_UNIT

One microsecond timeout for Cy_SMIF_TimeoutRun()

CY_SMIF_ID

The SMIF driver ID, reported as part of an unsuccessful API return status cy_en_smif_status_t.

CY_SMIF_ALIGNMENT_ERROR

Enable XIP_ALIGNMENT_ERROR interrupt see TRM for details.

CY_SMIF_RX_DATA_FIFO_UNDERFLOW

Enable RX_DATA_FIFO_UNDERFLOW interrupt see TRM for details.

CY_SMIF_TX_DATA_FIFO_OVERFLOW

Enable TX_DATA_FIFO_OVERFLOW interrupt see TRM for details.

CY_SMIF_TX_COMMAND_FIFO_OVERFLOW

Enable TX_CMD_FIFO_OVERFLOW interrupt see TRM for details.

CY_SMIF_TX_DATA_FIFO_LEVEL_TRIGGER

Enable TR_TX_REQ interrupt see TRM for details.

CY_SMIF_RX_DATA_FIFO_LEVEL_TRIGGER

Enable TR_RX_REQ interrupt see TRM for details.

Typedefs

typedef void (*cy_smif_event_cb_t)(uint32_t event)

The SMIF user callback function type called at the end of a transfer.

Parameters

event – The event which caused a callback call.

Enums

enum cy_en_smif_txfr_width_t

cy_en_smif_txfr_width_t: The Transfer width options for the command, data, the address and the mode.

Values:

enumerator CY_SMIF_WIDTH_SINGLE

Single SPI mode.

enumerator CY_SMIF_WIDTH_DUAL

Dual SPI mode.

enumerator CY_SMIF_WIDTH_QUAD

Quad SPI mode.

enumerator CY_SMIF_WIDTH_OCTAL

Octal SPI mode.

enumerator CY_SMIF_WIDTH_NA

The specific width parameter is not applicable for this memory command.

enum cy_en_smif_error_event_t

cy_en_smif_error_event_t: The SMIF error-event selection.

Values:

enumerator CY_SMIF_BUS_ERROR

Generates a bus error.

enumerator CY_SMIF_WAIT_STATES

Stalls the bus with the wait states.

This option will increase the interrupt latency.

enum cy_en_smif_data_select_t

cy_en_smif_data_select_t: The data line-selection options for a slave device.

Values:

enumerator CY_SMIF_DATA_SEL0

smif.spi_data[0] = DATA0, smif.spi_data[1] = DATA1, …, smif.spi_data[7] = DATA7.

This value is allowed for the SPI, DSPI, QSPI, dual QSPI, and octal SPI modes.

enumerator CY_SMIF_DATA_SEL1

smif.spi_data[2] = DATA0, smif.spi_data[3] = DATA1.

This value is only allowed for the SPI and DSPI modes.

enumerator CY_SMIF_DATA_SEL2

smif.spi_data[4] = DATA0, smif.spi_data[5] = DATA1, …, smif.spi_data[7] = DATA3.

This value is only allowed for the SPI, DSPI, QSPI and dual QSPI modes.

enumerator CY_SMIF_DATA_SEL3

smif.spi_data[6] = DATA0, smif.spi_data[7] = DATA1.

This value is only allowed for the SPI and DSPI modes.

enum cy_en_smif_mode_t

cy_en_smif_mode_t: The SMIF modes to work with an external memory.

Values:

enumerator CY_SMIF_NORMAL

Command mode (MMIO mode).

enumerator CY_SMIF_MEMORY

XIP (eXecute In Place) mode.

enum cy_en_smif_txfr_status_t

cy_en_smif_txfr_status_t: The SMIF transfer status return values.

Values:

enumerator CY_SMIF_STARTED

The SMIF started.

enumerator CY_SMIF_SEND_COMPLETE

The data transmission is complete.

enumerator CY_SMIF_SEND_BUSY

The data transmission is in progress.

enumerator CY_SMIF_RX_COMPLETE

The data reception is completed.

enumerator CY_SMIF_RX_BUSY

The data reception is in progress.

enumerator CY_SMIF_XIP_ERROR

An XIP alignment error.

enumerator CY_SMIF_CMD_ERROR

A TX CMD FIFO overflow.

enumerator CY_SMIF_TX_ERROR

A TX DATA FIFO overflow.

enumerator CY_SMIF_RX_ERROR

An RX DATA FIFO underflow.

enum cy_en_smif_status_t

cy_en_smif_status_t: The SMIF API return values.

Values:

enumerator CY_SMIF_SUCCESS

Successful SMIF operation.

enumerator CY_SMIF_CMD_FIFO_FULL

The command is cancelled.

The command FIFO is full.

enumerator CY_SMIF_EXCEED_TIMEOUT

The SMIF operation timeout exceeded.

enumerator CY_SMIF_NO_QE_BIT

The device does not have a QE bit.

The device detects 1-1-4 and 1-4-4 Reads based on the instruction.

enumerator CY_SMIF_BAD_PARAM

The SMIF API received the wrong parameter.

enumerator CY_SMIF_NO_SFDP_SUPPORT

The external memory does not support SFDP (JESD216B).

enumerator CY_SMIF_NOT_HYBRID_MEM

The external memory is not hybrid.

enumerator CY_SMIF_SFDP_CORRUPTED_TABLE

The SFDP table is corrupted.

enumerator CY_SMIF_SFDP_SS0_FAILED

Failed to initialize the slave select 0 external memory by auto detection (SFDP).

enumerator CY_SMIF_SFDP_SS1_FAILED

Failed to initialize the slave select 1 external memory by auto detection (SFDP).

enumerator CY_SMIF_SFDP_SS2_FAILED

Failed to initialize the slave select 2 external memory by auto detection (SFDP).

enumerator CY_SMIF_SFDP_SS3_FAILED

Failed to initialize the slave select 3 external memory by auto detection (SFDP).

enumerator CY_SMIF_CMD_NOT_FOUND

The command API is not supported for this memory device.

enum cy_en_smif_slave_select_t

cy_en_smif_slave_select_t: The SMIF slave select definitions for the driver API.

Each slave select is represented by an enumeration that has the bit corresponding to the slave select number set.

Values:

enumerator CY_SMIF_SLAVE_SELECT_0

The SMIF slave select 0.

enumerator CY_SMIF_SLAVE_SELECT_1

The SMIF slave select 1.

enumerator CY_SMIF_SLAVE_SELECT_2

The SMIF slave select 2.

enumerator CY_SMIF_SLAVE_SELECT_3

The SMIF slave select 3.

enum cy_en_smif_clk_select_t

cy_en_smif_clk_select_t: Specifies the clock source for the receiver clock.

note

This enum is available for CAT1B devices.

Values:

enumerator CY_SMIF_SEL_OUTPUT_CLK

The SMIF output clock.

enumerator CY_SMIF_SEL_INVERTED_OUTPUT_CLK

The SMIF inverted output clock.

enumerator CY_SMIF_SEL_FEEDBACK_CLK

The SMIF feedback clock.

enumerator CY_SMIF_SEL_INVERTED_FEEDBACK_CLK

The SMIF feedback inverted clock.

enumerator CY_SMIF_SEL_INTERNAL_CLK

The SMIF internal clock.

enumerator CY_SMIF_SEL_INVERTED_INTERNAL_CLK

The SMIF internal inverted clock.

enumerator CY_SMIF_SEL_INTERNAL_CLK

The SMIF internal clock.

enumerator CY_SMIF_SEL_INVERTED_INTERNAL_CLK

The SMIF internal inverted clock.

enumerator CY_SMIF_SEL_FEEDBACK_CLK

The SMIF feedback clock.

enumerator CY_SMIF_SEL_INVERTED_FEEDBACK_CLK

The SMIF feedback inverted clock.

enum cy_en_smif_clk_select_t

note

This enum is available for CAT1A devices.

Values:

enumerator CY_SMIF_SEL_OUTPUT_CLK

The SMIF output clock.

enumerator CY_SMIF_SEL_INVERTED_OUTPUT_CLK

The SMIF inverted output clock.

enumerator CY_SMIF_SEL_FEEDBACK_CLK

The SMIF feedback clock.

enumerator CY_SMIF_SEL_INVERTED_FEEDBACK_CLK

The SMIF feedback inverted clock.

enumerator CY_SMIF_SEL_INTERNAL_CLK

The SMIF internal clock.

enumerator CY_SMIF_SEL_INVERTED_INTERNAL_CLK

The SMIF internal inverted clock.

enumerator CY_SMIF_SEL_INTERNAL_CLK

The SMIF internal clock.

enumerator CY_SMIF_SEL_INVERTED_INTERNAL_CLK

The SMIF internal inverted clock.

enumerator CY_SMIF_SEL_FEEDBACK_CLK

The SMIF feedback clock.

enumerator CY_SMIF_SEL_INVERTED_FEEDBACK_CLK

The SMIF feedback inverted clock.

enum cy_en_smif_cache_t

cy_en_smif_cache_t: Specifies enabled type of SMIF cache.

Values:

enumerator CY_SMIF_CACHE_SLOW

The SMIF slow cache (in the clk_slow domain) see TRM for details.

enumerator CY_SMIF_CACHE_FAST

The SMIF fast cache (in the clk_fast domain) see TRM for details.

enumerator CY_SMIF_CACHE_BOTH

The SMIF both caches.

enum cy_en_smif_data_rate_t

cy_en_smif_data_rate_t: Specifies the data rate.

note

This enum is available for CAT1B devices.

Values:

enumerator CY_SMIF_SDR

The SMIF Single Data Rate (SDR)

enumerator CY_SMIF_DDR

The SMIF Double Data Rate (DDR)

enum cy_en_smif_field_presence_t

cy_en_smif_field_presence_t: Specifies the presence of the field.

note

This enum is available for CAT1B devices.

Values:

enumerator CY_SMIF_NOT_PRESENT
enumerator CY_SMIF_PRESENT_1BYTE
enumerator CY_SMIF_PRESENT_2BYTE

Functions

cy_en_smif_status_t Cy_SMIF_Init(SMIF_Type *base, cy_stc_smif_config_t const *config, uint32_t timeout, cy_stc_smif_context_t *context)

This function initializes the SMIF block as a communication block.

The user must ensure that the SMIF interrupt is disabled while this function is called. Enabling the interrupts can lead to triggering in the middle of the initialization operation, which can lead to erroneous initialization.

As parameters, this function takes the SMIF register base address and a context structure along with the configuration needed for the SMIF block, stored in a config

note

Make sure that the interrupts are initialized and disabled.

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

  • config – Passes a configuration structure that configures the SMIF block for operation.

  • timeout – A timeout in microseconds for blocking APIs in use.

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

void Cy_SMIF_DeInit(SMIF_Type *base)

This function de-initializes the SMIF block to default values.

note

The SMIF must be disabled before calling the function. Call Cy_SMIF_Disable

Parameters

base – Holds the base address of the SMIF block registers.

void Cy_SMIF_SetDataSelect(SMIF_Type *base, cy_en_smif_slave_select_t slaveSelect, cy_en_smif_data_select_t dataSelect)

This function configures the data select option for a specific slave.

The selection provides pre-set combinations for connecting the SMIF data lines to the GPIOs.

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

  • slaveSelect – The slave device ID. This number is either CY_SMIF_SLAVE_SELECT_0 or CY_SMIF_SLAVE_SELECT_1 or CY_SMIF_SLAVE_SELECT_2 or CY_SMIF_SLAVE_SELECT_3 (cy_en_smif_slave_select_t). It defines the slave select line to be used during the transmission.

  • dataSelect – This parameter selects the data select option. cy_en_smif_data_select_t

void Cy_SMIF_SetMode(SMIF_Type *base, cy_en_smif_mode_t mode)

Sets the mode of operation for the SMIF.

The mode of operation can be the XIP mode where the slave devices are mapped as memories and are directly accessed from the PSoC register map. In the MMIO mode, the SMIF block acts as a simple SPI engine.

note

Interrupt and triggers and not working in XIP mode, see TRM for details

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

  • mode – The mode of the SMIF operation.

cy_en_smif_mode_t Cy_SMIF_GetMode(SMIF_Type const *base)

Reads the mode of operation for the SMIF.

The mode of operation can be the XIP mode where the slave devices are mapped as memories and are directly accessed from the PSoC register map. In the MMIO mode, the SMIF block acts as a simple SPI engine.

Parameters

base – Holds the base address of the SMIF block registers.

Returns

The mode of SMIF operation (see cy_en_smif_mode_t).

cy_en_smif_status_t Cy_SMIF_TransmitCommand(SMIF_Type *base, uint8_t cmd, cy_en_smif_txfr_width_t cmdTxfrWidth, uint8_t const cmdParam[], uint32_t paramSize, cy_en_smif_txfr_width_t paramTxfrWidth, cy_en_smif_slave_select_t slaveSelect, uint32_t completeTxfr, cy_stc_smif_context_t const *context)

This function transmits a command byte followed by a parameter which is typically an address field.

The transfer is implemented using the TX FIFO. This function also asserts the slave select line. A command to a memory device generally starts with a command byte transmission. This function sets up the slave lines for the rest of the command structure. The Cy_SMIF_TransmitCommand is called before Cy_SMIF_TransmitData or Cy_SMIF_ReceiveData is called. When enabled, the completeTxfr parameter in the function will de-assert the slave select line at the end of the function execution.

note

This function blocks until all the command and associated parameters have been transmitted over the SMIF block or timeout expire.

note

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

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

  • cmd – The command byte to be transmitted.

  • cmdTxfrWidth – The width of command byte transfer cy_en_smif_txfr_width_t.

  • cmdParam – This is the pointer to an array that has bytes to be transmitted after the command byte. Typically, this field has the address bytes associated with the memory command.

  • paramSize – The size of the cmdParam array.

  • paramTxfrWidth – The width of parameter transfer cy_en_smif_txfr_width_t.

  • slaveSelect – Denotes the number of the slave device to which the transfer is made. (0, 1, 2 or 4 - the bit defines which slave to enable) Two-bit enable is possible only for the double quad SPI mode.

  • completeTxfr – Specifies if the slave select line must be de-asserted after transferring the last byte in the parameter array. Typically, this field is set to 0 when this function succeed through Cy_SMIF_TransmitData or Cy_SMIF_ReceiveData.

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

A status of the command transmit.

cy_en_smif_status_t Cy_SMIF_TransmitData(SMIF_Type *base, uint8_t const *txBuffer, uint32_t size, cy_en_smif_txfr_width_t transferWidth, cy_smif_event_cb_t TxCompleteCb, cy_stc_smif_context_t *context)

This function is used to transmit data using the SMIF interface.

This function uses the TX Data FIFO to implement the transmit functionality. The function sets up an interrupt to trigger the TX Data FIFO and uses that interrupt to fill the TX Data FIFO until all the data is transmitted. At the end of the transmission, the TxCompleteCb is executed.

note

This function is to be preceded by Cy_SMIF_TransmitCommand where the slave select is selected. The slave is de-asserted at the end of a transmit. The function triggers the transfer and the transfer itself utilizes the interrupt for FIFO operations in the background. Thus, frequent interrupts will be executed after this function is triggered. Since this API is non-blocking and sets up the interrupt to act on the data FIFO, ensure there will be no another instance of the function called before the current instance has completed execution.

note

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. The transfer statuses returned by Cy_SMIF_GetTransferStatus are no longer valid.

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

  • txBuffer – The pointer to the data to be transferred. 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.

  • size – The size of txBuffer. Must be > 0 and not greater than 65536.

  • transferWidth – The width of transfer cy_en_smif_txfr_width_t.

  • TxCompleteCb – The callback executed at the end of a transmission. NULL interpreted as no callback.

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

A status of a transmission.

cy_en_smif_status_t Cy_SMIF_TransmitDataBlocking(SMIF_Type *base, uint8_t const *txBuffer, uint32_t size, cy_en_smif_txfr_width_t transferWidth, cy_stc_smif_context_t const *context)

This function implements the transmit data phase in the memory command.

The data is transmitted using the Tx Data FIFO and the TX_COUNT command. This function blocks until completion. The function does not use the interrupts and will use CPU to monitor the FIFO status and move data accordingly. The function returns only on completion.

note

Since this API is blocking, ensure that other transfers finished and it will not be called during non-blocking transfer.

note

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. The transfer statuses returned by Cy_SMIF_GetTransferStatus are no longer valid.

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

  • txBuffer – The pointer to the data to be transferred. If this pointer is a NULL, then the function does not fill TX_FIFO. The user would handle the FIFO management in a DMA or a polling-based code.

  • size – The size of txBuffer. Must be > 0 and not greater than 65536.

  • transferWidth – The width of transfer cy_en_smif_txfr_width_t.

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

A status of a transmission.

cy_en_smif_status_t Cy_SMIF_ReceiveData(SMIF_Type *base, uint8_t *rxBuffer, uint32_t size, cy_en_smif_txfr_width_t transferWidth, cy_smif_event_cb_t RxCompleteCb, cy_stc_smif_context_t *context)

This function implements the receive data phase in the memory command.

The data is received into the RX Data FIFO using the RX_COUNT command. This function sets up the interrupt to trigger on the RX Data FIFO level, and the data is fetched from the RX Data FIFO to the rxBuffer as it gets filled. This function does not block until completion. The completion will trigger the call back function.

note

This function is to be preceded by Cy_SMIF_TransmitCommand. The slave select is de-asserted at the end of the receive. The function triggers the transfer and the transfer itself utilizes the interrupt for FIFO operations in the background. Thus, frequent interrupts will be executed after this function is triggered. This API is non-blocking and sets up the interrupt to act on the data FIFO, ensure there will be no another instance of the function called before the current instance has completed execution.

note

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. The transfer statuses returned by Cy_SMIF_GetTransferStatus are no longer valid.

note

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

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

  • rxBuffer – The pointer to the variable where the receive 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.

  • size – The size of data to be received. Must be > 0 and not greater than 65536.

  • transferWidth – The width of transfer cy_en_smif_txfr_width_t.

  • RxCompleteCb – The callback executed at the end of a reception. NULL interpreted as no callback.

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

A status of a reception.

cy_en_smif_status_t Cy_SMIF_ReceiveDataBlocking(SMIF_Type *base, uint8_t *rxBuffer, uint32_t size, cy_en_smif_txfr_width_t transferWidth, cy_stc_smif_context_t const *context)

This function implements the receive data phase in the memory command.

The data is received into the RX Data FIFO using the RX_COUNT command. This function blocks until completion. The function does not use the interrupts and will use CPU to monitor the FIFO status and move data accordingly. The function returns only on completion.

note

This function is to be preceded by Cy_SMIF_TransmitCommand. The slave select is de-asserted at the end of the receive. Ensure there is no another transfers.

note

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. The transfer statuses returned by Cy_SMIF_GetTransferStatus are no longer valid.

note

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

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

  • rxBuffer – The pointer to the variable where the receive 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.

  • size – The size of data to be received. Must be > 0 and not greater than 65536.

  • transferWidth – The width of transfer cy_en_smif_txfr_width_t.

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

A status of a reception.

cy_en_smif_status_t Cy_SMIF_SendDummyCycles(SMIF_Type *base, uint32_t cycles)

This function sends dummy-clock cycles.

The data lines are tri-stated during the dummy cycles.

note

This function is to be preceded by Cy_SMIF_TransmitCommand.

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

  • cycles – The number of dummy cycles. Must be > 0 and not greater than 65536.

Returns

A status of dummy cycles sending.

uint32_t Cy_SMIF_GetTransferStatus(SMIF_Type const *base, cy_stc_smif_context_t const *context)

This function provides the status of the transfer.

This function is used to poll for the status of the TransmitData or receiveData function. When this function is called to determine the status of ongoing Cy_SMIF_ReceiveData() or Cy_SMIF_TransmitData(), the returned status is only valid if the functions passed a non-NULL buffer to transmit or receive respectively. If the pointer passed to Cy_SMIF_ReceiveData() or Cy_SMIF_TransmitData() is a NULL, then the code/DMA outside this driver will take care of the transfer and the Cy_GetTxfrStatus() will return an erroneous result.

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

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

Returns the transfer status. cy_en_smif_txfr_status_t

void Cy_SMIF_Enable(SMIF_Type *base, cy_stc_smif_context_t *context)

Enables the operation of the SMIF block.

note

This function only enables the SMIF IP. The interrupts associated with the SMIF will need to be separately enabled using the interrupt driver.

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

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

cy_en_smif_status_t Cy_SMIF_TransmitCommand_Ext(SMIF_Type *base, uint16_t cmd, bool isCommand2byte, cy_en_smif_txfr_width_t cmdTxfrWidth, cy_en_smif_data_rate_t cmdDataRate, uint8_t const cmdParam[], uint32_t paramSize, cy_en_smif_txfr_width_t paramTxfrWidth, cy_en_smif_data_rate_t paramDataRate, cy_en_smif_slave_select_t slaveSelect, uint32_t cmpltTxfr, cy_stc_smif_context_t const *context)

This function transmits a command byte followed by a parameter which is typically an address field.

The transfer is implemented using the TX FIFO. This function also asserts the slave select line. A command to a memory device generally starts with a command byte transmission. This function sets up the slave lines for the rest of the command structure. The Cy_SMIF_TransmitCommand_Ext is called before Cy_SMIF_TransmitData_Ext or Cy_SMIF_ReceiveData_Ext is called. When enabled, the completeTxfr parameter in the function will de-assert the slave select line at the end of the function execution.

note

This function blocks until all the command and associated parameters have been transmitted over the SMIF block or timeout expire.

note

This API is available for CAT1B devices.

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

  • cmd – The command byte to be transmitted.

  • isCommand2byte – isCommand2byte

  • cmdTxfrWidth – The width of command byte transfer cy_en_smif_txfr_width_t.

  • cmdDataRate – cmdDataRate

  • cmdParam – This is the pointer to an array that has bytes to be transmitted after the command byte. Typically, this field has the address bytes associated with the memory command.

  • paramSize – The size of the cmdParam array.

  • paramTxfrWidth – The width of parameter transfer cy_en_smif_txfr_width_t.

  • paramDataRate – paramDataRate

  • slaveSelect – Denotes the number of the slave device to which the transfer is made. (0, 1, 2 or 4 - the bit defines which slave to enable) Two-bit enable is possible only for the Double Quad SPI mode.

  • completeTxfr – Specifies if the slave select line must be de-asserted after transferring the last byte in the parameter array. Typically, this field is set to 0 when this function succeed through Cy_SMIF_TransmitData_Ext or Cy_SMIF_ReceiveData_Ext.

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

A status of the command transmit.

cy_en_smif_status_t Cy_SMIF_TransmitData_Ext(SMIF_Type *base, uint8_t const *txBuffer, uint32_t size, cy_en_smif_txfr_width_t transferWidth, cy_en_smif_data_rate_t dataDataRate, cy_smif_event_cb_t TxCmpltCb, cy_stc_smif_context_t *context)

This function is used to transmit data using the SMIF interface.

This function uses the TX Data FIFO to implement the transmit functionality. The function sets up an interrupt to trigger the TX Data FIFO and uses that interrupt to fill the TX Data FIFO until all the data is transmitted. At the end of the transmission, the TxCmpltCb is executed.

note

This function is to be preceded by Cy_SMIF_TransmitCommand_Ext where the slave select is selected. The slave is de-asserted at the end of a transmit. The function triggers the transfer and the transfer itself utilizes the interrupt for FIFO operations in the background. Thus, frequent interrupts will be executed after this function is triggered. Since this API is non-blocking and sets up the interrupt to act on the data FIFO, ensure there will be no another instance of the function called before the current instance has completed execution.

note

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. The transfer statuses returned by Cy_SMIF_GetTransferStatus are no longer valid.

note

This API is available for CAT1B devices.

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

  • txBuffer – The pointer to the data to be transferred. 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.

  • size – The size of txBuffer. Must be > 0 and not greater than 65536.

  • transferWidth – The width of transfer cy_en_smif_txfr_width_t.

  • dataDataRate – dataDataRate

  • TxCmpltCb – The callback executed at the end of a transmission. NULL interpreted as no callback.

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

A status of a transmission.

cy_en_smif_status_t Cy_SMIF_TransmitDataBlocking_Ext(SMIF_Type *base, uint8_t const *txBuffer, uint32_t size, cy_en_smif_txfr_width_t transferWidth, cy_en_smif_data_rate_t dataRate, cy_stc_smif_context_t const *context)

This function implements the transmit data phase in the memory command.

The data is transmitted using the Tx Data FIFO and the TX_COUNT command. This function blocks until completion. The function does not use the interrupts and will use CPU to monitor the FIFO status and move data accordingly. The function returns only on completion.

note

Since this API is blocking, ensure that other transfers finished and it will not be called during non-blocking transfer.

note

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. The transfer statuses returned by Cy_SMIF_GetTransferStatus are no longer valid.

note

This API is available for CAT1B devices.

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

  • txBuffer – The pointer to the data to be transferred. If this pointer is a NULL, then the function does not fill TX_FIFO. The user would handle the FIFO management in a DMA or a polling-based code.

  • size – The size of txBuffer. Must be > 0 and not greater than 65536.

  • transferWidth – The width of transfer cy_en_smif_txfr_width_t.

  • dataDataRate – dataDataRate

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

A status of a transmission.

cy_en_smif_status_t Cy_SMIF_ReceiveData_Ext(SMIF_Type *base, uint8_t *rxBuffer, uint32_t size, cy_en_smif_txfr_width_t transferWidth, cy_en_smif_data_rate_t dataRate, cy_smif_event_cb_t RxCmpltCb, cy_stc_smif_context_t *context)

This function implements the receive data phase in the memory command.

The data is received into the RX Data FIFO using the RX_COUNT command. This function sets up the interrupt to trigger on the RX Data FIFO level, and the data is fetched from the RX Data FIFO to the rxBuffer as it gets filled. This function does not block until completion. The completion will trigger the call back function.

note

This function is to be preceded by Cy_SMIF_TransmitCommand. The slave select is de-asserted at the end of the receive. The function triggers the transfer and the transfer itself utilizes the interrupt for FIFO operations in the background. Thus, frequent interrupts will be executed after this function is triggered. This API is non-blocking and sets up the interrupt to act on the data FIFO, ensure there will be no another instance of the function called before the current instance has completed execution.

note

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. The transfer statuses returned by Cy_SMIF_GetTransferStatus are no longer valid.

note

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

note

This API is available for CAT1B devices.

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

  • rxBuffer – The pointer to the variable where the receive 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.

  • size – The size of data to be received. Must be > 0 and not greater than 65536.

  • transferWidth – The width of transfer cy_en_smif_txfr_width_t.

  • dataRate – dataRate

  • RxCmpltCb – The callback executed at the end of a reception. NULL interpreted as no callback.

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

A status of a reception.

cy_en_smif_status_t Cy_SMIF_ReceiveDataBlocking_Ext(SMIF_Type *base, uint8_t *rxBuffer, uint32_t size, cy_en_smif_txfr_width_t transferWidth, cy_en_smif_data_rate_t dataRate, cy_stc_smif_context_t const *context)

This function implements the receive data phase in the memory command.

The data is received into the RX Data FIFO using the RX_COUNT command. This function blocks until completion. The function does not use the interrupts and will use CPU to monitor the FIFO status and move data accordingly. The function returns only on completion.

note

This function is to be preceded by Cy_SMIF_TransmitCommand. The slave select is de-asserted at the end of the receive. Ensure there is no another transfers.

note

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. The transfer statuses returned by Cy_SMIF_GetTransferStatus are no longer valid.

note

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

note

This API is available for CAT1B devices.

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

  • rxBuffer – The pointer to the variable where the receive 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.

  • size – The size of data to be received. Must be > 0 and not greater than 65536.

  • transferWidth – The width of transfer cy_en_smif_txfr_width_t.

  • dataRate – dataRate

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

A status of a reception.

cy_en_smif_status_t Cy_SMIF_SendDummyCycles_Ext(SMIF_Type *base, cy_en_smif_txfr_width_t transferWidth, cy_en_smif_data_rate_t dataRate, uint32_t cycles)

This function sends dummy-clock cycles.

The data lines are tri-stated during the dummy cycles.

note

This function is to be preceded by Cy_SMIF_TransmitCommand.

note

This API is available for CAT1B devices.

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

  • transferWidth

  • dataRate

  • cycles – The number of dummy cycles. Must be > 0 and not greater than 65536.

Returns

A status of dummy cycles sending.

__STATIC_INLINE void Cy_SMIF_Disable (SMIF_Type *base)

Disables the operation of the SMIF block.

The SMIF block can be disabled only when it is not in the active state. Use the Cy_SMIF_BusyCheck() API to check it before calling this API.

Parameters

base – Holds the base address of the SMIF block registers.

__STATIC_INLINE void Cy_SMIF_SetInterruptMask (SMIF_Type *base, uint32_t interrupt)

This function is used to set an interrupt mask for the SMIF Interrupt.

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

  • interrupt – This is the mask for different source options that can be masked. See Interrupt Macros for possible values.

__STATIC_INLINE uint32_t Cy_SMIF_GetInterruptMask (SMIF_Type const *base)

This function is used to read an interrupt mask for the SMIF Interrupt.

Parameters

base – Holds the base address of the SMIF block registers.

Returns

Returns the mask set for the SMIF interrupt.

__STATIC_INLINE uint32_t Cy_SMIF_GetInterruptStatusMasked (SMIF_Type const *base)

This function is used to read an active masked interrupt.

This function can be used in the interrupt service-routine to find which source triggered the interrupt.

Parameters

base – Holds the base address of the SMIF block registers.

Returns

Returns a word with bits set at positions corresponding to the interrupts triggered in the system.

__STATIC_INLINE uint32_t Cy_SMIF_GetInterruptStatus (SMIF_Type const *base)

This function is used to read an active interrupt.

This status is the unmasked result, so will also show interrupts that will not generate active interrupts.

Parameters

base – Holds the base address of the SMIF block registers.

Returns

Returns a word with bits set at positions corresponding to the interrupts triggered in the system.

__STATIC_INLINE void Cy_SMIF_SetInterrupt (SMIF_Type *base, uint32_t interrupt)

This function is used to set an interrupt source.

This function can be used to activate interrupts through the software.

note

Interrupt sources set using this interrupt will generate interrupts only if they are not masked.

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

  • interrupt – An encoded integer with a bit set corresponding to the interrupt to be triggered. See Interrupt Macros for possible values.

__STATIC_INLINE void Cy_SMIF_ClearInterrupt (SMIF_Type *base, uint32_t interrupt)

This function is used to clear an interrupt source.

This function can be used in the user code to clear all pending interrupts.

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

  • interrupt – An encoded integer with a bit set corresponding to the interrupt that must be cleared. See Interrupt Macros for possible values.

__STATIC_INLINE void Cy_SMIF_SetTxFifoTriggerLevel (SMIF_Type *base, uint32_t level)

This function is used to set a trigger level for the TX FIFO.

This value must be an integer between 0 and 7. For the normal mode only. The triggering is active when TX_DATA_FIFO_STATUS <= level.

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

  • level – The trigger level to set (0-8).

__STATIC_INLINE void Cy_SMIF_SetRxFifoTriggerLevel (SMIF_Type *base, uint32_t level)

This function is used to set a trigger level for the RX FIFO.

This value must be an integer between 0 and 7. For the normal mode only. The triggering is active when RX_DATA_FIFOSTATUS > level.

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

  • level – The trigger level to set(0-8).

__STATIC_INLINE uint32_t Cy_SMIF_GetCmdFifoStatus (SMIF_Type const *base)

This function is used to read the status of the CMD FIFO.

Parameters

base – Holds the base address of the SMIF block registers.

Returns

Returns the number of the entries in the CMD FIFO.

__STATIC_INLINE uint32_t Cy_SMIF_GetTxFifoStatus (SMIF_Type const *base)

This function is used to read the status of the TX FIFO.

Parameters

base – Holds the base address of the SMIF block registers.

Returns

Returns the number of the entries in the TX FIFO.

__STATIC_INLINE uint32_t Cy_SMIF_GetRxFifoStatus (SMIF_Type const *base)

This function is used to read the status of the RX FIFO.

Parameters

base – Holds the base address of the SMIF block registers.

Returns

Returns the number of the entries in the RX FIFO.

cy_en_smif_status_t Cy_SMIF_Encrypt(SMIF_Type *base, uint32_t address, uint8_t data[], uint32_t size, cy_stc_smif_context_t const *context)

Uses the Encryption engine to create an encrypted result when the input, key and data arrays are provided.

The AES-128 encryption of the address with the key, fetching the result and XOR with the data array are all done in the function. The operational scheme is the following: data = XOR(AES128(address, key), data) Decryption is done using the input data-array identically to the encryption. In the XIP mode, encryption and decryption are done without calling this function. The operational scheme in the XIP mode is the same. The address parameter in the XIP mode equals the actual address in the PSoC memory map. The SMIF encryption engine is designed for code storage. For data storage, the encryption key can be changed. For sensitive data, the Crypto block is used.

note

The API does not have access to the encryption key. The key must be placed in the register before calling this API. The crypto routine that can access the key storage area is recommended. This crypto routine is typically a protection context 0 function.

note

This is a blocking API. The API waits for encryption completion. Will exit if a timeout is set (not equal to 0) and expired.

Function Usage

    /* Scenario:  Encrypt data in the txBuffer[] before writing data into the memory at the address=0x2000. */

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

    #define MEMTEST_AES_KEY_SIZE (16U)   /* The AES key length */
    #define PACKET_SIZE          (32U)   /* The memory Read/Write packet */

    /* Data to encrypt */
    uint8_t txBuffer[PACKET_SIZE] = {1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U,
                                     9U, 10U, 11U, 12U, 13U, 14U, 15U, 16U,
                                     17U, 18U, 19U, 20U, 21U, 22U, 23U, 24U,
                                     25U, 26U, 27U, 28U, 29U, 30U, 31U, 32U};
    uint32_t address = 0x2000UL;  /* The address to write data to  */

    /* The AES key.
    * Writing of the AES key should be from secure area of the code   
    */
    uint8_t key[MEMTEST_AES_KEY_SIZE] = {0x54U, 0x68U, 0x61U, 0x74U, 0x73U, 0x20U, 0x6DU, 0x79U,
                                         0x20U, 0x4BU, 0x75U, 0x6EU, 0x67U, 0x20U, 0x46U, 0x75U};

    /* Fill the key field in secure area of the code. */
    SMIF->CRYPTO_KEY0 = Cy_SMIF_PackBytesArray(&key[CY_SMIF_CRYPTO_FIRST_WORD], true);
    SMIF->CRYPTO_KEY1 = Cy_SMIF_PackBytesArray(&key[CY_SMIF_CRYPTO_SECOND_WORD], true);
    SMIF->CRYPTO_KEY2 = Cy_SMIF_PackBytesArray(&key[CY_SMIF_CRYPTO_THIRD_WORD], true);
    SMIF->CRYPTO_KEY3 = Cy_SMIF_PackBytesArray(&key[CY_SMIF_CRYPTO_FOURTH_WORD], true);

    /* Encrypt data in txBuffer */
    if (CY_SMIF_SUCCESS != Cy_SMIF_Encrypt(SMIF, address, txBuffer, sizeof(txBuffer), &SMIF_context))
    {
        /* Insert error handling */
    }
    
    /* The second call of Cy_SMIF_Encrypt() decrypts data in txBuffer */
    if (CY_SMIF_SUCCESS != Cy_SMIF_Encrypt(SMIF, address, txBuffer, sizeof(txBuffer), &SMIF_context))
    {
        /* Insert error handling */
    }
    

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

  • address – The address that gets encrypted is a masked 16-byte block address. The 32-bit address with the last 4 bits masked is placed as the last 4 bytes in the 128-bit input. The rest of the higher bit for the 128 bits are padded zeros. PA[127:0]: PA[3:0] = 0 PA[7:4] = ADDR[7:4]. PA[15:8] = ADDR[15:8]. PA[23:16] = ADDR[23:16]. PA[31:24] = ADDR[31:24]. The other twelve of the sixteen plain text address bytes of PA[127:0] are “0”: PA[127:32] = “0”.

  • data – This is the location where the input data-array is passed while the function is called. This array gets populated with the result after encryption is completed.

  • size – Provides a size of the array.

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

Returns

A status of the command transmit.

__STATIC_INLINE bool Cy_SMIF_BusyCheck (SMIF_Type const *base)

This function provides the status of the IP block (False - not busy, True - busy).

Parameters

base – Holds the base address of the SMIF block registers.

Returns

Returns an IP block status.

__STATIC_INLINE void Cy_SMIF_Interrupt (SMIF_Type *base, cy_stc_smif_context_t *context)

The Interrupt Service Routine for the SMIF.

The interrupt code will be responsible for the FIFO operations on FIFO interrupts during ongoing transfers. The user must place a call to this interrupt function in the interrupt routine corresponding to the interrupt attached to the SMIF. If the user does not do this, will break: the functionality of all the API functions in the SMIF driver that use SMIF interrupts to affect transfers.

All the Global variables described above are used when the Software Buffer is used.

Global Variables

  • context->txBufferAddress - The pointer to the data to be transferred.

  • context->txBufferSize - The size of txBuffer.

  • context->txBufferCounter - The number of data entries left to be transferred.

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

  • context – Passes a configuration structure that contains the transfer parameters of the SMIF block.

cy_en_smif_status_t Cy_SMIF_CacheEnable(SMIF_Type *base, cy_en_smif_cache_t cacheType)

This function is used to enable the fast cache, the slow cache or both.

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

  • cacheType – Holds the type of the cache to be modified. cy_en_smif_cache_t

Returns

A status of function completion.

cy_en_smif_status_t Cy_SMIF_CacheDisable(SMIF_Type *base, cy_en_smif_cache_t cacheType)

This function is used to disable the fast cache, the slow cache or both.

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

  • cacheType – Holds the type of the cache to be modified. cy_en_smif_cache_t

Returns

A status of function completion.

cy_en_smif_status_t Cy_SMIF_CachePrefetchingEnable(SMIF_Type *base, cy_en_smif_cache_t cacheType)

This function is used to enable pre-fetching for the fast cache, the slow cache or both.

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

  • cacheType – Holds the type of the cache to be modified. cy_en_smif_cache_t

Returns

A status of function completion.

cy_en_smif_status_t Cy_SMIF_CachePrefetchingDisable(SMIF_Type *base, cy_en_smif_cache_t cacheType)

This function is used to disable pre-fetching for the fast cache, the slow cache or both.

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

  • cacheType – Holds the type of the cache to be modified. cy_en_smif_cache_t

Returns

A status of function completion.

cy_en_smif_status_t Cy_SMIF_CacheInvalidate(SMIF_Type *base, cy_en_smif_cache_t cacheType)

This function is used to invalidate/clear the fast cache, the slow cache or both.

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

  • cacheType – Holds the type of the cache to be modified. cy_en_smif_cache_t

Returns

A status of function completion.

cy_en_syspm_status_t Cy_SMIF_DeepSleepCallback(cy_stc_syspm_callback_params_t *callbackParams, cy_en_syspm_callback_mode_t mode)

This function handles the transition of the SMIF into and out of Deep Sleep mode.

It prevents the device from entering DeepSleep if SMIF is actively communicating, or there is any data in the TX or RX FIFOs, or SMIF is in memory mode.

This function should be called while execution of Cy_SysPm_CpuEnterDeepSleep therefore must be registered as a callback before the call. To register it call Cy_SysPm_RegisterCallback and specify CY_SYSPM_DEEPSLEEP as the callback type.

note

This API is template and user should add code for external memory enter/exit low power mode.

Example setup of SysPM deep sleep and hibernate mode
    /* Initialize callback parameters with SMIF register base address and 
     * context structure */
    cy_stc_syspm_callback_params_t smifSysPm = 
    {
        /* .base */ SMIF0,
        /* .context */ &smifContext
    };

    /* Register SMIF SysPm callback for deep sleep mode*/
    cy_stc_syspm_callback_t smifDeepSleepCb = 
    {
        /* .callback       */ &Cy_SMIF_DeepSleepCallback,
        /* .type           */ CY_SYSPM_DEEPSLEEP,
        /* .skipMode       */ 0U,
        /* .callbackParams */ &smifSysPm,
        /* .prevItm        */ NULL,
        /* .nextItm        */ NULL,
        /* .order          */ 0
    };
    Cy_SysPm_RegisterCallback(&smifDeepSleepCb);
    
    /* Register SMIF SysPm callback for hibernate mode*/
    cy_stc_syspm_callback_t smifHibernateCb= 
    {
        /* .callback       */ &Cy_SMIF_HibernateCallback,
        /* .type           */ CY_SYSPM_HIBERNATE,
        /* .skipMode       */ 0U,
        /* .callbackParams */ &smifSysPm,
        /* .prevItm        */ NULL,
        /* .nextItm        */ NULL,
        /* .order          */ 0
    };   
    Cy_SysPm_RegisterCallback(&smifHibernateCb);
    

Parameters
Returns

cy_en_syspm_status_t

cy_en_syspm_status_t Cy_SMIF_HibernateCallback(cy_stc_syspm_callback_params_t *callbackParams, cy_en_syspm_callback_mode_t mode)

This function handles the transition of the SMIF into Hibernate mode.

It prevents the device from entering Hibernate if the SMIF is actively communicating, or there is any data in the TX or RX FIFO, or SMIF is in memory mode.

This function should be called during execution of Cy_SysPm_SystemEnterHibernate therefore it must be registered as a callback before the call. To register it call Cy_SysPm_RegisterCallback and specify CY_SYSPM_HIBERNATE as the callback type.

note

This API is template and user should add code for external memory enter/exit low power mode.

Example setup of SysPM deep sleep and hibernate mode
    /* Initialize callback parameters with SMIF register base address and 
     * context structure */
    cy_stc_syspm_callback_params_t smifSysPm = 
    {
        /* .base */ SMIF0,
        /* .context */ &smifContext
    };

    /* Register SMIF SysPm callback for deep sleep mode*/
    cy_stc_syspm_callback_t smifDeepSleepCb = 
    {
        /* .callback       */ &Cy_SMIF_DeepSleepCallback,
        /* .type           */ CY_SYSPM_DEEPSLEEP,
        /* .skipMode       */ 0U,
        /* .callbackParams */ &smifSysPm,
        /* .prevItm        */ NULL,
        /* .nextItm        */ NULL,
        /* .order          */ 0
    };
    Cy_SysPm_RegisterCallback(&smifDeepSleepCb);
    
    /* Register SMIF SysPm callback for hibernate mode*/
    cy_stc_syspm_callback_t smifHibernateCb= 
    {
        /* .callback       */ &Cy_SMIF_HibernateCallback,
        /* .type           */ CY_SYSPM_HIBERNATE,
        /* .skipMode       */ 0U,
        /* .callbackParams */ &smifSysPm,
        /* .prevItm        */ NULL,
        /* .nextItm        */ NULL,
        /* .order          */ 0
    };   
    Cy_SysPm_RegisterCallback(&smifHibernateCb);
    

Parameters
Returns

cy_en_syspm_status_t

struct cy_stc_smif_config_t
#include <>

The SMIF configuration structure.

Public Members

uint32_t mode

Specifies the mode of operation cy_en_smif_mode_t.

uint32_t deselectDelay

Specifies the minimum duration of SPI de-selection between SPI transfers:

  • “0”: 1 clock cycle.

  • ”1”: 2 clock cycles.

  • ”2”: 3 clock cycles.

  • ”3”: 4 clock cycles.

  • ”4”: 5 clock cycles.

  • ”5”: 6 clock cycles.

  • ”6”: 7 clock cycles.

  • ”7”: 8 clock cycles.

uint32_t rxClockSel

Specifies the clock source for the receiver clock cy_en_smif_clk_select_t.

uint32_t blockEvent

Specifies what happens when there is a Read from an empty RX FIFO or a Write to a full TX FIFO.

cy_en_smif_error_event_t.

struct cy_stc_smif_context_t
#include <>

The SMIF internal context data.

The user must not modify it.

Public Members

uint8_t volatile const *volatile txBufferAddress

The pointer to the data to transfer.

uint32_t txBufferSize

The size of the data to transmit in bytes.

uint32_t volatile txBufferCounter

The transfer counter.

The number of the transmitted bytes = txBufferSize - txBufferCounter

uint8_t volatile *volatile rxBufferAddress

The pointer to the variable where the received data is stored.

uint32_t rxBufferSize

The size of the data to be received in bytes.

uint32_t volatile rxBufferCounter

The transfer counter.

The number of the received bytes = rxBufferSize - rxBufferCounter

uint32_t volatile transferStatus

The status of the transfer.

The transmitting / receiving is completed / in progress

cy_smif_event_cb_t volatile txCompleteCb

The user-defined callback executed at the completion of a transmission.

cy_smif_event_cb_t volatile rxCompleteCb

The user-defined callback executed at the completion of a reception.

uint32_t timeout

The timeout in microseconds for the blocking functions.

This timeout value applies to all blocking APIs.

cy_en_smif_data_rate_t preCmdDataRate

preferred command data rate

note

This parameter is available for CAT1B devices.

cy_en_smif_txfr_width_t preCmdWidth

preferred command data rate

note

This parameter is available for CAT1B devices.

cy_en_smif_data_rate_t preXIPDataRate

preferred XIP data rate

note

This parameter is available for CAT1B devices.