usbpsu
Xilinx SDK Drivers API Documentation
xusbpsu_ch9.h File Reference

Overview

MODIFICATION HISTORY:
Ver   Who  Date     Changes

1.0 sg 06/06/16 First release 1.1 vak 30/11/16 updated for adding ch9 function callbacks 1.2 mn 01/20/17 fix to assign EP number and direction from wIndex field
 

Data Structures

struct  __attribute__
 USB Standard Control Request. More...
 
struct  __attribute__
 USB Standard Control Request. More...
 

Macros

Request types
#define XUSBPSU_REQ_TYPE_MASK   0x60
 Mask for request opcode. More...
 
#define XUSBPSU_CMD_STDREQ   0x00
 Standard Request. More...
 
#define XUSBPSU_CMD_CLASSREQ   0x20
 Class Request. More...
 
#define XUSBPSU_CMD_VENDREQ   0x40
 Vendor Request. More...
 
#define XUSBPSU_ENDPOINT_NUMBER_MASK   0x0f
 
#define XUSBPSU_ENDPOINT_DIR_MASK   0x80
 
#define USB_ENDPOINT_XFERTYPE_MASK   0x03
 
Request Values
#define XUSBPSU_REQ_GET_STATUS   0x00
 
#define XUSBPSU_REQ_CLEAR_FEATURE   0x01
 
#define XUSBPSU_REQ_SET_FEATURE   0x03
 
#define XUSBPSU_REQ_SET_ADDRESS   0x05
 
#define XUSBPSU_REQ_GET_DESCRIPTOR   0x06
 
#define XUSBPSU_REQ_SET_DESCRIPTOR   0x07
 
#define XUSBPSU_REQ_GET_CONFIGURATION   0x08
 
#define XUSBPSU_REQ_SET_CONFIGURATION   0x09
 
#define XUSBPSU_REQ_GET_INTERFACE   0x0a
 
#define XUSBPSU_REQ_SET_INTERFACE   0x0b
 
#define XUSBPSU_REQ_SYNC_FRAME   0x0c
 
#define XUSBPSU_REQ_SET_SEL   0x30
 
#define XUSBPSU_REQ_SET_ISOCH_DELAY   0x31
 
Feature Selectors
#define XUSBPSU_ENDPOINT_HALT   0x00
 
#define XUSBPSU_DEVICE_REMOTE_WAKEUP   0x01
 
#define XUSBPSU_TEST_MODE   0x02
 
#define XUSBPSU_U1_ENABLE   0x30
 
#define XUSBPSU_U2_ENABLE   0x31
 
Descriptor Types
#define XUSBPSU_TYPE_DEVICE_DESC   0x01
 
#define XUSBPSU_TYPE_CONFIG_DESC   0x02
 
#define XUSBPSU_TYPE_STRING_DESC   0x03
 
#define XUSBPSU_TYPE_INTERFACE_DESC   0x04
 
#define XUSBPSU_TYPE_ENDPOINT_CFG_DESC   0x05
 
#define XUSBPSU_TYPE_DEVICE_QUALIFIER   0x06
 
#define XUSBPSU_TYPE_BOS_DESC   0x0F
 
#define XUSBPSU_TYPE_HID_DESC   0x21
 
#define XUSBPSU_TYPE_REPORT_DESC   0x22
 
USB Device States
#define XUSBPSU_DEVICE_ATTACHED   0x00
 
#define XUSBPSU_DEVICE_POWERED   0x01
 
#define XUSBPSU_DEVICE_DEFAULT   0x02
 
#define XUSBPSU_DEVICE_ADDRESSED   0x03
 
#define XUSBPSU_DEVICE_CONFIGURED   0x04
 
#define XUSBPSU_DEVICE_SUSPENDED   0x05
 
Status type
#define XUSBPSU_STATUS_MASK   0x3
 
#define XUSBPSU_STATUS_DEVICE   0x0
 
#define XUSBPSU_STATUS_INTERFACE   0x1
 
#define XUSBPSU_STATUS_ENDPOINT   0x2
 
EP Types
#define XUSBPSU_EP_CONTROL   0
 
#define XUSBPSU_EP_ISOCHRONOUS   1
 
#define XUSBPSU_EP_BULK   2
 
#define XUSBPSU_EP_INTERRUPT   3
 
Device Classes
#define XUSBPSU_CLASS_HID   0x03
 
#define XUSBPSU_CLASS_STORAGE   0x08
 
#define XUSBPSU_CLASS_VENDOR   0xFF
 

Functions

void XUsbPsu_Ch9Handler (struct XUsbPsu *InstancePtr, SetupPacket *SetupData)
 This function handles a Setup Data packet from the host. More...
 

Macro Definition Documentation

◆ XUSBPSU_CMD_CLASSREQ

#define XUSBPSU_CMD_CLASSREQ   0x20

Class Request.

◆ XUSBPSU_CMD_STDREQ

#define XUSBPSU_CMD_STDREQ   0x00

Standard Request.

◆ XUSBPSU_CMD_VENDREQ

#define XUSBPSU_CMD_VENDREQ   0x40

Vendor Request.

◆ XUSBPSU_REQ_TYPE_MASK

#define XUSBPSU_REQ_TYPE_MASK   0x60

Mask for request opcode.

Function Documentation

◆ XUsbPsu_Ch9Handler()

void XUsbPsu_Ch9Handler ( struct XUsbPsu InstancePtr,
SetupPacket *  SetupData 
)

This function handles a Setup Data packet from the host.

Parameters
InstancePtris a pointer to XUsbPsu instance of the controller.
SetupDatais the structure containing the setup request.
Returns
  • XST_SUCCESS if the function is successful.
  • XST_FAILURE if an Error occured.
Note
None.