Skip to content

Commit e3c11e1

Browse files
committed
Move LIB_PICO_USB_RESET_INTERFACE only headers into separate files
1 parent 7c3274f commit e3c11e1

File tree

4 files changed

+142
-119
lines changed

4 files changed

+142
-119
lines changed

src/common/pico_usb_reset_interface_headers/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ package(default_visibility = ["//visibility:public"])
22

33
cc_library(
44
name = "pico_usb_reset_interface_headers",
5-
hdrs = ["include/pico/usb_reset_interface.h"],
5+
hdrs = ["include/pico/usb_reset_interface.h", "include/pico/usb_reset_interface_config.h", "include/pico/usb_reset_interface_tusb.h"],
66
includes = ["include"],
77
)

src/common/pico_usb_reset_interface_headers/include/pico/usb_reset_interface.h

Lines changed: 2 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -44,124 +44,8 @@
4444
#if LIB_PICO_USB_RESET_INTERFACE
4545
// These defines are only used by the pico_usb_reset_interface library, not the pico_usb_reset_interface_headers library
4646

47-
// PICO_CONFIG: PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED, Optionally define a pin to use as bootloader activity LED when BOOTSEL mode is entered via USB (either VIA_BAUD_RATE or VIA_VENDOR_INTERFACE), type=int, min=0, max=47 on RP2350B, 29 otherwise, group=pico_usb_reset_interface
48-
49-
// PICO_CONFIG: PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED_ACTIVE_LOW, Whether pin to use as bootloader activity LED when BOOTSEL mode is entered via USB (either VIA_BAUD_RATE or VIA_VENDOR_INTERFACE) is active low, type=bool, default=0, group=pico_usb_reset_interface
50-
#ifndef PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED_ACTIVE_LOW
51-
#define PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED_ACTIVE_LOW 0
52-
#endif
53-
54-
// PICO_CONFIG: PICO_STDIO_USB_RESET_BOOTSEL_FIXED_ACTIVITY_LED, Whether the pin specified by PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED is fixed or can be modified by picotool over the VENDOR USB interface, type=bool, default=0, group=pico_usb_reset_interface
55-
#ifndef PICO_STDIO_USB_RESET_BOOTSEL_FIXED_ACTIVITY_LED
56-
#define PICO_STDIO_USB_RESET_BOOTSEL_FIXED_ACTIVITY_LED 0
57-
#endif
58-
59-
// Any modes disabled here can't be re-enabled by picotool via VENDOR_INTERFACE.
60-
// PICO_CONFIG: PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK, Optionally disable either the mass storage interface (bit 0) or the PICOBOOT interface (bit 1) when entering BOOTSEL mode via USB (either VIA_BAUD_RATE or VIA_VENDOR_INTERFACE), type=int, min=0, max=3, default=0, group=pico_usb_reset_interface
61-
#ifndef PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK
62-
#define PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK 0u
63-
#endif
64-
65-
// PICO_CONFIG: PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE, Enable/disable resetting into BOOTSEL mode via an additional VENDOR USB interface - enables picotool based reset, type=bool, default=1 if application is not using TinyUSB directly, group=pico_usb_reset_interface
66-
#ifndef PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE
67-
#if !LIB_TINYUSB_HOST && !LIB_TINYUSB_DEVICE
68-
#define PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE 1
69-
#else
70-
#define PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE 0
71-
#endif
72-
#endif
73-
74-
// PICO_CONFIG: PICO_STDIO_USB_RESET_INCLUDE_APP_DRIVER_CB, Set to 0 if your application defines usbd_app_driver_get_cb, type=bool, default=1 when using pico_usb_reset_interface, 0 otherwise, group=pico_usb_reset_interface
75-
#ifndef PICO_STDIO_USB_RESET_INCLUDE_APP_DRIVER_CB
76-
#define PICO_STDIO_USB_RESET_INCLUDE_APP_DRIVER_CB LIB_PICO_STDIO_USB
77-
#endif
78-
79-
// PICO_CONFIG: PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_BOOTSEL, If vendor reset interface is included allow rebooting to BOOTSEL mode, type=bool, default=1, group=pico_usb_reset_interface
80-
#ifndef PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_BOOTSEL
81-
#define PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_BOOTSEL 1
82-
#endif
83-
84-
// PICO_CONFIG: PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_FLASH_BOOT, If vendor reset interface is included allow rebooting with regular flash boot, type=bool, default=1, group=pico_usb_reset_interface
85-
#ifndef PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_FLASH_BOOT
86-
#define PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_FLASH_BOOT 1
87-
#endif
88-
89-
// PICO_CONFIG: PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS, Delay in ms before rebooting via regular flash boot, default=100, group=pico_usb_reset_interface
90-
#ifndef PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS
91-
#define PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS 100
92-
#endif
93-
94-
// PICO_CONFIG: PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR, If vendor reset interface is included add support for Microsoft OS 2.0 Descriptor, type=bool, default=1 if application is not using TinyUSB directly, 0 otherwise, group=pico_usb_reset_interface
95-
#ifndef PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR
96-
#if !LIB_TINYUSB_HOST && !LIB_TINYUSB_DEVICE
97-
#define PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR 1
98-
#else
99-
#define PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR 0
100-
#endif
101-
#endif
102-
103-
// PICO_CONFIG: PICO_STDIO_USB_RESET_INTERFACE_MS_OS_20_DESCRIPTOR_ITF, If vendor reset interface is included the USB interface number for the reset interface, type=int, default=2 if application is not using TinyUSB directly, undefined otherwise, group=pico_usb_reset_interface
104-
#ifndef PICO_STDIO_USB_RESET_INTERFACE_MS_OS_20_DESCRIPTOR_ITF
105-
#if !LIB_TINYUSB_HOST && !LIB_TINYUSB_DEVICE
106-
#define PICO_STDIO_USB_RESET_INTERFACE_MS_OS_20_DESCRIPTOR_ITF 2
107-
#elif PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR
108-
#error Must set PICO_STDIO_USB_RESET_INTERFACE_MS_OS_20_DESCRIPTOR_ITF to the reset interface number when using PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR with custom USB descriptors
109-
#endif
110-
#endif
111-
112-
// Interface descriptor
113-
#define TUD_RPI_RESET_DESC_LEN 9
114-
#define TUD_RPI_RESET_DESCRIPTOR(_itfnum, _stridx) \
115-
/* Interface */\
116-
TUD_RPI_RESET_DESC_LEN, TUSB_DESC_INTERFACE, _itfnum, 0, 0, TUSB_CLASS_VENDOR_SPECIFIC, RESET_INTERFACE_SUBCLASS, RESET_INTERFACE_PROTOCOL, _stridx
117-
118-
119-
// Microsoft OS 2.0 Descriptor
120-
#define RPI_RESET_MS_OS_20_DESC_LEN (0x08 + 0x14 + 0x80)
121-
#define RPI_RESET_MS_OS_20_DESCRIPTOR(itf_num) \
122-
/* Function Subset header: length, type, first interface, reserved, subset length */ \
123-
U16_TO_U8S_LE(0x0008), U16_TO_U8S_LE(MS_OS_20_SUBSET_HEADER_FUNCTION), itf_num, 0, U16_TO_U8S_LE(RPI_RESET_MS_OS_20_DESC_LEN), \
124-
\
125-
/* MS OS 2.0 Compatible ID descriptor: length, type, compatible ID, sub compatible ID */ \
126-
U16_TO_U8S_LE(0x0014), U16_TO_U8S_LE(MS_OS_20_FEATURE_COMPATBLE_ID), 'W', 'I', 'N', 'U', 'S', 'B', 0x00, 0x00, \
127-
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* sub-compatible */ \
128-
\
129-
/* MS OS 2.0 Registry property descriptor: length, type */ \
130-
U16_TO_U8S_LE(0x0080), U16_TO_U8S_LE(MS_OS_20_FEATURE_REG_PROPERTY), \
131-
U16_TO_U8S_LE(0x0001), U16_TO_U8S_LE(0x0028), /* wPropertyDataType, wPropertyNameLength and PropertyName "DeviceInterfaceGUID" in UTF-16 */ \
132-
'D', 0x00, 'e', 0x00, 'v', 0x00, 'i', 0x00, 'c', 0x00, 'e', 0x00, 'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00, \
133-
'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', 0x00, 'G', 0x00, 'U', 0x00, 'I', 0x00, 'D', 0x00, 0x00, 0x00, \
134-
U16_TO_U8S_LE(0x004E), /* wPropertyDataLength */ \
135-
/* Vendor-defined Property Data: {bc7398c1-73cd-4cb7-98b8-913a8fca7bf6} */ \
136-
'{', 0, 'b', 0, 'c', 0, '7', 0, '3', 0, '9', 0, \
137-
'8', 0, 'c', 0, '1', 0, '-', 0, '7', 0, '3', 0, \
138-
'c', 0, 'd', 0, '-', 0, '4', 0, 'c', 0, 'b', 0, \
139-
'7', 0, '-', 0, '9', 0, '8', 0, 'b', 0, '8', 0, \
140-
'-', 0, '9', 0, '1', 0, '3', 0, 'a', 0, '8', 0, \
141-
'f', 0, 'c', 0, 'a', 0, '7', 0, 'b', 0, 'f', 0, \
142-
'6', 0, '}', 0, 0, 0
143-
144-
#include "stdint.h"
145-
#include "device/usbd_pvt.h"
146-
147-
void pico_usb_reset_interface_init(void);
148-
void pico_usb_reset_interface_reset(uint8_t __unused rhport);
149-
uint16_t pico_usb_reset_interface_open(uint8_t __unused rhport, tusb_desc_interface_t const *itf_desc, uint16_t max_len);
150-
bool pico_usb_reset_interface_control_xfer_cb(uint8_t __unused rhport, uint8_t stage, tusb_control_request_t const * request);
151-
bool pico_usb_reset_interface_xfer_cb(uint8_t __unused rhport, uint8_t __unused ep_addr, xfer_result_t __unused result, uint32_t __unused xferred_bytes);
152-
153-
static usbd_class_driver_t const pico_usb_reset_interface_driver =
154-
{
155-
#if CFG_TUSB_DEBUG >= 2
156-
.name = "RESET",
157-
#endif
158-
.init = pico_usb_reset_interface_init,
159-
.reset = pico_usb_reset_interface_reset,
160-
.open = pico_usb_reset_interface_open,
161-
.control_xfer_cb = pico_usb_reset_interface_control_xfer_cb,
162-
.xfer_cb = pico_usb_reset_interface_xfer_cb,
163-
.sof = NULL
164-
};
47+
#include "pico/usb_reset_interface_config.h"
48+
#include "pico/usb_reset_interface_tusb.h"
16549

