Documentation
¶
Overview ¶
Package usbserial implements Serial over USB (CDC-ACM) on i.MX6 SoCs.
This package is only meant to be used with `GOOS=tamago GOARCH=arm` as supported by the TamaGo framework for bare metal Go, see https://github.com/usbarmory/tamago.
Index ¶
- Variables
- type UART
- func (serial *UART) ACMControl(_ []byte, lastErr error) (in []byte, err error)
- func (serial *UART) ACMRx(out []byte, lastErr error) (_ []byte, err error)
- func (serial *UART) ACMTx(_ []byte, lastErr error) (in []byte, err error)
- func (serial *UART) Init() (err error)
- func (serial *UART) Write(p []byte) (n int, err error)
- func (serial *UART) WriteByte(c byte) (err error)
Constants ¶
This section is empty.
Variables ¶
var MaxPacketSize uint16 = 512
MaxPacketSize represents the USB data interface endpoint maximum packet size
Functions ¶
This section is empty.
Types ¶
type UART ¶
type UART struct {
sync.Mutex
// Device is the USB device associated to Serial over USB interface.
Device *usb.Device
// Rx is endpoint 1 OUT function, set by Init() to ACMRx if not
// already defined.
Rx func([]byte, error) ([]byte, error)
// Tx is endpoint 1 IN function, set by Init() to ACMTx if not already
// defined.
Tx func([]byte, error) ([]byte, error)
// Control is endpoint 2 IN function
Control func([]byte, error) ([]byte, error)
// contains filtered or unexported fields
}
UART represents a Serial over USB interface instance.
func (*UART) ACMControl ¶
ACMControl implements the endpoint 1 IN function.
func (*UART) ACMRx ¶
ACMRx implements the endpoint 2 OUT function, used to receive serial communication from host to device.
func (*UART) ACMTx ¶
ACMTx implements the endpoint 2 IN function, used to transmit serial communication from device to host.