<root>
<document schema='101' license='50,Dev User,XDKHX7' title='' description='' target='PIC16.33E.33EP256MU806' >
	<config data='!0,ffff!10,ffff!20,ffbf!30,ffff!40,ffff!50,ffff!60,ffff%0,1%1,1%4,3%10,7%17,1%20,3%22,1%25,1%26,2%30,f%34,1%35,1%36,1%37,1%40,7%43,1%44,1%50,3%52,1%55,1%60,1%61,1%64,3' clkspd='12000000' simspd='1' usewdt='0' constif='0' />
	<plugins >
		<dll_dbg_icd enabled='0' >
			<data name='debug' value='1' />
			<data name='userpins' value='0' />
			<data name='speed' value='0' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='1' />
			<data name='clkbit' value='6' />
			<data name='dataport' value='1' />
			<data name='databit' value='7' />
			<data name='monitor' value='1' />
			<data name='ictloop' value='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
		</dll_dbg_icd>
		<dll_models enabled='1' />
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<components >
		<settings autoimg='1' center='1' unitscale='1' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='7b54013c-c426-4aa0-abb7-80fc10cd39cc' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='FTDI (FT800)' description='The FT800 provides a powerful feature set in a small package to create dynamic HMI interfaces.
The device supports line by line graphics rendering to 1/16 of a pixel on displays with resolution up to 512 x 512 with 262K colours.
The chip includes a touch controller for sensing touch feedback from a TFT display with a resistive touch panel as well as a sound synthesizer and audio playback with a PWM output to drive a speaker.' category='Misc' catenable='1' author='MatrixTSL' manuname='FTDI' manucode='FT800' sysinfo='0' keywords='FTDI|USB|FT800|gLCD' dynamic='1' iconpath='' />
		<component class_type='root' codename='FT800' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties >
				<property name='SPI Properties' folder='property_1' hidden='0' >
					<property name='SPI Channel' target='CHANNEL' typeid='16' hidden='0' locked='0' info='SPI peripheral onboard the target microcontroller to use.' filter='000Software
001Channel 1
002Channel 2
003Channel 3
004Channel 4
' />
					<property name='Prescale' target='PR_SCALE' typeid='16' hidden='0' locked='0' info='Rate by which the master oscillator is reduced before clocking the SPI peripheral.' filter='004Fosc/4
016Fosc/16
064Fosc/64' />
					<property name='MISO (SDI)' target='MISO' typeid='5' hidden='0' locked='1' info='Data In Pin - Micro In Serial Out' />
					<property name='MOSI (SDO)' target='MOSI' typeid='5' hidden='0' locked='1' info='Data Out Pin - Micro Out Serial In' />
					<property name='CLK' target='CLK' typeid='5' hidden='0' locked='1' info='Clock Pin' />
					<property name='MOSI Remap' target='MosiRemap' typeid='16' hidden='0' locked='0' info='' filter='000$PORTE.5
001$PORTE.7
002$PORTG.6
003$PORTG.8
004$PORTF.4
005$PORTF.5
006$PORTF.3
007$PORTD.0
008$PORTD.1
009$PORTD.2
010$PORTD.3
011$PORTD.4
012$PORTD.5
013$PORTD.6
014$PORTD.7
015$PORTF.0
016$PORTF.1
017$PORTE.0
018$PORTE.2
019$PORTE.4' />
					<property name='MISO Remap' target='MisoRemap' typeid='16' hidden='0' locked='0' info='' filter='085$PORTE.5
086$PORTE.6
087$PORTE.7
118$PORTG.6
119$PORTG.7
120$PORTG.8
121$PORTG.9
037$PORTB.5
036$PORTB.4
035$PORTB.3
034$PORTB.2
033$PORTB.1
032$PORTB.0
038$PORTB.6
039$PORTB.7
040$PORTB.8
041$PORTB.9
042$PORTB.10
043$PORTB.11
044$PORTB.12
045$PORTB.13
046$PORTB.14
047$PORTB.15
100$PORTF.4
101$PORTF.5
099$PORTF.3
060$PORTC.12
072$PORTD.8
073$PORTD.9
074$PORTD.10
075$PORTD.11
064$PORTD.0
061$PORTC.13
062$PORTC.14
065$PORTD.1
066$PORTD.2
067$PORTD.3
068$PORTD.4
069$PORTD.5
070$PORTD.6
071$PORTD.7
096$PORTF.0
097$PORTF.1
080$PORTE.0
081$PORTE.1
082$PORTE.2
083$PORTE.3
084$PORTE.4' />
					<property name='CLK Remap' target='ClkRemap' typeid='16' hidden='0' locked='0' info='' filter='000$PORTE.5
