⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stream.h

📁 <B>SMSC USB2.0 Flash硬盘驱动源码</B>
💻 H
字号:
/*============================================================================
  ____________________________________________________________________________
                                ______________________________________________
   SSSS  M   M          CCCC          Standard Microsystems Corporation
  S      MM MM   SSSS  C                    Austin Design Center
   SSS   M M M  S      C                 11000 N. Mopac Expressway
      S  M   M   SSS   C                Stonelake Bldg. 6, Suite 500
  SSSS   M   M      S   CCCC                Austin, Texas 78759
                SSSS            ______________________________________________
  ____________________________________________________________________________
  Copyright(C) 1999, Standard Microsystems Corporation
  All Rights Reserved.
  This program code listing is proprietary to SMSC and may not be copied,
  distributed, or used without a license to do so.  Such license may have
  Limited or Restricted Rights. Please refer to the license for further
  clarification.
  ____________________________________________________________________________
  Notice: The program contained in this listing is a proprietary trade
  secret of SMSC, Hauppauge, New York, and is copyrighted
  under the United States Copyright Act of 1976 as an unpublished work,
  pursuant to Section 104 and Section 408 of Title XVII of the United
  States code. Unauthorized copying, adaption, distribution, use, or
  display is prohibited by this law.
  ____________________________________________________________________________
  Use, duplication, or disclosure by the Government is subject to
  restrictions as set forth in subparagraph(c)(1)(ii) of the Rights
  in Technical Data and Computer Software clause at DFARS 52.227-7013.
  Contractor/Manufacturer is Standard Microsystems Corporation,
  80 Arkay Drive, Hauppauge, New York, 1178-8847.
  ____________________________________________________________________________
  ____________________________________________________________________________
  stream.h - pseudo-stream implmentation over usb endpoint
  ____________________________________________________________________________
  comments tbd
  ____________________________________________________________________________
  Revision History
  Date      Who  Comment
  ________  ___  _____________________________________________________________
  06/09/01  cds  initial version
  10/18/01  cds  moved into mmrtlib.h
============================================================================*/

//------------------------------------------------------------------------------
// Declaration:
//  void stream_open(uint8 ndp, uint8 dir) reentrant;
// Purpose:
//  opens the given endpoint for streaming bytes in the given direction.
// Arguments:
//  ndp - the endpoint to be used for streaming the bytes
//  dir - the direction to stream.  k_data_in (dev to host) or k_data_out (host to dev)
// Return:
//  null
//------------------------------------------------------------------------------
void stream_open(uint8 ndp, uint8 dir) reentrant ;

//------------------------------------------------------------------------------
// Declaration:
//  uint8 stream_get(uint8* bytep) reentrant;
// Purpose:
//  Gets the next byte from an k_data_out stream.
// Arguments:
//  ndp - the stream ndp
//  bytep - a pointer to where the byte will be placed
// Return:
//  0 - no bytes available.
//  1 - one byte placed into bytep location
//------------------------------------------------------------------------------
uint8 stream_get(uint8 ndp, uint8* bytep) reentrant ;

//------------------------------------------------------------------------------
// Declaration:
//  uint8 stream_peek(uint8 ndp, uint8* bytep) reentrant ;
// Purpose:
//  Peeks at the stream and returns a byte if one is available,
//  but does not remove the byte from the stream.  This function
//  can be used to ensure that there are bytes available to be
//  "gotten" before moving on.
// Arguments:
//  ndp - the stream ndp
//  bytep - ptr to where byte will be stored
// Return:
//  0 - no bytes available.
//  1 - one byte placed into bytep location
//------------------------------------------------------------------------------
uint8 stream_peek(uint8 ndp, uint8* bytep) reentrant ;

//------------------------------------------------------------------------------
// Declaration:
//  void stream_put(uint8 ndp, uint8 byte);
// Purpose:
//  Put one byte on the out-bound (k_data_in) stream and send
//  off the packet if the packet is full.
// Arguments:
//  ndp - the stream ndp
//  byte - data to put
// Return:
//  0 - no space for byte.  try again later.
//  1 - one byte put into the stream.
//------------------------------------------------------------------------------
uint8 stream_put(uint8 ndp, uint8 byte) reentrant ;

//------------------------------------------------------------------------------
// Declaration:
//  void stream_flush(uint8 ndp) reentrant
// Purpose:
//  flushes whatever data is in the stream out to the sie.  if
//  there are 0 bytes in the current pkt, a ZLP is sent over
//  the usb.
// Arguments:
//  ndp - the stream ndp to flush
// Return:
//  none
//------------------------------------------------------------------------------
void stream_flush(uint8 ndp) reentrant ;

//------------------------------------------------------------------------------
// Declaration:
//  void stream_close(uint8 ndp) reentrant ;
// Purpose:
//  closes an ndp for streaming io.  if there is data remaining
//  on a data_in stream, it is tx'd before this fn returns.
//  unlike 'flush', if there is 0 data, a zlp is _not_ sent.
// Arguments:
//  ndp - endpoint to close
// Return:
//  none
//------------------------------------------------------------------------------
void stream_close(uint8 ndp) reentrant ;


// eof -------------------------------------------------------------------------


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -