Documentation
¶
Overview ¶
package cdc is for USB Communication Device Class devices.
Index ¶
- Variables
- func EnableUSBCDC()
- func NewRxRingBuffer() *rxRingBuffer
- func NewTxRingBuffer() *txRingBuffer
- type USBCDC
- func (usbcdc *USBCDC) Buffered() int
- func (usbcdc *USBCDC) Configure(config machine.UARTConfig) error
- func (usbcdc *USBCDC) DTR() bool
- func (usbcdc *USBCDC) Flush()
- func (usbcdc *USBCDC) RTS() bool
- func (usbcdc *USBCDC) Read(data []byte) (n int, err error)
- func (usbcdc *USBCDC) ReadByte() (byte, error)
- func (usbcdc *USBCDC) Receive(data byte)
- func (usbcdc *USBCDC) Write(data []byte) (n int, err error)
- func (usbcdc *USBCDC) WriteByte(c byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBufferEmpty = errors.New("USB-CDC buffer empty")
)
Functions ¶
func EnableUSBCDC ¶
func EnableUSBCDC()
func NewRxRingBuffer ¶
func NewRxRingBuffer() *rxRingBuffer
NewRxRingBuffer returns a new ring buffer.
func NewTxRingBuffer ¶
func NewTxRingBuffer() *txRingBuffer
NewTxRingBuffer returns a new ring buffer.
Types ¶
type USBCDC ¶
type USBCDC struct {
// contains filtered or unexported fields
}
USBCDC is the USB CDC aka serial over USB interface.
var ( // USB is a USB CDC interface. USB *USBCDC )
func (*USBCDC) Configure ¶
func (usbcdc *USBCDC) Configure(config machine.UARTConfig) error
Configure the USB CDC interface. The config is here for compatibility with the UART interface.
func (*USBCDC) ReadByte ¶
ReadByte reads a single byte from the RX buffer. If there is no data in the buffer, returns an error.
func (*USBCDC) Receive ¶
Receive handles adding data to the UART's data buffer. Usually called by the IRQ handler for a machine.
Click to show internal directories.
Click to hide internal directories.