usbps: xusbps_ch9_storage.h File Reference

| usbps Xilinx SDK Drivers API Documentation

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

Functions
xusbps_ch9_storage.h File Reference

## Overview

This file contains definitions used in the chapter 9 code.

    MODIFICATION HISTORY:

    Ver   Who  Date     Changes

    1.00a wgr  10/10/10 First release

## Functions
u32 | XUsbPs_Ch9SetupDevDescReply (u8 *BufPtr, u32 BufLen)
| This function returns the device descriptor for the device. More...
u32 | XUsbPs_Ch9SetupCfgDescReply (u8 *BufPtr, u32 BufLen)
| This function returns the configuration descriptor for the device. More...
u32 | XUsbPs_Ch9SetupStrDescReply (u8 *BufPtr, u32 BufLen, u8 Index)
| This function returns a string descriptor for the given index. More...
void | XUsbPs_SetConfiguration (XUsbPs *InstancePtr, int ConfigIdx)
| This function handles a "set configuration" request. More...

## Function Documentation

u32 XUsbPs_Ch9SetupCfgDescReply | ( | u8 * | BufPtr,
|  | u32 | BufLen
| ) |  |

This function returns the configuration descriptor for the device.

Parameters

  BufPtr | is the pointer to the buffer that is to be filled with the descriptor.
  BufLen | is the size of the provided buffer.

Returns
  Length of the descriptor in the buffer on success. 0 on error.

u32 XUsbPs_Ch9SetupDevDescReply | ( | u8 * | BufPtr,
|  | u32 | BufLen
| ) |  |

This function returns the device descriptor for the device.

Parameters

  BufPtr | is pointer to the buffer that is to be filled with the descriptor.
  BufLen | is the size of the provided buffer.

Returns
  Length of the descriptor in the buffer on success. 0 on error.

u32 XUsbPs_Ch9SetupStrDescReply | ( | u8 * | BufPtr,
|  | u32 | BufLen,
|  | u8 | Index
| ) |  |

This function returns a string descriptor for the given index.

Parameters

  BufPtr | is a pointer to the buffer that is to be filled with the descriptor.
  BufLen | is the size of the provided buffer.
  Index | is the index of the string for which the descriptor is requested.

Returns
  Length of the descriptor in the buffer on success. 0 on error.

void XUsbPs_SetConfiguration | ( | XUsbPs * | InstancePtr,
|  | int | ConfigIdx
| ) |  |

This function handles a "set configuration" request.

Parameters

  InstancePtr | is a pointer to XUsbPs instance of the controller.
  ConfigIdx | is the Index of the desired configuration.

Returns
  None

References XUSBPS_EP_DIRECTION_IN, XUSBPS_EP_DIRECTION_OUT, XUSBPS_EPCR1_OFFSET, XUSBPS_EPCR_RXR_MASK, XUSBPS_EPCR_RXT_BULK_MASK, XUSBPS_EPCR_TXR_MASK, XUSBPS_EPCR_TXT_BULK_MASK, XUsbPs_EpEnable, XUsbPs_EpPrime(), and XUsbPs_SetBits.