usbh_msc.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * @file usbh_msc.h
  3. * @brief
  4. *
  5. * Copyright (c) 2022 sakumisu
  6. *
  7. * Licensed to the Apache Software Foundation (ASF) under one or more
  8. * contributor license agreements. See the NOTICE file distributed with
  9. * this work for additional information regarding copyright ownership. The
  10. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  11. * "License"); you may not use this file except in compliance with the
  12. * License. You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  18. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  19. * License for the specific language governing permissions and limitations
  20. * under the License.
  21. *
  22. */
  23. #ifndef _USBH_MSC_H
  24. #define _USBH_MSC_H
  25. #include "usb_msc.h"
  26. #include "usb_scsi.h"
  27. struct usbh_msc {
  28. struct usbh_hubport *hport;
  29. uint8_t intf; /* Data interface number */
  30. uint8_t sdchar;
  31. usbh_epinfo_t bulkin; /* Bulk IN endpoint */
  32. usbh_epinfo_t bulkout; /* Bulk OUT endpoint */
  33. uint8_t *tx_buffer;
  34. uint32_t blocknum; /* Number of blocks on the USB mass storage device */
  35. uint16_t blocksize; /* Block size of USB mass storage device */
  36. };
  37. int usbh_msc_scsi_write10(struct usbh_msc *msc_class, uint32_t start_sector, const uint8_t *buffer, uint32_t nsectors);
  38. int usbh_msc_scsi_read10(struct usbh_msc *msc_class, uint32_t start_sector, const uint8_t *buffer, uint32_t nsectors);
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif