mstorage.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. */
  14. #include <rtthread.h>
  15. #define USBREQ_GET_MAX_LUN 0xfe
  16. #define USBREQ_MASS_STORAGE_RESET 0xff
  17. #define USB_MASS_STORAGE_PRODUCT_ID 0x1000 /* Product ID */
  18. #pragma pack(1)
  19. struct umass_descriptor
  20. {
  21. struct uinterface_descriptor intf_desc;
  22. struct uendpoint_descriptor ep_out_desc;
  23. struct uendpoint_descriptor ep_in_desc;
  24. };
  25. typedef struct umass_descriptor* umass_desc_t;
  26. struct capacity_data
  27. {
  28. rt_uint8_t LastLogicalBlockAddress[4];
  29. rt_uint8_t BlockLengthInBytes[4];
  30. };
  31. struct request_sense_data
  32. {
  33. rt_uint8_t ErrorCode:7;
  34. rt_uint8_t Valid:1;
  35. rt_uint8_t Reserved1;
  36. rt_uint8_t SenseKey:4;
  37. rt_uint8_t Reserved2:4;
  38. rt_uint8_t Information[4];
  39. rt_uint8_t AdditionalSenseLength;
  40. rt_uint8_t Reserved3[4];
  41. rt_uint8_t AdditionalSenseCode;
  42. rt_uint8_t AdditionalSenseCodeQualifier;
  43. rt_uint8_t Reserved4[4];
  44. }request_sense_data_t;
  45. #pragma pack()