beautypg.com

Usb_stall(), Usb_unstall(), Usb_in_1() – Maxim Integrated 73S12xxF Software User Manual

Page 49: E 49)

background image


UG_12xxF_016

73S12xxF Software User Guide

Rev. 1.50

49

USB_Stall()

Purpose

Stalls portions of the USB interface: The Endpoints to be stalled are configurable.

Synopsis

Void USB_Stall ( IN char cUSBEndpointStall );

Parameters

cUSBEndpointStall: Input parameter
Specifies which endpoints are to be stalled by this function. The other endpoints
remain in their previous state. This parameter can be the result of an OR operation
between the following values if several endpoints are to be disabled:

ENDPOINT_0 0x01
ENDPOINT_1_IN 0x02
ENDPOINT_2_IN 0x04
ENDPOINT_1_OUT 0x08

Return Codes None.

Deactivated endpoints will have a STALLED status. If all endpoints are stalled, it will disconnect
the USB interface from the Host.

USB_UnStall()

Purpose

Unstalls portions of the USB interface: The Endpoints to be unstalled are configurable.

Synopsis

Void USB_UnStall ( IN char cUSBEndpointUnStall );

Parameters

cUSBEndpointUnStall: Input parameter
Specifies which endpoints are to be unstalled by this function. The other endpoints
remain in their previous state. This parameter can be the result of an OR operation
between the following values if several endpoints are to be disabled:

ENDPOINT_0

0x01

ENDPOINT_1_IN 0x02
ENDPOINT_2_IN 0x04
ENDPOINT_1_OUT

0x08

Return Codes None.

All unstalled endpoints will have status = IDLE.

USB_IN_1()

Purpose

Send data to the Host through Endpoint 1 (BULK IN). When the buffer size is bigger
than the Maximum Packet Size (specified by the Descriptor string initialized in the

USB_Init()

function), then the API will split the buffer into smaller blocks and transmit

it in pieces.

Synopsis

Void USB_IN_1 ( IN struct USB_t *pUSB );

struct

{

unsigned char *USBData,

unsigned int

USBLen

USB_RC

USBStatus

} USB_t;

Parameters

USBData: Input parameter
Specifies the pointer to the data to be transmitted to the Host.

USBLen: Input/Output parameter
On input, specifies the number of bytes to send to the Host. On output, specifies the
current number of bytes sent to the Host.