iLLD_TC27xD  1.0
IfxQspi.h File Reference

QSPI basic functionality. More...

#include "_Impl/IfxQspi_cfg.h"
#include "Cpu/Std/IfxCpu_Intrinsics.h"
#include "If/SpiIf.h"
#include "Scu/Std/IfxScuCcu.h"
#include "Src/Std/IfxSrc.h"
#include "_PinMap/IfxQspi_PinMap.h"
#include "IfxQspi_reg.h"

Go to the source code of this file.

Enumerations

enum  IfxQspi_ChannelId {
  IfxQspi_ChannelId_0,
  IfxQspi_ChannelId_1,
  IfxQspi_ChannelId_2,
  IfxQspi_ChannelId_3,
  IfxQspi_ChannelId_4,
  IfxQspi_ChannelId_5,
  IfxQspi_ChannelId_6,
  IfxQspi_ChannelId_7,
  IfxQspi_ChannelId_8,
  IfxQspi_ChannelId_9,
  IfxQspi_ChannelId_10,
  IfxQspi_ChannelId_11,
  IfxQspi_ChannelId_12,
  IfxQspi_ChannelId_13,
  IfxQspi_ChannelId_14
}
 QSPI channel Number (BACON.CS) More...
 
enum  IfxQspi_DataLengthUnit {
  IfxQspi_DataLengthUnit_bit = 0,
  IfxQspi_DataLengthUnit_byte = 1
}
 Data length unit of a frame (BACON.BYTE) More...
 
enum  IfxQspi_Error {
  IfxQspi_Error_none = 0,
  IfxQspi_Error_parity = 1,
  IfxQspi_Error_configuration = 2,
  IfxQspi_Error_baudrate = 4,
  IfxQspi_Error_txfifoOverflow = 8,
  IfxQspi_Error_txfifoUnderflow = 16,
  IfxQspi_Error_rxfifoOverflow = 32,
  IfxQspi_Error_rxfifoUnderflow = 64,
  IfxQspi_Error_expectTimeout = 128,
  IfxQspi_Error_slsiMisplacedInactivation = 256
}
 QSPI Error Flags (STATUS.ERRORFLAGS) More...
 
enum  IfxQspi_ExpectTimeout {
  IfxQspi_ExpectTimeout_64 = 0,
  IfxQspi_ExpectTimeout_128 = 1,
  IfxQspi_ExpectTimeout_256 = 2,
  IfxQspi_ExpectTimeout_512 = 3,
  IfxQspi_ExpectTimeout_1024 = 4,
  IfxQspi_ExpectTimeout_2048 = 5,
  IfxQspi_ExpectTimeout_4096 = 6,
  IfxQspi_ExpectTimeout_8192 = 7,
  IfxQspi_ExpectTimeout_16384 = 8,
  IfxQspi_ExpectTimeout_32768 = 9,
  IfxQspi_ExpectTimeout_65536 = 10,
  IfxQspi_ExpectTimeout_131072 = 11,
  IfxQspi_ExpectTimeout_262144 = 12,
  IfxQspi_ExpectTimeout_524288 = 13,
  IfxQspi_ExpectTimeout_1048576 = 14,
  IfxQspi_ExpectTimeout_2097152 = 15
}
 Frame Expect phase time out value. More...
 
enum  IfxQspi_Mode {
  IfxQspi_Mode_master = 0,
  IfxQspi_Mode_pwmOverQspi = 1,
  IfxQspi_Mode_slave = 2
}
 QSPI controller mode (GLOBALCON.MODE) More...
 
enum  IfxQspi_PauseRunTransition {
  IfxQspi_PauseRunTransition_pause = 0,
  IfxQspi_PauseRunTransition_run = 1
}
 Request between pause and Run transition. More...
 
enum  IfxQspi_Phase {
  IfxQspi_Phase_wait = 0,
  IfxQspi_Phase_idleA = 1,
  IfxQspi_Phase_idleB = 2,
  IfxQspi_Phase_lead = 3,
  IfxQspi_Phase_data = 4,
  IfxQspi_Phase_trail = 5,
  IfxQspi_Phase_expect = 6,
  IfxQspi_Phase_leadStrobe = 7,
  IfxQspi_Phase_trailStrobe = 8
}
 QSPI frame phase (STATUS.PHASE) More...
 
