drv_spiflash.c 685 B

1234567891011121314151617181920212223242526272829303132
  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-03-19 wangyq the first version
  9. * 2019-11-01 wangyq update libraries
  10. */
  11. #include <rtthread.h>
  12. #include "spi_flash.h"
  13. #include "drv_spiflash.h"
  14. #include "spi_flash_sfud.h"
  15. #include "drv_spi.h"
  16. #if defined(BSP_USING_SPI_FLASH)
  17. int rt_hw_spi_flash_init(void)
  18. {
  19. es32f0_spi_device_attach(50, "spi0", "spi00");
  20. if (RT_NULL == rt_sfud_flash_probe("W25Q64", "spi00"))
  21. {
  22. return -RT_ERROR;
  23. };
  24. return RT_EOK;
  25. }
  26. INIT_COMPONENT_EXPORT(rt_hw_spi_flash_init);
  27. #endif