libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
usb_control.c File Reference
#include <stdlib.h>
#include <libopencm3/usb/usbd.h>
#include "usb_private.h"
Include dependency graph for usb_control.c:

Go to the source code of this file.

Functions

static void stall_transaction (usbd_device *usbd_dev)
 
static bool needs_zlp (uint16_t len, uint16_t wLength, uint8_t ep_size)
 If we're replying with some data, but less than the host is expecting, then we normally just do a short transfer. More...
 
int usbd_register_control_callback (usbd_device *usbd_dev, uint8_t type, uint8_t type_mask, usbd_control_callback callback)
 Registers a control callback. More...
 
static void usb_control_send_chunk (usbd_device *usbd_dev)
 
static int usb_control_recv_chunk (usbd_device *usbd_dev)
 
static enum usbd_request_return_codes usb_control_request_dispatch (usbd_device *usbd_dev, struct usb_setup_data *req)
 
static void usb_control_setup_read (usbd_device *usbd_dev, struct usb_setup_data *req)
 
static void usb_control_setup_write (usbd_device *usbd_dev, struct usb_setup_data *req)
 
void _usbd_control_setup (usbd_device *usbd_dev, uint8_t ea)
 
void _usbd_control_out (usbd_device *usbd_dev, uint8_t ea)
 
void _usbd_control_in (usbd_device *usbd_dev, uint8_t ea)
 

Function Documentation

◆ _usbd_control_in()

void _usbd_control_in ( usbd_device usbd_dev,
uint8_t  ea 
)

Definition at line 286 of file usb_control.c.

References usb_setup_data::bmRequestType, usb_setup_data::bRequest, stall_transaction(), usb_control_send_chunk(), USB_REQ_SET_ADDRESS, usbd_dev, usbd_ep_nak_set(), and usb_setup_data::wValue.

Referenced by usbd_init().

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

◆ _usbd_control_out()

void _usbd_control_out ( usbd_device usbd_dev,
uint8_t  ea 
)

Definition at line 240 of file usb_control.c.

References stall_transaction(), usb_control_recv_chunk(), usb_control_request_dispatch(), usbd_dev, usbd_ep_read_packet(), and usbd_ep_write_packet().

Referenced by usbd_init().

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

◆ _usbd_control_setup()

void _usbd_control_setup ( usbd_device usbd_dev,
uint8_t  ea 
)

Definition at line 222 of file usb_control.c.

References usb_setup_data::bmRequestType, usb_control_setup_read(), usb_control_setup_write(), usbd_dev, usbd_ep_nak_set(), and usb_setup_data::wLength.

Referenced by usbd_init().

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