enum  IfxQspi_PhaseTransitionEvent {
  IfxQspi_PhaseTransitionEvent_endOfWait = 0,
  IfxQspi_PhaseTransitionEvent_serialClockPolarityChange = 1,
  IfxQspi_PhaseTransitionEvent_startOfFrame = 2,
  IfxQspi_PhaseTransitionEvent_transmitBufferEmptied = 3,
  IfxQspi_PhaseTransitionEvent_receiveBufferFilled = 4,
  IfxQspi_PhaseTransitionEvent_endOfFrame = 5,
  IfxQspi_PhaseTransitionEvent_dataNotAvailable = 6,
  IfxQspi_PhaseTransitionEvent_endOfExpect = 7
}
 Phase Transition Event. More...
 
enum  IfxQspi_Reset {
  IfxQspi_Reset_none = 0,
  IfxQspi_Reset_stateMachineAndFifo = 1,
  IfxQspi_Reset_registers = 2,
  IfxQspi_Reset_kernel = 3
}
 Reset Request (GLOBALCON.RESETS) More...
 
enum  IfxQspi_RxFifoInt {
  IfxQspi_RxFifoInt_0,
  IfxQspi_RxFifoInt_1,
  IfxQspi_RxFifoInt_2,
  IfxQspi_RxFifoInt_3
}
 Receive Fifo Interrupt Threshold. More...
 
enum  IfxQspi_SleepMode {
  IfxQspi_SleepMode_enable = 0,
  IfxQspi_SleepMode_disable = 1
}
 Enable/disable the sensitivity of the module to sleep signal
Definition in Ifx_QSPI.CLC.B.EDIS. More...
 
enum  IfxQspi_StrobeDelay {
  IfxQspi_StrobeDelay_1,
  IfxQspi_StrobeDelay_2,
  IfxQspi_StrobeDelay_3,
  IfxQspi_StrobeDelay_4,
  IfxQspi_StrobeDelay_5,
  IfxQspi_StrobeDelay_6,
  IfxQspi_StrobeDelay_7,
  IfxQspi_StrobeDelay_8,
  IfxQspi_StrobeDelay_9,
  IfxQspi_StrobeDelay_10,
  IfxQspi_StrobeDelay_11,
  IfxQspi_StrobeDelay_12,
  IfxQspi_StrobeDelay_13,
  IfxQspi_StrobeDelay_14,
  IfxQspi_StrobeDelay_15,
  IfxQspi_StrobeDelay_16,
  IfxQspi_StrobeDelay_17,
  IfxQspi_StrobeDelay_18,
  IfxQspi_StrobeDelay_19,
  IfxQspi_StrobeDelay_20,
  IfxQspi_StrobeDelay_21,
  IfxQspi_StrobeDelay_22,
  IfxQspi_StrobeDelay_23,
  IfxQspi_StrobeDelay_24,
  IfxQspi_StrobeDelay_25,
  IfxQspi_StrobeDelay_26,
  IfxQspi_StrobeDelay_27,
  IfxQspi_StrobeDelay_28,
  IfxQspi_StrobeDelay_29,
  IfxQspi_StrobeDelay_30,
  IfxQspi_StrobeDelay_31,
  IfxQspi_StrobeDelay_32
}
 STROBE delay for SLSO in delayed mode (GLOBALCON.STROBE) More...
 
enum  IfxQspi_Suspend {
  IfxQspi_Suspend_none = 0,
  IfxQspi_Suspend_hard = 1,
  IfxQspi_Suspend_soft = 2
}
 OCDS Suspend Control (OCDS.SUS) More...
 
enum  IfxQspi_TxFifoInt {
  IfxQspi_TxFifoInt_1,
  IfxQspi_TxFifoInt_2,
  IfxQspi_TxFifoInt_3,
  IfxQspi_TxFifoInt_4
}
 Transmit Fifo Interrupt Threshold. More...
 

