2022-08-18 21:41:19 +08:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, sakumisu
|
2024-02-06 11:25:39 +08:00
|
|
|
* Copyright (c) 2024, zhihong chen
|
2021-07-10 18:31:58 +08:00
|
|
|
*
|
2022-08-18 21:41:19 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2021-07-10 18:31:58 +08:00
|
|
|
*/
|
2022-08-18 21:41:19 +08:00
|
|
|
#ifndef USBD_MSC_H
|
|
|
|
|
#define USBD_MSC_H
|
2021-07-10 18:31:58 +08:00
|
|
|
|
2021-11-26 23:41:59 +08:00
|
|
|
#include "usb_msc.h"
|
|
|
|
|
|
2021-07-10 18:31:58 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-10-20 21:22:08 +08:00
|
|
|
/* Init msc interface driver */
|
2024-02-06 19:51:50 +08:00
|
|
|
struct usbd_interface *usbd_msc_init_intf(uint8_t busid, struct usbd_interface *intf,
|
2022-10-20 21:22:08 +08:00
|
|
|
const uint8_t out_ep,
|
|
|
|
|
const uint8_t in_ep);
|
2022-08-20 16:20:23 +08:00
|
|
|
|
2024-02-06 19:51:50 +08:00
|
|
|
void usbd_msc_get_cap(uint8_t busid, uint8_t lun, uint32_t *block_num, uint32_t *block_size);
|
|
|
|
|
int usbd_msc_sector_read(uint8_t busid, uint8_t lun, uint32_t sector, uint8_t *buffer, uint32_t length);
|
|
|
|
|
int usbd_msc_sector_write(uint8_t busid, uint8_t lun, uint32_t sector, uint8_t *buffer, uint32_t length);
|
2021-07-10 18:31:58 +08:00
|
|
|
|
2024-02-06 19:51:50 +08:00
|
|
|
void usbd_msc_set_readonly(uint8_t busid, bool readonly);
|
2024-08-08 18:11:23 +08:00
|
|
|
bool usbd_msc_get_popup(uint8_t busid);
|
2022-09-25 19:47:41 +08:00
|
|
|
|
2024-08-08 18:03:30 +08:00
|
|
|
void usbd_msc_polling(uint8_t busid);
|
|
|
|
|
|
2021-07-10 18:31:58 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-08-18 21:41:19 +08:00
|
|
|
#endif /* USBD_MSC_H */
|