include/usb/dev_mux.h File Reference

USB device multiplexing layer. More...

#include <buffer.h>
#include <usb/usb_protocol.h>

Go to the source code of this file.

Data Structures

struct  udm_interface
 A USB device interface. More...
struct  udm_config
 A USB device configuration. More...

Functions

Configuration Management

The following functions may be called by the application to create configurations and associate interfaces with them. The interface objects are typically returned by the initialization function of a USB Device Interface Driver.

udm_create_config() returns a configuration object which can be passed as a parameter to the other configuration management functions. The configuration descriptor is managed by the UDM layer, but the application may alter certain fields by calling udm_config_set_self_powered(), udm_config_set_bus_powered(), and udm_config_set_max_power(). The application must not create more than one configuration with a given value, and it must not attempt to create more configurations than specified by APP_USB_DEVICE_NR_CONFIGS.

struct udm_configudm_create_config (uint8_t value, uint8_t nr_interfaces)
 Create a new USB device configuration.
void udm_config_add_interface (struct udm_config *config, struct udm_interface *iface)
 Add an interface to a configuration.
void udm_config_set_max_power (struct udm_config *config, unsigned int milliamps)
 Set the maximum power consumption of a configuration.
void udm_config_set_self_powered (struct udm_config *config)
 Mark a configuration as self-powered.
void udm_config_set_bus_powered (struct udm_config *config)
 Mark a configuration as bus-powered.
USB String Descriptor Support

The following functions may be used by the application to implement support for USB string descriptors. Such descriptors are optional according to the USB spec, so by default, all string descriptor requests are rejected.

To support string descriptors, the application must implement the function app_usb_get_string_descriptor() and provide a preprocessor define named HAVE_APP_USB_GET_STRING_DESCRIPTOR (which will disable the default implementation).

int udm_submit_ascii_string_desc (struct udc *udc, struct usb_request *req, const char *str, uint16_t max_len)
 Add a string descriptor buffer initialized from an 8-bit ASCII encoded string.
int udm_submit_utf16le_string_desc (struct udc *udc, struct usb_request *req, const le16_t *str, uint16_t max_len)
 Add a string descriptor buffer initialized from a UTF-16LE encoded string.

Detailed Description

USB device multiplexing layer.

Copyright (C) 2009 Atmel Corporation. All rights reserved.

Definition in file dev_mux.h.

Generated on Thu Apr 29 14:10:34 2010 for xplain-bc by  doxygen 1.6.3