mx25r6435f.h 5.9 KB

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