drv_ramdisk.h 819 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-04-17 Jianjia Ma first version
  9. */
  10. #ifndef __DRV_RAMDISK_H_
  11. #define __DRV_RAMDISK_H_
  12. #include <rtthread.h>
  13. #include "rtdevice.h"
  14. #include <drv_common.h>
  15. /* ramdisk */
  16. struct ramdisk_device
  17. {
  18. struct rt_device parent; /**< RT-Thread device struct */
  19. struct rt_device_blk_geometry geometry; /**< sector size, sector count */
  20. uint8_t* disk; /**< ramdisk start address */
  21. rt_size_t size; /**< size of the ramdisk */
  22. uint8_t is_allocated; /**< whether the disk buffer is allocated by us or user*/
  23. };
  24. #endif /*__DRV_RAMDISK_H_ */