Stima V4 Slave RAIN  4.2
Flash Class Reference

#include <flash.h>

Classes

struct  QSPI_Info
 
union  QSPI_IT_EventFlag
 

Public Types

enum  QSPI_StatusTypeDef {
  QSPI_KO_INIT = -1 , QSPI_OK = HAL_OK , QSPI_ERROR = HAL_ERROR , QSPI_BUSY = HAL_BUSY ,
  QSPI_TIMEOUT = HAL_TIMEOUT , QSPI_NOT_SUPPORTED , QSPI_SUSPENDED , QSPI_READY ,
  QSPI_RESET
}
 

Public Member Functions

 Flash ()
 
 Flash (QSPI_HandleTypeDef *hqspi)
 
QSPI_StatusTypeDef BSP_QSPI_Init (void)
 Initializes the QSPI interface. More...
 
QSPI_StatusTypeDef BSP_QSPI_DeInit (void)
 De-Initializes the QSPI interface. More...
 
QSPI_StatusTypeDef BSP_QSPI_Read (uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
 Reads an amount of data from the QSPI memory. More...
 
QSPI_StatusTypeDef BSP_QSPI_Write (uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
 Writes an amount of data to the QSPI memory. More...
 
QSPI_StatusTypeDef BSP_QSPI_Erase_Block (uint32_t BlockAddress)
 Erases the specified block of the QSPI memory. More...
 
QSPI_StatusTypeDef BSP_QSPI_Erase_Sector (uint32_t Sector)
 Erases the specified sector of the QSPI memory. More...
 
QSPI_StatusTypeDef BSP_QSPI_Erase_Chip (void)
 Erases the entire QSPI memory. More...
 
QSPI_StatusTypeDef BSP_QSPI_ReadStatus (uint32_t *Reg)
 Reads current full status registers (byte1 and 2) of the QSPI memory. More...
 
QSPI_StatusTypeDef BSP_QSPI_WriteStatus (uint32_t Reg)
 Write status registers of the QSPI memory. More...
 
QSPI_StatusTypeDef BSP_QSPI_GetStatus (void)
 Reads current status (RDY/BUSY, WEL and SUS bits) of the QSPI memory. More...
 
QSPI_StatusTypeDef BSP_QSPI_GetInfo (QSPI_Info *pInfo)
 Return the configuration of the QSPI memory. More...
 
QSPI_StatusTypeDef BSP_QSPI_EnableMemoryMappedMode (void)
 Configure the QSPI in memory-mapped mode. More...
 
QSPI_StatusTypeDef BSP_QSPI_DisableMemoryMappedMode (void)
 Disable the QSPI memory-mapped mode. More...
 
uint8_t BSP_QSPI_SuspendErase (void)
 This function suspends an ongoing erase command. More...
 
uint8_t BSP_QSPI_ResumeErase (void)
 This function resumes a paused erase command. More...
 

Private Member Functions

QSPI_StatusTypeDef BSP_QSPI_Receive (uint8_t *pData, uint32_t Timeout)
 Receive an amount of data in interrupt mode. More...
 
QSPI_StatusTypeDef BSP_QSPI_Transmit (uint8_t *pData, uint32_t Timeout)
 Transmit an amount of data in interrupt mode. More...
 
QSPI_StatusTypeDef BSP_QSPI_AutoPolling (QSPI_CommandTypeDef *cmd, QSPI_AutoPollingTypeDef *cfg, uint32_t Timeout)
 Configure the QSPI Automatic Polling Mode in interrupt mode. More...
 
QSPI_StatusTypeDef BSP_QSPI_WaitingForEvent (uint32_t Timeout)
 Waiting event for QSPI Module. More...
 
QSPI_StatusTypeDef QSPI_SetDeepPowerDown (void)
 This function enter in deep power down the QSPI memory. More...
 
QSPI_StatusTypeDef QSPI_ExitDeepPowerDown (void)
 This function exit from deep power down the QSPI memory. More...
 
QSPI_StatusTypeDef QSPI_ResetMemory (void)
 This function reset the QSPI memory. More...
 
QSPI_StatusTypeDef QSPI_DummyCyclesCfg (void)
 This function configure the dummy cycles on memory side. More...
 
QSPI_StatusTypeDef QSPI_WriteEnableVolat (void)
 This function enable the write for Volatile Status Register only. More...
 
QSPI_StatusTypeDef QSPI_WriteEnable (void)
 This function set Write Enable Latch bit and wait it is effective. More...
 
QSPI_StatusTypeDef QSPI_WriteDisable (void)
 This function clear Write Enable Latch bit and wait it is effective. More...
 
QSPI_StatusTypeDef QSPI_DisableContinuousMode (void)
 This function disable Continuous Read Mode Reset - Quad. More...
 
QSPI_StatusTypeDef QSPI_AutoPollingMemReady (uint32_t Timeout)
 This function read the SR of the memory and wait the EOP. More...
 

Private Attributes

QSPI_HandleTypeDef * _hqspi
 

Static Private Attributes

static QSPI_Info _FlashInfo
 
static QSPI_IT_EventFlag_evtFlag
 

Detailed Description

Definition at line 58 of file flash.h.

Member Enumeration Documentation

◆ QSPI_StatusTypeDef

Enumerator
QSPI_KO_INIT 
QSPI_OK 
QSPI_ERROR 
QSPI_BUSY 
QSPI_TIMEOUT 
QSPI_NOT_SUPPORTED 
QSPI_SUSPENDED 
QSPI_READY 
QSPI_RESET 

Definition at line 63 of file flash.h.

Constructor & Destructor Documentation

◆ Flash() [1/2]

Flash::Flash ( )

Definition at line 95 of file flash.cpp.

◆ Flash() [2/2]

Flash::Flash ( QSPI_HandleTypeDef *  hqspi)

Definition at line 99 of file flash.cpp.

Member Function Documentation

◆ BSP_QSPI_AutoPolling()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_AutoPolling ( QSPI_CommandTypeDef *  cmd,
QSPI_AutoPollingTypeDef *  cfg,
uint32_t  Timeout 
)
private

Configure the QSPI Automatic Polling Mode in interrupt mode.

Parameters
cmd: structure that contains the command configuration information.
cfg: structure that contains the polling configuration information.
Timeout: Timeout duration
Note
This function is used only in Automatic Polling Mode
Return values
QSPImemory status

Definition at line 702 of file flash.cpp.

◆ BSP_QSPI_DeInit()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_DeInit ( void  )

De-Initializes the QSPI interface.

Return values
QSPImemory status

Definition at line 171 of file flash.cpp.

◆ BSP_QSPI_DisableMemoryMappedMode()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_DisableMemoryMappedMode ( void  )

Disable the QSPI memory-mapped mode.

Return values
QSPImemory status

Definition at line 573 of file flash.cpp.

◆ BSP_QSPI_EnableMemoryMappedMode()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_EnableMemoryMappedMode ( void  )

Configure the QSPI in memory-mapped mode.

Return values
QSPImemory status

Definition at line 541 of file flash.cpp.

◆ BSP_QSPI_Erase_Block()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Erase_Block ( uint32_t  BlockAddress)

Erases the specified block of the QSPI memory.

Parameters
BlockAddressBlock address to erase
Return values
QSPImemory status

Definition at line 312 of file flash.cpp.

◆ BSP_QSPI_Erase_Chip()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Erase_Chip ( void  )

Erases the entire QSPI memory.

Return values
QSPImemory status

Definition at line 391 of file flash.cpp.

◆ BSP_QSPI_Erase_Sector()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Erase_Sector ( uint32_t  Sector)

Erases the specified sector of the QSPI memory.

Parameters
SectorSector address to erase (0 to 255)
Return values
QSPImemory status
Note
This function is non blocking meaning that sector erase operation is started but not completed when the function returns. Application has to call BSP_QSPI_GetStatus() to know when the device is available again (i.e. erase operation completed).

Definition at line 353 of file flash.cpp.

◆ BSP_QSPI_GetInfo()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_GetInfo ( QSPI_Info pInfo)

Return the configuration of the QSPI memory.

Parameters
pInfopointer on the configuration structure
Return values
QSPImemory status

Definition at line 527 of file flash.cpp.

◆ BSP_QSPI_GetStatus()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_GetStatus ( void  )

Reads current status (RDY/BUSY, WEL and SUS bits) of the QSPI memory.

Return values
QSPImemory status

Definition at line 509 of file flash.cpp.

◆ BSP_QSPI_Init()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Init ( void  )

Initializes the QSPI interface.

Return values
QSPImemory status

Definition at line 109 of file flash.cpp.

◆ BSP_QSPI_Read()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Read ( uint8_t *  pData,
uint32_t  ReadAddr,
uint32_t  Size 
)

Reads an amount of data from the QSPI memory.

Parameters
pDataPointer to data to be read
ReadAddrRead start address
SizeSize of data to read
Return values
QSPImemory status

Definition at line 207 of file flash.cpp.

◆ BSP_QSPI_ReadStatus()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_ReadStatus ( uint32_t *  Reg)

Reads current full status registers (byte1 and 2) of the QSPI memory.

Parameters
Regdestination variable address
Return values
QSPImemory status

Definition at line 425 of file flash.cpp.

◆ BSP_QSPI_Receive()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Receive ( uint8_t *  pData,
uint32_t  Timeout 
)
private

Receive an amount of data in interrupt mode.

Parameters
pData: pointer to data buffer
Timeout: Timeout duration
Note
This function is used only in Indirect Read Mode
Return values
QSPImemory status

Definition at line 669 of file flash.cpp.

◆ BSP_QSPI_ResumeErase()

uint8_t Flash::BSP_QSPI_ResumeErase ( void  )

This function resumes a paused erase command.

Return values
QSPImemory status

Definition at line 624 of file flash.cpp.

◆ BSP_QSPI_SuspendErase()

uint8_t Flash::BSP_QSPI_SuspendErase ( void  )

This function suspends an ongoing erase command.

Return values
QSPImemory status

Definition at line 586 of file flash.cpp.

◆ BSP_QSPI_Transmit()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Transmit ( uint8_t *  pData,
uint32_t  Timeout 
)
private

Transmit an amount of data in interrupt mode.

Parameters
pData: pointer to data buffer
Timeout: Timeout duration
Note
This function is used only in Indirect Write Mode
Return values
QSPImemory status

Definition at line 685 of file flash.cpp.

◆ BSP_QSPI_WaitingForEvent()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_WaitingForEvent ( uint32_t  Timeout)
private

Waiting event for QSPI Module.

Parameters
TimeoutTimeout for operation
Returns
QSPI polling status flag

Definition at line 716 of file flash.cpp.

◆ BSP_QSPI_Write()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Write ( uint8_t *  pData,
uint32_t  WriteAddr,
uint32_t  Size 
)

Writes an amount of data to the QSPI memory.

Parameters
pDataPointer to data to be written
WriteAddrWrite start address
SizeSize of data to write
Return values
QSPImemory status

Definition at line 245 of file flash.cpp.

◆ BSP_QSPI_WriteStatus()

Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_WriteStatus ( uint32_t  Reg)

Write status registers of the QSPI memory.

Parameters
Regsource variable
Return values
QSPImemory status

Definition at line 469 of file flash.cpp.

◆ QSPI_AutoPollingMemReady()

Flash::QSPI_StatusTypeDef Flash::QSPI_AutoPollingMemReady ( uint32_t  Timeout)
private

This function read the SR of the memory and wait the EOP.

Parameters
TimeoutTimeout for auto-polling
Return values
QSPImemory status

Definition at line 987 of file flash.cpp.

◆ QSPI_DisableContinuousMode()

Flash::QSPI_StatusTypeDef Flash::QSPI_DisableContinuousMode ( void  )
private

This function disable Continuous Read Mode Reset - Quad.

Return values
QSPImemory status

Definition at line 966 of file flash.cpp.

◆ QSPI_DummyCyclesCfg()

Flash::QSPI_StatusTypeDef Flash::QSPI_DummyCyclesCfg ( void  )
private

This function configure the dummy cycles on memory side.

Return values
QSPImemory status

Definition at line 823 of file flash.cpp.

◆ QSPI_ExitDeepPowerDown()

Flash::QSPI_StatusTypeDef Flash::QSPI_ExitDeepPowerDown ( void  )
private

This function exit from deep power down the QSPI memory.

Return values
QSPImemory status

Definition at line 764 of file flash.cpp.

◆ QSPI_ResetMemory()

Flash::QSPI_StatusTypeDef Flash::QSPI_ResetMemory ( void  )
private

This function reset the QSPI memory.

Return values
QSPImemory status

Definition at line 784 of file flash.cpp.

◆ QSPI_SetDeepPowerDown()

Flash::QSPI_StatusTypeDef Flash::QSPI_SetDeepPowerDown ( void  )
private

This function enter in deep power down the QSPI memory.

Return values
QSPImemory status

Definition at line 744 of file flash.cpp.

◆ QSPI_WriteDisable()

Flash::QSPI_StatusTypeDef Flash::QSPI_WriteDisable ( void  )
private

This function clear Write Enable Latch bit and wait it is effective.

Return values
QSPImemory status

Definition at line 930 of file flash.cpp.

◆ QSPI_WriteEnable()

Flash::QSPI_StatusTypeDef Flash::QSPI_WriteEnable ( void  )
private

This function set Write Enable Latch bit and wait it is effective.

Return values
QSPImemory status

Definition at line 894 of file flash.cpp.

◆ QSPI_WriteEnableVolat()

Flash::QSPI_StatusTypeDef Flash::QSPI_WriteEnableVolat ( void  )
private

This function enable the write for Volatile Status Register only.

Return values
QSPImemory status

Definition at line 874 of file flash.cpp.

Member Data Documentation

◆ _evtFlag

QSPI_IT_EventFlag* Flash::_evtFlag
inlinestaticprivate

Definition at line 138 of file flash.h.

◆ _FlashInfo

QSPI_Info Flash::_FlashInfo
inlinestaticprivate

Definition at line 137 of file flash.h.

◆ _hqspi

QSPI_HandleTypeDef* Flash::_hqspi
private

Definition at line 136 of file flash.h.


The documentation for this class was generated from the following files: