;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;  HandspringTypes
;
;  This file contains debugger templates for Handspring
;  defined structures.
;
;  History
;  	13-Jan-99	Art		Created
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; USB Manager defininitions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

typedef struct "UsbDeviceRequestType"
	> UInt8		"bmRequestType"
	> UInt8		"bRequest"
	> UInt16		"wValue"
	> UInt16		"wIndex"
	> UInt16		"wLength"
	typeend
	

typedef struct "UsbContolBufferType"
 	> UInt16					"length"
	> UInt16					"count"
	> MemPtr					"dataP"
	typeend


typedef struct "UsbQueueType"
	> UInt16 					"qStart"
	> UInt16 					"qEnd"
	> UInt16 					"qSize"
	> MemPtr 					"qData"
	> MemPtr					"defQData"
	typeend

typedef struct "UsbDebugInfoType"
	> UInt16					"busReset"
	> UInt16					"controlTransmit"
	> UInt16					"controlReceive"
	> UInt16					"mainTransmit"
	> UInt16					"mainReceive"
	> UInt16					"suspend"
	typeend


typedef struct "UsbPortInfoType"
	> UsbQueueType			"transmit"
	> UsbQueueType			"receive"
	> MemPtr					"wakeupHandler"
	> UInt32					"wakeupRefcon"
	> UInt16 					"smSignalSendSize"
	> UInt16					"smSignalReceiveSize"
	> UInt32 				"lastRcvTicks"
	> UInt32 				"lastSendTicks"
	> UInt16					"portFlags"

	> UInt8					"functionID"
	typeend


typedef struct "UsbConfigurationType"
	> UInt8					"configuration"
	> UInt8					"flags"
	> UInt16					"reserved"
	typeend


typedef UsbConfigurationType  @"UsbConfigurationPtr"


typedef struct "USBGlobalsType"
	> UInt16 					"openCount"
	> Int16					"port"
	> SerSettingsType	 	"settings"
	> UInt16 					"lineErrors"
	
	> UInt8					"controlState"
	> UInt16					"flags"
	> UsbDeviceRequestType 	"request"

	> UsbConfigurationPtr	"configP"
	> UsbContolBufferType	"cntlReceive"
	> UsbContolBufferType	"cntlTransmit"

	> UInt32					"smID"

	> MemPtr					"oldIntHandler"

	> MemPtr					"portInfoP"[2] 
	> UsbPortInfoType		"portInfo"[2]
	
	> UInt16					"intErrors"

	> UsbDebugInfoType		"debugInfo"
	typeend
typedef USBGlobalsType	@"USBGlobalsPtr"


;################################################################
; Macros
;##############################################################
alias "USBGlobals"	"dm @.l($0000027C) USBGlobalsType"

