quec_boot_sdmmc.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /** @file
  2. quec_boot_uart.h
  3. @brief
  4. This file is used to define boot uart api for different 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. 24/01/2021 Neo Init version
  17. =================================================================*/
  18. #ifndef QUEC_BOOT_SDMMC_H
  19. #define QUEC_BOOT_SDMMC_H
  20. #include "quec_boot_pff.h"
  21. #include "quec_proj_config.h"
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /*===========================================================================
  26. * Macro Definition
  27. ===========================================================================*/
  28. #define TCARD_SECTOR_SIZE (512)
  29. #define TCARD_CACHE_SECTOR_COUNT (64)
  30. #define SDMMC_OPT_BLOCK_COUNT (1)
  31. #define QUEC_ECHO_ENBLE 0
  32. #define QUEC_MINI_SD_INIT 1 //剪裁boot空间
  33. #define QL_BOOT_SDMMC_CLK_FREQ_SDHC 50000000 //50MHz
  34. #define QL_BOOT_SDMMC_CLK_FREQ_SD 25000000 //25MHz
  35. /*===========================================================================
  36. * Enum
  37. ===========================================================================*/
  38. typedef struct
  39. {
  40. uint32_t sdmmc_clk; //sdmmc时钟频率,400000 <= clk <= 50000000,默认25MHz
  41. uint32_t power_mv; //sdmmc电压,SD卡默认3.2v,emmc默认1.8v
  42. } ql_boot_sdmmc_cfg_t;
  43. /*===========================================================================
  44. * Functions declaration
  45. ===========================================================================*/
  46. //sdmmc1
  47. #if (defined CONFIG_QUEC_PROJECT_FEATURE_BOOT_SDMMC)
  48. int quec_boot_sdmmc_init(ql_boot_fat_mount_pt_e pt);
  49. int quec_boot_sdmmc_destroy();
  50. #ifdef CONFIG_QUEC_PROJECT_FEATURE_BOOT_FAT_RW
  51. int quec_boot_sdmmc_init_ex(ql_boot_fat_mount_pt_e pt);
  52. #endif
  53. #elif (defined CONFIG_QUEC_PROJECT_FEATURE_BOOT_EMMC)
  54. int quec_boot_emmc_init(ql_boot_fat_mount_pt_e pt);
  55. int quec_boot_emmc_destroy();
  56. #ifdef CONFIG_QUEC_PROJECT_FEATURE_BOOT_FAT_RW
  57. int quec_boot_emmc_init_ex(ql_boot_fat_mount_pt_e pt);
  58. #endif
  59. //sdmmc2
  60. #elif (defined CONFIG_QUEC_PROJECT_FEATURE_BOOT_SDMMC2)
  61. int quec_boot_sdmmc2_init(ql_boot_fat_mount_pt_e pt);
  62. int quec_boot_sdmmc2_destroy();
  63. #ifdef CONFIG_QUEC_PROJECT_FEATURE_BOOT_FAT_RW
  64. int quec_boot_sdmmc2_init_ex(ql_boot_fat_mount_pt_e pt);
  65. #endif
  66. #elif (defined CONFIG_QUEC_PROJECT_FEATURE_BOOT_EMMC2)
  67. int quec_boot_emmc2_init(ql_boot_fat_mount_pt_e pt);
  68. int quec_boot_emmc2_destroy();
  69. #ifdef CONFIG_QUEC_PROJECT_FEATURE_BOOT_FAT_RW
  70. int quec_boot_emmc2_init_ex(ql_boot_fat_mount_pt_e pt);
  71. #endif
  72. #endif
  73. #ifdef __cplusplus
  74. } /*"C" */
  75. #endif
  76. #endif /* QUEC_BOOT_SDMMC_H */