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

Go to the source code of this file.

Functions

usbd_deviceusbd_init (const usbd_driver *driver, const struct usb_device_descriptor *dev, const struct usb_config_descriptor *conf, const char *const *strings, int num_strings, uint8_t *control_buffer, uint16_t control_buffer_size)
 Main initialization entry point. More...
 
void usbd_register_reset_callback (usbd_device *usbd_dev, void(*callback)(void))
 Registers a reset callback. More...
 
void usbd_register_suspend_callback (usbd_device *usbd_dev, void(*callback)(void))
 Registers a suspend callback. More...
 
void usbd_register_resume_callback (usbd_device *usbd_dev, void(*callback)(void))
 Registers a resume callback. More...
 
void usbd_register_sof_callback (usbd_device *usbd_dev, void(*callback)(void))
 Registers a SOF callback. More...
 
void usbd_register_extra_string (usbd_device *usbd_dev, int index, const char *string)
 Registers a non-contiguous string descriptor. More...
 
void _usbd_reset (usbd_device *usbd_dev)
 
void usbd_poll (usbd_device *usbd_dev)
 
void usbd_disconnect (usbd_device *usbd_dev, bool disconnected)
 Disconnect, if supported by the driver. More...
 
void usbd_ep_setup (usbd_device *usbd_dev, uint8_t addr, uint8_t type, uint16_t max_size, usbd_endpoint_callback callback)
 Setup an endpoint. More...
 
uint16_t usbd_ep_write_packet (usbd_device *usbd_dev, uint8_t addr, const void *buf, uint16_t len)
 Write a packet. More...
 
uint16_t usbd_ep_read_packet (usbd_device *usbd_dev, uint8_t addr, void *buf, uint16_t len)
 Read a packet. More...
 
void usbd_ep_stall_set (usbd_device *usbd_dev, uint8_t addr, uint8_t stall)
 Set/clear STALL condition on an endpoint. More...
 
uint8_t usbd_ep_stall_get (usbd_device *usbd_dev, uint8_t addr)
 Get STALL status of an endpoint. More...
 
void usbd_ep_nak_set (usbd_device *usbd_dev, uint8_t addr, uint8_t nak)
 Set an Out endpoint to NAK. More...