Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: VL53L0X
Fork of BSP_B-L475E-IOT01 by
Drivers/BSP/B-L475E-IOT01/stm32l475e_iot01_qspi.h@3:c6b5944187d5, 2017-04-14 (annotated)
- Committer:
- bcostm
- Date:
- Fri Apr 14 11:34:20 2017 +0200
- Revision:
- 3:c6b5944187d5
- Child:
- 5:0c70bc6d2dc0
Add BSP/B-L4755-IOT01 folder + files
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| bcostm | 3:c6b5944187d5 | 1 | /** |
| bcostm | 3:c6b5944187d5 | 2 | ****************************************************************************** |
| bcostm | 3:c6b5944187d5 | 3 | * @file stm32l475e_iot01_qspi.h |
| bcostm | 3:c6b5944187d5 | 4 | * @author MCD Application Team |
| bcostm | 3:c6b5944187d5 | 5 | * @version V1.0.0 |
| bcostm | 3:c6b5944187d5 | 6 | * @date 17-March-2017 |
| bcostm | 3:c6b5944187d5 | 7 | * @brief This file contains the common defines and functions prototypes for |
| bcostm | 3:c6b5944187d5 | 8 | * the stm32l475e_iot01_qspi.c driver. |
| bcostm | 3:c6b5944187d5 | 9 | ****************************************************************************** |
| bcostm | 3:c6b5944187d5 | 10 | * @attention |
| bcostm | 3:c6b5944187d5 | 11 | * |
| bcostm | 3:c6b5944187d5 | 12 | * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> |
| bcostm | 3:c6b5944187d5 | 13 | * |
| bcostm | 3:c6b5944187d5 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
| bcostm | 3:c6b5944187d5 | 15 | * are permitted provided that the following conditions are met: |
| bcostm | 3:c6b5944187d5 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
| bcostm | 3:c6b5944187d5 | 17 | * this list of conditions and the following disclaimer. |
| bcostm | 3:c6b5944187d5 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| bcostm | 3:c6b5944187d5 | 19 | * this list of conditions and the following disclaimer in the documentation |
| bcostm | 3:c6b5944187d5 | 20 | * and/or other materials provided with the distribution. |
| bcostm | 3:c6b5944187d5 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| bcostm | 3:c6b5944187d5 | 22 | * may be used to endorse or promote products derived from this software |
| bcostm | 3:c6b5944187d5 | 23 | * without specific prior written permission. |
| bcostm | 3:c6b5944187d5 | 24 | * |
| bcostm | 3:c6b5944187d5 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| bcostm | 3:c6b5944187d5 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| bcostm | 3:c6b5944187d5 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| bcostm | 3:c6b5944187d5 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| bcostm | 3:c6b5944187d5 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| bcostm | 3:c6b5944187d5 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| bcostm | 3:c6b5944187d5 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| bcostm | 3:c6b5944187d5 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| bcostm | 3:c6b5944187d5 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| bcostm | 3:c6b5944187d5 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| bcostm | 3:c6b5944187d5 | 35 | * |
| bcostm | 3:c6b5944187d5 | 36 | ****************************************************************************** |
| bcostm | 3:c6b5944187d5 | 37 | */ |
| bcostm | 3:c6b5944187d5 | 38 | |
| bcostm | 3:c6b5944187d5 | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
| bcostm | 3:c6b5944187d5 | 40 | #ifndef __STM32L475E_IOT01_QSPI_H |
| bcostm | 3:c6b5944187d5 | 41 | #define __STM32L475E_IOT01_QSPI_H |
| bcostm | 3:c6b5944187d5 | 42 | |
| bcostm | 3:c6b5944187d5 | 43 | #ifdef __cplusplus |
| bcostm | 3:c6b5944187d5 | 44 | extern "C" { |
| bcostm | 3:c6b5944187d5 | 45 | #endif |
| bcostm | 3:c6b5944187d5 | 46 | |
| bcostm | 3:c6b5944187d5 | 47 | /* Includes ------------------------------------------------------------------*/ |
| bcostm | 3:c6b5944187d5 | 48 | #include "stm32l4xx_hal.h" |
| bcostm | 3:c6b5944187d5 | 49 | #include "../Components/mx25r6435f/mx25r6435f.h" |
| bcostm | 3:c6b5944187d5 | 50 | |
| bcostm | 3:c6b5944187d5 | 51 | /** @addtogroup BSP |
| bcostm | 3:c6b5944187d5 | 52 | * @{ |
| bcostm | 3:c6b5944187d5 | 53 | */ |
| bcostm | 3:c6b5944187d5 | 54 | |
| bcostm | 3:c6b5944187d5 | 55 | /** @addtogroup STM32L475E_IOT01 |
| bcostm | 3:c6b5944187d5 | 56 | * @{ |
| bcostm | 3:c6b5944187d5 | 57 | */ |
| bcostm | 3:c6b5944187d5 | 58 | |
| bcostm | 3:c6b5944187d5 | 59 | /** @addtogroup STM32L475E_IOT01_QSPI |
| bcostm | 3:c6b5944187d5 | 60 | * @{ |
| bcostm | 3:c6b5944187d5 | 61 | */ |
| bcostm | 3:c6b5944187d5 | 62 | |
| bcostm | 3:c6b5944187d5 | 63 | /* Exported constants --------------------------------------------------------*/ |
| bcostm | 3:c6b5944187d5 | 64 | /** @defgroup STM32L475E_IOT01_QSPI_Exported_Constants QSPI Exported Constants |
| bcostm | 3:c6b5944187d5 | 65 | * @{ |
| bcostm | 3:c6b5944187d5 | 66 | */ |
| bcostm | 3:c6b5944187d5 | 67 | /* QSPI Error codes */ |
| bcostm | 3:c6b5944187d5 | 68 | #define QSPI_OK ((uint8_t)0x00) |
| bcostm | 3:c6b5944187d5 | 69 | #define QSPI_ERROR ((uint8_t)0x01) |
| bcostm | 3:c6b5944187d5 | 70 | #define QSPI_BUSY ((uint8_t)0x02) |
| bcostm | 3:c6b5944187d5 | 71 | #define QSPI_NOT_SUPPORTED ((uint8_t)0x04) |
| bcostm | 3:c6b5944187d5 | 72 | #define QSPI_SUSPENDED ((uint8_t)0x08) |
| bcostm | 3:c6b5944187d5 | 73 | |
| bcostm | 3:c6b5944187d5 | 74 | /** |
| bcostm | 3:c6b5944187d5 | 75 | * @} |
| bcostm | 3:c6b5944187d5 | 76 | */ |
| bcostm | 3:c6b5944187d5 | 77 | |
| bcostm | 3:c6b5944187d5 | 78 | /* Exported types ------------------------------------------------------------*/ |
| bcostm | 3:c6b5944187d5 | 79 | /** @defgroup STM32L475E_IOT01_QSPI_Exported_Types QSPI Exported Types |
| bcostm | 3:c6b5944187d5 | 80 | * @{ |
| bcostm | 3:c6b5944187d5 | 81 | */ |
| bcostm | 3:c6b5944187d5 | 82 | /* QSPI Info */ |
| bcostm | 3:c6b5944187d5 | 83 | typedef struct { |
| bcostm | 3:c6b5944187d5 | 84 | uint32_t FlashSize; /*!< Size of the flash */ |
| bcostm | 3:c6b5944187d5 | 85 | uint32_t EraseSectorSize; /*!< Size of sectors for the erase operation */ |
| bcostm | 3:c6b5944187d5 | 86 | uint32_t EraseSectorsNumber; /*!< Number of sectors for the erase operation */ |
| bcostm | 3:c6b5944187d5 | 87 | uint32_t ProgPageSize; /*!< Size of pages for the program operation */ |
| bcostm | 3:c6b5944187d5 | 88 | uint32_t ProgPagesNumber; /*!< Number of pages for the program operation */ |
| bcostm | 3:c6b5944187d5 | 89 | } QSPI_Info; |
| bcostm | 3:c6b5944187d5 | 90 | |
| bcostm | 3:c6b5944187d5 | 91 | /** |
| bcostm | 3:c6b5944187d5 | 92 | * @} |
| bcostm | 3:c6b5944187d5 | 93 | */ |
| bcostm | 3:c6b5944187d5 | 94 | |
| bcostm | 3:c6b5944187d5 | 95 | /* Exported functions --------------------------------------------------------*/ |
| bcostm | 3:c6b5944187d5 | 96 | /** @defgroup STM32L475E_IOT01_QSPI_Exported_Functions QSPI Exported Functions |
| bcostm | 3:c6b5944187d5 | 97 | * @{ |
| bcostm | 3:c6b5944187d5 | 98 | */ |
| bcostm | 3:c6b5944187d5 | 99 | uint8_t BSP_QSPI_Init (void); |
| bcostm | 3:c6b5944187d5 | 100 | uint8_t BSP_QSPI_DeInit (void); |
| bcostm | 3:c6b5944187d5 | 101 | uint8_t BSP_QSPI_Read (uint8_t* pData, uint32_t ReadAddr, uint32_t Size); |
| bcostm | 3:c6b5944187d5 | 102 | uint8_t BSP_QSPI_Write (uint8_t* pData, uint32_t WriteAddr, uint32_t Size); |
| bcostm | 3:c6b5944187d5 | 103 | uint8_t BSP_QSPI_Erase_Block (uint32_t BlockAddress); |
| bcostm | 3:c6b5944187d5 | 104 | uint8_t BSP_QSPI_Erase_Sector (uint32_t Sector); |
| bcostm | 3:c6b5944187d5 | 105 | uint8_t BSP_QSPI_Erase_Chip (void); |
| bcostm | 3:c6b5944187d5 | 106 | uint8_t BSP_QSPI_GetStatus (void); |
| bcostm | 3:c6b5944187d5 | 107 | uint8_t BSP_QSPI_GetInfo (QSPI_Info* pInfo); |
| bcostm | 3:c6b5944187d5 | 108 | uint8_t BSP_QSPI_EnableMemoryMappedMode(void); |
| bcostm | 3:c6b5944187d5 | 109 | uint8_t BSP_QSPI_SuspendErase (void); |
| bcostm | 3:c6b5944187d5 | 110 | uint8_t BSP_QSPI_ResumeErase (void); |
| bcostm | 3:c6b5944187d5 | 111 | uint8_t BSP_QSPI_EnterDeepPowerDown (void); |
| bcostm | 3:c6b5944187d5 | 112 | uint8_t BSP_QSPI_LeaveDeepPowerDown (void); |
| bcostm | 3:c6b5944187d5 | 113 | |
| bcostm | 3:c6b5944187d5 | 114 | void BSP_QSPI_MspInit(void); |
| bcostm | 3:c6b5944187d5 | 115 | void BSP_QSPI_MspDeInit(void); |
| bcostm | 3:c6b5944187d5 | 116 | /** |
| bcostm | 3:c6b5944187d5 | 117 | * @} |
| bcostm | 3:c6b5944187d5 | 118 | */ |
| bcostm | 3:c6b5944187d5 | 119 | |
| bcostm | 3:c6b5944187d5 | 120 | /** |
| bcostm | 3:c6b5944187d5 | 121 | * @} |
| bcostm | 3:c6b5944187d5 | 122 | */ |
| bcostm | 3:c6b5944187d5 | 123 | |
| bcostm | 3:c6b5944187d5 | 124 | /** |
| bcostm | 3:c6b5944187d5 | 125 | * @} |
| bcostm | 3:c6b5944187d5 | 126 | */ |
| bcostm | 3:c6b5944187d5 | 127 | |
| bcostm | 3:c6b5944187d5 | 128 | /** |
| bcostm | 3:c6b5944187d5 | 129 | * @} |
| bcostm | 3:c6b5944187d5 | 130 | */ |
| bcostm | 3:c6b5944187d5 | 131 | |
| bcostm | 3:c6b5944187d5 | 132 | #ifdef __cplusplus |
| bcostm | 3:c6b5944187d5 | 133 | } |
| bcostm | 3:c6b5944187d5 | 134 | #endif |
| bcostm | 3:c6b5944187d5 | 135 | |
| bcostm | 3:c6b5944187d5 | 136 | #endif /* __STM32L475E_IOT01_QSPI_H */ |
| bcostm | 3:c6b5944187d5 | 137 | |
| bcostm | 3:c6b5944187d5 | 138 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
