spi_flash.h 913 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2006-2023, 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. struct spi_flash_device
  15. {
  16. struct rt_device flash_device;
  17. struct rt_device_blk_geometry geometry;
  18. struct rt_spi_device * rt_spi_device;
  19. struct rt_mutex lock;
  20. void * user_data;
  21. };
  22. typedef struct spi_flash_device *rt_spi_flash_device_t;
  23. #ifdef RT_USING_MTD_NOR
  24. struct spi_flash_mtd
  25. {
  26. struct rt_mtd_nor_device mtd_device;
  27. struct rt_spi_device * rt_spi_device;
  28. struct rt_mutex lock;
  29. void * user_data;
  30. };
  31. #endif
  32. #endif