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:
Thu Feb 23 14:14:08 2017 +0100
Revision:
1:3e58f8a39705
Parent:
0:c0f3bbab73d2
Child:
4:72a949940ad6
STM32Cube_FW_F7_V1.6.0 BSP_DISCO_F769NI

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