blob: 38661e914648d72646a6833e56f7645f4a31ca3b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
/*
* Copyright (c) 2022, sakumisu
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "usbd_core.h"
#include "usbd_mtp.h"
struct mtp_cfg_priv {
uint8_t device_status;
} usbd_mtp_cfg;
/* max USB packet size */
#ifndef CONFIG_USB_HS
#define MTP_BULK_EP_MPS 64
#else
#define MTP_BULK_EP_MPS 512
#endif
#define MSD_OUT_EP_IDX 0
#define MSD_IN_EP_IDX 1
/* Describe EndPoints configuration */
static struct usbd_interface mtp_ep_data[2];
static int mtp_class_interface_request_handler(struct usb_setup_packet *setup, uint8_t **data, uint32_t *len)
{
USB_LOG_DBG("MTP Class request: "
"bRequest 0x%02x\r\n",
setup->bRequest);
switch (setup->bRequest) {
case MTP_REQUEST_CANCEL:
break;
case MTP_REQUEST_GET_EXT_EVENT_DATA:
break;
case MTP_REQUEST_RESET:
break;
case MTP_REQUEST_GET_DEVICE_STATUS:
break;
default:
USB_LOG_WRN("Unhandled MTP Class bRequest 0x%02x\r\n", setup->bRequest);
return -1;
}
return 0;
}
static void usbd_mtp_bulk_out(uint8_t ep)
{
}
static void usbd_mtp_bulk_in(uint8_t ep)
{
}
static void mtp_notify_handler(uint8_t event, void *arg)
{
switch (event) {
case USBD_EVENT_RESET:
break;
default:
break;
}
}
|