atomvm_gleam/usb_cdc
Types
Options for open / open_default.
Currently unused by the AtomVM USB CDC drivers; pass
default_config. Reserved for future driver options.
pub type Config {
Config
}
Constructors
-
Config
Errors from the USB CDC driver.
pub type Error {
Failed
NotSupported
Badarg
Timeout
Ealready
Other(String)
}
Constructors
-
Failed -
NotSupported -
Badarg -
Timeout -
Ealready -
Other(String)
USB CDC ACM driver wrappers for AtomVM (ESP32 / RP2 / STM32).
Peripheral name strings accepted by open differ by platform:
- ESP32: CDC interface id such as
"CDC0"or"USB0"(default CDC 0 when usingopen_default). - RP2 / STM32: the name is ignored (single CDC interface); prefer
open_default.
Upstream (same export shape on each platform):
ESP32,
RP2,
STM32.
Implements the
uart_hal
behaviour over USB CDC.
Opaque USB CDC driver handle (port() from usb_cdc:open/1 / open/2).
pub type UsbCdc
Values
pub fn read(
usb: UsbCdc,
timeout_ms: Int,
) -> Result(BitArray, Error)
Read available data, waiting up to timeout_ms.
See usb_cdc:read/2.