adafruit / Adafruit_TinyUSB_Arduino

Arduino library for TinyUSB
MIT License
465 stars 120 forks source link

How to send/receive serial from pico to device thru D+ and D- pins #243

Closed Icesythe7 closed 1 year ago

Icesythe7 commented 1 year ago

I can run the device info and get a valid response thru D+ and D- pins

TinyUSB Dual Device Info Example
Device attached, address = 1
Device 1: ID 1a86:7523
Device Descriptor:
  bLength             18
  bDescriptorType     1
  bcdUSB              0110
  bDeviceClass        255
  bDeviceSubClass     0
  bDeviceProtocol     0
  bMaxPacketSize0     8
  idVendor            0x1a86
  idProduct           0x7523
  bcdDevice           0264
  iManufacturer       0     
  iProduct            2     USB Serial

How can 1 now connect to the device at baud 1700000 and send/recieve serial data? Ie this is basically what I am wanting


void tuh_mount_cb (uint8_t daddr)
{
  Serial.printf("Device attached, address = %d\r\n", daddr);

  // Get Device Descriptor
  tuh_descriptor_get_device(daddr, &desc_device, 18, print_device_descriptor, 0);

  // if usb serial device
  if (iProduct == 2)
  {
    usbserial.begin(portx, baud y)
    usbserial.write(0x3F);

    while (usbserial.available)
    {
      Serial.println(usbserial.read());
    }
  }
}```
hathach commented 1 year ago

question please use discussion