libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
Generic USB Standard Request Interface

Generic USB Standard Request Interface More...

Functions

int usbd_register_set_config_callback (usbd_device *usbd_dev, usbd_set_config_callback callback)
 Registers a "Set Config" callback. More...
 
void usbd_register_set_altsetting_callback (usbd_device *usbd_dev, usbd_set_altsetting_callback callback)
 Registers a "Set Interface" (alternate setting) callback. More...
 
static uint16_t build_config_descriptor (usbd_device *usbd_dev, uint8_t index, uint8_t *buf, uint16_t len)
 
static int usb_descriptor_type (uint16_t wValue)
 
static int usb_descriptor_index (uint16_t wValue)
 
static enum usbd_request_return_codes usb_standard_get_descriptor (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len)
 
static enum usbd_request_return_codes usb_standard_set_address (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len)
 
static enum usbd_request_return_codes usb_standard_set_configuration (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len)
 
static enum usbd_request_return_codes usb_standard_get_configuration (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len)
 
static enum usbd_request_return_codes usb_standard_set_interface (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len)
 
static enum usbd_request_return_codes usb_standard_get_interface (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len)
 
static enum usbd_request_return_codes usb_standard_device_get_status (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len)
 
static enum usbd_request_return_codes usb_standard_interface_get_status (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len)
 
static enum usbd_request_return_codes usb_standard_endpoint_get_status (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len)
 
static enum usbd_request_return_codes usb_standard_endpoint_stall (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len)
 
static enum usbd_request_return_codes usb_standard_endpoint_unstall (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len)
 

Detailed Description

Generic USB Standard Request Interface

Version
1.0.0
Author
© 2010 Gareth McMullin garet.nosp@m.h@bl.nosp@m.acksp.nosp@m.here.nosp@m..co.n.nosp@m.z
Date
10 March 2013

LGPL License Terms libopencm3 License

Function Documentation

◆ build_config_descriptor()

◆ usb_descriptor_index()

static int usb_descriptor_index ( uint16_t  wValue)
static

Definition at line 147 of file usb_standard.c.

Referenced by usb_standard_get_descriptor().

Here is the caller graph for this function:

◆ usb_descriptor_type()

static int usb_descriptor_type ( uint16_t  wValue)
static

Definition at line 142 of file usb_standard.c.

Referenced by usb_standard_get_descriptor().

Here is the caller graph for this function:

◆ usb_standard_device_get_status()

static enum usbd_request_return_codes usb_standard_device_get_status ( usbd_device usbd_dev,
struct usb_setup_data req,
uint8_t **  buf,
uint16_t *  len 
)
static

Definition at line 407 of file usb_standard.c.

References USBD_REQ_HANDLED.

Referenced by _usbd_standard_request_device().

Here is the caller graph for this function:

◆ usb_standard_endpoint_get_status()

static enum usbd_request_return_codes usb_standard_endpoint_get_status ( usbd_device usbd_dev,
struct usb_setup_data req,
uint8_t **  buf,
uint16_t *  len 
)
static

Definition at line 444 of file usb_standard.c.

References usbd_ep_stall_get(), USBD_REQ_HANDLED, and usb_setup_data::wIndex.

Referenced by _usbd_standard_request_endpoint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_standard_endpoint_stall()

static enum usbd_request_return_codes usb_standard_endpoint_stall ( usbd_device usbd_dev,
struct usb_setup_data req,
uint8_t **  buf,
uint16_t *  len 
)
static

Definition at line 460 of file usb_standard.c.

References usbd_ep_stall_set(), USBD_REQ_HANDLED, and usb_setup_data::wIndex.

Referenced by _usbd_standard_request_endpoint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_standard_endpoint_unstall()

static enum usbd_request_return_codes usb_standard_endpoint_unstall ( usbd_device usbd_dev,
struct usb_setup_data req,
uint8_t **  buf,
uint16_t *  len 
)
static

Definition at line 473 of file usb_standard.c.

References usbd_ep_stall_set(), USBD_REQ_HANDLED, and usb_setup_data::wIndex.

Referenced by _usbd_standard_request_endpoint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usb_standard_get_configuration()

static enum usbd_request_return_codes usb_standard_get_configuration ( usbd_device usbd_dev,
struct usb_setup_data req,
uint8_t **  buf,
uint16_t *  len 
)
static

Definition at line 328 of file usb_standard.c.

References usb_config_descriptor::bConfigurationValue, and USBD_REQ_HANDLED.

Referenced by _usbd_standard_request_device().

Here is the caller graph for this function:

◆ usb_standard_get_descriptor()

static enum usbd_request_return_codes usb_standard_get_descriptor ( usbd_device usbd_dev,
struct usb_setup_data req,
uint8_t **  buf,
uint16_t *  len 
)
static

◆ usb_standard_get_interface()

static enum usbd_request_return_codes usb_standard_get_interface ( usbd_device usbd_dev,
struct usb_setup_data req,
uint8_t **  buf,
uint16_t *  len 
)
static

◆ usb_standard_interface_get_status()

static enum usbd_request_return_codes usb_standard_interface_get_status ( usbd_device usbd_dev,
struct usb_setup_data req,
uint8_t **  buf,
uint16_t *  len 
)
static

Definition at line 426 of file usb_standard.c.

References USBD_REQ_HANDLED.

Referenced by _usbd_standard_request_interface().

Here is the caller graph for this function:

◆ usb_standard_set_address()

static enum usbd_request_return_codes usb_standard_set_address ( usbd_device usbd_dev,
struct usb_setup_data req,
uint8_t **  buf,
uint16_t *  len 
)
static

Definition at line 239 of file usb_standard.c.

References usb_setup_data::bmRequestType, USBD_REQ_HANDLED, USBD_REQ_NOTSUPP, and usb_setup_data::wValue.

Referenced by _usbd_standard_request_device().

Here is the caller graph for this function:

◆ usb_standard_set_configuration()

static enum usbd_request_return_codes usb_standard_set_configuration ( usbd_device usbd_dev,
struct usb_setup_data req,
uint8_t **  buf,
uint16_t *  len 
)
static

◆ usb_standard_set_interface()

static enum usbd_request_return_codes usb_standard_set_interface ( usbd_device usbd_dev,
struct usb_setup_data req,
uint8_t **  buf,
uint16_t *  len 
)
static

◆ usbd_register_set_altsetting_callback()

void usbd_register_set_altsetting_callback ( usbd_device usbd_dev,
usbd_set_altsetting_callback  callback 
)

Registers a "Set Interface" (alternate setting) callback.

Parameters
usbd_devthe usb device handle returned from usbd_init
callbackyour desired callback function

Definition at line 62 of file usb_standard.c.

◆ usbd_register_set_config_callback()

int usbd_register_set_config_callback ( usbd_device usbd_dev,
usbd_set_config_callback  callback 
)

Registers a "Set Config" callback.

Parameters
usbd_devthe usb device handle returned from usbd_init
callbackyour desired callback function
Returns
0 if successful or already existed.
-1 if no more space was available for callbacks.

Definition at line 42 of file usb_standard.c.

Referenced by usb_msc_init().

Here is the caller graph for this function: