libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
usbd.h File Reference
Include dependency graph for usbd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define otgfs_usb_driver   stm32f107_usb_driver
 
#define otghs_usb_driver   stm32f207_usb_driver
 

Typedefs

typedef struct _usbd_driver usbd_driver
 
typedef struct _usbd_device usbd_device
 
typedef void(* usbd_control_complete_callback) (usbd_device *usbd_dev, struct usb_setup_data *req)
 
typedef enum usbd_request_return_codes(* usbd_control_callback) (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len, usbd_control_complete_callback *complete)
 
typedef void(* usbd_set_config_callback) (usbd_device *usbd_dev, uint16_t wValue)
 
typedef void(* usbd_set_altsetting_callback) (usbd_device *usbd_dev, uint16_t wIndex, uint16_t wValue)
 
typedef void(* usbd_endpoint_callback) (usbd_device *usbd_dev, uint8_t ep)
 

Enumerations

enum  usbd_request_return_codes { USBD_REQ_NOTSUPP = 0 , USBD_REQ_HANDLED = 1 , USBD_REQ_NEXT_CALLBACK = 2 }
 

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...
 
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...
 
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...
 
void usbd_register_extra_string (usbd_device *usbd_dev, int index, const char *string)
 Registers a non-contiguous string descriptor. More...
 
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...
 

Variables

const usbd_driver st_usbfs_v1_usb_driver
 
const usbd_driver stm32f107_usb_driver
 
const usbd_driver stm32f207_usb_driver
 
const usbd_driver st_usbfs_v2_usb_driver
 
const usbd_driver efm32lg_usb_driver
 
const usbd_driver efm32hg_usb_driver
 
const usbd_driver lm4f_usb_driver