beautypg.com

Usb_init(), E 43) – Maxim Integrated 73S12xxF Software User Manual

Page 43

background image


UG_12xxF_016

73S12xxF Software User Guide

Rev. 1.50

43

The USB interface contains four endpoints, which are defined as follows:

1. Endpoint 0 for the control transfer

2. Endpoint 1 IN for the Bulk transfer

3. Endpoint 1 OUT for the Bulk transfer

4. Endpoint 2 IN for the interrupt transfer

The Low-level API handles all Endpoint 0 (control endpoint) communications; thus PC driver enumeration
takes place during the device reset time and is transparent to an application. An application can be
written to monitor this reset signal to determine when it can start sending Endpoint 1 IN and/or Endpoint
2 IN packets to the host or to expect Endpoint 1 OUT packets from the host. (References to
transmission direction (IN/OUT) are relative to the host.)

USB_Init()

Purpose

Configure the USB interface during the reset procedure. The descriptors (device,
configuration, endpoint, interface and string) used in future enumeration requests are
configured. When leaving this function, the USB interface is ready to answer any
enumeration request.

Synopsis

Void USB_Init (

IN struct USB_Init_t *pUSB,

IN struct USB_LangID_t *pLangID,

IN void (*pRESET) (),

IN void (*pSUSPEND) (),

IN void (*pRESUME) () );


struct USB_Init_t

{

struct USB_Device_t

Device;

struct USB_Config_t

Config;

struct USB_CCID_t

CCID;

struct USB_Strings_t Strings;

};

The Device, Config, CCID, Strings and LangID structures are described at the end of
this function description.


Parameters

pUSB: Input parameter
Specifies the Device, Configuration, Endpoints, Interfaces and String Descriptors
defining the USB interface.

pLangID: Input parameter
Specifies the Language ID codes String Descriptor.

pRESET: Input parameter
Specifies a pointer to the function to call when RESET signaling has occurred on the
USB bus.

pSUSPEND: Input parameter
Specifies a pointer to the function to call when SUSPEND signaling has occurred on
the USB bus.

pRESUME: Input parameter
Specifies a pointer to the function to call when RESUME signaling has occurred on
the USB bus.

Return Codes None.

This function will activate the USB interface and ALL Endpoints will be ACTIVE. Endpoint 0 gets device
descriptor requests and will return the device descriptor. Endpoint 0 gets configuration descriptor