BSP driver for DISCO_L496AG

Dependents:   DISCO_L496AG-LCD-prova_1 DISCO_L496AG-LCD-prova_2 DISCO_L496AG-LCD-demo DISCO_L496AG-SRAM-demo

Committer:
Jerome Coutant
Date:
Wed Nov 20 16:48:24 2019 +0100
Revision:
2:106c7b82e064
Parent:
0:d83f1c8ca282
Update BSP files with CubeL4 V1.14.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:d83f1c8ca282 1 /**
bcostm 0:d83f1c8ca282 2 ******************************************************************************
bcostm 0:d83f1c8ca282 3 * @file mx25r6435f.h
bcostm 0:d83f1c8ca282 4 * @author MCD Application Team
bcostm 0:d83f1c8ca282 5 * @brief This file contains all the description of the MX25R6435F QSPI memory.
bcostm 0:d83f1c8ca282 6 ******************************************************************************
bcostm 0:d83f1c8ca282 7 * @attention
bcostm 0:d83f1c8ca282 8 *
Jerome Coutant 2:106c7b82e064 9 * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
Jerome Coutant 2:106c7b82e064 10 * All rights reserved.</center></h2>
bcostm 0:d83f1c8ca282 11 *
Jerome Coutant 2:106c7b82e064 12 * This software component is licensed by ST under BSD 3-Clause license,
Jerome Coutant 2:106c7b82e064 13 * the "License"; You may not use this file except in compliance with the
Jerome Coutant 2:106c7b82e064 14 * License. You may obtain a copy of the License at:
Jerome Coutant 2:106c7b82e064 15 * opensource.org/licenses/BSD-3-Clause
bcostm 0:d83f1c8ca282 16 *
bcostm 0:d83f1c8ca282 17 ******************************************************************************
bcostm 0:d83f1c8ca282 18 */
bcostm 0:d83f1c8ca282 19
bcostm 0:d83f1c8ca282 20 /* Define to prevent recursive inclusion -------------------------------------*/
bcostm 0:d83f1c8ca282 21 #ifndef __MX25R6435F_H
bcostm 0:d83f1c8ca282 22 #define __MX25R6435F_H
bcostm 0:d83f1c8ca282 23
bcostm 0:d83f1c8ca282 24 #ifdef __cplusplus
bcostm 0:d83f1c8ca282 25 extern "C" {
bcostm 0:d83f1c8ca282 26 #endif
bcostm 0:d83f1c8ca282 27
bcostm 0:d83f1c8ca282 28 /* Includes ------------------------------------------------------------------*/
bcostm 0:d83f1c8ca282 29
bcostm 0:d83f1c8ca282 30 /** @addtogroup BSP
bcostm 0:d83f1c8ca282 31 * @{
bcostm 0:d83f1c8ca282 32 */
bcostm 0:d83f1c8ca282 33
bcostm 0:d83f1c8ca282 34 /** @addtogroup Components
bcostm 0:d83f1c8ca282 35 * @{
bcostm 0:d83f1c8ca282 36 */
bcostm 0:d83f1c8ca282 37
bcostm 0:d83f1c8ca282 38 /** @addtogroup mx25r6435f
bcostm 0:d83f1c8ca282 39 * @{
bcostm 0:d83f1c8ca282 40 */
bcostm 0:d83f1c8ca282 41
bcostm 0:d83f1c8ca282 42 /** @defgroup MX25R6435F_Exported_Types
bcostm 0:d83f1c8ca282 43 * @{
bcostm 0:d83f1c8ca282 44 */
bcostm 0:d83f1c8ca282 45
bcostm 0:d83f1c8ca282 46 /**
bcostm 0:d83f1c8ca282 47 * @}
bcostm 0:d83f1c8ca282 48 */
bcostm 0:d83f1c8ca282 49
bcostm 0:d83f1c8ca282 50 /** @defgroup MX25R6435F_Exported_Constants
bcostm 0:d83f1c8ca282 51 * @{
bcostm 0:d83f1c8ca282 52 */
bcostm 0:d83f1c8ca282 53
bcostm 0:d83f1c8ca282 54 /**
bcostm 0:d83f1c8ca282 55 * @brief MX25R6435F Configuration
bcostm 0:d83f1c8ca282 56 */
bcostm 0:d83f1c8ca282 57 #define MX25R6435F_FLASH_SIZE 0x800000 /* 64 MBits => 8MBytes */
bcostm 0:d83f1c8ca282 58 #define MX25R6435F_BLOCK_SIZE 0x10000 /* 128 blocks of 64KBytes */
bcostm 0:d83f1c8ca282 59 #define MX25R6435F_SUBBLOCK_SIZE 0x8000 /* 256 blocks of 32KBytes */
bcostm 0:d83f1c8ca282 60 #define MX25R6435F_SECTOR_SIZE 0x1000 /* 2048 sectors of 4kBytes */
bcostm 0:d83f1c8ca282 61 #define MX25R6435F_PAGE_SIZE 0x100 /* 32768 pages of 256 bytes */
bcostm 0:d83f1c8ca282 62
bcostm 0:d83f1c8ca282 63 #define MX25R6435F_DUMMY_CYCLES_READ 8
bcostm 0:d83f1c8ca282 64 #define MX25R6435F_DUMMY_CYCLES_READ_DUAL 4
bcostm 0:d83f1c8ca282 65 #define MX25R6435F_DUMMY_CYCLES_READ_QUAD 4
bcostm 0:d83f1c8ca282 66 #define MX25R6435F_DUMMY_CYCLES_2READ 2
bcostm 0:d83f1c8ca282 67 #define MX25R6435F_DUMMY_CYCLES_4READ 4
bcostm 0:d83f1c8ca282 68
bcostm 0:d83f1c8ca282 69 #define MX25R6435F_ALT_BYTES_PE_MODE 0xA5
bcostm 0:d83f1c8ca282 70 #define MX25R6435F_ALT_BYTES_NO_PE_MODE 0xAA
bcostm 0:d83f1c8ca282 71
bcostm 0:d83f1c8ca282 72 #define MX25R6435F_CHIP_ERASE_MAX_TIME 240000
bcostm 0:d83f1c8ca282 73 #define MX25R6435F_BLOCK_ERASE_MAX_TIME 3500
bcostm 0:d83f1c8ca282 74 #define MX25R6435F_SUBBLOCK_ERASE_MAX_TIME 3000
bcostm 0:d83f1c8ca282 75 #define MX25R6435F_SECTOR_ERASE_MAX_TIME 240
bcostm 0:d83f1c8ca282 76
bcostm 0:d83f1c8ca282 77 /**
bcostm 0:d83f1c8ca282 78 * @brief MX25R6435F Commands
bcostm 0:d83f1c8ca282 79 */
bcostm 0:d83f1c8ca282 80 /* Read Operations */
bcostm 0:d83f1c8ca282 81 #define READ_CMD 0x03
bcostm 0:d83f1c8ca282 82 #define FAST_READ_CMD 0x0B
bcostm 0:d83f1c8ca282 83 #define DUAL_OUT_READ_CMD 0x3B
bcostm 0:d83f1c8ca282 84 #define DUAL_INOUT_READ_CMD 0xBB
bcostm 0:d83f1c8ca282 85 #define QUAD_OUT_READ_CMD 0x6B
bcostm 0:d83f1c8ca282 86 #define QUAD_INOUT_READ_CMD 0xEB
bcostm 0:d83f1c8ca282 87
bcostm 0:d83f1c8ca282 88 /* Program Operations */
bcostm 0:d83f1c8ca282 89 #define PAGE_PROG_CMD 0x02
bcostm 0:d83f1c8ca282 90 #define QUAD_PAGE_PROG_CMD 0x38
bcostm 0:d83f1c8ca282 91
bcostm 0:d83f1c8ca282 92 /* Erase Operations */
bcostm 0:d83f1c8ca282 93 #define SECTOR_ERASE_CMD 0x20
bcostm 0:d83f1c8ca282 94 #define SUBBLOCK_ERASE_CMD 0x52
bcostm 0:d83f1c8ca282 95 #define BLOCK_ERASE_CMD 0xD8
bcostm 0:d83f1c8ca282 96 #define CHIP_ERASE_CMD 0x60
bcostm 0:d83f1c8ca282 97 #define CHIP_ERASE_CMD_2 0xC7
bcostm 0:d83f1c8ca282 98
bcostm 0:d83f1c8ca282 99 #define PROG_ERASE_RESUME_CMD 0x7A
bcostm 0:d83f1c8ca282 100 #define PROG_ERASE_RESUME_CMD_2 0x30
bcostm 0:d83f1c8ca282 101 #define PROG_ERASE_SUSPEND_CMD 0x75
bcostm 0:d83f1c8ca282 102 #define PROG_ERASE_SUSPEND_CMD_2 0xB0
bcostm 0:d83f1c8ca282 103
bcostm 0:d83f1c8ca282 104 /* Identification Operations */
bcostm 0:d83f1c8ca282 105 #define READ_ID_CMD 0x9F
bcostm 0:d83f1c8ca282 106 #define READ_ELECTRONIC_ID_CMD 0xAB
bcostm 0:d83f1c8ca282 107 #define READ_ELEC_MANUFACTURER_DEVICE_ID_CMD 0x90
bcostm 0:d83f1c8ca282 108 #define READ_SERIAL_FLASH_DISCO_PARAM_CMD 0x5A
bcostm 0:d83f1c8ca282 109
bcostm 0:d83f1c8ca282 110 /* Write Operations */
bcostm 0:d83f1c8ca282 111 #define WRITE_ENABLE_CMD 0x06
bcostm 0:d83f1c8ca282 112 #define WRITE_DISABLE_CMD 0x04
bcostm 0:d83f1c8ca282 113
bcostm 0:d83f1c8ca282 114 /* Register Operations */
bcostm 0:d83f1c8ca282 115 #define READ_STATUS_REG_CMD 0x05
bcostm 0:d83f1c8ca282 116 #define READ_CFG_REG_CMD 0x15
bcostm 0:d83f1c8ca282 117 #define WRITE_STATUS_CFG_REG_CMD 0x01
bcostm 0:d83f1c8ca282 118
bcostm 0:d83f1c8ca282 119 #define READ_SEC_REG_CMD 0x2B
bcostm 0:d83f1c8ca282 120 #define WRITE_SEC_REG_CMD 0x2F
bcostm 0:d83f1c8ca282 121
bcostm 0:d83f1c8ca282 122 /* Power Down Operations */
bcostm 0:d83f1c8ca282 123 #define DEEP_POWER_DOWN_CMD 0xB9
bcostm 0:d83f1c8ca282 124
bcostm 0:d83f1c8ca282 125 /* Burst Operations */
bcostm 0:d83f1c8ca282 126 #define SET_BURST_LENGTH_CMD 0xC0
bcostm 0:d83f1c8ca282 127
bcostm 0:d83f1c8ca282 128 /* One-Time Programmable Operations */
bcostm 0:d83f1c8ca282 129 #define ENTER_SECURED_OTP_CMD 0xB1
bcostm 0:d83f1c8ca282 130 #define EXIT_SECURED_OTP_CMD 0xC1
bcostm 0:d83f1c8ca282 131
bcostm 0:d83f1c8ca282 132 /* No Operation */
bcostm 0:d83f1c8ca282 133 #define NO_OPERATION_CMD 0x00
bcostm 0:d83f1c8ca282 134
bcostm 0:d83f1c8ca282 135 /* Reset Operations */
bcostm 0:d83f1c8ca282 136 #define RESET_ENABLE_CMD 0x66
bcostm 0:d83f1c8ca282 137 #define RESET_MEMORY_CMD 0x99
bcostm 0:d83f1c8ca282 138 #define RELEASE_READ_ENHANCED_CMD 0xFF
bcostm 0:d83f1c8ca282 139
bcostm 0:d83f1c8ca282 140 /**
bcostm 0:d83f1c8ca282 141 * @brief MX25R6435F Registers
bcostm 0:d83f1c8ca282 142 */
bcostm 0:d83f1c8ca282 143 /* Status Register */
bcostm 0:d83f1c8ca282 144 #define MX25R6435F_SR_WIP ((uint8_t)0x01) /*!< Write in progress */
bcostm 0:d83f1c8ca282 145 #define MX25R6435F_SR_WEL ((uint8_t)0x02) /*!< Write enable latch */
bcostm 0:d83f1c8ca282 146 #define MX25R6435F_SR_BP ((uint8_t)0x3C) /*!< Block protect */
bcostm 0:d83f1c8ca282 147 #define MX25R6435F_SR_QE ((uint8_t)0x40) /*!< Quad enable */
bcostm 0:d83f1c8ca282 148 #define MX25R6435F_SR_SRWD ((uint8_t)0x80) /*!< Status register write disable */
bcostm 0:d83f1c8ca282 149
bcostm 0:d83f1c8ca282 150 /* Configuration Register 1 */
bcostm 0:d83f1c8ca282 151 #define MX25R6435F_CR1_TB ((uint8_t)0x08) /*!< Top / bottom */
bcostm 0:d83f1c8ca282 152
bcostm 0:d83f1c8ca282 153 /* Configuration Register 2 */
bcostm 0:d83f1c8ca282 154 #define MX25R6435F_CR2_LH_SWITCH ((uint8_t)0x02) /*!< Low power / high performance switch */
bcostm 0:d83f1c8ca282 155
bcostm 0:d83f1c8ca282 156 /* Security Register */
bcostm 0:d83f1c8ca282 157 #define MX25R6435F_SECR_SOI ((uint8_t)0x01) /*!< Secured OTP indicator */
bcostm 0:d83f1c8ca282 158 #define MX25R6435F_SECR_LDSO ((uint8_t)0x02) /*!< Lock-down secured OTP */
bcostm 0:d83f1c8ca282 159 #define MX25R6435F_SECR_PSB ((uint8_t)0x04) /*!< Program suspend bit */
bcostm 0:d83f1c8ca282 160 #define MX25R6435F_SECR_ESB ((uint8_t)0x08) /*!< Erase suspend bit */
bcostm 0:d83f1c8ca282 161 #define MX25R6435F_SECR_P_FAIL ((uint8_t)0x20) /*!< Program fail flag */
bcostm 0:d83f1c8ca282 162 #define MX25R6435F_SECR_E_FAIL ((uint8_t)0x40) /*!< Erase fail flag */
bcostm 0:d83f1c8ca282 163
bcostm 0:d83f1c8ca282 164 /**
bcostm 0:d83f1c8ca282 165 * @}
bcostm 0:d83f1c8ca282 166 */
bcostm 0:d83f1c8ca282 167
bcostm 0:d83f1c8ca282 168 /** @defgroup MX25R6435F_Exported_Functions
bcostm 0:d83f1c8ca282 169 * @{
bcostm 0:d83f1c8ca282 170 */
bcostm 0:d83f1c8ca282 171 /**
bcostm 0:d83f1c8ca282 172 * @}
bcostm 0:d83f1c8ca282 173 */
bcostm 0:d83f1c8ca282 174
bcostm 0:d83f1c8ca282 175 /**
bcostm 0:d83f1c8ca282 176 * @}
bcostm 0:d83f1c8ca282 177 */
bcostm 0:d83f1c8ca282 178
bcostm 0:d83f1c8ca282 179 /**
bcostm 0:d83f1c8ca282 180 * @}
bcostm 0:d83f1c8ca282 181 */
bcostm 0:d83f1c8ca282 182
bcostm 0:d83f1c8ca282 183 /**
bcostm 0:d83f1c8ca282 184 * @}
bcostm 0:d83f1c8ca282 185 */
bcostm 0:d83f1c8ca282 186
bcostm 0:d83f1c8ca282 187 #ifdef __cplusplus
bcostm 0:d83f1c8ca282 188 }
bcostm 0:d83f1c8ca282 189 #endif
bcostm 0:d83f1c8ca282 190
bcostm 0:d83f1c8ca282 191 #endif /* __MX25R6435F_H */
bcostm 0:d83f1c8ca282 192
bcostm 0:d83f1c8ca282 193 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/