1

Does anyone know how to read CTS pin of CH340 using libusb_control_transfer? I can write to RTS using following code:

libusb_control_transfer( handle,        //      libusb_device_handle *  dev_handle
                         CTRL_OUT,      //      uint8_t bmRequestType
                         0xA4,          //      uint8_t bRequest
                         1<<6,          //      uint16_t wValue
                         0,             //      uint16_t wIndex
                         NULL,          //      unsigned char *data
                         0,             //      uint16_t wLength
                         1000);         //      unsigned int timeout

So I think it might be possible to do the same to read state of CTS pin?

modman
  • 11
  • 3

1 Answers1

0

Thanks to kernel driver source code:

        libusb_control_transfer( handle,
                             CTRL_IN,
                             0x95,
                             0x0706,
                             0,
                             &data[0],
                             2,
                             1000);
modman
  • 11
  • 3