mass.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * File : mass.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2011, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2011-12-12 Yi Qiu first version
  13. */
  14. #ifndef __MASS_H__
  15. #define __MASS_H__
  16. #include <rtthread.h>
  17. #include "dfs_fs.h"
  18. #define MAX_PARTITION_COUNT 4
  19. #define SECTOR_SIZE 512
  20. struct ustor_data
  21. {
  22. struct dfs_partition part;
  23. struct uhintf* intf;
  24. int udisk_id;
  25. const char path;
  26. };
  27. struct ustor
  28. {
  29. upipe_t pipe_in;
  30. upipe_t pipe_out;
  31. rt_uint32_t capicity[2];
  32. struct rt_device dev[MAX_PARTITION_COUNT];
  33. rt_uint8_t dev_cnt;
  34. };
  35. typedef struct ustor* ustor_t;
  36. rt_err_t rt_usbh_storage_get_max_lun(struct uhintf* intf, rt_uint8_t* max_lun);
  37. rt_err_t rt_usbh_storage_reset(struct uhintf* intf);
  38. rt_err_t rt_usbh_storage_read10(struct uhintf* intf, rt_uint8_t *buffer,
  39. rt_uint32_t sector, rt_size_t count, int timeout);
  40. rt_err_t rt_usbh_storage_write10(struct uhintf* intf, rt_uint8_t *buffer,
  41. rt_uint32_t sector, rt_size_t count, int timeout);
  42. rt_err_t rt_usbh_storage_request_sense(struct uhintf* intf, rt_uint8_t* buffer);
  43. rt_err_t rt_usbh_storage_test_unit_ready(struct uhintf* intf);
  44. rt_err_t rt_usbh_storage_inquiry(struct uhintf* intf, rt_uint8_t* buffer);
  45. rt_err_t rt_usbh_storage_get_capacity(struct uhintf* intf, rt_uint8_t* buffer);
  46. #endif