16650
#endif
16751

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* Copyright (c) 2025 Raspberry Pi (Trading) Ltd.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef _PICO_USB_RESET_INTERFACE_CONFIG_H
8+
#define _PICO_USB_RESET_INTERFACE_CONFIG_H
9+
10+
// PICO_CONFIG: PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED, Optionally define a pin to use as bootloader activity LED when BOOTSEL mode is entered via USB (either VIA_BAUD_RATE or VIA_VENDOR_INTERFACE), type=int, min=0, max=47 on RP2350B, 29 otherwise, group=pico_usb_reset_interface
11+
12+
// PICO_CONFIG: PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED_ACTIVE_LOW, Whether pin to use as bootloader activity LED when BOOTSEL mode is entered via USB (either VIA_BAUD_RATE or VIA_VENDOR_INTERFACE) is active low, type=bool, default=0, group=pico_usb_reset_interface
13+
#ifndef PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED_ACTIVE_LOW
14+
#define PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED_ACTIVE_LOW 0
15+
#endif
16+
17+
// PICO_CONFIG: PICO_STDIO_USB_RESET_BOOTSEL_FIXED_ACTIVITY_LED, Whether the pin specified by PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED is fixed or can be modified by picotool over the VENDOR USB interface, type=bool, default=0, group=pico_usb_reset_interface
18+
#ifndef PICO_STDIO_USB_RESET_BOOTSEL_FIXED_ACTIVITY_LED
19+
#define PICO_STDIO_USB_RESET_BOOTSEL_FIXED_ACTIVITY_LED 0
20+
#endif
21+
22+
// Any modes disabled here can't be re-enabled by picotool via VENDOR_INTERFACE.
23+
// PICO_CONFIG: PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK, Optionally disable either the mass storage interface (bit 0) or the PICOBOOT interface (bit 1) when entering BOOTSEL mode via USB (either VIA_BAUD_RATE or VIA_VENDOR_INTERFACE), type=int, min=0, max=3, default=0, group=pico_usb_reset_interface
24+
#ifndef PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK
25+
#define PICO_STDIO_USB_RESET_BOOTSEL_INTERFACE_DISABLE_MASK 0u
26+
#endif
27+
28+
// PICO_CONFIG: PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE, Enable/disable resetting into BOOTSEL mode via an additional VENDOR USB interface - enables picotool based reset, type=bool, default=1 if application is not using TinyUSB directly, group=pico_usb_reset_interface
29+
#ifndef PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE
30+
#if !LIB_TINYUSB_HOST && !LIB_TINYUSB_DEVICE
31+
#define PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE 1
32+
#else
33+
#define PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE 0
34+
#endif
35+
#endif
36+
37+
// PICO_CONFIG: PICO_STDIO_USB_RESET_INCLUDE_APP_DRIVER_CB, Set to 0 if your application defines usbd_app_driver_get_cb, type=bool, default=1 when using pico_usb_reset_interface, 0 otherwise, group=pico_usb_reset_interface
38+
#ifndef PICO_STDIO_USB_RESET_INCLUDE_APP_DRIVER_CB
39+
#define PICO_STDIO_USB_RESET_INCLUDE_APP_DRIVER_CB LIB_PICO_STDIO_USB
40+
#endif
41+
42+
// PICO_CONFIG: PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_BOOTSEL, If vendor reset interface is included allow rebooting to BOOTSEL mode, type=bool, default=1, group=pico_usb_reset_interface
43+
#ifndef PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_BOOTSEL
44+
#define PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_BOOTSEL 1
45+
#endif
46+
47+
// PICO_CONFIG: PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_FLASH_BOOT, If vendor reset interface is included allow rebooting with regular flash boot, type=bool, default=1, group=pico_usb_reset_interface
48+
#ifndef PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_FLASH_BOOT
49+
#define PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_FLASH_BOOT 1
50+
#endif
51+
52+
// PICO_CONFIG: PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS, Delay in ms before rebooting via regular flash boot, default=100, group=pico_usb_reset_interface
53+
#ifndef PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS
54+
#define PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS 100
55+
#endif
56+
57+
// PICO_CONFIG: PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR, If vendor reset interface is included add support for Microsoft OS 2.0 Descriptor, type=bool, default=1 if application is not using TinyUSB directly, 0 otherwise, group=pico_usb_reset_interface
58+
#ifndef PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR
59+
#if !LIB_TINYUSB_HOST && !LIB_TINYUSB_DEVICE
60+
#define PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR 1
61+
#else
62+
#define PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR 0
63+
#endif
64+
#endif
65+
66+
// PICO_CONFIG: PICO_STDIO_USB_RESET_INTERFACE_MS_OS_20_DESCRIPTOR_ITF, If vendor reset interface is included the USB interface number for the reset interface, type=int, default=2 if application is not using TinyUSB directly, undefined otherwise, group=pico_usb_reset_interface
67+
#ifndef PICO_STDIO_USB_RESET_INTERFACE_MS_OS_20_DESCRIPTOR_ITF
68+
#if !LIB_TINYUSB_HOST && !LIB_TINYUSB_DEVICE
69+
#define PICO_STDIO_USB_RESET_INTERFACE_MS_OS_20_DESCRIPTOR_ITF 2
70+
#elif PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR
71+
#error Must set PICO_STDIO_USB_RESET_INTERFACE_MS_OS_20_DESCRIPTOR_ITF to the reset interface number when using PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR with custom USB descriptors
72+
#endif
73+
#endif
74+
75+
#endif
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright (c) 2025 Raspberry Pi (Trading) Ltd.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef _PICO_USB_RESET_INTERFACE_TUSB_H
8+
#define _PICO_USB_RESET_INTERFACE_TUSB_H
9+
10+
// Interface descriptor
11+
#define TUD_RPI_RESET_DESC_LEN 9
12+
#define TUD_RPI_RESET_DESCRIPTOR(_itfnum, _stridx) \
13+
/* Interface */\
14+
TUD_RPI_RESET_DESC_LEN, TUSB_DESC_INTERFACE, _itfnum, 0, 0, TUSB_CLASS_VENDOR_SPECIFIC, RESET_INTERFACE_SUBCLASS, RESET_INTERFACE_PROTOCOL, _stridx
15+
16+
17+
// Microsoft OS 2.0 Descriptor
18+
#define RPI_RESET_MS_OS_20_DESC_LEN (0x08 + 0x14 + 0x80)
19+
#define RPI_RESET_MS_OS_20_DESCRIPTOR(itf_num) \
20+
/* Function Subset header: length, type, first interface, reserved, subset length */ \
21+
U16_TO_U8S_LE(0x0008), U16_TO_U8S_LE(MS_OS_20_SUBSET_HEADER_FUNCTION), itf_num, 0, U16_TO_U8S_LE(RPI_RESET_MS_OS_20_DESC_LEN), \
22+
\
23+
/* MS OS 2.0 Compatible ID descriptor: length, type, compatible ID, sub compatible ID */ \
24+
U16_TO_U8S_LE(0x0014), U16_TO_U8S_LE(MS_OS_20_FEATURE_COMPATBLE_ID), 'W', 'I', 'N', 'U', 'S', 'B', 0x00, 0x00, \
25+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* sub-compatible */ \
26+
\
27+
/* MS OS 2.0 Registry property descriptor: length, type */ \
28+
U16_TO_U8S_LE(0x0080), U16_TO_U8S_LE(MS_OS_20_FEATURE_REG_PROPERTY), \
29+
U16_TO_U8S_LE(0x0001), U16_TO_U8S_LE(0x0028), /* wPropertyDataType, wPropertyNameLength and PropertyName "DeviceInterfaceGUID" in UTF-16 */ \
30+
'D', 0x00, 'e', 0x00, 'v', 0x00, 'i', 0x00, 'c', 0x00, 'e', 0x00, 'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00, \
31+
'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', 0x00, 'G', 0x00, 'U', 0x00, 'I', 0x00, 'D', 0x00, 0x00, 0x00, \
32+
U16_TO_U8S_LE(0x004E), /* wPropertyDataLength */ \
33+
/* Vendor-defined Property Data: {bc7398c1-73cd-4cb7-98b8-913a8fca7bf6} */ \
34+
'{', 0, 'b', 0, 'c', 0, '7', 0, '3', 0, '9', 0, \
35+
'8', 0, 'c', 0, '1', 0, '-', 0, '7', 0, '3', 0, \
36+
'c', 0, 'd', 0, '-', 0, '4', 0, 'c', 0, 'b', 0, \
37+
'7', 0, '-', 0, '9', 0, '8', 0, 'b', 0, '8', 0, \
38+
'-', 0, '9', 0, '1', 0, '3', 0, 'a', 0, '8', 0, \
39+
'f', 0, 'c', 0, 'a', 0, '7', 0, 'b', 0, 'f', 0, \
40+
'6', 0, '}', 0, 0, 0
41+
42+
#include "stdint.h"
43+
#include "device/usbd_pvt.h"
44+
45+
void pico_usb_reset_interface_init(void);
46+
void pico_usb_reset_interface_reset(uint8_t __unused rhport);
47+
uint16_t pico_usb_reset_interface_open(uint8_t __unused rhport, tusb_desc_interface_t const *itf_desc, uint16_t max_len);
48+
bool pico_usb_reset_interface_control_xfer_cb(uint8_t __unused rhport, uint8_t stage, tusb_control_request_t const * request);
49+
bool pico_usb_reset_interface_xfer_cb(uint8_t __unused rhport, uint8_t __unused ep_addr, xfer_result_t __unused result, uint32_t __unused xferred_bytes);
50+
51+
static usbd_class_driver_t const pico_usb_reset_interface_driver =
52+
{
53+
#if CFG_TUSB_DEBUG >= 2
54+
.name = "RESET",
55+
#endif
56+
.init = pico_usb_reset_interface_init,
57+
.reset = pico_usb_reset_interface_reset,
58+
.open = pico_usb_reset_interface_open,
59+
.control_xfer_cb = pico_usb_reset_interface_control_xfer_cb,
60+
.xfer_cb = pico_usb_reset_interface_xfer_cb,
61+
.sof = NULL
62+
};
63+
64+
#endif

0 commit comments

Comments
 (0)