drv_spiflash.c 689 B

123456789101112131415161718192021222324
  1. /*
  2. * File : gpio.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2015, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2017-11-08 ZYH the first version
  13. */
  14. #include <rtthread.h>
  15. #ifdef RT_USING_W25QXX
  16. #include <drv_spi.h>
  17. #include "spi_flash_w25qxx.h"
  18. int rt_w25qxx_init(void)
  19. {
  20. stm32_spi_bus_attach_device(RT_W25QXX_CS_PIN, RT_W25QXX_SPI_BUS_NAME, "w25qxx");
  21. return w25qxx_init("flash0", "w25qxx");
  22. }
  23. INIT_DEVICE_EXPORT(rt_w25qxx_init);
  24. #endif