USB::CDC Namespace Reference

Classes

class  Device
 Serial device implementation, in ACM mode. More...
 
class  HostDevice
 Implements CDC interface for a connected serial device. More...
 
class  UsbSerial
 Base class for both device and host serial port modes. More...
 

Typedefs

using MountCallback = Delegate< HostDevice *(const HostInterface::Instance &inst)>
 Application callback to notify connection of a new device. More...
 
using UnmountCallback = Delegate< void(HostDevice &dev)>
 Application callback to notify disconnection of a device. More...
 

Enumerations

enum class  Event { rx_data , tx_done , line_break }
 

Functions

void onMount (MountCallback callback)
 Application should call this method to receive device connection notifications. More...
 
void onUnmount (UnmountCallback callback)
 Application should call this method to receive device disconnection notifications. More...
 

Typedef Documentation

◆ MountCallback

Application callback to notify connection of a new device.

Parameters
instTinyUSB device instance
Return values
HostDevice*Application returns pointer to implementation, or nullptr to ignore this device

◆ UnmountCallback

using USB::CDC::UnmountCallback = typedef Delegate<void(HostDevice& dev)>

Application callback to notify disconnection of a device.

Parameters
devThe device which has been disconnected

Enumeration Type Documentation

◆ Event

enum USB::CDC::Event
strong
Enumerator
rx_data 
tx_done 
line_break 

Function Documentation

◆ onMount()

void USB::CDC::onMount ( MountCallback  callback)

Application should call this method to receive device connection notifications.

Parameters
callback

◆ onUnmount()

void USB::CDC::onUnmount ( UnmountCallback  callback)

Application should call this method to receive device disconnection notifications.

Parameters
callback