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

usbhs: implement USBHS USB device driver #63

Merged
merged 8 commits into from
Nov 4, 2024

Commits on Nov 3, 2024

  1. crate: remove use of unstable feature naked_functions

    Since all uses of naked_functions have been removed, remove the feature
    declaration to build on the stable toolchain.
    Codetector1374 authored and Dummyc0m committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    23ec707 View commit details
    Browse the repository at this point in the history
  2. bugfix(otgfs): Remove wrong assertions

    ExplodingWaffle pointed out[1] the host is allowed to send a shorter
    packet than what we were expecting. Remove the assertions and links to
    embassy.
    
    [1] ch32-rs#59 (comment)
    
    Reported-by: Harry Brooke <harry.brooke1@hotmail.co.uk>
    Codetector1374 authored and Dummyc0m committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    a08faca View commit details
    Browse the repository at this point in the history
  3. usb: remove the dir function from Dir trait

    Refactor to improve code reuse in USBHS.
    Dummyc0m committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    45a1c0c View commit details
    Browse the repository at this point in the history
  4. macros: add unwrap macro

    Calling .unwrap can result in extra strings and bloat. Use the defmt
    unwrap macro.
    Dummyc0m committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    02566e1 View commit details
    Browse the repository at this point in the history
  5. usbhs: setup RCC

    Setup USBHS related RCC register values.
    
    Co-authored-by: Harry Brooke <harry.brooke1@hotmail.co.uk>
    Co-authored-by: Codetector <codetector@codetector.org>
    Co-authored-by: Dummyc0m <xieyuanchu@gmail.com>
    3 people committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    9dec54d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    29e93f6 View commit details
    Browse the repository at this point in the history
  7. usbhs: implement USBHS USB device driver

    Implement the Embassy USB driver for the USBHS peripheral. The
    implementation largely mirrors the OTG_FS driver and has similar
    limitation such as non-configurable endpoint buffer sizes, in/out on the
    same endpoint index, lack of iso transfer, and untested bulk transfer.
    
    This change requires the latest fixes in ch32-metapac due to incorrect
    striding of the endpoint control registers.
    
    Tested on CH32V305 with the following applications:
    - USB HID device, for testing non-control endpoints interrupt transfer.
    - USB DFU, for testing the control endpoint.
    
    Co-authored-by: Harry Brooke <harry.brooke1@hotmail.co.uk>
    Co-authored-by: Codetector <codetector@codetector.org>
    Co-authored-by: Dummyc0m <xieyuanchu@gmail.com>
    3 people committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    2966c4a View commit details
    Browse the repository at this point in the history
  8. cleanup(usb): EndpointBufferAllocator asserts

    Small cleanup in EndpointBufferAllocator to ensure we don't request max_packet_size > 64
    Codetector1374 committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    8949439 View commit details
    Browse the repository at this point in the history