;********************************************************************************
;  IrDA Project
;********************************************************************************

	device	SX28L, OSCXT4, TURBO, STACKX_OPTIONX
;	device	PINS28, PAGES4, BANKS8, OSCHS, TURBO, STACKX, OPTIONX
	id	'IrDA'
	reset	Startup
	freq	50000000

;********** Mode Constants **********

TRIS		=	$0F
PLP		=	$0E
LVL		=	$0D
ST		=	$0C
WKEN		=	$0B
WKED		=	$0A
WKPND		=	$09
COMP		=	$08

IsrStatus	=	$0C			;Global ISR status register
DebugData	=	$0D			;Debug data to be sent out the debug port
Temp		=	$0E			;2 bytes of tempory storage

PhysicalDataTx	=	0			;Shows all transmitted bytes to IR medium
PhysicalDataRx	=	0			;Shows all received bytes from IR medium
PayloadDataTx	=	0			;Shows all payload data bytes transmitted followed by ^ when frame is complete
PayloadDataRx	=	0			;Shows all payload data bytes received followed by ^ or ! for pass/fail when frame is complete
PayloadInfo	=	0			;Filters address and shows I, S, or U based on command type
IFrameDataTx	=	0			;Shows all I frame data bytes transmitted followed by ^ or ! for ack/!ack
IFrameDataRx	=	0			;Shows all I frame data bytes received followed by ^ or ! for ack/!ack

ShowXIDInfo	=	1
ShowConnect	=	1

	IsrDataSeg
	FrameDataSeg
	PayloadDataSeg
	LapDataSeg
	LmpDataSeg
	
	org		$0000

	IsrCodeSeg
	MainCodeSeg
	FrameCodeSeg
	LmpRxStringSeg

	org		$0200

	LapCodeSeg
	PayloadString3

	org		$0400

	PayloadCodeSeg
	PayloadString1
	PayloadString2

	org		$0600

; ====================================================================
; Application Code
; 
; Uncomment the following lines for the three different applications.
;
; SX to PC communications (IrComm):
;	AppCommSX2PCCodeSeg
;
; Transparent data transfer. PC to PC. (IrComm):
	AppCommTransCodeSeg
;
; SX to SX communications:
;	AppSX2SXCodeSeg
;
; ====================================================================

	LmpCodeSeg
	LmpTxStringSeg
