RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Functions | Variables
stm32h747i_eval_qspi.c File Reference

This file includes a standard driver for the MT25TL01G QSPI memory mounted on STM32H747I-EVAL board. More...

#include "stm32h747i_eval_qspi.h"

Functions

int32_t BSP_QSPI_Init (uint32_t Instance, BSP_QSPI_Init_t *Init)
 Initializes the QSPI interface.
 
int32_t BSP_QSPI_DeInit (uint32_t Instance)
 De-Initializes the QSPI interface.
 
__weak HAL_StatusTypeDef MX_QSPI_Init (QSPI_HandleTypeDef *hQspi, MX_QSPI_Init_t *Config)
 Initializes the QSPI interface.
 
int32_t BSP_QSPI_Read (uint32_t Instance, uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
 Reads an amount of data from the QSPI memory.
 
int32_t BSP_QSPI_Write (uint32_t Instance, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
 Writes an amount of data to the QSPI memory.
 
int32_t BSP_QSPI_EraseBlock (uint32_t Instance, uint32_t BlockAddress, BSP_QSPI_Erase_t BlockSize)
 Erases the specified block of the QSPI memory. MT25TL01G support 4K, 32K, 64K size block erase commands for each Die. i.e 8K, 64K, 128K at BSP level (see BSP_QSPI_Erase_t type definition)
 
int32_t BSP_QSPI_EraseChip (uint32_t Instance)
 Erases the entire QSPI memory.
 
int32_t BSP_QSPI_GetStatus (uint32_t Instance)
 Reads current status of the QSPI memory. If WIP != 0 then return busy.
 
int32_t BSP_QSPI_GetInfo (uint32_t Instance, BSP_QSPI_Info_t *pInfo)
 Return the configuration of the QSPI memory.
 
int32_t BSP_QSPI_EnableMemoryMappedMode (uint32_t Instance)
 Configure the QSPI in memory-mapped mode Only 1 Instance can running MMP mode. And it will lock system at this mode.
 
int32_t BSP_QSPI_DisableMemoryMappedMode (uint32_t Instance)
 Exit form memory-mapped mode Only 1 Instance can running MMP mode. And it will lock system at this mode.
 
int32_t BSP_QSPI_ReadID (uint32_t Instance, uint8_t *Id)
 Get flash ID, 3 Byte Manufacturer ID, Memory type, Memory density.
 
int32_t BSP_QSPI_ConfigFlash (uint32_t Instance, BSP_QSPI_Interface_t Mode, BSP_QSPI_Transfer_t Rate)
 Set Flash to desired Interface mode. And this instance becomes current instance. If current instance running at MMP mode then this function isn't work. Indirect -> Indirect.
 

Variables

QSPI_HandleTypeDef hqspi
 
BSP_QSPI_Ctx_t QSPI_Ctx [QSPI_INSTANCES_NUMBER]
 

Detailed Description

This file includes a standard driver for the MT25TL01G QSPI memory mounted on STM32H747I-EVAL board.

Author
MCD Application Team
How To use this driver:
-----------------------
 - This driver is used to drive the MT25TL01G QSPI external
     memory mounted on STM32H747I-EVAL evaluation board.

 - This driver need a specific component driver (MT25TL01G) to be included with.

Driver description:
-------------------
 - Initialization steps:
     + Initialize the QPSI external memory using the BSP_QSPI_Init() function. This
          function includes the MSP layer hardware resources initialization and the
          QSPI interface with the external memory.
       STR and DTR transfer rates are supported.
       SPI, SPI 2-IO, SPI-4IO and QPI modes are supported

 - QSPI memory operations
     + QSPI memory can be accessed with read/write operations once it is
          initialized.
          Read/write operation can be performed with AHB access using the functions
          BSP_QSPI_Read()/BSP_QSPI_Write().
     + The function BSP_QSPI_GetInfo() returns the configuration of the QSPI memory.
          (see the QSPI memory data sheet)
     + Perform erase block operation using the function BSP_QSPI_EraseBlock() and by
          specifying the block address. You can perform an erase operation of the whole
          chip by calling the function BSP_QSPI_EraseChip().
     + The function BSP_QSPI_GetStatus() returns the current status of the QSPI memory.
          (see the QSPI memory data sheet)
     + The function BSP_QSPI_EnableMemoryMappedMode enables the QSPI memory mapped mode
     + The function BSP_QSPI_DisableMemoryMappedMode disables the QSPI memory mapped mode
     + The function BSP_QSPI_ConfigFlash() allow to configure the QSPI mode and transfer rate

Note:
--------
  Regarding the "Instance" parameter, needed for all functions, it is used to select
  an QSPI instance. On the STM32H747I_EVAL board, there's one instance. Then, this
  parameter should be 0.
Attention

Copyright (c) 2019 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.