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§
- Ch34x
Device - CH34x device — owns the shared control pipe on endpoint 0.
- Ch34x
Info - Descriptor-located info for a single CH34x interface.
- Ch34x
Matcher - Matcher for the vendor-specific CH34x interface.
- Ch34x
Port - An open CH34x UART port.
- Reader
- Port reader half.
- Writer
- Port writer half.
Enums§
- Ch34x
Error - 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 inconfig_descthat exposes a bulk IN + bulk OUT endpoint pair.