STM32412G-Discovery BSP User Manual: STM32412G Discovery QSPI Private Functions

STM32412G-Discovery BSP Drivers

STM32412G-Discovery BSP User Manual
STM32412G Discovery QSPI Private Functions

Functions

uint8_t BSP_QSPI_Init (void)
 Initializes the QSPI interface.
uint8_t BSP_QSPI_DeInit (void)
 De-Initializes the QSPI interface.
uint8_t BSP_QSPI_Read (uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
 Reads an amount of data from the QSPI memory.
uint8_t BSP_QSPI_Write (uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
 Writes an amount of data to the QSPI memory.
uint8_t BSP_QSPI_Erase_Block (uint32_t BlockAddress)
 Erases the specified block of the QSPI memory.
uint8_t BSP_QSPI_Erase_Chip (void)
 Erases the entire QSPI memory.
uint8_t BSP_QSPI_GetStatus (void)
 Reads current status of the QSPI memory.
uint8_t BSP_QSPI_GetInfo (QSPI_Info *pInfo)
 Return the configuration of the QSPI memory.
uint8_t BSP_QSPI_EnableMemoryMappedMode (void)
 Configure the QSPI in memory-mapped mode.
__weak void BSP_QSPI_MspInit (QSPI_HandleTypeDef *hqspi, void *Params)
 QSPI MSP Initialization This function configures the hardware resources used in this example:
__weak void BSP_QSPI_MspDeInit (QSPI_HandleTypeDef *hqspi, void *Params)
 QSPI MSP De-Initialization This function frees the hardware resources used in this example:
static uint8_t QSPI_ResetMemory (QSPI_HandleTypeDef *hqspi)
 This function reset the QSPI memory.
static uint8_t QSPI_DummyCyclesCfg (QSPI_HandleTypeDef *hqspi)
 This function configure the dummy cycles on memory side.
static uint8_t QSPI_WriteEnable (QSPI_HandleTypeDef *hqspi)
 This function send a Write Enable and wait it is effective.
static uint8_t QSPI_AutoPollingMemReady (QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
 This function read the SR of the memory and wait the EOP.

Function Documentation

uint8_t BSP_QSPI_DeInit ( void  )

De-Initializes the QSPI interface.

Return values:
QSPImemory status

Definition at line 158 of file stm32412g_discovery_qspi.c.

References BSP_QSPI_MspDeInit(), QSPI_ERROR, QSPI_OK, and QSPIHandle.

uint8_t BSP_QSPI_EnableMemoryMappedMode ( void  )

Configure the QSPI in memory-mapped mode.

Return values:
QSPImemory status

Definition at line 452 of file stm32412g_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPIHandle.

uint8_t BSP_QSPI_Erase_Block ( uint32_t  BlockAddress)

Erases the specified block of the QSPI memory.

Parameters:
BlockAddress,:Block address to erase
Return values:
QSPImemory status

Definition at line 301 of file stm32412g_discovery_qspi.c.

References QSPI_AutoPollingMemReady(), QSPI_ERROR, QSPI_OK, QSPI_WriteEnable(), and QSPIHandle.

uint8_t BSP_QSPI_Erase_Chip ( void  )

Erases the entire QSPI memory.

Return values:
QSPImemory status

Definition at line 343 of file stm32412g_discovery_qspi.c.

References QSPI_AutoPollingMemReady(), QSPI_ERROR, QSPI_OK, QSPI_WriteEnable(), and QSPIHandle.

uint8_t BSP_QSPI_GetInfo ( QSPI_Info pInfo)

Return the configuration of the QSPI memory.

Parameters:
pInfo,:pointer on the configuration structure
Return values:
QSPImemory status

Definition at line 436 of file stm32412g_discovery_qspi.c.

References QSPI_Info::EraseSectorSize, QSPI_Info::EraseSectorsNumber, QSPI_Info::FlashSize, QSPI_Info::ProgPageSize, QSPI_Info::ProgPagesNumber, and QSPI_OK.

uint8_t BSP_QSPI_GetStatus ( void  )

Reads current status of the QSPI memory.

Return values:
QSPImemory status

Definition at line 383 of file stm32412g_discovery_qspi.c.

References QSPI_BUSY, QSPI_ERROR, QSPI_OK, QSPI_SUSPENDED, and QSPIHandle.

uint8_t BSP_QSPI_Init ( void  )

Initializes the QSPI interface.

Return values:
QSPImemory status

Definition at line 111 of file stm32412g_discovery_qspi.c.

References BSP_QSPI_MspInit(), QSPI_DummyCyclesCfg(), QSPI_ERROR, QSPI_NOT_SUPPORTED, QSPI_OK, QSPI_ResetMemory(), and QSPIHandle.

__weak void BSP_QSPI_MspDeInit ( QSPI_HandleTypeDef *  hqspi,
void *  Params 
)

QSPI MSP De-Initialization This function frees the hardware resources used in this example:

  • Disable the Peripheral's clock
  • Revert GPIO and NVIC configuration to their default state
    Parameters:
    hqspi,:QSPI handle
    Params: pointer on additional configuration parameters, can be NULL.

Definition at line 555 of file stm32412g_discovery_qspi.c.

References QSPI_CLK_DISABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_CS_GPIO_PORT, QSPI_CS_PIN, QSPI_D0_GPIO_PORT, QSPI_D0_PIN, QSPI_D1_GPIO_PORT, QSPI_D1_PIN, QSPI_D2_GPIO_PORT, QSPI_D2_PIN, QSPI_D3_GPIO_PORT, QSPI_D3_PIN, QSPI_FORCE_RESET, and QSPI_RELEASE_RESET.

Referenced by BSP_QSPI_DeInit().

__weak void BSP_QSPI_MspInit ( QSPI_HandleTypeDef *  hqspi,
void *  Params 
)

QSPI MSP Initialization This function configures the hardware resources used in this example:

  • Peripheral's clock enable
  • Peripheral's GPIO Configuration
  • NVIC configuration for QSPI interrupt
    Parameters:
    hqspi,:QSPI handle
    Params: pointer on additional configuration parameters, can be NULL.

Definition at line 490 of file stm32412g_discovery_qspi.c.

References QSPI_CLK_ENABLE, QSPI_CLK_GPIO_CLK_ENABLE, QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN, QSPI_CS_GPIO_CLK_ENABLE, QSPI_CS_GPIO_PORT, QSPI_CS_PIN, QSPI_D0_GPIO_PORT, QSPI_D0_PIN, QSPI_D1_GPIO_PORT, QSPI_D1_PIN, QSPI_D2_GPIO_PORT, QSPI_D2_PIN, QSPI_D3_GPIO_PORT, QSPI_D3_PIN, QSPI_Dx_GPIO_CLK_ENABLE, QSPI_FORCE_RESET, and QSPI_RELEASE_RESET.

Referenced by BSP_QSPI_Init().

uint8_t BSP_QSPI_Read ( uint8_t *  pData,
uint32_t  ReadAddr,
uint32_t  Size 
)

Reads an amount of data from the QSPI memory.

Parameters:
pData,:Pointer to data to be read
ReadAddr,:Read start address
Size,:Size of data to read
Return values:
QSPImemory status

Definition at line 181 of file stm32412g_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPIHandle.

uint8_t BSP_QSPI_Write ( uint8_t *  pData,
uint32_t  WriteAddr,
uint32_t  Size 
)

Writes an amount of data to the QSPI memory.

Parameters:
pData,:Pointer to data to be written
WriteAddr,:Write start address
Size,:Size of data to write
Return values:
QSPImemory status

Definition at line 227 of file stm32412g_discovery_qspi.c.

References QSPI_AutoPollingMemReady(), QSPI_ERROR, QSPI_OK, QSPI_WriteEnable(), and QSPIHandle.

static uint8_t QSPI_AutoPollingMemReady ( QSPI_HandleTypeDef *  hqspi,
uint32_t  Timeout 
) [static]

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

Parameters:
hqspi,:QSPI handle
Timeout

Definition at line 727 of file stm32412g_discovery_qspi.c.

References QSPI_ERROR, and QSPI_OK.

Referenced by BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_Write(), and QSPI_ResetMemory().

static uint8_t QSPI_DummyCyclesCfg ( QSPI_HandleTypeDef *  hqspi) [static]

This function configure the dummy cycles on memory side.

Parameters:
hqspi,:QSPI handle

Definition at line 624 of file stm32412g_discovery_qspi.c.

References QSPI_ERROR, QSPI_OK, and QSPI_WriteEnable().

Referenced by BSP_QSPI_Init().

static uint8_t QSPI_ResetMemory ( QSPI_HandleTypeDef *  hqspi) [static]

This function reset the QSPI memory.

Parameters:
hqspi,:QSPI handle

Definition at line 583 of file stm32412g_discovery_qspi.c.

References QSPI_AutoPollingMemReady(), QSPI_ERROR, and QSPI_OK.

Referenced by BSP_QSPI_Init().

static uint8_t QSPI_WriteEnable ( QSPI_HandleTypeDef *  hqspi) [static]

This function send a Write Enable and wait it is effective.

Parameters:
hqspi,:QSPI handle

Definition at line 682 of file stm32412g_discovery_qspi.c.

References QSPI_ERROR, and QSPI_OK.

Referenced by BSP_QSPI_Erase_Block(), BSP_QSPI_Erase_Chip(), BSP_QSPI_Write(), and QSPI_DummyCyclesCfg().

Generated on Tue Jan 24 2017 11:28:06 for STM32412G-Discovery BSP User Manual by   doxygen 1.7.6.1