spi_flash.h 948 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2016/5/20 bernard the first version
  9. * 2020/1/7 redoc add include
  10. */
  11. #ifndef SPI_FLASH_H__
  12. #define SPI_FLASH_H__
  13. #include <rtdevice.h>
  14. #ifdef RT_USING_MTD_NOR
  15. #include "drivers/mtd_nor.h"
  16. #endif
  17. struct spi_flash_device
  18. {
  19. struct rt_device flash_device;
  20. struct rt_device_blk_geometry geometry;
  21. struct rt_spi_device * rt_spi_device;
  22. struct rt_mutex lock;
  23. void * user_data;
  24. };
  25. typedef struct spi_flash_device *rt_spi_flash_device_t;
  26. #ifdef RT_USING_MTD_NOR
  27. struct spi_flash_mtd
  28. {
  29. struct rt_mtd_nor_device mtd_device;
  30. struct rt_spi_device * rt_spi_device;
  31. struct rt_mutex lock;
  32. void * user_data;
  33. };
  34. #endif
  35. #endif