PebbleOS v4.48.0-75-g7416f78a1
Loading...
Searching...
No Matches
usb.h File Reference
#include <stdint.h>
#include <pbl/kernel/compiler.h>

Data Structures

struct  pbl_usb_setup
 Setup packet, its 16-bit fields in CPU order. More...
 
struct  pbl_usb_desc_header
 The first two fields of every descriptor. More...
 
struct  pbl_usb_desc_device
 Device descriptor. More...
 
struct  pbl_usb_desc_qualifier
 Device qualifier descriptor: the device as it would be at the other speed. More...
 
struct  pbl_usb_desc_config
 Configuration descriptor, which the descriptors of its interfaces follow. More...
 
struct  pbl_usb_desc_iad
 Interface association descriptor: interfaces that make one function. More...
 
struct  pbl_usb_desc_iface
 Interface descriptor, of one alternate setting of an interface. More...
 
struct  pbl_usb_desc_ep
 Endpoint descriptor. More...
 
struct  pbl_usb_desc_bos
 BOS descriptor, which device capability descriptors follow. More...
 
struct  pbl_usb_desc_usb20_ext
 USB 2.0 extension capability. More...
 
struct  pbl_usb_desc_platform
 Platform capability, which data of the platform follows. More...
 

Macros

bmRequestType fields
#define PBL_USB_DIR_IN   0x80U
 
#define PBL_USB_TYPE_MASK   0x60U
 
#define PBL_USB_TYPE_STANDARD   0x00U
 
#define PBL_USB_TYPE_CLASS   0x20U
 
#define PBL_USB_TYPE_VENDOR   0x40U
 
#define PBL_USB_RECIP_MASK   0x1fU
 
#define PBL_USB_RECIP_DEVICE   0x00U
 
#define PBL_USB_RECIP_INTERFACE   0x01U
 
#define PBL_USB_RECIP_ENDPOINT   0x02U
 
Standard requests
#define PBL_USB_REQ_GET_STATUS   0x00U
 
#define PBL_USB_REQ_CLEAR_FEATURE   0x01U
 
#define PBL_USB_REQ_SET_FEATURE   0x03U
 
#define PBL_USB_REQ_SET_ADDRESS   0x05U
 
#define PBL_USB_REQ_GET_DESCRIPTOR   0x06U
 
#define PBL_USB_REQ_GET_CONFIGURATION   0x08U
 
#define PBL_USB_REQ_SET_CONFIGURATION   0x09U
 
#define PBL_USB_REQ_GET_INTERFACE   0x0aU
 
#define PBL_USB_REQ_SET_INTERFACE   0x0bU
 
Feature selectors
#define PBL_USB_FEATURE_ENDPOINT_HALT   0x00U
 
#define PBL_USB_FEATURE_DEVICE_REMOTE_WAKEUP   0x01U
 
Descriptor types
#define PBL_USB_DESC_DEVICE   0x01U
 
#define PBL_USB_DESC_CONFIGURATION   0x02U
 
#define PBL_USB_DESC_STRING   0x03U
 
#define PBL_USB_DESC_INTERFACE   0x04U
 
#define PBL_USB_DESC_ENDPOINT   0x05U
 
#define PBL_USB_DESC_DEVICE_QUALIFIER   0x06U
 
#define PBL_USB_DESC_OTHER_SPEED   0x07U
 
#define PBL_USB_DESC_IAD   0x0bU
 
#define PBL_USB_DESC_BOS   0x0fU
 
#define PBL_USB_DESC_DEVICE_CAP   0x10U
 
#define PBL_USB_DESC_CS_INTERFACE   0x24U
 
Device capability types, in the BOS descriptor
#define PBL_USB_CAP_USB20_EXT   0x02U
 
#define PBL_USB_CAP_PLATFORM   0x05U