Functions

IFX_INLINE void IfxQspi_clearAllEventFlags (Ifx_QSPI *qspi)
 Clear ALL service requests. More...
 
IFX_INLINE void IfxQspi_clearRxReq (Ifx_QSPI *qspi)
 Clear RX service requests. More...
 
IFX_INLINE void IfxQspi_clearTxReq (Ifx_QSPI *qspi)
 Clear TX service requests. More...
 
IFX_INLINE void IfxQspi_configPT1Event (Ifx_QSPI *qspi, IfxQspi_PhaseTransitionEvent pt1Config)
 Configure PT1 event (also USR event depending if USREN=1 ) More...
 
IFX_INLINE void IfxQspi_configPT2Event (Ifx_QSPI *qspi, IfxQspi_PhaseTransitionEvent pt2Config)
 Configure PT2 event. More...
 
IFX_INLINE void IfxQspi_enableLoopbackMode (Ifx_QSPI *qspi, boolean enable)
 Enable/Disable Loopback mode. More...
 
IFX_INLINE void IfxQspi_enableModuleSuspend (Ifx_QSPI *qspi, IfxQspi_Suspend suspend)
 enable Hard/Soft Module suspend Note: The api works only when the OCDS is enabled and in Supervisor Mode. When OCDS is disabled the OCS suspend control is ineffective. More...
 
IFX_INLINE void IfxQspi_enablePT1Event (Ifx_QSPI *qspi, boolean enable)
 enable Phase Transition1 Event More...
 
IFX_INLINE void IfxQspi_enablePT2Event (Ifx_QSPI *qspi, boolean enable)
 enable Phase Transition2 Event More...
 
IFX_INLINE void IfxQspi_enableUsrEvent (Ifx_QSPI *qspi, boolean enable)
 enable User Event (Event selected by PT1) More...
 
IFX_INLINE uint16 IfxQspi_getErrorFlags (Ifx_QSPI *qspi)
 
IFX_INLINE void IfxQspi_pause (Ifx_QSPI *qspi)
 Request for Module in Pause state no interrupts no communication. More...
 
IFX_INLINE uint32 IfxQspi_readReceiveFifo (Ifx_QSPI *qspi)
 Read the oldest data from RXFIFO. More...
 
IFX_INLINE void IfxQspi_requestReset (Ifx_QSPI *qspi, IfxQspi_Reset reset)
 Request reset (State Machine & FIFO / Register / Module) More...
 
IFX_INLINE void IfxQspi_run (Ifx_QSPI *qspi)
 Request for QSPI in Run state. More...
 
IFX_INLINE void IfxQspi_setReceiveFifoInterrruptThreshold (Ifx_QSPI *qspi, IfxQspi_RxFifoInt rxFifoInt)
 Set the threshold of RXFIFO for service request generation. More...
 
IFX_INLINE void IfxQspi_writeTransmitFifo (Ifx_QSPI *qspi, uint32 data)
 Write Data into DATAENTRY register. More...
 
IFX_EXTERN void IfxQspi_read16 (Ifx_QSPI *qspi, uint16 *data, Ifx_SizeT count)
 Reads 16bit data from the Rx FIFO. More...
 
IFX_EXTERN void IfxQspi_read32 (Ifx_QSPI *qspi, uint32 *data, Ifx_SizeT count)
 Reads 32bit data from the Rx FIFO. More...
 
IFX_EXTERN void IfxQspi_read8 (Ifx_QSPI *qspi, uint8 *data, Ifx_SizeT count)
 Reads 8bit data from the Rx FIFO. More...
 
IFX_EXTERN void IfxQspi_resetModule (Ifx_QSPI *qspi)
 resets QSPI kernel More...
 
IFX_EXTERN void IfxQspi_write16 (Ifx_QSPI *qspi, IfxQspi_ChannelId channelId, uint16 *data, Ifx_SizeT count)
 Writes 16bit data into the Tx FIFO. More...
 
