ql_boot_spi_flash.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /** @file
  2. ql_boot_spi_flash.h
  3. @brief
  4. This file is used to define boot spi flash 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. 08/12/2020 Neo Init version
  17. =================================================================*/
  18. #ifndef QL_BOOT_SPI_FLASH_H
  19. #define QL_BOOT_SPI_FLASH_H
  20. #include "boot_spi_flash.h"
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #define QL_COMPONENT_STORAGE_INTERNALFLASH 0x8304
  25. /*========================================================================
  26. * Enumeration Definition
  27. *========================================================================*/
  28. typedef enum
  29. {
  30. QL_BOOT_SPI_FLASH_SUCCESS = 0,
  31. QL_BOOT_SPI_FLASH_ERROR = 1 | ( QL_COMPONENT_STORAGE_INTERNALFLASH << 16),
  32. QL_BOOT_SPI_FLASH_READ_ERROR,
  33. QL_BOOT_SPI_FLASH_WRITE_ERROR,
  34. QL_BOOT_SPI_FLASH_ERASE_ERROR,
  35. QL_BOOT_SPI_FLASH_PARAM_NULL_ERROR
  36. }ql_errcode_boot_spi_flash_e;
  37. /*========================================================================
  38. * function Definition
  39. *========================================================================*/
  40. ql_errcode_boot_spi_flash_e ql_boot_spi_flash_init(bootSpiFlash_t* boot_spi);
  41. ql_errcode_boot_spi_flash_e ql_boot_spi_flash_read(bootSpiFlash_t *boot_spi, uint32_t offset, void *data, size_t size);
  42. ql_errcode_boot_spi_flash_e ql_boot_spi_flash_write(bootSpiFlash_t *boot_spi, uint32_t offset, const void *data, size_t size);
  43. ql_errcode_boot_spi_flash_e ql_boot_spi_flash_erase_sector(bootSpiFlash_t *boot_spi, uint32_t offset, size_t size);
  44. void ql_boot_spi_flash_demo(bootSpiFlash_t *boot_spi);
  45. #ifdef __cplusplus
  46. } /*"C" */
  47. #endif
  48. #endif /* QL_BOOT_SPI_FLASH_H */