Skip to content

Commit

Permalink
add example description
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Jun 20, 2022
1 parent 0931a82 commit 7ef1fd2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
18 changes: 10 additions & 8 deletions examples/CDC/cdc_multi/cdc_multi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
MIT license, check LICENSE for more information
*/

/* The example creates two virtual serial ports. Text entered on
any of the ports will be echoed to the all ports with
- all lower case in port0 (Serial)
- all upper case in port1

The max number of CDC ports (CFG_TUD_CDC) has to be changed to at least 2.
Config file is located in Adafruit_TinyUSB_Arduino/src/arduino/ports/platform/tusb_config_platform.h
where platform is one of: esp32, nrf, rp2040, samd
*/
/* The example creates two virtual serial ports. Text entered on
* any of the ports will be echoed to the all ports with
* - all lower case in port0 (Serial)
* - all upper case in port1
*
* Requirement:
* The max number of CDC ports (CFG_TUD_CDC) has to be changed to at least 2.
* Config file is located in Adafruit_TinyUSB_Arduino/src/arduino/ports/platform/tusb_config_platform.h
* where platform is one of: esp32, nrf, rp2040, samd
*/

#include <Adafruit_TinyUSB.h>

Expand Down
31 changes: 31 additions & 0 deletions examples/DualRole/device_info_rp2040/device_info_rp2040.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,37 @@
any redistribution
*********************************************************************/


/* This example demonstrates use of both device and host, where
* - Device run on native usb controller (controller0)
* - Host run on bit-banging 2 GPIOs with the help of Pico-PIO-USB library (controller1)
*
* Requirements:
* - [Pico-PIO-USB](https://github.com/sekigon-gonnoc/Pico-PIO-USB) library
* - 2 consecutive GPIOs: D+ is defined by HOST_PIN_DP (gpio2), D- = D+ +1 (gpio3)
* - Provide VBus (5v) and GND for peripheral
*
* RP2040 host stack will get device descriptors of attached devices and print it out via
* device cdc (Serial) as follows:
* Device 1: ID 046d:c52f
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 0200
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x046d
idProduct 0xc52f
bcdDevice 2200
iManufacturer 1 Logitech
iProduct 2 USB Receiver
iSerialNumber 0
bNumConfigurations 1
*
*/

// pio-usb is required for rp2040 host
#include "pio_usb.h"
#define HOST_PIN_DP 2 // Pin used as D+ for host, D- = D+ + 1
Expand Down

0 comments on commit 7ef1fd2

Please sign in to comment.