mass.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2011-12-12 Yi Qiu first version
  9. */
  10. #ifndef __MASS_H__
  11. #define __MASS_H__
  12. #include <rtthread.h>
  13. #include "dfs_fs.h"
  14. #define MAX_PARTITION_COUNT 4
  15. #define SECTOR_SIZE 512
  16. struct ustor_data
  17. {
  18. struct dfs_partition part;
  19. struct uhintf* intf;
  20. int udisk_id;
  21. const char path;
  22. };
  23. struct ustor
  24. {
  25. upipe_t pipe_in;
  26. upipe_t pipe_out;
  27. rt_uint32_t capicity[2];
  28. struct rt_device dev[MAX_PARTITION_COUNT];
  29. rt_uint8_t dev_cnt;
  30. };
  31. typedef struct ustor* ustor_t;
  32. rt_err_t rt_usbh_storage_get_max_lun(struct uhintf* intf, rt_uint8_t* max_lun);
  33. rt_err_t rt_usbh_storage_reset(struct uhintf* intf);
  34. rt_err_t rt_usbh_storage_read10(struct uhintf* intf, rt_uint8_t *buffer,
  35. rt_uint32_t sector, rt_size_t count, int timeout);
  36. rt_err_t rt_usbh_storage_write10(struct uhintf* intf, rt_uint8_t *buffer,
  37. rt_uint32_t sector, rt_size_t count, int timeout);
  38. rt_err_t rt_usbh_storage_request_sense(struct uhintf* intf, rt_uint8_t* buffer);
  39. rt_err_t rt_usbh_storage_test_unit_ready(struct uhintf* intf);
  40. rt_err_t rt_usbh_storage_inquiry(struct uhintf* intf, rt_uint8_t* buffer);
  41. rt_err_t rt_usbh_storage_get_capacity(struct uhintf* intf, rt_uint8_t* buffer);
  42. #endif