Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CH552 CDC+HID support #265

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

CH552 CDC+HID support #265

wants to merge 7 commits into from

Conversation

jthornblad
Copy link
Contributor

@jthornblad jthornblad commented Sep 25, 2024

Description

  • Support both CDC and HID USB classes in the CH552.
  • Introduce a framing protocol between CH552 and CPU to be able to address different USB endpoints from firmware and device apps.
  • Add support to firmware to speak to CDC using the firmware protocol above.
  • Increase baud rate to 500 k.
  • Introduce a clear to send signal between CH552 and CPU.

Closes #216
Closes #286

Note well:

  • The introduction of the framing protocol means all device apps will have to change to be able to communicate with a client at all.
  • All client applications will have to adjust to the new baud rate.

Type of change

  • Feature (non breaking change which adds functionality)
  • Breaking Change (a change which would cause existing functionality to not work as expected)
  • Documentation (a change to documentation)

Submission checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my changes
  • I have tested and verified my changes on target
  • My changes are well written and CI is passing
  • I have squashed my work to relevant commits and rebased on main for linear history
  • I have added a "Co-authored-by: x" if several people contributed, either pair programming or by squashing commits from different authors.
  • I have updated the documentation where relevant (readme, dev.tillitis.se etc.)
  • QEMU is updated to reflect changes

jthornblad and others added 5 commits December 16, 2024 12:18
- Add USB HID support.
- Add framing to distinguish between CDC and HID data sent over the UART.
- Add some debug printing.
- Cleanup of code and formatting.
Throwing away mode and length from incoming data. Adding mode and
length to outgoing data.

Splitting responses into frames small enough for the USB<->UART
transceiver to handle.
to let the CH552 and FPGA signal each other that it is OK to send
UART data. The CTS signals indicate "OK to send" if high. If an
incoming CTS signal goes low, the receiver of that signal should
immediatly stop sending UART data.
  - Add CTS signals let the FPGA and CH552 signal each other that
    it is OK send UART data.
  - Update the CH552 rx and frame handling logic.
  - Fix minor spelling errors and indentation
@mchack-work mchack-work linked an issue Jan 8, 2025 that may be closed by this pull request
5 tasks
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.

Increase baudrate to 500 kilobaud CH552 fw: Support for different USB classes: CDC and HID
2 participants