quec_spi_nor_flash_prop.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /** @file
  2. quec_spi_nor_flash_prop.h
  3. @brief
  4. This file is used to define spi NOR FLASH api for open Quectel Project.
  5. */
  6. /*================================================================
  7. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  8. Quectel Wireless Solution Proprietary and Confidential.
  9. =================================================================*/
  10. /*=================================================================
  11. EDIT HISTORY FOR MODULE
  12. This section contains comments describing changes made to the module.
  13. Notice that changes are listed in reverse chronological order.
  14. WHEN WHO WHAT, WHERE, WHY
  15. ------------ ------- -------------------------------------------------------------------------------
  16. =================================================================*/
  17. #include "quec_spi_nor_flash_prop.h"
  18. /* 4-line SPI NOR Flash supported model list,can add by yourself*/
  19. static quec_spi_nor_flash_info_s quec_spi_nor_flash_props[] =
  20. {
  21. //You can cut out it by defining macros
  22. //#define DISABLE_GD25LE64E_C
  23. #ifndef DISABLE_GD25LE64E_C
  24. {
  25. // GD25LE64E
  26. // GD25LE64C
  27. .mid = 0x1760c8,
  28. .capacity = 0x800000,
  29. .mode = QUEC_NOR_FLASH_MODE_16BIT,
  30. .mount_start_addr = 0x0000000,
  31. .mount_size = 0x800000,
  32. .pb_size = 0x200,
  33. },
  34. #endif
  35. #ifndef DISABLE_XM25QU64B
  36. {
  37. // XM25QU64B
  38. .mid = 0x175020,
  39. .capacity = 0x800000,
  40. .mode = QUEC_NOR_FLASH_MODE_8BIT,
  41. .mount_start_addr = 0x0000000,
  42. .mount_size = 0x800000,
  43. .pb_size = 0x200,
  44. },
  45. #endif
  46. #ifndef DISABLE_XM25QU128C
  47. {
  48. // XM25QU128C
  49. .mid = 0x184120,
  50. .capacity = 0x1000000,
  51. .mode = QUEC_NOR_FLASH_MODE_16BIT,
  52. .mount_start_addr = 0x0000000,
  53. .mount_size = 0x1000000,
  54. .pb_size = 0x200,
  55. },
  56. #endif
  57. #ifndef DISABLE_W25Q64JWSSIM
  58. {
  59. // W25Q64JWSSIM
  60. .mid = 0x1780ef,
  61. .capacity = 0x800000,
  62. .mode = QUEC_NOR_FLASH_MODE_16BIT,
  63. .mount_start_addr = 0x0000000,
  64. .mount_size = 0x800000,
  65. .pb_size = 0x200,
  66. },
  67. #endif
  68. #ifndef DISABLE_W25Q256JWFQ
  69. {
  70. // W25Q256JWFQ
  71. .mid = 0x1960ef,
  72. .capacity = 0x2000000,
  73. .mode = QUEC_NOR_FLASH_MODE_8BIT,
  74. .mount_start_addr = 0x0000000,
  75. .mount_size = 0x2000000,
  76. .pb_size = 0x400, //256mbits容量,愿意空间换时间,加快扫描块的时间。块变大,数量变少,因此时间变快。
  77. },
  78. #endif
  79. };
  80. static unsigned int quec_spi_nor_flash_prop_len = sizeof(quec_spi_nor_flash_props)/sizeof(quec_spi_nor_flash_props[0]);
  81. bool quec_spi_nor_props_init(quec_spi_nor_flash_info_s **props_ptr,unsigned int *props_len)
  82. {
  83. if(props_ptr == NULL || props_len == NULL)
  84. {
  85. return false;
  86. }
  87. *props_ptr = quec_spi_nor_flash_props;
  88. *props_len = quec_spi_nor_flash_prop_len;
  89. return true;
  90. }