Farnell-Element14 Bologna IOT Team / BSP_B-L475E-IOT01

Dependencies:   VL53L0X

Fork of BSP_B-L475E-IOT01 by ST

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mx25r6435f.h Source File

mx25r6435f.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    mx25r6435f.h
00004   * @author  MCD Application Team
00005   * @version V1.0.0
00006   * @date    17-February-2017
00007   * @brief   This file contains all the description of the MX25R6435F QSPI memory.
00008   ******************************************************************************
00009   * @attention
00010   *
00011   * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
00012   *
00013   * Redistribution and use in source and binary forms, with or without modification,
00014   * are permitted provided that the following conditions are met:
00015   *   1. Redistributions of source code must retain the above copyright notice,
00016   *      this list of conditions and the following disclaimer.
00017   *   2. Redistributions in binary form must reproduce the above copyright notice,
00018   *      this list of conditions and the following disclaimer in the documentation
00019   *      and/or other materials provided with the distribution.
00020   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00021   *      may be used to endorse or promote products derived from this software
00022   *      without specific prior written permission.
00023   *
00024   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00025   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00026   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00027   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00028   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00029   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00030   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00032   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00033   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034   *
00035   ******************************************************************************
00036   */ 
00037 
00038 /* Define to prevent recursive inclusion -------------------------------------*/
00039 #ifndef __MX25R6435F_H
00040 #define __MX25R6435F_H
00041 
00042 #ifdef __cplusplus
00043  extern "C" {
00044 #endif 
00045 
00046 /* Includes ------------------------------------------------------------------*/
00047 
00048 /** @addtogroup BSP
00049   * @{
00050   */ 
00051 
00052 /** @addtogroup Components
00053   * @{
00054   */ 
00055   
00056 /** @addtogroup mx25r6435f
00057   * @{
00058   */
00059 
00060 /** @defgroup MX25R6435F_Exported_Types
00061   * @{
00062   */
00063    
00064 /**
00065   * @}
00066   */ 
00067 
00068 /** @defgroup MX25R6435F_Exported_Constants
00069   * @{
00070   */
00071    
00072 /** 
00073   * @brief  MX25R6435F Configuration  
00074   */  
00075 #define MX25R6435F_FLASH_SIZE                0x800000  /* 64 MBits => 8MBytes */
00076 #define MX25R6435F_BLOCK_SIZE                0x10000   /* 128 blocks of 64KBytes */
00077 #define MX25R6435F_SUBBLOCK_SIZE             0x8000    /* 256 blocks of 32KBytes */
00078 #define MX25R6435F_SECTOR_SIZE               0x1000    /* 2048 sectors of 4kBytes */
00079 #define MX25R6435F_PAGE_SIZE                 0x100     /* 32768 pages of 256 bytes */
00080 
00081 #define MX25R6435F_DUMMY_CYCLES_READ         8
00082 #define MX25R6435F_DUMMY_CYCLES_READ_DUAL    4
00083 #define MX25R6435F_DUMMY_CYCLES_READ_QUAD    4
00084 #define MX25R6435F_DUMMY_CYCLES_2READ        2
00085 #define MX25R6435F_DUMMY_CYCLES_4READ        4
00086 
00087 #define MX25R6435F_ALT_BYTES_PE_MODE         0xA5
00088 #define MX25R6435F_ALT_BYTES_NO_PE_MODE      0xAA
00089 
00090 #define MX25R6435F_CHIP_ERASE_MAX_TIME       240000
00091 #define MX25R6435F_BLOCK_ERASE_MAX_TIME      3500
00092 #define MX25R6435F_SUBBLOCK_ERASE_MAX_TIME   3000
00093 #define MX25R6435F_SECTOR_ERASE_MAX_TIME     240
00094 
00095 /** 
00096   * @brief  MX25R6435F Commands  
00097   */  
00098 /* Read Operations */
00099 #define READ_CMD                             0x03
00100 #define FAST_READ_CMD                        0x0B
00101 #define DUAL_OUT_READ_CMD                    0x3B
00102 #define DUAL_INOUT_READ_CMD                  0xBB
00103 #define QUAD_OUT_READ_CMD                    0x6B
00104 #define QUAD_INOUT_READ_CMD                  0xEB
00105 
00106 /* Program Operations */
00107 #define PAGE_PROG_CMD                        0x02
00108 #define QUAD_PAGE_PROG_CMD                   0x38
00109 
00110 /* Erase Operations */
00111 #define SECTOR_ERASE_CMD                     0x20
00112 #define SUBBLOCK_ERASE_CMD                   0x52
00113 #define BLOCK_ERASE_CMD                      0xD8
00114 #define CHIP_ERASE_CMD                       0x60
00115 #define CHIP_ERASE_CMD_2                     0xC7
00116 
00117 #define PROG_ERASE_RESUME_CMD                0x7A
00118 #define PROG_ERASE_RESUME_CMD_2              0x30
00119 #define PROG_ERASE_SUSPEND_CMD               0x75
00120 #define PROG_ERASE_SUSPEND_CMD_2             0xB0
00121 
00122 /* Identification Operations */
00123 #define READ_ID_CMD                          0x9F
00124 #define READ_ELECTRONIC_ID_CMD               0xAB
00125 #define READ_ELEC_MANUFACTURER_DEVICE_ID_CMD 0x90
00126 #define READ_SERIAL_FLASH_DISCO_PARAM_CMD    0x5A
00127 
00128 /* Write Operations */
00129 #define WRITE_ENABLE_CMD                     0x06
00130 #define WRITE_DISABLE_CMD                    0x04
00131 
00132 /* Register Operations */
00133 #define READ_STATUS_REG_CMD                  0x05
00134 #define READ_CFG_REG_CMD                     0x15
00135 #define WRITE_STATUS_CFG_REG_CMD             0x01
00136 
00137 #define READ_SEC_REG_CMD                     0x2B
00138 #define WRITE_SEC_REG_CMD                    0x2F
00139 
00140 /* Power Down Operations */
00141 #define DEEP_POWER_DOWN_CMD                  0xB9
00142 
00143 /* Burst Operations */
00144 #define SET_BURST_LENGTH_CMD                 0xC0
00145 
00146 /* One-Time Programmable Operations */
00147 #define ENTER_SECURED_OTP_CMD                0xB1
00148 #define EXIT_SECURED_OTP_CMD                 0xC1
00149 
00150 /* No Operation */
00151 #define NO_OPERATION_CMD                     0x00
00152 
00153 /* Reset Operations */
00154 #define RESET_ENABLE_CMD                     0x66
00155 #define RESET_MEMORY_CMD                     0x99
00156 #define RELEASE_READ_ENHANCED_CMD            0xFF
00157 
00158 /** 
00159   * @brief  MX25R6435F Registers  
00160   */ 
00161 /* Status Register */
00162 #define MX25R6435F_SR_WIP                    ((uint8_t)0x01)    /*!< Write in progress */
00163 #define MX25R6435F_SR_WEL                    ((uint8_t)0x02)    /*!< Write enable latch */
00164 #define MX25R6435F_SR_BP                     ((uint8_t)0x3C)    /*!< Block protect */
00165 #define MX25R6435F_SR_QE                     ((uint8_t)0x40)    /*!< Quad enable */
00166 #define MX25R6435F_SR_SRWD                   ((uint8_t)0x80)    /*!< Status register write disable */
00167 
00168 /* Configuration Register 1 */
00169 #define MX25R6435F_CR1_TB                    ((uint8_t)0x08)    /*!< Top / bottom */
00170 
00171 /* Configuration Register 2 */
00172 #define MX25R6435F_CR2_LH_SWITCH             ((uint8_t)0x02)    /*!< Low power / high performance switch */
00173 
00174 /* Security Register */
00175 #define MX25R6435F_SECR_SOI                  ((uint8_t)0x01)    /*!< Secured OTP indicator */
00176 #define MX25R6435F_SECR_LDSO                 ((uint8_t)0x02)    /*!< Lock-down secured OTP */
00177 #define MX25R6435F_SECR_PSB                  ((uint8_t)0x04)    /*!< Program suspend bit */
00178 #define MX25R6435F_SECR_ESB                  ((uint8_t)0x08)    /*!< Erase suspend bit */
00179 #define MX25R6435F_SECR_P_FAIL               ((uint8_t)0x20)    /*!< Program fail flag */
00180 #define MX25R6435F_SECR_E_FAIL               ((uint8_t)0x40)    /*!< Erase fail flag */
00181 
00182 /**
00183   * @}
00184   */
00185   
00186 /** @defgroup MX25R6435F_Exported_Functions
00187   * @{
00188   */ 
00189 /**
00190   * @}
00191   */ 
00192 
00193 /**
00194   * @}
00195   */ 
00196 
00197 /**
00198   * @}
00199   */ 
00200 
00201 /**
00202   * @}
00203   */
00204   
00205 #ifdef __cplusplus
00206 }
00207 #endif
00208 
00209 #endif /* __MX25R6435F_H */
00210 
00211 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/