Skip to content

FTDI VCP Driver to include CTS signal on change? (IEC-460) #360

@Rotario

Description

@Rotario

Is your feature request related to a problem?

Hi - I'm trying to integrate with a device that uses CTS signals for flow control.

I can see below that the FTDI driver implementation follows the CNC-PSTN standard, so it's missing the CTS signal.

How can I use the ESP usb vcp driver to respect CTS signals from some legacy hardware?

esp-usb/host/class/cdc/usb_host_cdc_acm/include/usb/usb_types_cdc.h

/**
 * @brief UART State Bitmap
 * @see Table 31, USB CDC-PSTN specification rev. 1.2
 */
typedef union {
    struct {
        uint16_t bRxCarrier : 1;  // State of receiver carrier detection mechanism of device. This signal corresponds to V.24 signal 109 and RS-232 signal DCD.
        uint16_t bTxCarrier : 1;  // State of transmission carrier. This signal corresponds to V.24 signal 106 and RS-232 signal DSR.
        uint16_t bBreak : 1;      // State of break detection mechanism of the device.
        uint16_t bRingSignal : 1; // State of ring signal detection of the device.
        uint16_t bFraming : 1;    // A framing error has occurred.
        uint16_t bParity : 1;     // A parity error has occurred.
        uint16_t bOverRun : 1;    // Received data has been discarded due to overrun in the device.
        uint16_t reserved : 9;
    };
    uint16_t val;
} cdc_acm_uart_state_t;

Describe the solution you'd like.

I'd like to be able to monitor the state change using the already available
Here:

    const cdc_acm_host_device_config_t dev_config = {
      .connection_timeout_ms = 5000, // 5 seconds, enough time to plug the device in or experiment with timeout
      .out_buffer_size = 4096,
      .in_buffer_size = 4096,
      .event_cb = handle_event,
      .data_cb = handle_rx,
      .user_arg = NULL,
    };
  

Describe alternatives you've considered.

i can patch the FTDI driver for now to surface CTS in an unused bit of the cdc_acm_uart_state_t struct but I'd like to not have to patch this every time I update

Additional context.

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions