/*****************************************************************************
Copyright(c) 2005 Analog Devices, Inc.  All Rights Reserved. This software is 
proprietary and confidential to Analog Devices, Inc. and its licensors.
******************************************************************************

$RCSfile: adi_usbio_blackfin.h,v $
$Revision: 1.4 $
$Date: 2007/11/15 01:40:30 $

Project:	BlackfinSDK
Title:		USB IO function prototypes for Blackfin (BlackfinSDK)
Author(s):	bmk
Revised by: 

Description:
			Supported USB I/O functions for Blackfin (BlackfinSDK applications)

References:
			None

******************************************************************************
Tab Setting:			4
Target Processor:		ADSP-BF5xx
Target Tools Revision:	ADSP VisualDSP++ v4.5
******************************************************************************

Modification History:
====================
$Log: adi_usbio_blackfin.h,v $
Revision 1.4  2007/11/15 01:40:30  randreol
Eliimate compiler warning for ConfigureEndpoints

Revision 1.3  2007/11/14 03:19:12  randreol
Port to new USB driver

Revision 1.4  2006/11/10 03:28:16  bmk
USBIO support for SDK 2.0

*****************************************************************************/

#ifndef __ADI_USBIO_BLACKFIN_H__
#define __ADI_USBIO_BLACKFIN_H__

#include <stdio.h>					// stdio header

/***************************
Globals
***************************/

// stdio file pointers
extern FILE *fpin, *fpout, *fperr;

// Semaphores specific to Net2272 used for handshaking btwn ISR and foreground code.
extern volatile bool	Net2272Ready;	// TRUE indicates Net2272 has been configured
extern volatile bool	Net2272TxDone;	// TRUE indicates present USB Tx operation is done
extern volatile bool	Net2272RxDone;	// TRUE indicates present USB Rx operation is done

/***************************
Function Prototypes
***************************/

unsigned int ConfigureEndpoints(void);

// Sets USB to be the default IO device to perform file I/O and stdio over USB with the host
u32 ConfigUSB_IO		( 
	ADI_DEV_DEVICE_HANDLE 	DeviceHandle 	// USB Device Handle
);

// Informs host to Stop and free the USBIO
u32 StopUSB_IO			(
	ADI_DEV_DEVICE_HANDLE	DeviceHandle	// USB Device Handle
);

// Checks whether a given command is supported by this firmware
u32 QueryUSBSupport		( 
	ADI_DEV_DEVICE_HANDLE	DeviceHandle,	// USB Device Handle
	u32 					Command			// command queried for support			
);

// Wrapper for adi_dev_Read() which lets the user specify if they want to wait for completion or not.
u32 USB_Read			(
	ADI_DEV_DEVICE_HANDLE 	DeviceHandle, 		// device handle
	ADI_DEV_BUFFER_TYPE 	BufferType,			// buffer type
	ADI_DEV_BUFFER 			*pBuffer, 			// pointer to buffer
	bool 					bWaitForCompletion	// completion flag
);

// Wrapper for adi_dev_Write() which lets the user specify if they want to wait for completion or not.
u32 USB_Write			(
	ADI_DEV_DEVICE_HANDLE 	DeviceHandle, 		// device handle
	ADI_DEV_BUFFER_TYPE 	BufferType,			// buffer type
	ADI_DEV_BUFFER 			*pBuffer, 			// pointer to buffer
	bool 					bWaitForCompletion	// completion flag
);

#endif // __ADI_USBIO_BLACKFIN_H__

/*****/
