drv_spiflash.c 690 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2019-02-15 wangyq the first version
  9. * 2019-11-01 wangyq update libraries
  10. */
  11. #include "board.h"
  12. #include <rtthread.h>
  13. #if defined(BSP_USING_SPI_FLASH)
  14. #include "spi_flash.h"
  15. #include "drv_spiflash.h"
  16. #include "spi_flash_sfud.h"
  17. #include "drv_spi.h"
  18. int rt_hw_spi_flash_init(void)
  19. {
  20. if (RT_NULL == rt_sfud_flash_probe(ES_DEVICE_NAME_SPI_FALSH_DEV, ES_DEVICE_NAME_SPI_DEV))
  21. {
  22. return -RT_ERROR;
  23. };
  24. return RT_EOK;
  25. }
  26. INIT_COMPONENT_EXPORT(rt_hw_spi_flash_init);
  27. #endif