embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

Module ch34x

Module ch34x 

Source
Expand description

WCH CH34x (CH340 / CH341) USB ↔ UART bridge driver.

Driver for Winchiphead / WCH USB-to-UART bridge ICs (CH340G, CH340C, CH340N, CH340K, CH341A). Transports serial data over bulk endpoints and performs line configuration, baud rate, and modem control via vendor-specific control transfers.

Modules§

id
WCH VID and common CH34x PIDs.

Structs§

Ch34xDevice
CH34x device — owns the shared control pipe on endpoint 0.
Ch34xInfo
Descriptor-located info for a single CH34x interface.
Ch34xMatcher
Matcher for the vendor-specific CH34x interface.
Ch34xPort
An open CH34x UART port.
Reader
Port reader half.
Writer
Port writer half.

Enums§

Ch34xError
CH34x host driver error.

Functions§

calculate_baud_divisor
Calculate the CH340 prescaler and divisor register value for a target baud rate.
find_ch34x
Return the nth (0-indexed) vendor-class interface in config_desc that exposes a bulk IN + bulk OUT endpoint pair.