mstorage.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * File : mstorage.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2012, 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. * 2012-10-01 Yi Qiu first version
  13. * 2012-12-12 heyuanjie87 add MASS endpoints collection
  14. */
  15. #ifndef __MSTORAGE_H__
  16. #define __MSTORAGE_H__
  17. #include <rtthread.h>
  18. #define USBREQ_GET_MAX_LUN 0xfe
  19. #define USBREQ_MASS_STORAGE_RESET 0xff
  20. #define USB_MASS_STORAGE_PRODUCT_ID 0x1000 /* Product ID */
  21. #pragma pack(1)
  22. struct umass_descriptor
  23. {
  24. struct uinterface_descriptor intf_desc;
  25. struct uendpoint_descriptor ep_out_desc;
  26. struct uendpoint_descriptor ep_in_desc;
  27. };
  28. typedef struct umass_descriptor* umass_desc_t;
  29. struct capacity_data
  30. {
  31. rt_uint8_t LastLogicalBlockAddress[4];
  32. rt_uint8_t BlockLengthInBytes[4];
  33. };
  34. struct request_sense_data
  35. {
  36. rt_uint8_t ErrorCode:7;
  37. rt_uint8_t Valid:1;
  38. rt_uint8_t Reserved1;
  39. rt_uint8_t SenseKey:4;
  40. rt_uint8_t Reserved2:4;
  41. rt_uint8_t Information[4];
  42. rt_uint8_t AdditionalSenseLength;
  43. rt_uint8_t Reserved3[4];
  44. rt_uint8_t AdditionalSenseCode;
  45. rt_uint8_t AdditionalSenseCodeQualifier;
  46. rt_uint8_t Reserved4[4];
  47. }request_sense_data_t;
  48. struct mass_eps
  49. {
  50. uep_t ep_in;
  51. uep_t ep_out;
  52. };
  53. typedef struct mass_eps* mass_eps_t;
  54. #pragma pack()
  55. #endif