Contains the BSP driver for the B-L475E-IOT01 board.

Dependents:   mbed-os-example-ble-Thermometer DISCO_L475VG_IOT01-Telegram-BOT DISCO_L475VG_IOT01-sche_cheveux DISCO_L475VG_IOT01-QSPI_FLASH_FILE_SYSTEM ... more

https://os.mbed.com/platforms/ST-Discovery-L475E-IOT01A/

Committer:
bcostm
Date:
Fri Apr 14 13:09:54 2017 +0200
Revision:
4:137bb367ba50
Child:
7:bfe8272ced90
Add remaining Components files

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 4:137bb367ba50 1 /**
bcostm 4:137bb367ba50 2 ******************************************************************************
bcostm 4:137bb367ba50 3 * @file mx25r6435f.h
bcostm 4:137bb367ba50 4 * @author MCD Application Team
bcostm 4:137bb367ba50 5 * @version V1.0.0
bcostm 4:137bb367ba50 6 * @date 17-February-2017
bcostm 4:137bb367ba50 7 * @brief This file contains all the description of the MX25R6435F QSPI memory.
bcostm 4:137bb367ba50 8 ******************************************************************************
bcostm 4:137bb367ba50 9 * @attention
bcostm 4:137bb367ba50 10 *
bcostm 4:137bb367ba50 11 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
bcostm 4:137bb367ba50 12 *
bcostm 4:137bb367ba50 13 * Redistribution and use in source and binary forms, with or without modification,
bcostm 4:137bb367ba50 14 * are permitted provided that the following conditions are met:
bcostm 4:137bb367ba50 15 * 1. Redistributions of source code must retain the above copyright notice,
bcostm 4:137bb367ba50 16 * this list of conditions and the following disclaimer.
bcostm 4:137bb367ba50 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bcostm 4:137bb367ba50 18 * this list of conditions and the following disclaimer in the documentation
bcostm 4:137bb367ba50 19 * and/or other materials provided with the distribution.
bcostm 4:137bb367ba50 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bcostm 4:137bb367ba50 21 * may be used to endorse or promote products derived from this software
bcostm 4:137bb367ba50 22 * without specific prior written permission.
bcostm 4:137bb367ba50 23 *
bcostm 4:137bb367ba50 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bcostm 4:137bb367ba50 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bcostm 4:137bb367ba50 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bcostm 4:137bb367ba50 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bcostm 4:137bb367ba50 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bcostm 4:137bb367ba50 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bcostm 4:137bb367ba50 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bcostm 4:137bb367ba50 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bcostm 4:137bb367ba50 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bcostm 4:137bb367ba50 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bcostm 4:137bb367ba50 34 *
bcostm 4:137bb367ba50 35 ******************************************************************************
bcostm 4:137bb367ba50 36 */
bcostm 4:137bb367ba50 37
bcostm 4:137bb367ba50 38 /* Define to prevent recursive inclusion -------------------------------------*/
bcostm 4:137bb367ba50 39 #ifndef __MX25R6435F_H
bcostm 4:137bb367ba50 40 #define __MX25R6435F_H
bcostm 4:137bb367ba50 41
bcostm 4:137bb367ba50 42 #ifdef __cplusplus
bcostm 4:137bb367ba50 43 extern "C" {
bcostm 4:137bb367ba50 44 #endif
bcostm 4:137bb367ba50 45
bcostm 4:137bb367ba50 46 /* Includes ------------------------------------------------------------------*/
bcostm 4:137bb367ba50 47
bcostm 4:137bb367ba50 48 /** @addtogroup BSP
bcostm 4:137bb367ba50 49 * @{
bcostm 4:137bb367ba50 50 */
bcostm 4:137bb367ba50 51
bcostm 4:137bb367ba50 52 /** @addtogroup Components
bcostm 4:137bb367ba50 53 * @{
bcostm 4:137bb367ba50 54 */
bcostm 4:137bb367ba50 55
bcostm 4:137bb367ba50 56 /** @addtogroup mx25r6435f
bcostm 4:137bb367ba50 57 * @{
bcostm 4:137bb367ba50 58 */
bcostm 4:137bb367ba50 59
bcostm 4:137bb367ba50 60 /** @defgroup MX25R6435F_Exported_Types
bcostm 4:137bb367ba50 61 * @{
bcostm 4:137bb367ba50 62 */
bcostm 4:137bb367ba50 63
bcostm 4:137bb367ba50 64 /**
bcostm 4:137bb367ba50 65 * @}
bcostm 4:137bb367ba50 66 */
bcostm 4:137bb367ba50 67
bcostm 4:137bb367ba50 68 /** @defgroup MX25R6435F_Exported_Constants
bcostm 4:137bb367ba50 69 * @{
bcostm 4:137bb367ba50 70 */
bcostm 4:137bb367ba50 71
bcostm 4:137bb367ba50 72 /**
bcostm 4:137bb367ba50 73 * @brief MX25R6435F Configuration
bcostm 4:137bb367ba50 74 */
bcostm 4:137bb367ba50 75 #define MX25R6435F_FLASH_SIZE 0x800000 /* 64 MBits => 8MBytes */
bcostm 4:137bb367ba50 76 #define MX25R6435F_BLOCK_SIZE 0x10000 /* 128 blocks of 64KBytes */
bcostm 4:137bb367ba50 77 #define MX25R6435F_SUBBLOCK_SIZE 0x8000 /* 256 blocks of 32KBytes */
bcostm 4:137bb367ba50 78 #define MX25R6435F_SECTOR_SIZE 0x1000 /* 2048 sectors of 4kBytes */
bcostm 4:137bb367ba50 79 #define MX25R6435F_PAGE_SIZE 0x100 /* 32768 pages of 256 bytes */
bcostm 4:137bb367ba50 80
bcostm 4:137bb367ba50 81 #define MX25R6435F_DUMMY_CYCLES_READ 8
bcostm 4:137bb367ba50 82 #define MX25R6435F_DUMMY_CYCLES_READ_DUAL 4
bcostm 4:137bb367ba50 83 #define MX25R6435F_DUMMY_CYCLES_READ_QUAD 4
bcostm 4:137bb367ba50 84 #define MX25R6435F_DUMMY_CYCLES_2READ 2
bcostm 4:137bb367ba50 85 #define MX25R6435F_DUMMY_CYCLES_4READ 4
bcostm 4:137bb367ba50 86
bcostm 4:137bb367ba50 87 #define MX25R6435F_ALT_BYTES_PE_MODE 0xA5
bcostm 4:137bb367ba50 88 #define MX25R6435F_ALT_BYTES_NO_PE_MODE 0xAA
bcostm 4:137bb367ba50 89
bcostm 4:137bb367ba50 90 #define MX25R6435F_CHIP_ERASE_MAX_TIME 240000
bcostm 4:137bb367ba50 91 #define MX25R6435F_BLOCK_ERASE_MAX_TIME 3500
bcostm 4:137bb367ba50 92 #define MX25R6435F_SUBBLOCK_ERASE_MAX_TIME 3000
bcostm 4:137bb367ba50 93 #define MX25R6435F_SECTOR_ERASE_MAX_TIME 240
bcostm 4:137bb367ba50 94
bcostm 4:137bb367ba50 95 /**
bcostm 4:137bb367ba50 96 * @brief MX25R6435F Commands
bcostm 4:137bb367ba50 97 */
bcostm 4:137bb367ba50 98 /* Read Operations */
bcostm 4:137bb367ba50 99 #define READ_CMD 0x03
bcostm 4:137bb367ba50 100 #define FAST_READ_CMD 0x0B
bcostm 4:137bb367ba50 101 #define DUAL_OUT_READ_CMD 0x3B
bcostm 4:137bb367ba50 102 #define DUAL_INOUT_READ_CMD 0xBB
bcostm 4:137bb367ba50 103 #define QUAD_OUT_READ_CMD 0x6B
bcostm 4:137bb367ba50 104 #define QUAD_INOUT_READ_CMD 0xEB
bcostm 4:137bb367ba50 105
bcostm 4:137bb367ba50 106 /* Program Operations */
bcostm 4:137bb367ba50 107 #define PAGE_PROG_CMD 0x02
bcostm 4:137bb367ba50 108 #define QUAD_PAGE_PROG_CMD 0x38
bcostm 4:137bb367ba50 109
bcostm 4:137bb367ba50 110 /* Erase Operations */
bcostm 4:137bb367ba50 111 #define SECTOR_ERASE_CMD 0x20
bcostm 4:137bb367ba50 112 #define SUBBLOCK_ERASE_CMD 0x52
bcostm 4:137bb367ba50 113 #define BLOCK_ERASE_CMD 0xD8
bcostm 4:137bb367ba50 114 #define CHIP_ERASE_CMD 0x60
bcostm 4:137bb367ba50 115 #define CHIP_ERASE_CMD_2 0xC7
bcostm 4:137bb367ba50 116
bcostm 4:137bb367ba50 117 #define PROG_ERASE_RESUME_CMD 0x7A
bcostm 4:137bb367ba50 118 #define PROG_ERASE_RESUME_CMD_2 0x30
bcostm 4:137bb367ba50 119 #define PROG_ERASE_SUSPEND_CMD 0x75
bcostm 4:137bb367ba50 120 #define PROG_ERASE_SUSPEND_CMD_2 0xB0
bcostm 4:137bb367ba50 121
bcostm 4:137bb367ba50 122 /* Identification Operations */
bcostm 4:137bb367ba50 123 #define READ_ID_CMD 0x9F
bcostm 4:137bb367ba50 124 #define READ_ELECTRONIC_ID_CMD 0xAB
bcostm 4:137bb367ba50 125 #define READ_ELEC_MANUFACTURER_DEVICE_ID_CMD 0x90
bcostm 4:137bb367ba50 126 #define READ_SERIAL_FLASH_DISCO_PARAM_CMD 0x5A
bcostm 4:137bb367ba50 127
bcostm 4:137bb367ba50 128 /* Write Operations */
bcostm 4:137bb367ba50 129 #define WRITE_ENABLE_CMD 0x06
bcostm 4:137bb367ba50 130 #define WRITE_DISABLE_CMD 0x04
bcostm 4:137bb367ba50 131
bcostm 4:137bb367ba50 132 /* Register Operations */
bcostm 4:137bb367ba50 133 #define READ_STATUS_REG_CMD 0x05
bcostm 4:137bb367ba50 134 #define READ_CFG_REG_CMD 0x15
bcostm 4:137bb367ba50 135 #define WRITE_STATUS_CFG_REG_CMD 0x01
bcostm 4:137bb367ba50 136
bcostm 4:137bb367ba50 137 #define READ_SEC_REG_CMD 0x2B
bcostm 4:137bb367ba50 138 #define WRITE_SEC_REG_CMD 0x2F
bcostm 4:137bb367ba50 139
bcostm 4:137bb367ba50 140 /* Power Down Operations */
bcostm 4:137bb367ba50 141 #define DEEP_POWER_DOWN_CMD 0xB9
bcostm 4:137bb367ba50 142
bcostm 4:137bb367ba50 143 /* Burst Operations */
bcostm 4:137bb367ba50 144 #define SET_BURST_LENGTH_CMD 0xC0
bcostm 4:137bb367ba50 145
bcostm 4:137bb367ba50 146 /* One-Time Programmable Operations */
bcostm 4:137bb367ba50 147 #define ENTER_SECURED_OTP_CMD 0xB1
bcostm 4:137bb367ba50 148 #define EXIT_SECURED_OTP_CMD 0xC1
bcostm 4:137bb367ba50 149
bcostm 4:137bb367ba50 150 /* No Operation */
bcostm 4:137bb367ba50 151 #define NO_OPERATION_CMD 0x00
bcostm 4:137bb367ba50 152
bcostm 4:137bb367ba50 153 /* Reset Operations */
bcostm 4:137bb367ba50 154 #define RESET_ENABLE_CMD 0x66
bcostm 4:137bb367ba50 155 #define RESET_MEMORY_CMD 0x99
bcostm 4:137bb367ba50 156 #define RELEASE_READ_ENHANCED_CMD 0xFF
bcostm 4:137bb367ba50 157
bcostm 4:137bb367ba50 158 /**
bcostm 4:137bb367ba50 159 * @brief MX25R6435F Registers
bcostm 4:137bb367ba50 160 */
bcostm 4:137bb367ba50 161 /* Status Register */
bcostm 4:137bb367ba50 162 #define MX25R6435F_SR_WIP ((uint8_t)0x01) /*!< Write in progress */
bcostm 4:137bb367ba50 163 #define MX25R6435F_SR_WEL ((uint8_t)0x02) /*!< Write enable latch */
bcostm 4:137bb367ba50 164 #define MX25R6435F_SR_BP ((uint8_t)0x3C) /*!< Block protect */
bcostm 4:137bb367ba50 165 #define MX25R6435F_SR_QE ((uint8_t)0x40) /*!< Quad enable */
bcostm 4:137bb367ba50 166 #define MX25R6435F_SR_SRWD ((uint8_t)0x80) /*!< Status register write disable */
bcostm 4:137bb367ba50 167
bcostm 4:137bb367ba50 168 /* Configuration Register 1 */
bcostm 4:137bb367ba50 169 #define MX25R6435F_CR1_TB ((uint8_t)0x08) /*!< Top / bottom */
bcostm 4:137bb367ba50 170
bcostm 4:137bb367ba50 171 /* Configuration Register 2 */
bcostm 4:137bb367ba50 172 #define MX25R6435F_CR2_LH_SWITCH ((uint8_t)0x02) /*!< Low power / high performance switch */
bcostm 4:137bb367ba50 173
bcostm 4:137bb367ba50 174 /* Security Register */
bcostm 4:137bb367ba50 175 #define MX25R6435F_SECR_SOI ((uint8_t)0x01) /*!< Secured OTP indicator */
bcostm 4:137bb367ba50 176 #define MX25R6435F_SECR_LDSO ((uint8_t)0x02) /*!< Lock-down secured OTP */
bcostm 4:137bb367ba50 177 #define MX25R6435F_SECR_PSB ((uint8_t)0x04) /*!< Program suspend bit */
bcostm 4:137bb367ba50 178 #define MX25R6435F_SECR_ESB ((uint8_t)0x08) /*!< Erase suspend bit */
bcostm 4:137bb367ba50 179 #define MX25R6435F_SECR_P_FAIL ((uint8_t)0x20) /*!< Program fail flag */
bcostm 4:137bb367ba50 180 #define MX25R6435F_SECR_E_FAIL ((uint8_t)0x40) /*!< Erase fail flag */
bcostm 4:137bb367ba50 181
bcostm 4:137bb367ba50 182 /**
bcostm 4:137bb367ba50 183 * @}
bcostm 4:137bb367ba50 184 */
bcostm 4:137bb367ba50 185
bcostm 4:137bb367ba50 186 /** @defgroup MX25R6435F_Exported_Functions
bcostm 4:137bb367ba50 187 * @{
bcostm 4:137bb367ba50 188 */
bcostm 4:137bb367ba50 189 /**
bcostm 4:137bb367ba50 190 * @}
bcostm 4:137bb367ba50 191 */
bcostm 4:137bb367ba50 192
bcostm 4:137bb367ba50 193 /**
bcostm 4:137bb367ba50 194 * @}
bcostm 4:137bb367ba50 195 */
bcostm 4:137bb367ba50 196
bcostm 4:137bb367ba50 197 /**
bcostm 4:137bb367ba50 198 * @}
bcostm 4:137bb367ba50 199 */
bcostm 4:137bb367ba50 200
bcostm 4:137bb367ba50 201 /**
bcostm 4:137bb367ba50 202 * @}
bcostm 4:137bb367ba50 203 */
bcostm 4:137bb367ba50 204
bcostm 4:137bb367ba50 205 #ifdef __cplusplus
bcostm 4:137bb367ba50 206 }
bcostm 4:137bb367ba50 207 #endif
bcostm 4:137bb367ba50 208
bcostm 4:137bb367ba50 209 #endif /* __MX25R6435F_H */
bcostm 4:137bb367ba50 210
bcostm 4:137bb367ba50 211 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/