picofuse

Data Structures | Macros | Typedefs | Enumerations | Functions
usb.h File Reference

USB host interface. More...

#include <stdbool.h>
#include <stdint.h>
Include dependency graph for usb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hw_usb_device_t
 Describes one interface of a USB device observed by the host. More...
 

Macros

#define HW_USB_STRING_MAX_LENGTH   63
 Maximum length of USB string descriptor fields, excluding the null terminator.
 
#define HW_USB_INTERFACE_MAX_COUNT   8
 Maximum number of interfaces a backend will report attach/detach events for on any single device - internal to each backend's own per-device interface cache, not a limit on any public array.
 

Typedefs

typedef struct hid_t hid_t
 
typedef struct hid_device_t hid_device_t
 
typedef struct hw_usb_t hw_usb_t
 Opaque USB host handle.
 
typedef void(* hw_usb_callback_t) (hw_usb_t *usb, hw_usb_event_t event, const hw_usb_device_t *device, void *userdata)
 Callback invoked on USB hotplug events. More...
 

Enumerations

enum  hw_usb_event_t { hw_usb_event_attached = (1 << 0), hw_usb_event_detached = (1 << 1) }
 USB hotplug event type. More...
 
enum  hw_usb_device_class_t {
  hw_usb_device_class_per_interface = 0x00, hw_usb_device_class_audio = 0x01, hw_usb_device_class_communications = 0x02, hw_usb_device_class_hid = 0x03,
  hw_usb_device_class_physical = 0x05, hw_usb_device_class_image = 0x06, hw_usb_device_class_printer = 0x07, hw_usb_device_class_mass_storage = 0x08,
  hw_usb_device_class_hub = 0x09, hw_usb_device_class_cdc_data = 0x0A, hw_usb_device_class_smart_card = 0x0B, hw_usb_device_class_content_security = 0x0D,
  hw_usb_device_class_video = 0x0E, hw_usb_device_class_personal_healthcare = 0x0F, hw_usb_device_class_audio_video = 0x10, hw_usb_device_class_bluetooth = 0xE0,
  hw_usb_device_class_miscellaneous = 0xEF, hw_usb_device_class_application_specific = 0xFE, hw_usb_device_class_vendor_specific = 0xFF
}
 USB device class codes. More...
 
enum  hw_usb_device_subclass_t { hw_usb_device_subclass_none = 0x00, hw_usb_device_subclass_boot_interface = 0x01, hw_usb_device_subclass_abstract_control_model = 0x02, hw_usb_device_subclass_vendor_specific = 0xFF }
 USB device subclass codes. More...
 
enum  hw_usb_device_protocol_t { hw_usb_device_protocol_none = 0x00, hw_usb_device_protocol_keyboard = 0x01, hw_usb_device_protocol_mouse = 0x02 }
 USB device protocol codes. More...
 

Functions

const char * hw_usb_device_class_to_string (hw_usb_device_class_t device_class)
 Convert a USB device class code to a display string. More...
 
const char * hw_usb_device_protocol_to_string (hw_usb_device_protocol_t device_protocol)
 Convert a USB device protocol code to a display string. More...
 
Lifecycle
hw_usb_thw_usb_init (void)
 Initialize the USB host subsystem. More...
 
void hw_usb_deinit (hw_usb_t *usb)
 Deinitialize the USB host subsystem. More...
 
Methods
void hw_usb_set_callback (hw_usb_t *usb, hw_usb_callback_t callback, void *userdata)
 Attach or detach the USB hotplug callback. More...
 
HID Integration
hid_device_thw_usb_register_hid (hid_t *instance, hw_usb_t *usb)
 Register a USB host hotplug observer as a HID source. More...
 

Detailed Description

USB host interface.

Definition in file usb.h.