001$PORTE.7
002$PORTG.6
003$PORTG.8
004$PORTF.4
005$PORTF.5
006$PORTF.3
007$PORTD.0
008$PORTD.1
009$PORTD.2
010$PORTD.3
011$PORTD.4
012$PORTD.5
013$PORTD.6
014$PORTD.7
015$PORTF.0
016$PORTF.1
017$PORTE.0
018$PORTE.2
019$PORTE.4' />
				</property>
				<property name='Pin Connections' folder='property_2' hidden='0' >
					<property name='Power Pin' target='PwrPin' typeid='5' hidden='0' locked='0' info='' />
					<property name='CS Pin' target='CSPin' typeid='5' hidden='0' locked='0' info='' />
				</property>
				<property name='Display Properties' folder='property_3' hidden='0' >
					<property name='Width' target='Width' typeid='21' hidden='0' locked='0' info='Active width of LCD display' />
					<property name='Height' target='Height' typeid='21' hidden='0' locked='0' info='Active height of LCD display' />
					<property name='HCycle' target='HCycle' typeid='21' hidden='0' locked='0' info='Total number of clocks per line' />
					<property name='HOffset' target='HOffset' typeid='21' hidden='0' locked='0' info='Start of active line' />
					<property name='HSync0' target='HSync0' typeid='21' hidden='0' locked='0' info='Start of horizontal sync pulse' />
					<property name='HSync1' target='HSync1' typeid='21' hidden='0' locked='0' info='End of horizontal sync pulse' />
					<property name='VCycle' target='VCycle' typeid='21' hidden='0' locked='0' info='Total number of lines per screen' />
					<property name='VOffset' target='VOffset' typeid='21' hidden='0' locked='0' info='Start of active screen' />
					<property name='VSync0' target='VSync0' typeid='21' hidden='0' locked='0' info='Start of vertical sync pulse' />
					<property name='VSync1' target='VSync1' typeid='21' hidden='0' locked='0' info='End of vertical sync pulse' />
					<property name='PixelClock' target='PixelClock' typeid='21' hidden='0' locked='0' info='Pixel Clock
' />
					<property name='Swizzle' target='Swizzle' typeid='21' hidden='0' locked='0' info=' Define RGB output pins' />
					<property name='Clock Polarity' target='ClkPol' typeid='21' hidden='0' locked='0' info='Define active edge of PCLK
' />
				</property>
			</properties>
			<values >
				<value target='CHANNEL' data='001' />
				<value target='PR_SCALE' data='004' />
				<value target='MISO' data='$PORTE.6' />
				<value target='MOSI' data='$PORTE.5' />
				<value target='CLK' data='$PORTE.7' />
				<value target='MosiRemap' data='000' />
				<value target='MisoRemap' data='086' />
				<value target='ClkRemap' data='001' />
				<value target='PwrPin' data='$PORTB.0' />
				<value target='CSPin' data='$PORTB.1' />
				<value target='Width' data='320' />
				<value target='Height' data='240' />
				<value target='HCycle' data='408' />
				<value target='HOffset' data='70' />
				<value target='HSync0' data='0' />
				<value target='HSync1' data='10' />
				<value target='VCycle' data='263' />
				<value target='VOffset' data='13' />
				<value target='VSync0' data='0' />
				<value target='VSync1' data='2' />
				<value target='PixelClock' data='8' />
				<value target='Swizzle' data='2' />
				<value target='ClkPol' data='0' />
			</values>
			<events >
				<event class='Components' event='Initialise' target='Ev_Initialise' />
				<event class='Components' event='Property' target='Ev_Property' />
			</events>
			<apis >
				<api name='IncrementCommandOffset' alt='IncrementCommandOffset' type='1' proto='1' />
				<api name='MemRead16' alt='MemRead16' type='1' proto='1' />
				<api name='MemRead8' alt='MemRead8' type='1' proto='1' />
				<api name='MemRead32' alt='MemRead32' type='1' proto='1' />
				<api name='MemWrite16' alt='MemWrite16' type='1' proto='1' />
				<api name='MemWrite8' alt='MemWrite8' type='1' proto='1' />
				<api name='CommandWrite' alt='CommandWrite' type='1' proto='1' />
				<api name='MemWrite32' alt='MemWrite32' type='1' proto='1' />
				<api name='Initialise' alt='Initialise' type='1' proto='1' />
			</apis>
			<variables >
				<variable public='0' >
					<def class_type='variable' name='FT800_CORERST' type='s16' description='Reset core - all registers default' isconst='1' isinit='1' usrinit='104' setinit='0x68' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='PointY' type='u32' description='' isconst='0' isinit='1' usrinit='2176' setinit='136 * 16' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='BLACK' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0x000000' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='PointX' type='u32' description='' isconst='0' isinit='1' usrinit='1536' setinit='96 * 16' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RED' type='s32' description='' isconst='1' isinit='1' usrinit='16711680' setinit='0xFF0000' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ramDisplayList' type='u32' description='Set beginning of display list memory' isconst='0' isinit='1' usrinit='1048576' setinit='0x100000' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FT800_CLK48M' type='s16' description='Select 48MHz PLL' isconst='1' isinit='1' usrinit='98' setinit='0x62' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='BLUE' type='s16' description='' isconst='1' isinit='1' usrinit='255' setinit='0x0000FF' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MEM_READ' type='s16' description='FT800 Host Memory Read' isconst='1' isinit='1' usrinit='0' setinit='0x00' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MEM_WRITE' type='s16' description='FT800 Host Memory Write' isconst='1' isinit='1' usrinit='128' setinit='0x80' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='GREEN' type='s32' description='' isconst='1' isinit='1' usrinit='65280' setinit='0x00FF00' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='PointSize' type='u16' description='Default Dot Size' isconst='0' isinit='1' usrinit='256' setinit='0x100' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='pvt_Channel' type='s16' description='' isconst='0' isinit='1' usrinit='-1' setinit='-1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FT800_CLK36M' type='s16' description='Select 36MHz PLL' isconst='1' isinit='1' usrinit='97' setinit='0x61' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FT800_PWRDOWN' type='s16' description='Place FT800 in Power Down (core off)' isconst='1' isinit='1' usrinit='80' setinit='0x50' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FT800_SLEEP' type='s16' description='Place FT800 in Sleep (clk off)' isconst='1' isinit='1' usrinit='66' setinit='0x42' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FT800_ACTIVE' type='s16' description='Initializes FT800' isconst='1' isinit='1' usrinit='0' setinit='0x00' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FT800_STANDBY' type='s16' description='Place FT800 in Standby (clk running)' isconst='1' isinit='1' usrinit='65' setinit='0x41' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FT800_CLKEXT' type='s16' description='Select external clock source' isconst='1' isinit='1' usrinit='68' setinit='0x44' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Colour' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='WHITE' type='s32' description='' isconst='1' isinit='1' usrinit='16777215' setinit='0xFFFFFF' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='IncrementCommandOffset' description='Adds commandSize to the currentOffset.
