Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
USB Device Controller (UDC)

The UDC provides a high-level abstraction of the USB device.

You can use these functions to control the main device state (start/attach/wakeup).

All USB Device Interface (UDI) in USB Device Stack is based on UDC to support USB enumeration.

This documentation describes common USB Device usage based on UDC, as follow:

API Overview

Functions

static void udc_attach (void)
 Attach device to the bus when possible. More...
 
static void udc_detach (void)
 Detaches the device from the bus. More...
 
usb_iface_desc_t UDC_DESC_STORAGE * udc_get_interface_desc (void)
 Returns a pointer on the current interface descriptor. More...
 
static bool udc_include_vbus_monitoring (void)
 Authorizes the VBUS event. More...
 
static void udc_remotewakeup (void)
 The USB driver sends a resume signal called "Upstream Resume". More...
 
void udc_start (void)
 Start the USB Device stack. More...
 
void udc_stop (void)
 Stop the USB Device stack. More...
 

static void udc_attach ( void  )
inlinestatic

Attach device to the bus when possible.

Warning
If a VBUS control is included in driver, then it will attach device when an acceptable VBUS level from the host is detected.
static void udc_detach ( void  )
inlinestatic

Detaches the device from the bus.

The driver must remove pull-up on USB line D- or D+.

usb_iface_desc_t UDC_DESC_STORAGE* udc_get_interface_desc ( void  )

Returns a pointer on the current interface descriptor.

Returns
Pointer on the current interface descriptor.
static bool udc_include_vbus_monitoring ( void  )
inlinestatic

Authorizes the VBUS event.

Returns
True, if the VBUS monitoring is possible.

See VBUS Monitoring for more details.

static void udc_remotewakeup ( void  )
inlinestatic

The USB driver sends a resume signal called "Upstream Resume".

This is authorized only when the remote wakeup feature is enabled by host.

void udc_start ( void  )

Start the USB Device stack.

void udc_stop ( void  )

Stop the USB Device stack.