
Cypress Semiconductor Corporation
SL811HS and SL811HST: Application Notes
©2001 Cypress Semiconductor Corporation. All rights reserved. The information
and specifications contained in this document are subject to change without
notice.
Date: 07/26/01
Revision: 1.21
Page: 25
4.1.9 Single OUT Packet
Example of a single OUT Packet: The OUT Packet transaction consists of an OUT PID
containing device USB address and Endpoint. It is followed by a DATA token with data
payload. The program sample shows a PID OUT token followed by a Data0 packet. For
continuous OUT packets, Data tokens are required to toggle between Data0 and Data1, and so
on.
Program Sample 9: Single OUT Packet
short addr = 3; // address 3 short addr = 3; // address 3
... ...
SL11Write(EP0Address, (BYTE)cMemStart); // DATA0 SL11Write(EP0Address, (BYTE)cMemStart); // DATA0
// PID_IN an // PID_IN and endpoint 2d endpoint 2
SL11Write(EP0Status, ((PID_OUT & 0xff)<<4) | 2); // PID + ep SL11Write(EP0Status, ((PID_OUT & 0xff)<<4) | 2); // PID + ep
SL11Write(EP0Counter, addr); SL11Write(EP0Counter, addr);
SL11Write(EP0XferLen,payload); // payload SL11Write(EP0XferLen,payload); // payload
SL11Write(EP0Control,DATA0_WR); SL11Write(EP0Control,DATA0_WR);
USB Trace 3: OUT Packet
4.1.10 Short Data Packet
Comentarios a estos manuales