Kuroneko.Gadget.ACM (kuroneko_gadget v0.5.0)

Copy Markdown View Source

The kernel's CDC ACM function: a serial port between the device and the target computer.

Kuroneko.Gadget.configure([:keyboard, :mouse, Kuroneko.Gadget.ACM])
Kuroneko.Gadget.ACM.tty()
#=> {:ok, "/dev/ttyGS0"}

The target sees a modem: /dev/ttyACM0 on Linux, /dev/cu.usbmodem... on macOS, a COM port on Windows. Each port takes two IN endpoints and one OUT; more than one need names, such as {Kuroneko.Gadget.ACM, name: "console"}. It takes no options.

Read the device's end with a port program such as Circuits.UART: a File read blocks one of the VM's dirty I/O schedulers until data comes, and nothing can call it off.

Summary

Functions

The device's end of a port, such as "/dev/ttyGS0": the one :name names, "serial" by default. Takes the :gadget option.

Functions

tty(opts \\ [])

@spec tty(keyword()) :: {:ok, Path.t()} | {:error, Kuroneko.Gadget.configfs_error()}

The device's end of a port, such as "/dev/ttyGS0": the one :name names, "serial" by default. Takes the :gadget option.