Checks for 4K ring-buffer offset roll-over 
' >
						<return name='Return' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='currentOffset' type='u16' description='graphics processor command list pointer' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='commandSize' type='u8' description='number of bytes to increment the offset' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculate Address' >
							<exp exp='.Return = .currentOffset + .commandSize' />
						</command>
						<command class_type='decision' title='Check for address rollover' exp='.Return &gt; 4095' swap='0' >
							<flowline >
								<command class_type='calculation' title='Roll over pointer' >
									<exp exp='.Return = .Return - 4096' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='MemRead16' description='Reads a single unsigned int from the FT800 internal address space' >
						<return name='Return' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Address' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='low' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='med' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='high' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Work out address bytes' >
							<exp exp='.low = .Address &amp; 0xFF' />
							<exp exp='.med = .Address &gt;&gt; 8' />
							<exp exp='.high = .Address / 65536' />
							<exp exp='.high = .high | MEM_READ' />
						</command>
						<command class_type='calculation' title='CS Low - Device Enable' >
							<exp exp='CSPin = 0' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.high' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.med' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.low' />
						</command>
						<command class_type='call' title='Dummy Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Read Data Byte' component='cal_spi' macro='Master_Byte' >
							<return exp='.Return' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Read Data Byte' component='cal_spi' macro='Master_Byte' >
							<return exp='.low' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Combine Data Bytes' >
							<exp exp='.Return = .Return | (.Low &lt;&lt; 8)' />
						</command>
						<command class_type='calculation' title='CS High - Device Disable - Process CMD' >
							<exp exp='CSPin = 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='pvt_Pins_Cal2Comp' description='' >
						<command class_type='call' title='Call Macro' macro='pvt_Prop_Cal2Comp' >
							<argument exp='&quot;MISO&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='pvt_Prop_Cal2Comp' >
							<argument exp='&quot;MOSI&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='pvt_Prop_Cal2Comp' >
							<argument exp='&quot;CLK&quot;' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Initialise' description='Initialisation routine for the component once the component is linked to its parent' >
						<return name='Return' type='u32' description='Non-zero to prevent initialisation' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='pvt_List_Cal2Comp' >
							<argument exp='&quot;CHANNEL&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='pvt_List_Cal2Comp' >
							<argument exp='&quot;PR_SCALE&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='pvt_Pins_ShowHide' />
					</flowline>
				</macro>
				<macro >
					<flowline name='pvt_Pins_ShowHide' description='' >
						<command class_type='decision' title='Decision' exp='CHANNEL' swap='0' >
							<flowline >
								<command class_type='sim' title='Panel' macro='Component.Property.SetWritable' >
									<argument exp='this' />
									<argument exp='&quot;MOSI&quot;' />
									<argument exp='false' />
								</command>
								<command class_type='sim' title='Panel' macro='Component.Property.SetWritable' >
									<argument exp='this' />
									<argument exp='&quot;MISO&quot;' />
									<argument exp='false' />
								</command>
								<command class_type='sim' title='Panel' macro='Component.Property.SetWritable' >
									<argument exp='this' />
									<argument exp='&quot;CLK&quot;' />
									<argument exp='false' />
								</command>
							</flowline>
							<flowline >
								<command class_type='sim' title='Panel' macro='Component.Property.SetWritable' >
									<argument exp='this' />
									<argument exp='&quot;MOSI&quot;' />
									<argument exp='true' />
								</command>
								<command class_type='sim' title='Panel' macro='Component.Property.SetWritable' >
									<argument exp='this' />
									<argument exp='&quot;MISO&quot;' />
									<argument exp='true' />
								</command>
								<command class_type='sim' title='Panel' macro='Component.Property.SetWritable' >
									<argument exp='this' />
									<argument exp='&quot;CLK&quot;' />
									<argument exp='true' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='MemRead8' description='Reads a single data byte from the FT800 internal address space' >
						<return name='Return' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Address' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='low' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='med' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='high' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Work out address bytes' >
							<exp exp='.Low = .Address &amp; 0xFF' />
							<exp exp='.Med = .Address &gt;&gt; 8' />
							<exp exp='.High = .Address / 65536' />
							<exp exp='.High = .High | MEM_READ' />
						</command>
						<command class_type='calculation' title='CS Low - Device Enable' >
							<exp exp='CSPin = 0' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.High' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Med' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Low' />
						</command>
						<command class_type='call' title='Dummy Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Read Data Byte' component='cal_spi' macro='Master_Byte' >
							<return exp='.Return' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='CS High - Device Disable - Process CMD' >
							<exp exp='CSPin = 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='MemRead32' description='Reads a single unsigned long from the FT800 internal address space' >
						<return name='Return' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Address' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='low' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='med' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='high' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Work out address bytes' >
							<exp exp='.low = .Address &amp; 0xFF' />
							<exp exp='.med = .Address &gt;&gt; 8' />
							<exp exp='.high = .Address / 65536' />
							<exp exp='.high = .high | MEM_READ' />
						</command>
						<command class_type='calculation' title='CS Low - Device Enable' >
							<exp exp='CSPin = 0' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.high' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.med' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.low' />
						</command>
						<command class_type='call' title='Dummy Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Read Data Byte' component='cal_spi' macro='Master_Byte' >
							<return exp='.Return' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Read Data Byte' component='cal_spi' macro='Master_Byte' >
							<return exp='.low' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Read Data Byte' component='cal_spi' macro='Master_Byte' >
							<return exp='.med' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Read Data Byte' component='cal_spi' macro='Master_Byte' >
							<return exp='.high' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='CS High - Device Disable - Process CMD' >
							<exp exp='CSPin = 1' />
						</command>
						<command class_type='calculation' title='Combine Data Bytes' >
							<exp exp='.Return = .Return | (.low &lt;&lt; 8)' />
							<exp exp='.Return = .Return + (.med * 65536)' />
							<exp exp='.Return = .Return + (.high * 16777216)' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='pvt_Prop_Cal2Comp' description='' >
						<param name='sProperty' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='sTemp' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<command class_type='sim' title='Call Macro' component='cal_spi' macro='GetValue' >
							<return exp='.sTemp' />
							<argument exp='.sProperty' />
						</command>
						<command class_type='sim' title='Clear the property option list' macro='Component.Property.SetValue' >
							<argument exp='this' />
							<argument exp='.sProperty' />
							<argument exp='.sTemp' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Property' description='Sent when a property has been changed by the User' >
						<return name='Return' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='tempstr' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<command class_type='decision' title='Decision' exp='CHANNEL != pvt_Channel' swap='0' >
							<flowline >
								<command class_type='call' title='Call Macro' macro='pvt_Prop_Comp2Cal' >
									<argument exp='&quot;CHANNEL&quot;' />
								</command>
								<command class_type='sim' title='Simulation' macro='Component.Property.GetValue' >
									<return exp='.tempstr' />
									<argument exp='cal_spi' />
									<argument exp='&quot;Remappable&quot;' />
								</command>
								<command class_type='decision' title='Decision' exp='.tempstr[0] = &apos;1&apos;' swap='0' >
									<flowline >
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;MosiRemap&quot;' />
											<argument exp='1' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;MisoRemap&quot;' />
											<argument exp='1' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;ClkRemap&quot;' />
											<argument exp='1' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetFilter' >
											<return exp='.tempstr' />
											<argument exp='cal_spi' />
											<argument exp='&quot;MOSIPins&quot;' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetFilter' >
											<argument exp='this' />
											<argument exp='&quot;MosiRemap&quot;' />
											<argument exp='.tempstr' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetValue' >
											<return exp='.tempstr' />
											<argument exp='this' />
											<argument exp='&quot;MosiRemap&quot;' />
										</command>
										<command class_type='sim' title='Simulation' component='cal_spi' macro='SetValue' >
											<argument exp='&quot;MOSIPins&quot;' />
											<argument exp='.tempstr' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetFilter' >
											<return exp='.tempstr' />
											<argument exp='cal_spi' />
											<argument exp='&quot;MISOPins&quot;' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetFilter' >
											<argument exp='this' />
											<argument exp='&quot;MisoRemap&quot;' />
											<argument exp='.tempstr' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetValue' >
											<return exp='.tempstr' />
											<argument exp='this' />
											<argument exp='&quot;MisoRemap&quot;' />
										</command>
										<command class_type='sim' title='Simulation' component='cal_spi' macro='SetValue' >
											<argument exp='&quot;MISOPins&quot;' />
											<argument exp='.tempstr' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetFilter' >
											<return exp='.tempstr' />
											<argument exp='cal_spi' />
											<argument exp='&quot;CLKPins&quot;' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetFilter' >
											<argument exp='this' />
											<argument exp='&quot;ClkRemap&quot;' />
											<argument exp='.tempstr' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetValue' >
											<return exp='.tempstr' />
											<argument exp='this' />
											<argument exp='&quot;ClkRemap&quot;' />
										</command>
										<command class_type='sim' title='Simulation' component='cal_spi' macro='SetValue' >
											<argument exp='&quot;ClkPins&quot;' />
											<argument exp='.tempstr' />
										</command>
									</flowline>
									<flowline >
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;MosiRemap&quot;' />
											<argument exp='0' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;MisoRemap&quot;' />
											<argument exp='0' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;ClkRemap&quot;' />
											<argument exp='0' />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Simulation' macro='pvt_Pins_Cal2Comp' />
								<command class_type='calculation' title='Calculation' >
									<exp exp='pvt_Channel = CHANNEL' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='call' title='Call Macro' macro='pvt_Pins_ShowHide' />
						<command class_type='decision' title='Decision' exp='CHANNEL' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Component.Property.GetValue' >
									<return exp='.tempstr' />
									<argument exp='cal_spi' />
									<argument exp='&quot;Remappable&quot;' />
								</command>
								<command class_type='decision' title='Decision' exp='.tempstr[0] = &apos;1&apos;' swap='0' >
									<flowline >
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;MosiRemap&quot;' />
											<argument exp='1' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;MisoRemap&quot;' />
											<argument exp='1' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;ClkRemap&quot;' />
											<argument exp='1' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetFilter' >
											<return exp='.tempstr' />
											<argument exp='cal_spi' />
											<argument exp='&quot;MOSIPins&quot;' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetFilter' >
											<argument exp='this' />
											<argument exp='&quot;MosiRemap&quot;' />
											<argument exp='.tempstr' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetValue' >
											<return exp='.tempstr' />
											<argument exp='this' />
											<argument exp='&quot;MosiRemap&quot;' />
										</command>
										<command class_type='sim' title='Simulation' component='cal_spi' macro='SetValue' >
											<argument exp='&quot;MOSIPins&quot;' />
											<argument exp='.tempstr' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetFilter' >
											<return exp='.tempstr' />
											<argument exp='cal_spi' />
											<argument exp='&quot;MISOPins&quot;' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetFilter' >
											<argument exp='this' />
											<argument exp='&quot;MisoRemap&quot;' />
											<argument exp='.tempstr' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetValue' >
											<return exp='.tempstr' />
											<argument exp='this' />
											<argument exp='&quot;MisoRemap&quot;' />
										</command>
										<command class_type='sim' title='Simulation' component='cal_spi' macro='SetValue' >
											<argument exp='&quot;MISOPins&quot;' />
											<argument exp='.tempstr' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetFilter' >
											<return exp='.tempstr' />
											<argument exp='cal_spi' />
											<argument exp='&quot;CLKPins&quot;' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetFilter' >
											<argument exp='this' />
											<argument exp='&quot;ClkRemap&quot;' />
											<argument exp='.tempstr' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.GetValue' >
											<return exp='.tempstr' />
											<argument exp='this' />
											<argument exp='&quot;ClkRemap&quot;' />
										</command>
										<command class_type='sim' title='Simulation' component='cal_spi' macro='SetValue' >
											<argument exp='&quot;ClkPins&quot;' />
											<argument exp='.tempstr' />
										</command>
										<command class_type='call' title='Simulation' macro='pvt_Pins_Cal2Comp' />
									</flowline>
									<flowline >
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;MosiRemap&quot;' />
											<argument exp='0' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;MisoRemap&quot;' />
											<argument exp='0' />
										</command>
										<command class_type='sim' title='Simulation' macro='Component.Property.SetVisible' >
											<argument exp='this' />
											<argument exp='&quot;ClkRemap&quot;' />
											<argument exp='0' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Macro' macro='pvt_Pins_Comp2Cal' />
							</flowline>
						</command>
						<command class_type='call' title='Panel' macro='pvt_Prop_Comp2Cal' >
							<argument exp='&quot;PR_SCALE&quot;' />
						</command>
						<command class_type='call' title='' disable='1' macro='PopulateInjectorFilter' />
						<command class_type='call' title='' disable='1' macro='GetInjectorHandle' >
							<argument exp='Injector' />
						</command>
						<command class_type='decision' title='Decision' disable='1' exp='InjectorHandle &gt; 0' swap='0' >
							<flowline >
								<command class_type='sim' title='Call Macro' disable='1' macro='System.RedirectMacros' >
									<argument exp='InjectorBase1' />
									<argument exp='InjectorHandle' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='pvt_Pins_Comp2Cal' description='' >
						<command class_type='call' title='Call Macro' macro='pvt_Prop_Comp2Cal' >
							<argument exp='&quot;MISO&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='pvt_Prop_Comp2Cal' >
							<argument exp='&quot;MOSI&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='pvt_Prop_Comp2Cal' >
							<argument exp='&quot;CLK&quot;' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='MemWrite16' description='Writes a unsigned int value to the FT800 internal address space' >
						<param name='Address' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Data' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Low' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Med' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='High' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Work out address bytes' >
							<exp exp='.Low = .Address &amp; 0xFF' />
							<exp exp='.Med = .Address &gt;&gt; 8' />
							<exp exp='.High = .Address / 65536' />
							<exp exp='.High = .High | MEM_WRITE' />
						</command>
						<command class_type='calculation' title='CS Low - Device Enable' >
							<exp exp='CSPin = 0' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.High' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Med' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Low' />
						</command>
						<command class_type='call' title='Send Data Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Data' />
						</command>
						<command class_type='call' title='Send Data Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Data &gt;&gt; 8' />
						</command>
						<command class_type='calculation' title='CS High - Device Disable - Process CMD' >
							<exp exp='CSPin = 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='MemWrite8' description='Writes a byte value to the FT800 internal address space' >
						<param name='Address' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Data' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Low' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Med' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='High' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Work out address bytes' >
							<exp exp='.Low = .Address &amp; 0xFF' />
							<exp exp='.Med = .Address &gt;&gt; 8' />
							<exp exp='.High = .Address / 65536' />
							<exp exp='.High = .High | MEM_WRITE' />
						</command>
						<command class_type='calculation' title='CS Low - Device Enable' >
							<exp exp='CSPin = 0' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.High' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Med' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Low' />
						</command>
						<command class_type='call' title='Send Data Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Data' />
						</command>
						<command class_type='calculation' title='CS High - Device Disable - Process CMD' >
							<exp exp='CSPin = 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='pvt_Prop_Comp2Cal' description='' >
						<param name='sProperty' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='sTemp' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<command class_type='sim' title='Simulation' macro='Component.Property.GetValue' >
							<return exp='.sTemp' />
							<argument exp='this' />
							<argument exp='.sProperty' />
						</command>
						<command class_type='sim' title='Simulation' component='cal_spi' macro='SetValue' >
							<argument exp='.sProperty' />
							<argument exp='.sTemp' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='CommandWrite' description='Sends FT800 command' >
						<param name='Command' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='CS Low - Device Enable' >
							<exp exp='CSPin = 0' />
						</command>
						<command class_type='call' title='Send command' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Command' />
						</command>
						<command class_type='call' title='Command needs two or more 0&apos;s' component='cal_spi' macro='Master_Byte' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Command needs two or more 0&apos;s' component='cal_spi' macro='Master_Byte' >
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='CS High - Device Disable - Process CMD' >
							<exp exp='CSPin = 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Loop' description='Repetitive activities - Draw a dot on the LCD
