usb: xusb_keyboard.h File Reference

| usb Xilinx SDK Drivers API Documentation

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

Functions
xusb_keyboard.h File Reference

## Overview

This file contains the constants, type definitions, variables and function prototypes used in the USB keyboard example.

Note
  None.

    MODIFICATION HISTORY:

    Ver   Who  Date     Changes

    1.00a hvm  5/31/07 First release
    3.02a hvm  08/16/10 Updated with the little endian support changes.
    4.00a hvm  08/11/11 Updated the Message[] variable data to
                    handle the address alignment issue.
    4.02a bss  11/01/11 Number of endpoints changed from 0x00 to 0x01 in
                    FsUsbConfig to support Full Speed (CR 627573).

## Functions
void | InitUsbInterface (XUsb *InstancePtr)
| This is the USB initialization function. More...
void | UsbIfIntrHandler (void *CallBackRef, u32 IntrStatus)
| This function is the interrupt handler for the USB mass storage device application. More...
void | Ep0IntrHandler (void *CallBackRef, u8 EpNum, u32 IntrStatus)
| This function is the interrupt handler for the USB End point Zero events. More...
void | Ep1IntrHandler (void *CallBackRef, u8 EpNum, u32 IntrStatus)
| This function is the interrupt handler for the USB End point one events. More...

## Function Documentation

void Ep0IntrHandler | ( | void * | CallBackRef,
|  | u8 | EpNum,
|  | u32 | IntrStatus
| ) |  |

This function is the interrupt handler for the USB End point Zero events.

Parameters

  CallBackRef | is the callback reference passed from the interrupt. handler, which in our case is a pointer to the driver instance.
  EpNum | is the end point number.
  IntrStatus | is a bit mask indicating pending interrupts.

Returns
  None.

Note
  EpNum is not used in this function as the handler is attached specific to end point zero. This parameter is useful when a single handler is used for processing all end point interrupts.

This function is the interrupt handler for the USB End point Zero events.

Parameters

  CallBackRef | is the callback reference passed from the caller function, which in our case is a pointer to the driver instance.
  EpNum | is the end point number.
  IntrStatus | is a bit mask indicating pending interrupts.

Returns
  None.

Note
  EpNum is not used in this function as the handler is attached specific to end point zero. This parameter is useful when a single handler is used for processing all end point interrupts.

void Ep1IntrHandler | ( | void * | CallBackRef,
|  | u8 | EpNum,
|  | u32 | IntrStatus
| ) |  |

This function is the interrupt handler for the USB End point one events.

Parameters

  CallBackRef | is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance.
  EpNum | is the end point number.
  IntrStatus | is a bit mask indicating pending interrupts.

Returns
  None.

Note
  EpNum is not used in this function as the handler is attached specific to end point one. This parameter is useful when a single handler is used for processing all end point interrupts.

This function is the interrupt handler for the USB End point one events.

Parameters

  CallBackRef | is the callback reference passed from the caller function, which in our case is a pointer to the driver instance.
  IntrStatus | is a bit mask indicating pending interrupts.

Returns
  None.

Note
  EpNum is not used in this function as the handler is attached specific to end point one. This parameter is useful when a single handler is used for processing all end point interrupts.

void InitUsbInterface | ( | XUsb * | InstancePtr | ) |

This is the USB initialization function.

This example initializes the device for Mass Storage Application. The following configuration is done.

- EP0 : CONTROL end point, Bidirectional, Packet size 64 bytes.
- EP1 : NON_ISOCHRONOUS, BULK_IN, packet size 512 bytes.
- EP2 : NON_ISOCHRONOUS, BULK_OUT, packet size 512 bytes

Parameters

  InstancePtr | is a pointer to the XUsb instance.

Returns
  None.

Note
  None.

This is the USB initialization function.

The following is the configuration.

- EP0 : CONTROL end point, Bidirectional, Packet size 64 bytes.
- EP1 : NON_ISOCHRONOUS, INTERRUPT_IN, packet size of 16 bytes.

Parameters

  InstancePtr | is a pointer to the XUsb instance.

Returns
  None.

Note
  None.

This example initializes the device for Microphone Application. The following configuration is done.

- EP0 : CONTROL end point, Bidirectional, Packet size 64 bytes.
- EP1 : ISOCHRONOUS, BULK_IN, packet size 1024 bytes.

Parameters

  InstancePtr | is a pointer to the XUsb instance.

Returns
  None.

Note
  None.

This example initializes the USB device for USB mouse example. The following configuration is done.

- EP0 : CONTROL end point, Bidirectional, Packet size 64 bytes.
- EP1 : NON_ISOCHRONOUS, INTERRUPT_IN, packet size of 16 bytes.

Parameters

  InstancePtr | is a pointer to the XUsb instance.

Returns
  None.

Note
  None.

void UsbIfIntrHandler | ( | void * | CallBackRef,
|  | u32 | IntrStatus
| ) |  |

This function is the interrupt handler for the USB mass storage device application.

Parameters

  CallBackRef | is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance.
  IntrStatus | is a bit mask indicating pending interrupts.

Returns
  None.

Note
  None.

This function is the interrupt handler for the USB mass storage device application.

Parameters

  CallBackRef | is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance.
  IntrStatus | is a bit mask indicating pending interrupts.

Returns
  None.

Note
  Each interrupt source is disabled upon reception. This is to avoid the repetitive occurrence of the same event. This is done because these event conditions exist for few milliseconds.

This function is the interrupt handler for the USB mass storage device application.

Parameters

  CallBackRef | is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance.
  IntrStatus | is a bit mask indicating pending interrupts.

Returns
  None.

Note
  None.

This function is the interrupt handler for the USB mass storage device application.

Parameters

  CallBackRef | is the callback reference passed from to the function, which in our case is a pointer to the driver instance.
  IntrStatus | is a bit mask indicating pending interrupts.

Returns
  None.

Note
  None.