IFX_EXTERN void IfxQspi_write32 (Ifx_QSPI *qspi, IfxQspi_ChannelId channelId, uint32 *data, Ifx_SizeT count)
 Writes 32bit data into the Tx FIFO. More...
 
IFX_EXTERN void IfxQspi_write8 (Ifx_QSPI *qspi, IfxQspi_ChannelId channelId, uint8 *data, Ifx_SizeT count)
 Writes 8bit data into the Tx FIFO. More...
 
IFX_INLINE void IfxQspi_flushReceiveFifo (Ifx_QSPI *qspi)
 flush the receive FIFO More...
 
IFX_INLINE void IfxQspi_flushTransmitFifo (Ifx_QSPI *qspi)
 flush the transmit FIFO More...
 
IFX_INLINE IfxQspi_Mode IfxQspi_getMode (Ifx_QSPI *qspi)
 Gets the current mode of QSPI. More...
 
IFX_INLINE float IfxQspi_getModuleFrequency (Ifx_QSPI *qspi)
 Specifies function to get module frequency. More...
 
IFX_INLINE IfxQspi_Phase IfxQspi_getPhase (Ifx_QSPI *qspi)
 Gets actual transmission phase. More...
 
IFX_INLINE uint8 IfxQspi_getReceiveFifoLevel (Ifx_QSPI *qspi)
 Gets the filling level of RXFIFO. More...
 
IFX_INLINE float IfxQspi_getTimeQuantaFrequency (Ifx_QSPI *qspi)
 Gets Time Quanta frequency. More...
 
IFX_INLINE uint8 IfxQspi_getTransmitFifoLevel (Ifx_QSPI *qspi)
 Gets the filling level of TXFIFO. More...
 
IFX_INLINE boolean IfxQspi_isModuleEnabled (Ifx_QSPI *qspi)
 Specifies the Module enable or disable status. More...
 
IFX_INLINE void IfxQspi_setDisableModuleRequest (Ifx_QSPI *qspi)
 Sets the disable module request. More...
 
IFX_INLINE void IfxQspi_setEnableModuleRequest (Ifx_QSPI *qspi)
 Sets the enable module request. More...
 
IFX_INLINE void IfxQspi_setSleepMode (Ifx_QSPI *qspi, IfxQspi_SleepMode mode)
 Sets the disable module request. More...
 
IFX_INLINE void IfxQspi_setTransmitFifoInterrruptThreshold (Ifx_QSPI *qspi, IfxQspi_TxFifoInt txFifoInt)
 Set the threshold of TXFIFO for service request generation. More...
 
IFX_INLINE void IfxQspi_writeBasicConfiguration (Ifx_QSPI *qspi, uint32 baconVal)
 Write configuration into BACON register. More...
 
IFX_INLINE void IfxQspi_writeBasicConfigurationBeginStream (Ifx_QSPI *qspi, uint32 baconVal)
 Write configuration into BACON register with .LAST flag set to 0. More...
 
IFX_INLINE void IfxQspi_writeBasicConfigurationEndStream (Ifx_QSPI *qspi, uint32 baconVal)
 Write configuration into BACON register with .LAST flag set to 1. More...
 
IFX_INLINE void IfxQspi_writeExtendedConfiguration (Ifx_QSPI *qspi, IfxQspi_ChannelId channelId, uint32 econVal)
 Writes channel timing configuration into ECON register. More...
 
IFX_INLINE void IfxQspi_writeMixedDataTransmitFifo (Ifx_QSPI *qspi, uint32 mixEntryVal)
 Writes Data and Configuration into MIXEDENTRY register. More...
 
IFX_EXTERN float IfxQspi_calcRealBaudrate (Ifx_QSPI *qspi, IfxQspi_ChannelId channelId)
 Function to calculate baudrate of specified channel. More...
 
IFX_EXTERN uint32 IfxQspi_calculateBasicConfigurationValue (Ifx_QSPI *qspi, const IfxQspi_ChannelId channelId, const SpiIf_ChMode *chMode, const float baudrate)
 Function to calculate BACON register values. More...
 