Continually change colors from white to red and back' >
						<local name='BuffRd' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='BuffWr' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='CmdOffset' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='loop' title='Loop' type='0' exp='.BuffWr != .BuffRd' start='0' >
							<flowline >
								<command class_type='call' title='Call Macro' macro='MemRead16' >
									<return exp='.BuffRd' />
									<argument exp='0x1024e4' />
								</command>
								<command class_type='call' title='Call Macro' macro='MemRead16' >
									<return exp='.BuffWr' />
									<argument exp='0x1024e8' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.CmdOffset = .BuffWr' />
						</command>
						<command class_type='decision' title='Decision' exp='Colour != WHITE' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='Colour = WHITE' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='Colour = RED' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Start the display list' macro='MemWrite32' >
							<argument exp='0x108000 + .CmdOffset' />
							<argument exp='0xffffff00' />
						</command>
						<command class_type='call' title='Update the command pointer' macro='IncrementCommandOffset' >
							<return exp='.CmdOffset' />
							<argument exp='.CmdOffset' />
							<argument exp='4' />
						</command>
						<command class_type='call' title='Set the default clear color to black' macro='MemWrite32' >
							<argument exp='0x108000 + .CmdOffset' />
							<argument exp='0x02000000 | BLACK' />
						</command>
						<command class_type='call' title='Update the command pointer' macro='IncrementCommandOffset' >
							<return exp='.CmdOffset' />
							<argument exp='.CmdOffset' />
							<argument exp='4' />
						</command>
						<command class_type='call' title='Clear the screen - this and the previous prevent artifacts' macro='MemWrite32' >
							<argument exp='0x108000 + .CmdOffset' />
							<argument exp='0x26000007' />
						</command>
						<command class_type='call' title='Update the command pointer' macro='IncrementCommandOffset' >
							<return exp='.CmdOffset' />
							<argument exp='.CmdOffset' />
							<argument exp='4' />
						</command>
						<command class_type='call' title='Set the color of the following item' macro='MemWrite32' >
							<argument exp='0x108000 + .CmdOffset' />
							<argument exp='0x04000000 | Colour' />
						</command>
						<command class_type='call' title='Update the command pointer' macro='IncrementCommandOffset' >
							<return exp='.CmdOffset' />
							<argument exp='.CmdOffset' />
							<argument exp='4' />
						</command>
						<command class_type='call' title='Select the size of the dot to draw' macro='MemWrite32' >
							<argument exp='0x108000 + .CmdOffset' />
							<argument exp='0x0D000000 | PointSize' />
						</command>
						<command class_type='call' title='Update the command pointer' macro='IncrementCommandOffset' >
							<return exp='.CmdOffset' />
							<argument exp='.CmdOffset' />
							<argument exp='4' />
						</command>
						<command class_type='call' title='Indicate to draw a point (dot)' macro='MemWrite32' >
							<argument exp='0x108000 + .CmdOffset' />
							<argument exp='0x1F000000 | 2' />
						</command>
						<command class_type='call' title='Update the command pointer' macro='IncrementCommandOffset' >
							<return exp='.CmdOffset' />
							<argument exp='.CmdOffset' />
							<argument exp='4' />
						</command>
						<command class_type='call' title='Set the point center location' macro='MemWrite32' >
							<argument exp='0x108000 + .CmdOffset' />
							<argument exp='0x40000000 | (PointX &lt;&lt; 15) | PointY' />
						</command>
						<command class_type='call' title='Update the command pointer' macro='IncrementCommandOffset' >
							<return exp='.CmdOffset' />
							<argument exp='.CmdOffset' />
							<argument exp='4' />
						</command>
						<command class_type='call' title='End the point' macro='MemWrite32' >
							<argument exp='0x108000 + .CmdOffset' />
							<argument exp='0x21000000' />
						</command>
						<command class_type='call' title='Update the command pointer' macro='IncrementCommandOffset' >
							<return exp='.CmdOffset' />
							<argument exp='.CmdOffset' />
							<argument exp='4' />
						</command>
						<command class_type='call' title='Instruct the graphics processor to show the list' macro='MemWrite32' >
							<argument exp='0x108000 + .CmdOffset' />
							<argument exp='0x00000000' />
						</command>
						<command class_type='call' title='Update the command pointer' macro='IncrementCommandOffset' >
							<return exp='.CmdOffset' />
							<argument exp='.CmdOffset' />
							<argument exp='4' />
						</command>
						<command class_type='call' title='Make this list active' macro='MemWrite32' >
							<argument exp='0x108000 + .CmdOffset' />
							<argument exp='0xffffff01' />
						</command>
						<command class_type='call' title='Update the command pointer' macro='IncrementCommandOffset' >
							<return exp='.CmdOffset' />
							<argument exp='.CmdOffset' />
							<argument exp='4' />
						</command>
						<command class_type='call' title='Update the ring buffer pointer' macro='MemWrite16' >
							<argument exp='0x1024e8' />
							<argument exp='.CmdOffset' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='pvt_List_Cal2Comp' description='' >
						<param name='sProperty' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='sTemp' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='100' />
						</local>
						<command class_type='sim' title='Simulation' component='cal_spi' macro='GetList' >
							<return exp='.sTemp' />
							<argument exp='.sProperty' />
						</command>
						<command class_type='sim' title='Simulation' macro='Component.Property.SetFilter' >
							<argument exp='this' />
							<argument exp='.sProperty' />
							<argument exp='.sTemp' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<command class_type='call' title='Call Macro' macro='Ev_Initialise' />
						<command class_type='call' title='Call Macro' macro='Initialise' />
						<command class_type='loop' title='Loop' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Macro' macro='Loop' />
								<command class_type='delay' title='Wait a half-second to observe the changing color' exp='500' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='MemWrite32' description='Writes a unsigned long value to the FT800 internal address space' >
						<param name='Address' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Data' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Low' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Med' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='High' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='DatH' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='DatH2' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Work out address bytes' >
							<exp exp='.Low = .Address &amp; 0xFF' />
							<exp exp='.Med = .Address &gt;&gt; 8' />
							<exp exp='.High = .Address / 65536' />
							<exp exp='.High = .High | MEM_WRITE' />
							<exp exp='' />
							<exp exp='.DatH = .Data / 65536' />
							<exp exp='.DatH2 = .Data / 16777216' />
						</command>
						<command class_type='calculation' title='CS Low - Device Enable' >
							<exp exp='CSPin = 0' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.High' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Med' />
						</command>
						<command class_type='call' title='Send Address Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Low' />
						</command>
						<command class_type='call' title='Send Data Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Data' />
						</command>
						<command class_type='call' title='Send Data Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.Data &gt;&gt; 8' />
						</command>
						<command class_type='call' title='Send Data Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.DatH' />
						</command>
						<command class_type='call' title='Send Data Byte' component='cal_spi' macro='Master_Byte' >
							<argument exp='.DatH2' />
						</command>
						<command class_type='calculation' title='CS High - Device Disable - Process CMD' >
							<exp exp='CSPin = 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialise' description='System initialization routines.  Executed once on reset.
