STM32L476G-Discovery board drivers V1.0.0

Dependents:   DiscoLogger DISCO_L476VG_GlassLCD DISCO_L476VG_MicrophoneRecorder DISCO_L476VG_UART ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers stm32l476g_discovery_qspi.h Source File

stm32l476g_discovery_qspi.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l476g_discovery_qspi.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains the common defines and functions prototypes for
00006   *          the stm32l476g_discovery_qspi.c driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
00011   * All rights reserved.</center></h2>
00012   *
00013   * This software component is licensed by ST under BSD 3-Clause license,
00014   * the "License"; You may not use this file except in compliance with the
00015   * License. You may obtain a copy of the License at:
00016   *                        opensource.org/licenses/BSD-3-Clause
00017   *
00018   ******************************************************************************
00019   */
00020 
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __STM32L476G_DISCOVERY_QSPI_H
00023 #define __STM32L476G_DISCOVERY_QSPI_H
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 /* Includes ------------------------------------------------------------------*/
00030 #include "stm32l4xx_hal.h"
00031 #include "../Components/n25q128a/n25q128a.h"
00032 
00033 /** @addtogroup BSP
00034   * @{
00035   */
00036 
00037 /** @addtogroup STM32L476G_DISCOVERY
00038   * @{
00039   */
00040 
00041 /** @addtogroup STM32L476G_DISCOVERY_QSPI
00042   * @{
00043   */
00044 
00045 /* Exported constants --------------------------------------------------------*/
00046 /** @defgroup STM32L476G_DISCOVERY_QSPI_Exported_Constants Exported Constants
00047   * @{
00048   */
00049 /* QSPI Error codes */
00050 #define QSPI_OK            ((uint8_t)0x00)
00051 #define QSPI_ERROR         ((uint8_t)0x01)
00052 #define QSPI_BUSY          ((uint8_t)0x02)
00053 #define QSPI_NOT_SUPPORTED ((uint8_t)0x04)
00054 #define QSPI_SUSPENDED     ((uint8_t)0x08)
00055 
00056 /**
00057   * @}
00058   */
00059 
00060 /* Exported types ------------------------------------------------------------*/
00061 /** @defgroup STM32L476G_DISCOVERY_QSPI_Exported_Types Exported Types
00062   * @{
00063   */
00064 /* QSPI Info */
00065 typedef struct
00066 {
00067   uint32_t FlashSize;          /*!< Size of the flash */
00068   uint32_t EraseSectorSize;    /*!< Size of sectors for the erase operation */
00069   uint32_t EraseSectorsNumber; /*!< Number of sectors for the erase operation */
00070   uint32_t ProgPageSize;       /*!< Size of pages for the program operation */
00071   uint32_t ProgPagesNumber;    /*!< Number of pages for the program operation */
00072 } QSPI_Info;
00073 
00074 /**
00075   * @}
00076   */
00077 
00078 /* Exported functions --------------------------------------------------------*/
00079 /** @defgroup STM32L476G_DISCOVERY_QSPI_Exported_Functions Exported Functions
00080   * @{
00081   */
00082 uint8_t BSP_QSPI_Init(void);
00083 uint8_t BSP_QSPI_DeInit(void);
00084 uint8_t BSP_QSPI_Read(uint8_t *pData, uint32_t ReadAddr, uint32_t Size);
00085 uint8_t BSP_QSPI_Write(uint8_t *pData, uint32_t WriteAddr, uint32_t Size);
00086 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress);
00087 uint8_t BSP_QSPI_Erase_Sector(uint32_t Sector);
00088 uint8_t BSP_QSPI_Erase_Chip(void);
00089 uint8_t BSP_QSPI_GetStatus(void);
00090 uint8_t BSP_QSPI_GetInfo(QSPI_Info *pInfo);
00091 uint8_t BSP_QSPI_EnableMemoryMappedMode(void);
00092 uint8_t BSP_QSPI_SuspendErase(void);
00093 uint8_t BSP_QSPI_ResumeErase(void);
00094 
00095 /**
00096   * @}
00097   */
00098 
00099 /**
00100   * @}
00101   */
00102 
00103 /**
00104   * @}
00105   */
00106 
00107 /**
00108   * @}
00109   */
00110 
00111 #ifdef __cplusplus
00112 }
00113 #endif
00114 
00115 #endif /* __STM32L476G_DISCOVERY_QSPI_H */
00116 
00117 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/