arcusb_hostapi.h 3.16 KB
#ifndef __hostapi_h__
#define __hostapi_h__ 1

/*HEADER******************************************************************
**************************************************************************
*** 
*** Copyright (c) 2001-2002 ARC International.
*** All rights reserved                                          
***                                                              
*** This software embodies materials and concepts which are      
*** confidential to ARC International and is made
*** available solely pursuant to the terms of a written license   
*** agreement with ARC International             
***
*** File: hostapi.h
***
*** Comments:      
***   This file contains the USB Host API specific data structures and function 
***   definitions.
***                                                               
**************************************************************************
*END*********************************************************************/

/* Available service types */
#define  USB_SERVICE_PIPE0                   (0x00)
#define  USB_SERVICE_PIPE1                   (0x01)
#define  USB_SERVICE_PIPE2                   (0x02)
#define  USB_SERVICE_PIPE3                   (0x03)
#define  USB_SERVICE_PIPE4                   (0x04)
#define  USB_SERVICE_PIPE5                   (0x05)
#define  USB_SERVICE_PIPE6                   (0x06)
#define  USB_SERVICE_PIPE7                   (0x07)
#define  USB_SERVICE_PIPE8                   (0x08)
#define  USB_SERVICE_PIPE9                   (0x09)
#define  USB_SERVICE_PIPE10                  (0x0A)
#define  USB_SERVICE_PIPE250                 (0xFB)
#define  USB_SERVICE_STALL_PACKET            (0xFC)
#define  USB_SERVICE_HOST_RESUME             (0xFD)
#define  USB_SERVICE_ATTACH                  (0xFE)
#define  USB_SERVICE_DETACH                  (0xFF)

#ifdef __cplusplus
extern "C" {
#endif

extern int_16 _usb_host_open_pipe(_usb_host_handle handle, uint_8 bAdder, 
   uint_8 bEP, uint_8 bDirection, uint_8 bInterval, uint_8 PipeType, 
   uint_16 max_pkt_size, uint_8, uint_8 flag);
extern void _usb_host_close_pipe(_usb_host_handle handle, int_16 pipeid);   
extern void _usb_host_close_all_pipes(_usb_host_handle handle);
extern uint_8 _usb_host_init(uint_8, uint_8, uint_8, _usb_host_handle _PTR_);
extern uint_8 _usb_host_register_service(_usb_host_handle, uint_8,
   void(_CODE_PTR_)(pointer, uint_32));
extern uint_8 _usb_host_unregister_service(_usb_host_handle, uint_8);
extern uint_8 _usb_host_call_service(_usb_host_handle, uint_8, uint_32);
extern uint_8 _usb_host_send_data(_usb_host_handle handle, int_16  pipeid, 
   uchar_ptr pAddress, uint_32 wLength);
extern uint_8 _usb_host_send_setup(_usb_host_handle handle, int_16  pipeid, 
   uchar_ptr Tx1_ptr, uchar_ptr Tx2_ptr, uchar_ptr Rx_ptr, uint_32 wLength1, 
   uint_32 wLength2);
extern uint_8 _usb_host_recv_data(_usb_host_handle handle, int_16 pipeid, 
   uchar_ptr pAddress, uint_32 wLength);
extern uint_8 _usb_host_get_transfer_status(_usb_host_handle handle, 
   int_16  pipeid); 
extern uint_8 _usb_host_cancel_transfer(_usb_host_handle handle, int_16  pipeid); 
extern void _usb_host_shutdown(_usb_host_handle);

#ifdef __cplusplus
}
#endif

#endif /* __hostapi_h__ */