Returns 0 if device not detected or 1 if device is correctly initialised.' >
						<return name='Return' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='RetVal' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='duty' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Enable Power Pin' >
							<exp exp='PwrPin = 1' />
						</command>
						<command class_type='calculation' title='Disable SPI Device' >
							<exp exp='CSPin = 1' />
						</command>
						<command class_type='call' title='Startup SPI' component='cal_spi' macro='Master_Init' />
						<command class_type='delay' title='Delay' exp='20' type='1' />
						<command class_type='calculation' title='Disable Power Pin' >
							<exp exp='PwrPin = 0' />
						</command>
						<command class_type='delay' title='Delay' exp='20' type='1' />
						<command class_type='calculation' title='Enable Power Pin' >
							<exp exp='PwrPin = 1' />
						</command>
						<command class_type='delay' title='Delay' exp='20' type='1' />
						<command class_type='call' title='Start FT800' macro='CommandWrite' >
							<argument exp='FT800_ACTIVE' />
						</command>
						<command class_type='delay' title='Delay' exp='5' type='1' />
						<command class_type='call' title='Set FT800 for external clock' macro='CommandWrite' >
							<argument exp='FT800_CLKEXT' />
						</command>
						<command class_type='delay' title='Delay' exp='5' type='1' />
						<command class_type='call' title='Set FT800 for 48MHz PLL' macro='CommandWrite' >
							<argument exp='FT800_CLK48M' />
						</command>
						<command class_type='delay' title='Delay' exp='5' type='1' />
						<command class_type='call' title='Read ID register' macro='MemRead8' >
							<return exp='.RetVal' />
							<argument exp='0x102400' />
						</command>
						<command class_type='decision' title='Read ID register - is it 0x7C?' exp='.RetVal != 0x7C' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = 0' />
								</command>
								<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' />
							</flowline>
							<flowline />
						</command>
						<command class_type='call' title='Set PCLK to zero - don&apos;t clock the LCD until later' macro='MemWrite8' >
							<argument exp='0x10246c' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Turn off backlight' macro='MemWrite8' >
							<argument exp='0x1024c4' />
							<argument exp='0' />
						</command>
						<command class_type='comment' title='' comment='Initialise Display
