MG32F157 Standard Peripherals Firmware Library
Macros | Functions
mg32f157_qspi.c File Reference

This file provides all the QSPI firmware functions. More...

#include "mg32f157_qspi.h"
#include "mg32f157_rcc.h"

Macros

#define QSPI_CR_CLEAR_MASK   0x00FFFFCF
 
#define QSPI_DCR_CLEAR_MASK   0xFFE0F7FE
 
#define QSPI_CCR_CLEAR_MASK   0x90800000
 
#define QSPI_PIR_CLEAR_MASK   0xFFFF0000
 
#define QSPI_LPTR_CLEAR_MASK   0xFFFF0000
 
#define QSPI_CCR_CLEAR_INSTRUCTION_MASK   0xFFFFFF00
 
#define QSPI_CCR_CLEAR_DCY_MASK   0xFFC3FFFF
 
#define QSPI_CR_CLEAR_FIFOTHRESHOLD_MASK   0xFFFFF0FF
 
#define QSPI_CR_INTERRUPT_MASK   0x001F0000
 
#define QSPI_SR_INTERRUPT_MASK   0x0000001F
 
#define QSPI_FSR_INTERRUPT_MASK   0x0000001B
 

Functions

void QSPI_StructInit (QSPI_InitTypeDef *QSPI_InitStruct)
 Fills each QSPI_InitStruct member with its default value. More...
 
void QSPI_ComConfig_StructInit (QSPI_ComConfig_InitTypeDef *QSPI_ComConfig_InitStruct)
 Fills each QSPI_ComConfig_InitStruct member with its default value. More...
 
void QSPI_Init (QSPI_InitTypeDef *QSPI_InitStruct)
 Initializes the QSPI peripheral according to the specified parameters in the QSPI_InitStruct. More...
 
void QSPI_ComConfig_Init (QSPI_ComConfig_InitTypeDef *QSPI_ComConfig_InitStruct)
 Initializes the QSPI CCR according to the specified parameters in the QSPI_ComConfig_InitStruct. More...
 
void QSPI_Cmd (FunctionalState NewState)
 Enables or disables QSPI peripheral. More...
 
void QSPI_AutoPollingMode_Config (uint32_t QSPI_Match, uint32_t QSPI_Mask, uint32_t QSPI_Match_Mode)
 Configure the QSPI Automatic Polling Mode. More...
 
void QSPI_AutoPollingMode_SetInterval (uint32_t QSPI_Interval)
 Sets the number of CLK cycle between two read during automatic polling phases. More...
 
void QSPI_MemoryMappedMode_SetTimeout (uint32_t QSPI_Timeout)
 Sets the value of the Timeout in Memory Mapped mode. More...
 
void QSPI_SetAddress (uint32_t QSPI_Address)
 Sets the value of the Address. More...
 
void QSPI_SetAlternateByte (uint32_t QSPI_AlternateByte)
 Sets the value of the Alternate Bytes. More...
 
void QSPI_SetFIFOThreshold (uint32_t QSPI_FIFOThreshold)
 Sets the FIFO Threshold. More...
 
void QSPI_SetDataLength (uint32_t QSPI_DataLength)
 Sets number of Bytes to be transferred. More...
 
void QSPI_TimeoutCounterCmd (FunctionalState NewState)
 Enables or disables The Timeout Counter. More...
 
void QSPI_AutoPollingModeStopCmd (FunctionalState NewState)
 Enables or disables Automatic Polling Mode Stop when a match occurs. More...
 
void QSPI_AbortRequest (void)
 Abort the on-going command sequence. More...
 
void QSPI_SendData8 (uint8_t Data)
 Transmits a 8bit Data through the QSPI peripheral. More...
 
void QSPI_SendData16 (uint16_t Data)
 Transmits a 16bit Data through the QSPI peripheral. More...
 
void QSPI_SendData32 (uint32_t Data)
 Transmits a 32bit Data through the QSPI peripheral. More...
 
uint8_t QSPI_ReceiveData8 (void)
 Returns the most recent received 8bit data by the QSPI peripheral. More...
 
uint16_t QSPI_ReceiveData16 (void)
 Returns the most recent received 16bit data by the QSPI peripheral. More...
 
uint32_t QSPI_ReceiveData32 (void)
 Returns the most recent received 32bit data by the QSPI peripheral. More...
 
void QSPI_DMACmd (FunctionalState NewState)
 Enables or disables DMA for Indirect Mode. More...
 
void QSPI_ITConfig (uint32_t QSPI_IT, FunctionalState NewState)
 Enables or disables the specified QSPI interrupts. More...
 
uint32_t QSPI_GetFIFOLevel (void)
 Returns the current QSPI FIFO filled level. More...
 
uint32_t QSPI_GetFMode (void)
 Returns the QSPI functional mode. More...
 
FlagStatus QSPI_GetFlagStatus (uint32_t QSPI_FLAG)
 Checks whether the specified QSPI flag is set or not. More...
 
void QSPI_ClearFlag (uint32_t QSPI_FLAG)
 Clears the QSPI flag. More...
 
ITStatus QSPI_GetITStatus (uint32_t QSPI_IT)
 Checks whether the specified QSPI interrupt has occurred or not. More...
 
void QSPI_ClearITPendingBit (uint32_t QSPI_IT)
 Clears the QSPI's interrupt pending bits. More...
 
void QSPI_DualFlashMode_Cmd (FunctionalState NewState)
 Enables or disables QSPI Dual Flash Mode. More...
 

Detailed Description

This file provides all the QSPI firmware functions.

Author
MegawinTech Application Team
Version
V0.0.4
Date
16-June-2023