BSP driver for DISCO_L496AG

Dependents:   DISCO_L496AG-LCD-prova_1 DISCO_L496AG-LCD-prova_2 DISCO_L496AG-LCD-demo DISCO_L496AG-SRAM-demo

Committer:
Jerome Coutant
Date:
Wed Nov 20 16:48:24 2019 +0100
Revision:
2:106c7b82e064
Parent:
0:d83f1c8ca282
Update BSP files with CubeL4 V1.14.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:d83f1c8ca282 1 /**
bcostm 0:d83f1c8ca282 2 ******************************************************************************
bcostm 0:d83f1c8ca282 3 * @file stm32l496g_discovery_qspi.h
bcostm 0:d83f1c8ca282 4 * @author MCD Application Team
bcostm 0:d83f1c8ca282 5 * @brief This file contains the common defines and functions prototypes for
bcostm 0:d83f1c8ca282 6 * the stm32l496g_discovery_qspi.c driver.
bcostm 0:d83f1c8ca282 7 ******************************************************************************
bcostm 0:d83f1c8ca282 8 * @attention
bcostm 0:d83f1c8ca282 9 *
Jerome Coutant 2:106c7b82e064 10 * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
Jerome Coutant 2:106c7b82e064 11 * All rights reserved.</center></h2>
bcostm 0:d83f1c8ca282 12 *
Jerome Coutant 2:106c7b82e064 13 * This software component is licensed by ST under BSD 3-Clause license,
Jerome Coutant 2:106c7b82e064 14 * the "License"; You may not use this file except in compliance with the
Jerome Coutant 2:106c7b82e064 15 * License. You may obtain a copy of the License at:
Jerome Coutant 2:106c7b82e064 16 * opensource.org/licenses/BSD-3-Clause
bcostm 0:d83f1c8ca282 17 *
bcostm 0:d83f1c8ca282 18 ******************************************************************************
bcostm 0:d83f1c8ca282 19 */
bcostm 0:d83f1c8ca282 20
bcostm 0:d83f1c8ca282 21 /* Define to prevent recursive inclusion -------------------------------------*/
bcostm 0:d83f1c8ca282 22 #ifndef __STM32L496G_DISCOVERY_QSPI_H
bcostm 0:d83f1c8ca282 23 #define __STM32L496G_DISCOVERY_QSPI_H
bcostm 0:d83f1c8ca282 24
bcostm 0:d83f1c8ca282 25 #ifdef __cplusplus
bcostm 0:d83f1c8ca282 26 extern "C" {
bcostm 0:d83f1c8ca282 27 #endif
bcostm 0:d83f1c8ca282 28
bcostm 0:d83f1c8ca282 29 /* Includes ------------------------------------------------------------------*/
bcostm 0:d83f1c8ca282 30 #include "stm32l4xx_hal.h"
bcostm 0:d83f1c8ca282 31 #include "../Components/mx25r6435f/mx25r6435f.h"
bcostm 0:d83f1c8ca282 32
bcostm 0:d83f1c8ca282 33 /** @addtogroup BSP
bcostm 0:d83f1c8ca282 34 * @{
bcostm 0:d83f1c8ca282 35 */
bcostm 0:d83f1c8ca282 36
bcostm 0:d83f1c8ca282 37 /** @addtogroup STM32L496G_DISCOVERY
bcostm 0:d83f1c8ca282 38 * @{
bcostm 0:d83f1c8ca282 39 */
bcostm 0:d83f1c8ca282 40
bcostm 0:d83f1c8ca282 41 /** @addtogroup STM32L496G_DISCOVERY_QSPI
bcostm 0:d83f1c8ca282 42 * @{
bcostm 0:d83f1c8ca282 43 */
bcostm 0:d83f1c8ca282 44
bcostm 0:d83f1c8ca282 45 /* Exported constants --------------------------------------------------------*/
bcostm 0:d83f1c8ca282 46 /** @defgroup STM32L496G_DISCOVERY_QSPI_Exported_Constants Exported Constants
bcostm 0:d83f1c8ca282 47 * @{
bcostm 0:d83f1c8ca282 48 */
bcostm 0:d83f1c8ca282 49 /* QSPI Error codes */
bcostm 0:d83f1c8ca282 50 #define QSPI_OK ((uint8_t)0x00)
bcostm 0:d83f1c8ca282 51 #define QSPI_ERROR ((uint8_t)0x01)
bcostm 0:d83f1c8ca282 52 #define QSPI_BUSY ((uint8_t)0x02)
bcostm 0:d83f1c8ca282 53 #define QSPI_NOT_SUPPORTED ((uint8_t)0x04)
bcostm 0:d83f1c8ca282 54 #define QSPI_SUSPENDED ((uint8_t)0x08)
bcostm 0:d83f1c8ca282 55
bcostm 0:d83f1c8ca282 56 /**
bcostm 0:d83f1c8ca282 57 * @}
bcostm 0:d83f1c8ca282 58 */
bcostm 0:d83f1c8ca282 59
bcostm 0:d83f1c8ca282 60 /* Exported types ------------------------------------------------------------*/
bcostm 0:d83f1c8ca282 61 /** @defgroup STM32L496G_DISCOVERY_QSPI_Exported_Types Exported Types
bcostm 0:d83f1c8ca282 62 * @{
bcostm 0:d83f1c8ca282 63 */
bcostm 0:d83f1c8ca282 64 /* QSPI Info */
bcostm 0:d83f1c8ca282 65 typedef struct
bcostm 0:d83f1c8ca282 66 {
bcostm 0:d83f1c8ca282 67 uint32_t FlashSize; /*!< Size of the flash */
bcostm 0:d83f1c8ca282 68 uint32_t EraseSectorSize; /*!< Size of sectors for the erase operation */
bcostm 0:d83f1c8ca282 69 uint32_t EraseSectorsNumber; /*!< Number of sectors for the erase operation */
bcostm 0:d83f1c8ca282 70 uint32_t ProgPageSize; /*!< Size of pages for the program operation */
bcostm 0:d83f1c8ca282 71 uint32_t ProgPagesNumber; /*!< Number of pages for the program operation */
bcostm 0:d83f1c8ca282 72 } QSPI_Info;
bcostm 0:d83f1c8ca282 73
bcostm 0:d83f1c8ca282 74 /**
bcostm 0:d83f1c8ca282 75 * @}
bcostm 0:d83f1c8ca282 76 */
bcostm 0:d83f1c8ca282 77
bcostm 0:d83f1c8ca282 78 /* Exported functions --------------------------------------------------------*/
bcostm 0:d83f1c8ca282 79 /** @defgroup STM32L496G_DISCOVERY_QSPI_Exported_Functions Exported Functions
bcostm 0:d83f1c8ca282 80 * @{
bcostm 0:d83f1c8ca282 81 */
bcostm 0:d83f1c8ca282 82 uint8_t BSP_QSPI_Init(void);
bcostm 0:d83f1c8ca282 83 uint8_t BSP_QSPI_DeInit(void);
bcostm 0:d83f1c8ca282 84 uint8_t BSP_QSPI_Read(uint8_t *pData, uint32_t ReadAddr, uint32_t Size);
bcostm 0:d83f1c8ca282 85 uint8_t BSP_QSPI_Write(uint8_t *pData, uint32_t WriteAddr, uint32_t Size);
bcostm 0:d83f1c8ca282 86 uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress);
bcostm 0:d83f1c8ca282 87 uint8_t BSP_QSPI_Erase_Sector(uint32_t Sector);
bcostm 0:d83f1c8ca282 88 uint8_t BSP_QSPI_Erase_Chip(void);
bcostm 0:d83f1c8ca282 89 uint8_t BSP_QSPI_GetStatus(void);
bcostm 0:d83f1c8ca282 90 uint8_t BSP_QSPI_GetInfo(QSPI_Info *pInfo);
bcostm 0:d83f1c8ca282 91 uint8_t BSP_QSPI_EnableMemoryMappedMode(void);
bcostm 0:d83f1c8ca282 92 uint8_t BSP_QSPI_SuspendErase(void);
bcostm 0:d83f1c8ca282 93 uint8_t BSP_QSPI_ResumeErase(void);
bcostm 0:d83f1c8ca282 94 uint8_t BSP_QSPI_EnterDeepPowerDown(void);
bcostm 0:d83f1c8ca282 95 uint8_t BSP_QSPI_LeaveDeepPowerDown(void);
bcostm 0:d83f1c8ca282 96
bcostm 0:d83f1c8ca282 97 /**
bcostm 0:d83f1c8ca282 98 * @}
bcostm 0:d83f1c8ca282 99 */
bcostm 0:d83f1c8ca282 100
bcostm 0:d83f1c8ca282 101 /**
bcostm 0:d83f1c8ca282 102 * @}
bcostm 0:d83f1c8ca282 103 */
bcostm 0:d83f1c8ca282 104
bcostm 0:d83f1c8ca282 105 /**
bcostm 0:d83f1c8ca282 106 * @}
bcostm 0:d83f1c8ca282 107 */
bcostm 0:d83f1c8ca282 108
bcostm 0:d83f1c8ca282 109 /**
bcostm 0:d83f1c8ca282 110 * @}
bcostm 0:d83f1c8ca282 111 */
bcostm 0:d83f1c8ca282 112
bcostm 0:d83f1c8ca282 113 #ifdef __cplusplus
bcostm 0:d83f1c8ca282 114 }
bcostm 0:d83f1c8ca282 115 #endif
bcostm 0:d83f1c8ca282 116
bcostm 0:d83f1c8ca282 117 #endif /* __STM32L496G_DISCOVERY_QSPI_H */
bcostm 0:d83f1c8ca282 118
bcostm 0:d83f1c8ca282 119 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/