' textarea='12,0,12,0' />
						<command class_type='call' title='Active display width' macro='MemWrite16' >
							<argument exp='0x102430' />
							<argument exp='Width' />
						</command>
						<command class_type='call' title='total number of clocks per line, incl front/back porch' macro='MemWrite16' >
							<argument exp='0x102428' />
							<argument exp='HCycle' />
						</command>
						<command class_type='call' title='start of active line' macro='MemWrite16' >
							<argument exp='0x10242c' />
							<argument exp='HOffset' />
						</command>
						<command class_type='call' title='start of horizontal sync pulse' macro='MemWrite16' >
							<argument exp='0x102434' />
							<argument exp='HSync0' />
						</command>
						<command class_type='call' title='End of horizontal sync pulse' macro='MemWrite16' >
							<argument exp='0x102438' />
							<argument exp='HSync1' />
						</command>
						<command class_type='call' title='active display height' macro='MemWrite16' >
							<argument exp='0x102444' />
							<argument exp='Height' />
						</command>
						<command class_type='call' title='total number of lines per screen, incl pre/post' macro='MemWrite16' >
							<argument exp='0x10243c' />
							<argument exp='VCycle' />
						</command>
						<command class_type='call' title='start of active screen' macro='MemWrite16' >
							<argument exp='0x102440' />
							<argument exp='VOffset' />
						</command>
						<command class_type='call' title='start of vertical sync pulse' macro='MemWrite16' >
							<argument exp='0x102448' />
							<argument exp='VSync0' />
						</command>
						<command class_type='call' title='End of vertical sync pulse' macro='MemWrite16' >
							<argument exp='0x10244C' />
							<argument exp='VSync1' />
						</command>
						<command class_type='call' title='FT800 output to LCD - pin order' macro='MemWrite8' >
							<argument exp='0x102460' />
							<argument exp='Swizzle' />
						</command>
						<command class_type='call' title='LCD data is clocked in on this PCLK edge' macro='MemWrite8' >
							<argument exp='0x102468' />
							<argument exp='ClkPol' />
						</command>
						<command class_type='comment' title='' comment='Disable Touch
