ST / BSP_DISCO_F769NI

Dependents:   mbed-os-example-blinky-5 DISCO-F769NI_TOUCHSCREEN_demo_custom_1 Datarecorder2 DISCO-F769NI_TOUCHSCREEN_demo ... more

Committer:
Jerome Coutant
Date:
Fri Nov 15 11:20:11 2019 +0100
Revision:
4:72a949940ad6
Parent:
1:3e58f8a39705
STM32Cube_FW_F7_V1.15.0 Update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jerome Coutant 0:c0f3bbab73d2 1 /**
Jerome Coutant 0:c0f3bbab73d2 2 ******************************************************************************
Jerome Coutant 0:c0f3bbab73d2 3 * @file mx25l512.h
Jerome Coutant 0:c0f3bbab73d2 4 * @author MCD Application Team
Jerome Coutant 0:c0f3bbab73d2 5 * @brief This file contains all the description of the MX25L51245G QSPI memory.
Jerome Coutant 0:c0f3bbab73d2 6 ******************************************************************************
Jerome Coutant 0:c0f3bbab73d2 7 * @attention
Jerome Coutant 0:c0f3bbab73d2 8 *
Jerome Coutant 0:c0f3bbab73d2 9 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Jerome Coutant 0:c0f3bbab73d2 10 *
Jerome Coutant 0:c0f3bbab73d2 11 * Redistribution and use in source and binary forms, with or without modification,
Jerome Coutant 0:c0f3bbab73d2 12 * are permitted provided that the following conditions are met:
Jerome Coutant 0:c0f3bbab73d2 13 * 1. Redistributions of source code must retain the above copyright notice,
Jerome Coutant 0:c0f3bbab73d2 14 * this list of conditions and the following disclaimer.
Jerome Coutant 0:c0f3bbab73d2 15 * 2. Redistributions in binary form must reproduce the above copyright notice,
Jerome Coutant 0:c0f3bbab73d2 16 * this list of conditions and the following disclaimer in the documentation
Jerome Coutant 0:c0f3bbab73d2 17 * and/or other materials provided with the distribution.
Jerome Coutant 0:c0f3bbab73d2 18 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Jerome Coutant 0:c0f3bbab73d2 19 * may be used to endorse or promote products derived from this software
Jerome Coutant 0:c0f3bbab73d2 20 * without specific prior written permission.
Jerome Coutant 0:c0f3bbab73d2 21 *
Jerome Coutant 0:c0f3bbab73d2 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Jerome Coutant 0:c0f3bbab73d2 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Jerome Coutant 0:c0f3bbab73d2 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Jerome Coutant 0:c0f3bbab73d2 25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Jerome Coutant 0:c0f3bbab73d2 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Jerome Coutant 0:c0f3bbab73d2 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Jerome Coutant 0:c0f3bbab73d2 28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Jerome Coutant 0:c0f3bbab73d2 29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Jerome Coutant 0:c0f3bbab73d2 30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Jerome Coutant 0:c0f3bbab73d2 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Jerome Coutant 0:c0f3bbab73d2 32 *
Jerome Coutant 0:c0f3bbab73d2 33 ******************************************************************************
Jerome Coutant 0:c0f3bbab73d2 34 */
Jerome Coutant 0:c0f3bbab73d2 35
Jerome Coutant 0:c0f3bbab73d2 36 /* Define to prevent recursive inclusion -------------------------------------*/
Jerome Coutant 0:c0f3bbab73d2 37 #ifndef __MX25L512_H
Jerome Coutant 0:c0f3bbab73d2 38 #define __MX25L512_H
Jerome Coutant 0:c0f3bbab73d2 39
Jerome Coutant 0:c0f3bbab73d2 40 #ifdef __cplusplus
Jerome Coutant 0:c0f3bbab73d2 41 extern "C" {
Jerome Coutant 0:c0f3bbab73d2 42 #endif
Jerome Coutant 0:c0f3bbab73d2 43
Jerome Coutant 0:c0f3bbab73d2 44 /* Includes ------------------------------------------------------------------*/
Jerome Coutant 0:c0f3bbab73d2 45
Jerome Coutant 0:c0f3bbab73d2 46 /** @addtogroup BSP
Jerome Coutant 0:c0f3bbab73d2 47 * @{
Jerome Coutant 0:c0f3bbab73d2 48 */
Jerome Coutant 0:c0f3bbab73d2 49
Jerome Coutant 0:c0f3bbab73d2 50 /** @addtogroup Components
Jerome Coutant 0:c0f3bbab73d2 51 * @{
Jerome Coutant 0:c0f3bbab73d2 52 */
Jerome Coutant 0:c0f3bbab73d2 53
Jerome Coutant 0:c0f3bbab73d2 54 /** @addtogroup MX25L512
Jerome Coutant 0:c0f3bbab73d2 55 * @{
Jerome Coutant 0:c0f3bbab73d2 56 */
Jerome Coutant 0:c0f3bbab73d2 57
Jerome Coutant 0:c0f3bbab73d2 58 /** @defgroup MX25L512_Exported_Types
Jerome Coutant 0:c0f3bbab73d2 59 * @{
Jerome Coutant 0:c0f3bbab73d2 60 */
Jerome Coutant 0:c0f3bbab73d2 61
Jerome Coutant 0:c0f3bbab73d2 62 /**
Jerome Coutant 0:c0f3bbab73d2 63 * @}
Jerome Coutant 0:c0f3bbab73d2 64 */
Jerome Coutant 0:c0f3bbab73d2 65
Jerome Coutant 0:c0f3bbab73d2 66 /** @defgroup MX25L512_Exported_Constants
Jerome Coutant 0:c0f3bbab73d2 67 * @{
Jerome Coutant 0:c0f3bbab73d2 68 */
Jerome Coutant 0:c0f3bbab73d2 69
Jerome Coutant 0:c0f3bbab73d2 70 /**
Jerome Coutant 0:c0f3bbab73d2 71 * @brief MX25L512 Configuration
Jerome Coutant 0:c0f3bbab73d2 72 */
Jerome Coutant 0:c0f3bbab73d2 73 #define MX25L512_FLASH_SIZE 0x4000000 /* 512 MBits => 64MBytes */
Jerome Coutant 0:c0f3bbab73d2 74 #define MX25L512_SECTOR_SIZE 0x10000 /* 1024 sectors of 64KBytes */
Jerome Coutant 0:c0f3bbab73d2 75 #define MX25L512_SUBSECTOR_SIZE 0x1000 /* 16384 subsectors of 4kBytes */
Jerome Coutant 0:c0f3bbab73d2 76 #define MX25L512_PAGE_SIZE 0x100 /* 262144 pages of 256 bytes */
Jerome Coutant 0:c0f3bbab73d2 77
Jerome Coutant 0:c0f3bbab73d2 78 #define MX25L512_DUMMY_CYCLES_READ_QUAD 3
Jerome Coutant 0:c0f3bbab73d2 79 #define MX25L512_DUMMY_CYCLES_READ 8
Jerome Coutant 0:c0f3bbab73d2 80 #define MX25L512_DUMMY_CYCLES_READ_QUAD_IO 10
Jerome Coutant 0:c0f3bbab73d2 81 #define MX25L512_DUMMY_CYCLES_READ_DTR 6
Jerome Coutant 0:c0f3bbab73d2 82 #define MX25L512_DUMMY_CYCLES_READ_QUAD_DTR 8
Jerome Coutant 0:c0f3bbab73d2 83
Jerome Coutant 0:c0f3bbab73d2 84 #define MX25L512_BULK_ERASE_MAX_TIME 600000
Jerome Coutant 0:c0f3bbab73d2 85 #define MX25L512_SECTOR_ERASE_MAX_TIME 2000
Jerome Coutant 0:c0f3bbab73d2 86 #define MX25L512_SUBSECTOR_ERASE_MAX_TIME 800
Jerome Coutant 0:c0f3bbab73d2 87
Jerome Coutant 0:c0f3bbab73d2 88 /**
Jerome Coutant 0:c0f3bbab73d2 89 * @brief MX25L512 Commands
Jerome Coutant 0:c0f3bbab73d2 90 */
Jerome Coutant 0:c0f3bbab73d2 91 /* Reset Operations */
Jerome Coutant 0:c0f3bbab73d2 92 #define RESET_ENABLE_CMD 0x66
Jerome Coutant 0:c0f3bbab73d2 93 #define RESET_MEMORY_CMD 0x99
Jerome Coutant 0:c0f3bbab73d2 94
Jerome Coutant 0:c0f3bbab73d2 95 /* Identification Operations */
Jerome Coutant 0:c0f3bbab73d2 96 #define READ_ID_CMD 0x9F
Jerome Coutant 0:c0f3bbab73d2 97 #define MULTIPLE_IO_READ_ID_CMD 0xAF
Jerome Coutant 0:c0f3bbab73d2 98 #define READ_SERIAL_FLASH_DISCO_PARAM_CMD 0x5A
Jerome Coutant 0:c0f3bbab73d2 99
Jerome Coutant 0:c0f3bbab73d2 100 /* Read Operations */
Jerome Coutant 0:c0f3bbab73d2 101 #define READ_CMD 0x03
Jerome Coutant 0:c0f3bbab73d2 102 #define READ_4_BYTE_ADDR_CMD 0x13
Jerome Coutant 0:c0f3bbab73d2 103
Jerome Coutant 0:c0f3bbab73d2 104 #define FAST_READ_CMD 0x0B
Jerome Coutant 0:c0f3bbab73d2 105 #define FAST_READ_DTR_CMD 0x0D
Jerome Coutant 0:c0f3bbab73d2 106 #define FAST_READ_4_BYTE_ADDR_CMD 0x0C
Jerome Coutant 0:c0f3bbab73d2 107
Jerome Coutant 0:c0f3bbab73d2 108 #define DUAL_OUT_FAST_READ_CMD 0x3B
Jerome Coutant 0:c0f3bbab73d2 109 #define DUAL_OUT_FAST_READ_4_BYTE_ADDR_CMD 0x3C
Jerome Coutant 0:c0f3bbab73d2 110
Jerome Coutant 0:c0f3bbab73d2 111 #define DUAL_INOUT_FAST_READ_CMD 0xBB
Jerome Coutant 0:c0f3bbab73d2 112 #define DUAL_INOUT_FAST_READ_DTR_CMD 0xBD
Jerome Coutant 0:c0f3bbab73d2 113 #define DUAL_INOUT_FAST_READ_4_BYTE_ADDR_CMD 0xBC
Jerome Coutant 0:c0f3bbab73d2 114
Jerome Coutant 0:c0f3bbab73d2 115 #define QUAD_OUT_FAST_READ_CMD 0x6B
Jerome Coutant 0:c0f3bbab73d2 116 #define QUAD_OUT_FAST_READ_4_BYTE_ADDR_CMD 0x6C
Jerome Coutant 0:c0f3bbab73d2 117
Jerome Coutant 0:c0f3bbab73d2 118 #define QUAD_INOUT_FAST_READ_CMD 0xEB
Jerome Coutant 0:c0f3bbab73d2 119 #define QUAD_INOUT_FAST_READ_DTR_CMD 0xED
Jerome Coutant 1:3e58f8a39705 120 #define QSPI_READ_4_BYTE_ADDR_CMD 0xEC
Jerome Coutant 0:c0f3bbab73d2 121
Jerome Coutant 0:c0f3bbab73d2 122 /* Write Operations */
Jerome Coutant 0:c0f3bbab73d2 123 #define WRITE_ENABLE_CMD 0x06
Jerome Coutant 0:c0f3bbab73d2 124 #define WRITE_DISABLE_CMD 0x04
Jerome Coutant 0:c0f3bbab73d2 125
Jerome Coutant 0:c0f3bbab73d2 126 /* Register Operations */
Jerome Coutant 0:c0f3bbab73d2 127 #define READ_STATUS_REG_CMD 0x05
Jerome Coutant 0:c0f3bbab73d2 128 #define READ_CFG_REG_CMD 0x15
Jerome Coutant 0:c0f3bbab73d2 129 #define WRITE_STATUS_CFG_REG_CMD 0x01
Jerome Coutant 0:c0f3bbab73d2 130
Jerome Coutant 0:c0f3bbab73d2 131 #define READ_LOCK_REG_CMD 0x2D
Jerome Coutant 0:c0f3bbab73d2 132 #define WRITE_LOCK_REG_CMD 0x2C
Jerome Coutant 0:c0f3bbab73d2 133
Jerome Coutant 0:c0f3bbab73d2 134 #define READ_EXT_ADDR_REG_CMD 0xC8
Jerome Coutant 0:c0f3bbab73d2 135 #define WRITE_EXT_ADDR_REG_CMD 0xC5
Jerome Coutant 0:c0f3bbab73d2 136
Jerome Coutant 0:c0f3bbab73d2 137 /* Program Operations */
Jerome Coutant 0:c0f3bbab73d2 138 #define PAGE_PROG_CMD 0x02
Jerome Coutant 1:3e58f8a39705 139 #define QSPI_PAGE_PROG_4_BYTE_ADDR_CMD 0x12
Jerome Coutant 0:c0f3bbab73d2 140
Jerome Coutant 0:c0f3bbab73d2 141 #define QUAD_IN_FAST_PROG_CMD 0x38
Jerome Coutant 0:c0f3bbab73d2 142 #define EXT_QUAD_IN_FAST_PROG_CMD 0x38
Jerome Coutant 0:c0f3bbab73d2 143 #define QUAD_IN_FAST_PROG_4_BYTE_ADDR_CMD 0x3E
Jerome Coutant 0:c0f3bbab73d2 144
Jerome Coutant 0:c0f3bbab73d2 145 /* Erase Operations */
Jerome Coutant 0:c0f3bbab73d2 146 #define SUBSECTOR_ERASE_CMD 0x20
Jerome Coutant 0:c0f3bbab73d2 147 #define SUBSECTOR_ERASE_4_BYTE_ADDR_CMD 0x21
Jerome Coutant 0:c0f3bbab73d2 148
Jerome Coutant 0:c0f3bbab73d2 149 #define SECTOR_ERASE_CMD 0xD8
Jerome Coutant 0:c0f3bbab73d2 150 #define SECTOR_ERASE_4_BYTE_ADDR_CMD 0xDC
Jerome Coutant 0:c0f3bbab73d2 151
Jerome Coutant 0:c0f3bbab73d2 152 #define BULK_ERASE_CMD 0xC7
Jerome Coutant 0:c0f3bbab73d2 153
Jerome Coutant 0:c0f3bbab73d2 154 #define PROG_ERASE_RESUME_CMD 0x30
Jerome Coutant 0:c0f3bbab73d2 155 #define PROG_ERASE_SUSPEND_CMD 0xB0
Jerome Coutant 0:c0f3bbab73d2 156
Jerome Coutant 0:c0f3bbab73d2 157 /* 4-byte Address Mode Operations */
Jerome Coutant 0:c0f3bbab73d2 158 #define ENTER_4_BYTE_ADDR_MODE_CMD 0xB7
Jerome Coutant 0:c0f3bbab73d2 159 #define EXIT_4_BYTE_ADDR_MODE_CMD 0xE9
Jerome Coutant 0:c0f3bbab73d2 160
Jerome Coutant 0:c0f3bbab73d2 161 /* Quad Operations */
Jerome Coutant 0:c0f3bbab73d2 162 #define ENTER_QUAD_CMD 0x35
Jerome Coutant 0:c0f3bbab73d2 163 #define EXIT_QUAD_CMD 0xF5
Jerome Coutant 1:3e58f8a39705 164
Jerome Coutant 1:3e58f8a39705 165 /* Added for compatibility */
Jerome Coutant 1:3e58f8a39705 166 #define QPI_READ_4_BYTE_ADDR_CMD QSPI_READ_4_BYTE_ADDR_CMD
Jerome Coutant 1:3e58f8a39705 167 #define QPI_PAGE_PROG_4_BYTE_ADDR_CMD QSPI_PAGE_PROG_4_BYTE_ADDR_CMD
Jerome Coutant 0:c0f3bbab73d2 168
Jerome Coutant 0:c0f3bbab73d2 169 /**
Jerome Coutant 0:c0f3bbab73d2 170 * @brief MX25L512 Registers
Jerome Coutant 0:c0f3bbab73d2 171 */
Jerome Coutant 0:c0f3bbab73d2 172 /* Status Register */
Jerome Coutant 0:c0f3bbab73d2 173 #define MX25L512_SR_WIP ((uint8_t)0x01) /*!< Write in progress */
Jerome Coutant 0:c0f3bbab73d2 174 #define MX25L512_SR_WREN ((uint8_t)0x02) /*!< Write enable latch */
Jerome Coutant 0:c0f3bbab73d2 175 #define MX25L512_SR_BLOCKPR ((uint8_t)0x5C) /*!< Block protected against program and erase operations */
Jerome Coutant 0:c0f3bbab73d2 176 #define MX25L512_SR_PRBOTTOM ((uint8_t)0x20) /*!< Protected memory area defined by BLOCKPR starts from top or bottom */
Jerome Coutant 0:c0f3bbab73d2 177 #define MX25L512_SR_QUADEN ((uint8_t)0x40) /*!< Quad IO mode enabled if =1 */
Jerome Coutant 0:c0f3bbab73d2 178 #define MX25L512_SR_SRWREN ((uint8_t)0x80) /*!< Status register write enable/disable */
Jerome Coutant 0:c0f3bbab73d2 179
Jerome Coutant 0:c0f3bbab73d2 180 /* Configuration Register */
Jerome Coutant 0:c0f3bbab73d2 181 #define MX25L512_CR_ODS ((uint8_t)0x07) /*!< Output driver strength */
Jerome Coutant 0:c0f3bbab73d2 182 #define MX25L512_CR_ODS_30 ((uint8_t)0x07) /*!< Output driver strength 30 ohms (default)*/
Jerome Coutant 0:c0f3bbab73d2 183 #define MX25L512_CR_ODS_15 ((uint8_t)0x06) /*!< Output driver strength 15 ohms */
Jerome Coutant 0:c0f3bbab73d2 184 #define MX25L512_CR_ODS_20 ((uint8_t)0x05) /*!< Output driver strength 20 ohms */
Jerome Coutant 0:c0f3bbab73d2 185 #define MX25L512_CR_ODS_45 ((uint8_t)0x03) /*!< Output driver strength 45 ohms */
Jerome Coutant 0:c0f3bbab73d2 186 #define MX25L512_CR_ODS_60 ((uint8_t)0x02) /*!< Output driver strength 60 ohms */
Jerome Coutant 0:c0f3bbab73d2 187 #define MX25L512_CR_ODS_90 ((uint8_t)0x01) /*!< Output driver strength 90 ohms */
Jerome Coutant 0:c0f3bbab73d2 188 #define MX25L512_CR_TB ((uint8_t)0x08) /*!< Top/Bottom bit used to configure the block protect area */
Jerome Coutant 0:c0f3bbab73d2 189 #define MX25L512_CR_PBE ((uint8_t)0x10) /*!< Preamble Bit Enable */
Jerome Coutant 0:c0f3bbab73d2 190 #define MX25L512_CR_4BYTE ((uint8_t)0x20) /*!< 3-bytes or 4-bytes addressing */
Jerome Coutant 0:c0f3bbab73d2 191 #define MX25L512_CR_NB_DUMMY ((uint8_t)0xC0) /*!< Number of dummy clock cycles */
Jerome Coutant 0:c0f3bbab73d2 192
Jerome Coutant 1:3e58f8a39705 193 #define MX25L512_MANUFACTURER_ID ((uint8_t)0xC2)
Jerome Coutant 1:3e58f8a39705 194 #define MX25L512_DEVICE_ID_MEM_TYPE ((uint8_t)0x20)
Jerome Coutant 1:3e58f8a39705 195 #define MX25L512_DEVICE_ID_MEM_CAPACITY ((uint8_t)0x1A)
Jerome Coutant 1:3e58f8a39705 196 #define MX25L512_UNIQUE_ID_DATA_LENGTH ((uint8_t)0x10)
Jerome Coutant 0:c0f3bbab73d2 197
Jerome Coutant 0:c0f3bbab73d2 198 /**
Jerome Coutant 0:c0f3bbab73d2 199 * @}
Jerome Coutant 0:c0f3bbab73d2 200 */
Jerome Coutant 0:c0f3bbab73d2 201
Jerome Coutant 0:c0f3bbab73d2 202 /** @defgroup MX25L512_Exported_Functions
Jerome Coutant 0:c0f3bbab73d2 203 * @{
Jerome Coutant 0:c0f3bbab73d2 204 */
Jerome Coutant 0:c0f3bbab73d2 205 /**
Jerome Coutant 0:c0f3bbab73d2 206 * @}
Jerome Coutant 0:c0f3bbab73d2 207 */
Jerome Coutant 0:c0f3bbab73d2 208
Jerome Coutant 0:c0f3bbab73d2 209 #ifdef __cplusplus
Jerome Coutant 0:c0f3bbab73d2 210 }
Jerome Coutant 0:c0f3bbab73d2 211 #endif
Jerome Coutant 0:c0f3bbab73d2 212
Jerome Coutant 0:c0f3bbab73d2 213 #endif /* __MX25L512_H */
Jerome Coutant 0:c0f3bbab73d2 214
Jerome Coutant 0:c0f3bbab73d2 215 /**
Jerome Coutant 0:c0f3bbab73d2 216 * @}
Jerome Coutant 0:c0f3bbab73d2 217 */
Jerome Coutant 0:c0f3bbab73d2 218
Jerome Coutant 0:c0f3bbab73d2 219 /**
Jerome Coutant 0:c0f3bbab73d2 220 * @}
Jerome Coutant 0:c0f3bbab73d2 221 */
Jerome Coutant 0:c0f3bbab73d2 222
Jerome Coutant 0:c0f3bbab73d2 223 /**
Jerome Coutant 0:c0f3bbab73d2 224 * @}
Jerome Coutant 0:c0f3bbab73d2 225 */
Jerome Coutant 0:c0f3bbab73d2 226
Jerome Coutant 0:c0f3bbab73d2 227 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/