drv_qspi.h 802 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Email: opensource_embedded@phytium.com.cn
  7. *
  8. * Change Logs:
  9. * Date Author Notes
  10. * 2023-03-20 zhangyan first version
  11. *
  12. */
  13. #ifndef __DRV_QSPI_H__
  14. #define __DRV_QSPI_H__
  15. #include "rtconfig.h"
  16. #ifdef BSP_USING_QSPI
  17. #include <rtthread.h>
  18. #include "rtdevice.h"
  19. #include "fqspi_flash.h"
  20. #define PHYTIUM_QSPI_NAME "qspi"
  21. #ifdef __cplusplus
  22. extern "C"
  23. {
  24. #endif
  25. typedef struct
  26. {
  27. rt_uint32_t fqspi_id;
  28. rt_uint32_t init; /* 0 is init already */
  29. FQspiCtrl fqspi;
  30. struct rt_spi_bus qspi_bus;
  31. } phytium_qspi_bus;
  32. rt_err_t phytium_qspi_bus_attach_device(const char *bus_name, const char *device_name);
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif
  37. #endif // !DRT_QSPI_H