Skip to content

Commit 7ef1fd2

Browse files
committed
add example description
1 parent 0931a82 commit 7ef1fd2

File tree

2 files changed

+41
-8
lines changed

2 files changed

+41
-8
lines changed

examples/CDC/cdc_multi/cdc_multi.ino

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
MIT license, check LICENSE for more information
88
*/
99

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
1410

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+
*/
1921

2022
#include <Adafruit_TinyUSB.h>
2123

examples/DualRole/device_info_rp2040/device_info_rp2040.ino

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,37 @@
99
any redistribution
1010
*********************************************************************/
1111

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+
1243
// pio-usb is required for rp2040 host
1344
#include "pio_usb.h"
1445
#define HOST_PIN_DP 2 // Pin used as D+ for host, D- = D+ + 1

0 commit comments

Comments
 (0)