Documentation ¶
Overview ¶
Package usbserial provides a simple USB CDC ACM serial driver. The main goal is simplicity, small code size and robustness but not speed.
The USB protocol is packet-oriented. This package simulates a stream-oriented device using a packet-oriented protocol. If all you want to do is sending and/or receiving packets of data over an USB its better and quite easy to use the CDC ACM data endponts with the usb package directly. Such approach will use the native packet/transaction oriented interface with the minimal overhead and maximum possible speed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
A Serial is a simple CDC ACM driver.
func NewDriver ¶
NewDriver... rxe (host out), txe (host in). MaxPkt must be power of two and equal or multiple of the maximum packet size declared in the OUT endpoint descriptor used by this driver as Rx endpoint.
func (*Driver) SetAutoFlush ¶
SetAutoFlush enables/disables the AutoFlush mode. If AutoFlush is enabled, Write calls Flush before exit.
func (*Driver) SetWriteSink ¶
SetWriteSink the WriteSink mode. Enabled WriteSink mode ensures that writes will not block if the USB serial device is not open for reading on the host side.