IFX_EXTERN uint32 IfxQspi_calculateExtendedConfigurationValue (Ifx_QSPI *qspi, const uint8 cs, const SpiIf_ChConfig *chConfig)
 Function to calculate ECON register values. More...
 
IFX_EXTERN uint32 IfxQspi_calculatePrescaler (Ifx_QSPI *qspi, float baudrate)
 Function to calculate prescaler. More...
 
IFX_EXTERN uint32 IfxQspi_calculateTimeQuantumLength (Ifx_QSPI *qspi, float maxBaudrate)
 Specifies the function to calculate Time quantum length. More...
 
IFX_EXTERN uint32 IfxQspi_recalcBasicConfiguration (uint32 oldBACON, Ifx_SizeT numOfData, boolean shortData, boolean lastData)
 Re-calculated BACON from the oldBACON. More...
 
IFX_EXTERN void IfxQspi_setSlaveSelectOutputControl (Ifx_QSPI *qspi, IfxQspi_ChannelId channelId, boolean outputEnable, boolean activeLevel)
 Configures a Slave Select Output. More...
 
IFX_INLINE volatile Ifx_SRC_SRCR * IfxQspi_getErrorSrc (Ifx_QSPI *qspi)
 Gets the Error request value. More...
 
IFX_INLINE uint32 IfxQspi_getIndex (Ifx_QSPI *qspi)
 Specifies the function to get Index. More...
 
IFX_INLINE volatile Ifx_SRC_SRCR * IfxQspi_getReceiveSrc (Ifx_QSPI *qspi)
 Gets the RXFIFO service request. More...
 
IFX_INLINE volatile Ifx_SRC_SRCR * IfxQspi_getTransmitSrc (Ifx_QSPI *qspi)
 Gets the TXFIFO service request. More...
 
IFX_INLINE void IfxQspi_initMrstInPin (const IfxQspi_Mrst_In *mrstIn, IfxPort_InputMode mrstInMode)
 Initializes a MRST input. More...
 
IFX_INLINE void IfxQspi_initMrstOutPin (const IfxQspi_Mrst_Out *mrstOut, IfxPort_OutputMode mrstOutMode, IfxPort_PadDriver padDriver)
 Initializes a MRST output. More...
 
IFX_INLINE void IfxQspi_initMtsrInPin (const IfxQspi_Mtsr_In *mtsrIn, IfxPort_InputMode mtsrInMode)
 Initializes a MTSR input. More...
 
IFX_INLINE void IfxQspi_initMtsrOutPin (const IfxQspi_Mtsr_Out *mtsrOut, IfxPort_OutputMode mtsrOutMode, IfxPort_PadDriver padDriver)
 Initializes a MTSR output. More...
 
IFX_INLINE void IfxQspi_initSclkInPin (const IfxQspi_Sclk_In *sclkIn, IfxPort_InputMode sclkInMode)
 Initializes a SCLK input. More...
 
IFX_INLINE void IfxQspi_initSclkOutPin (const IfxQspi_Sclk_Out *sclkOut, IfxPort_OutputMode sclkOutMode, IfxPort_PadDriver padDriver)
 Initializes a SCLK output. More...
 
IFX_INLINE void IfxQspi_initSlsi (const IfxQspi_Slsi_In *slsi, IfxPort_InputMode slsiMode)
 Initializes a SLSI input. More...
 
IFX_INLINE void IfxQspi_initSlso (const IfxQspi_Slso_Out *slso, IfxPort_OutputMode slsoMode, IfxPort_PadDriver padDriver, IfxPort_OutputIdx outIndex)
 Initializes a SLSO output. More...
 

Detailed Description

QSPI basic functionality.

Version
iLLD_1_0_0_11_0
                            IMPORTANT NOTICE

Infineon Technologies AG (Infineon) is supplying this file for use exclusively with Infineon's microcontroller products. This file can be freely distributed within development tools that are supporting such microcontroller products.

THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.

Definition in file IfxQspi.h.