File tree Expand file tree Collapse file tree 2 files changed +41
-8
lines changed
DualRole/device_info_rp2040 Expand file tree Collapse file tree 2 files changed +41
-8
lines changed Original file line number Diff line number Diff line change 7
7
MIT license, check LICENSE for more information
8
8
*/
9
9
10
- /* The example creates two virtual serial ports. Text entered on
11
- any of the ports will be echoed to the all ports with
12
- - all lower case in port0 (Serial)
13
- - all upper case in port1
14
10
15
- The max number of CDC ports (CFG_TUD_CDC) has to be changed to at least 2.
16
- Config file is located in Adafruit_TinyUSB_Arduino/src/arduino/ports/platform/tusb_config_platform.h
17
- where platform is one of: esp32, nrf, rp2040, samd
18
- */
11
+ /* The example creates two virtual serial ports. Text entered on
12
+ * any of the ports will be echoed to the all ports with
13
+ * - all lower case in port0 (Serial)
14
+ * - all upper case in port1
15
+ *
16
+ * Requirement:
17
+ * The max number of CDC ports (CFG_TUD_CDC) has to be changed to at least 2.
18
+ * Config file is located in Adafruit_TinyUSB_Arduino/src/arduino/ports/platform/tusb_config_platform.h
19
+ * where platform is one of: esp32, nrf, rp2040, samd
20
+ */
19
21
20
22
#include < Adafruit_TinyUSB.h>
21
23
Original file line number Diff line number Diff line change 9
9
any redistribution
10
10
*********************************************************************/
11
11
12
+
13
+ /* This example demonstrates use of both device and host, where
14
+ * - Device run on native usb controller (controller0)
15
+ * - Host run on bit-banging 2 GPIOs with the help of Pico-PIO-USB library (controller1)
16
+ *
17
+ * Requirements:
18
+ * - [Pico-PIO-USB](https://github.com/sekigon-gonnoc/Pico-PIO-USB) library
19
+ * - 2 consecutive GPIOs: D+ is defined by HOST_PIN_DP (gpio2), D- = D+ +1 (gpio3)
20
+ * - Provide VBus (5v) and GND for peripheral
21
+ *
22
+ * RP2040 host stack will get device descriptors of attached devices and print it out via
23
+ * device cdc (Serial) as follows:
24
+ * Device 1: ID 046d:c52f
25
+ Device Descriptor:
26
+ bLength 18
27
+ bDescriptorType 1
28
+ bcdUSB 0200
29
+ bDeviceClass 0
30
+ bDeviceSubClass 0
31
+ bDeviceProtocol 0
32
+ bMaxPacketSize0 8
33
+ idVendor 0x046d
34
+ idProduct 0xc52f
35
+ bcdDevice 2200
36
+ iManufacturer 1 Logitech
37
+ iProduct 2 USB Receiver
38
+ iSerialNumber 0
39
+ bNumConfigurations 1
40
+ *
41
+ */
42
+
12
43
// pio-usb is required for rp2040 host
13
44
#include " pio_usb.h"
14
45
#define HOST_PIN_DP 2 // Pin used as D+ for host, D- = D+ + 1
You can’t perform that action at this time.
0 commit comments