| usbpsu Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xusb_ch9.h File Reference

## Overview

This file contains definitions used chapter 9 specific code.

    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
    1.4   BK  12/01/18  Renamed the file and added changes to have a common
                   example for all USB IPs.

## Macros
Request types
#define | USB_REQ_TYPE_MASK 0x60
| Mask for request opcode. More...
#define | USB_CMD_STDREQ 0x00
| Standard Request. More...
#define | USB_CMD_CLASSREQ 0x20
| Class Request. More...
#define | USB_CMD_VENDREQ 0x40
| Vendor Request. More...
#define | USB_ENDPOINT_NUMBER_MASK 0x0f
#define | USB_ENDPOINT_DIR_MASK 0x80
#define | USB_ENDPOINT_XFERTYPE_MASK 0x03
Request Values
#define | USB_REQ_GET_STATUS 0x00
#define | USB_REQ_CLEAR_FEATURE 0x01
#define | USB_REQ_SET_FEATURE 0x03
#define | USB_REQ_SET_ADDRESS 0x05
#define | USB_REQ_GET_DESCRIPTOR 0x06
#define | USB_REQ_SET_DESCRIPTOR 0x07
#define | USB_REQ_GET_CONFIGURATION 0x08
#define | USB_REQ_SET_CONFIGURATION 0x09
#define | USB_REQ_GET_INTERFACE 0x0a
#define | USB_REQ_SET_INTERFACE 0x0b
#define | USB_REQ_SYNC_FRAME 0x0c
#define | USB_REQ_SET_SEL 0x30
#define | USB_REQ_SET_ISOCH_DELAY 0x31
Feature Selectors
#define | USB_ENDPOINT_HALT 0x00
#define | USB_DEVICE_REMOTE_WAKEUP 0x01
#define | USB_TEST_MODE 0x02
#define | USB_U1_ENABLE 0x30
#define | USB_U2_ENABLE 0x31
#define | USB_INTRF_FUNC_SUSPEND 0x00 /* function suspend */
Descriptor Types
#define | USB_TYPE_DEVICE_DESC 0x01
#define | USB_TYPE_CONFIG_DESC 0x02
#define | USB_TYPE_STRING_DESC 0x03
#define | USB_TYPE_INTERFACE_DESC 0x04
#define | USB_TYPE_ENDPOINT_CFG_DESC 0x05
#define | USB_TYPE_DEVICE_QUALIFIER 0x06
#define | OSD_TYPE_CONFIG_DESCR 0x07
#define | USB_TYPE_INTERFACE_ASSOCIATION 0x0b
#define | USB_TYPE_BOS_DESC 0x0F
#define | USB_TYPE_HID_DESC 0x21
#define | USB_TYPE_REPORT_DESC 0x22
#define | USB_TYPE_DFUFUNC_DESC 0x21 /* DFU Functional Desc */
Status type
#define | USB_STATUS_MASK 0x3
#define | USB_STATUS_DEVICE 0x0
#define | USB_STATUS_INTERFACE 0x1
#define | USB_STATUS_ENDPOINT 0x2
EP Types
#define | USB_EP_CONTROL 0
#define | USB_EP_ISOCHRONOUS 1
#define | USB_EP_BULK 2
#define | USB_EP_INTERRUPT 3
Device Classes
#define | USB_CLASS_AUDIO 0x01
#define | USB_CLASS_HID 0x03
#define | USB_CLASS_STORAGE 0x08
#define | USB_CLASS_MISC 0xEF
#define | USB_CLASS_DFU 0xFE
#define | USB_CLASS_VENDOR 0xFF

## Functions
void | Ch9Handler (struct Usb_DevData *InstancePtr, SetupPacket *SetupData)
| This function handles a Setup Data packet from the host. More...

## Macro Definition Documentation

#define USB_CMD_CLASSREQ 0x20

Class Request.

Referenced by Ch9Handler(), and Usb_ClassReq_Keyboard().

#define USB_CMD_STDREQ 0x00

Standard Request.

Referenced by Ch9Handler(), and Usb_GetDescReply().

#define USB_CMD_VENDREQ 0x40

Vendor Request.

Referenced by Ch9Handler().

#define USB_REQ_TYPE_MASK 0x60

Mask for request opcode.

Referenced by Ch9Handler().

## Function Documentation

void Ch9Handler | ( | struct Usb_DevData * | InstancePtr,
|  | SetupPacket * | SetupData
| ) |  |

This function handles a Setup Data packet from the host.

Parameters

  InstancePtr | is a pointer to Usb_DevData instance of the controller.
  SetupData | is the structure containing the setup request.

Returns
  None.

Note
  None.

References Usb_DevData::PrivateData, USB_CMD_CLASSREQ, USB_CMD_STDREQ, USB_CMD_VENDREQ, and USB_REQ_TYPE_MASK.

Referenced by main().