' textarea='50,1,50,1' />
						<command class_type='call' title='Disable touch' macro='MemWrite8' >
							<argument exp='0x1024f0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Eliminate any false touches' macro='MemWrite16' >
							<argument exp='0x102504' />
							<argument exp='0' />
						</command>
						<command class_type='comment' title='' comment='Disable Audio
' textarea='50,1,50,1' />
						<command class_type='call' title='turn recorded audio volume down' macro='MemWrite8' >
							<argument exp='0x10247c' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='turn synthesizer volume down' macro='MemWrite8' >
							<argument exp='0x102480' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='set synthesizer to mute' macro='MemWrite16' >
							<argument exp='0x102484' />
							<argument exp='0x6000' />
						</command>
						<command class_type='comment' title='' comment='Initial Display List - Enable display
' textarea='50,1,50,1' />
						<command class_type='calculation' title='start of Display List' >
							<exp exp='ramDisplayList = 0x100000' />
						</command>
						<command class_type='call' title='Clear Color RGB' macro='MemWrite32' >
							<argument exp='ramDisplayList' />
							<argument exp='0x02000000' />
						</command>
						<command class_type='calculation' title='point to next location' >
							<exp exp='ramDisplayList = ramDisplayList + 4' />
						</command>
						<command class_type='call' title='Clear 00100110' macro='MemWrite32' >
							<argument exp='ramDisplayList' />
							<argument exp='0x26000007' />
						</command>
						<command class_type='calculation' title='point to next location' >
							<exp exp='ramDisplayList = ramDisplayList + 4' />
						</command>
						<command class_type='call' title='DISPLAY command' macro='MemWrite32' >
							<argument exp='ramDisplayList' />
							<argument exp='0x00000000' />
						</command>
						<command class_type='call' title='DISPLAY command' macro='MemWrite32' >
							<argument exp='0x102450' />
							<argument exp='0x2' />
						</command>
						<command class_type='calculation' title='start of Display List' >
							<exp exp='ramDisplayList = 0x100000' />
						</command>
						<command class_type='call' title='Read the FT800 GPIO register for a read/modify/write operation' macro='MemRead8' >
							<return exp='.RetVal' />
							<argument exp='0x102490' />
						</command>
						<command class_type='calculation' title='set bit 7 of FT800 GPIO register (DISP) - others are inputs' >
							<exp exp='.RetVal = .RetVal | 0x80' />
						</command>
						<command class_type='call' title='Enable the DISP signal to the LCD panel' macro='MemWrite8' >
							<argument exp='0x102490' />
							<argument exp='.RetVal' />
						</command>
						<command class_type='call' title='Now start clocking data to the LCD panel' macro='MemWrite8' >
							<argument exp='0x10246c' />
							<argument exp='PixelClock' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.duty = 0' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.duty &lt;= 128' >
							<flowline >
								<command class_type='call' title='Turn on backlight - ramp up slowly to full brighness' macro='MemWrite8' >
									<argument exp='0x1024c4' />
									<argument exp='.duty' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.duty = .duty + 1' />
								</command>
								<command class_type='delay' title='Delay' exp='10' type='1' />
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Return = 1' />
						</command>
						<command class_type='label' title='Connection Point' labelid='0' labelname='A' />
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='c67171df-0ad6-4b11-8361-cfe14b072847' vmin='0' vmaj='1' codename='cal_spi' x='0' y='0' z='0' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='ENABLED' data='1' />
					<value target='REF' data='1' />
					<value target='CHANNEL' data='001' />
					<value target='MOSI' data='$PORTE.5' />
					<value target='MOSIPins' data='000' />
					<value target='MISO' data='$PORTE.6' />
					<value target='MISOPins' data='086' />
					<value target='CLK' data='$PORTE.7' />
					<value target='CLKPins' data='001' />
					<value target='SS' data='' />
					<value target='PR_SCALE' data='004' />
					<value target='BMODE' data='2' />
					<value target='CKP' data='000' />
					<value target='CKE' data='001' />
					<value target='SMP' data='000' />
					<value target='MOSI_PORT' data='$PORTE.5' />
					<value target='MOSI_TRIS' data='$PORTE.5' />
					<value target='MOSI_PIN' data='5' />
					<value target='MISO_PORT' data='$PORTE.6' />
					<value target='MISO_TRIS' data='$PORTE.6' />
					<value target='MISO_PIN' data='6' />
					<value target='SCK_PORT' data='$PORTE.7' />
					<value target='SCK_TRIS' data='$PORTE.7' />
					<value target='SCK_PIN' data='7' />
					<value target='SS_PORT' data='' />
					<value target='SS_TRIS' data='' />
					<value target='SS_PIN' data='0' />
					<value target='Remappable' data='1' />
					<value target='MOSIReg' data='000' />
					<value target='CLKREG' data='001' />
					<value target='MOSIRPNUM' data='5' />
					<value target='CLKRPNUM' data='6' />
					<value target='MISORPREG' data='RPINR20bits.SDI1R' />
					<value target='CS_PORT' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='15335401' img='' style='4294967295' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='0' lighting='0' brightness='0' perspective='0' >
		<background rgb='15335401' img='' style='0' />
		<table rgb='16777215' img='' style='4294967295' size='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='Loop' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='1050' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_Property' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='pvt_Prop_Cal2Comp' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='MemWrite32' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='MemWrite16' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='MemRead8' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='IncrementCommandOffset' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='CommandWrite' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='MemRead16' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='MemRead32' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='MemWrite8' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAATgUAALkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
