Skip to content

Optional interface name per CDC - #28

Closed
Jiu-xiao wants to merge 1 commit into
devfrom
feat/cdc-interface-name-20261007
Closed

Jiu-xiao wants to merge 1 commit into
devfrom
feat/cdc-interface-name-20261007

Conversation

@Jiu-xiao

@Jiu-xiao Jiu-xiao commented Oct 8, 2026

Copy link
Copy Markdown
Member

An item of USB.<instance>.cdc in libxr_config.yaml may set interface. It becomes the control and data interface name of that CDCUart, so a host can tell apart CDCs that share VID:PID.

USB:
  usb_otg_hs:
    enable: true
    cdc:
    - {tx_fifo_size: 128, rx_fifo_size: 128, queue_size: 3, interface: Console}
    - {tx_fifo_size: 128, rx_fifo_size: 128, queue_size: 3, interface: Telemetry}

What changes

  • _check_cdc: interface is optional and must be a string; it gets no default.
  • The generated USB::CDCUart takes the name twice (control_interface_string, data_interface_string); double quotes in the name are escaped.
  • Items without interface generate the same code as before (LibXR defaults XRUSB CDC Control / XRUSB CDC Data).
  • README: the interface key with an example.

The two constructor arguments exist in CDCUart on LibXR master (V2.0.0) and dev.

Verification

  • python -m unittest discover -s tests -p "test_*.py": 507 tests OK (6 skipped), including the new cases in tests/test_generator_code_stm32.py; ruff check and ruff format --check clean.

An item of USB.<instance>.cdc may set interface; it becomes the control and data interface names of the CDCUart, so a host can tell CDCs with the same VID:PID apart. Items without it generate the same code as before.
@Jiu-xiao

Jiu-xiao commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Duplicate of #26 (same patch, identical tree after merge); its CI run on the merged tree passed and #26 was merged.

@Jiu-xiao Jiu-xiao closed this Oct 8, 2026
@Jiu-xiao
Jiu-xiao deleted the feat/cdc-interface-name-20261007 branch October 11, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant