MTB CAT5 Peripheral driver library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

General Description

The SMIF interface can be used to transmit different types of commands.

Each command has different phases: command, dummy cycles, and transmit and receive data which require separate APIs.

During the time that Slave Select line is active (LOW) the clock signal (CLK) is toggled while command information is first transferred on the data (IO) signals from the master to the slave. The clock continues to toggle during any period required for information access in the slave. The clock continues to toggle during the transfer of read data from the slave to the master or write data from the master to the slave. When the master has transferred the desired amount of data, the master drives the Slave Select line inactive (HIGH). Basic flow for read/write commands using Cy_SMIF_TransmitCommand, Cy_SMIF_TransmitData, Cy_SMIF_ReceiveData and Cy_SMIF_SendDummyCycles with a Quad SPI interface.

smif_1_0_p03_rw_cmd.png

The sequence of the PDL functions required in a read or write transaction is: Cy_SMIF_TransmitCommand() -> Cy_SMIF_SendDummyCycles() -> Cy_SMIF_ReceiveData() / Cy_SMIF_TransmitData() -> Cy_SMIF_BusyCheck(). The address is sent as part of the Cy_SMIF_TransmitCommand() function. No separate function call is required.

API Reference

 Low Power Callback
 The driver supports SysPm callback for Deep Sleep and Hibernate transition.
 

Functions

cy_en_smif_status_t Cy_SMIF_CacheInvalidate (SMIF_Type *base, cy_en_smif_cache_t cacheType)
 
void Cy_SMIF_Enable (SMIF_Type *base, cy_stc_smif_context_t *context)
 
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)
 
SMIF_DEVICE_Type volatile * Cy_SMIF_GetDeviceBySlot (SMIF_Type *base, cy_en_smif_slave_select_t slaveSelect)
 
cy_en_smif_mode_t Cy_SMIF_GetMode (SMIF_Type const *base)
 
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)
 
cy_en_smif_status_t Cy_SMIF_SetCryptoEnable (SMIF_Type *base, cy_en_smif_slave_select_t slaveId)
 
void Cy_SMIF_SetCryptoKey (SMIF_Type *base, uint32_t *key)
 
void Cy_SMIF_SetDataSelect (SMIF_Type *base, cy_en_smif_slave_select_t slaveSelect, cy_en_smif_data_select_t dataSelect)
 
void Cy_SMIF_SetMode (SMIF_Type *base, cy_en_smif_mode_t mode)
 
BOOL8 Cy_SMIF_BusyCheck (SMIF_Type const *base)
 
uint32_t Cy_SMIF_GetCmdFifoStatus (SMIF_Type const *base)
 
void Cy_SMIF_PushTxFifo (SMIF_Type *baseaddr, cy_stc_smif_context_t *context)
 Writes transmitted data into the FIFO. More...
 
void Cy_SMIF_PopRxFifo (SMIF_Type *baseaddr, cy_stc_smif_context_t *context)
 Reads received data from the FIFO. More...
 
cy_en_smif_status_t Cy_SMIF_SendDummyCycles (SMIF_Type *base, uint32_t cycles)
 
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)
 
void Cy_SMIF_DeInit (SMIF_Type *base)
 
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)
 
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)
 
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)
 
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)
 
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)
 
uint32_t Cy_SMIF_GetTransferStatus (SMIF_Type const *base, cy_stc_smif_context_t const *context)
 
cy_en_smif_status_t Cy_SMIF_TransmitCommand_Ext (SMIF_Type *base, uint16_t cmd, BOOL8 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 completeTxfr, cy_stc_smif_context_t const *context)
 
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)
 
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 dataDataRate, cy_stc_smif_context_t const *context)
 
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)
 
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)
 
void Cy_SMIF_Interrupt (SMIF_Type *base, cy_stc_smif_context_t *context)
 
cy_en_smif_status_t Cy_SMIF_CacheEnable (SMIF_Type *base, cy_en_smif_cache_t cacheType)
 
cy_en_smif_status_t Cy_SMIF_CacheDisable (SMIF_Type *base, cy_en_smif_cache_t cacheType)
 
cy_en_smif_status_t Cy_SMIF_CachePrefetchingEnable (SMIF_Type *base, cy_en_smif_cache_t cacheType)
 
cy_en_smif_status_t Cy_SMIF_CachePrefetchingDisable (SMIF_Type *base, cy_en_smif_cache_t cacheType)
 
void Cy_SMIF_SetCryptoIV (SMIF_Type *base, uint32_t *nonce)
 
cy_en_smif_status_t Cy_SMIF_ConvertSlaveSlotToIndex (cy_en_smif_slave_select_t ss, uint32_t *device_idx)
 
void Cy_SMIF_SetRxCaptureMode (SMIF_Type *base, cy_en_smif_capture_mode_t mode)
 
cy_en_smif_status_t Cy_SMIF_Bridge_Enable (SMIF_Base_Type *base, BOOL8 enable)
 
cy_en_smif_status_t Cy_SMIF_Bridge_SetPortPriority (SMIF_Base_Type *base, cy_stc_smif_bridge_pri_t *bridge_priority)
 
cy_en_smif_status_t Cy_SMIF_Bridge_SetSimpleRemapRegion (SMIF_Base_Type *base, const cy_stc_smif_bridge_remap_t *region_info)
 
cy_en_smif_status_t Cy_SMIF_Bridge_SetInterleavingRemapRegion (SMIF_Base_Type *base, const cy_stc_smif_bridge_interleave_remap_t *region_info)
 
cy_en_smif_status_t Cy_SMIF_Bridge_DeactivateRemapRegion (SMIF_Base_Type *base, uint32_t regionIdx)
 

Function Documentation

void Cy_SMIF_PushTxFifo ( SMIF_Type baseaddr,
cy_stc_smif_context_t context 
)

Writes transmitted data into the FIFO.

void Cy_SMIF_PopRxFifo ( SMIF_Type baseaddr,
cy_stc_smif_context_t context 
)

Reads received data from the FIFO.