<root>
<document scada='0' schema='102' license='1,mnfisher,5YZWG2' title='' description='' fcversion='524802' target='ARD.ATMEGA.Arduino Nano 328' >
	<config data='' clkspd='16000000' simspd='1' usewdt='0' constif='0' commport='3' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<traces />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='1' />
			<data name='ClockPin' value='1' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='0' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='11' />
			<data name='CalculatedCommsDelay' value='11' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='5a5e0901-a1b0-449d-ac78-b9c0810bf21e' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<component class_type='root' codename='panel' 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' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='writeBlock' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</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='readBlock' type='u16' description='Current block to read from' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='readAddress' type='u8' description='Current address in block to read from' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='writeAddress' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</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='WriteFloat' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='x' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='sz' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='FCL_ADDR = (MX_UINT32)&amp;FCL_X;
FCL_SZ = sizeof(FCL_X);' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WriteBlockAddr' >
							<argument exp='.addr' />
							<argument exp='.sz' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadInt' description='' >
						<return name='Return' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='x' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='FCL_ADDR = (MX_UINT8*)&amp;FCL_X;' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='ReadBlockAddr' >
							<argument exp='.addr' />
							<argument exp='2' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
							<exp exp='.Return = .x' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadFloat' description='' >
						<return name='Return' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='f' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='native' title='C Code' ccode='FCL_ADDR = (MX_UINT8*)&amp;FCL_F;' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='ReadBlockAddr' >
							<argument exp='.addr' />
							<argument exp='4' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
							<exp exp='.Return = .f' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='WriteByte' description='Write a single byte to current write address' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='x' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='FCL_ADDR = (MX_UINT8 *)&amp;FCL_X;' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WriteBlockAddr' >
							<argument exp='.addr' />
							<argument exp='1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SetReadAddress' description='Call to set address to read from - all reads increment this by an appropriate value..' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='address' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
							<exp exp='readBlock = .address &gt;&gt; 8' />
							<exp exp='readAddress = .address' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='WriteInt' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='x' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='sz' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='FCL_ADDR = (MX_UINT32)&amp;FCL_X;
FCL_SZ = sizeof(FCL_X);' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WriteBlockAddr' >
							<argument exp='.addr' />
							<argument exp='.sz' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadString' description='Read a string from current address (two byte length) then string data
Result must be large enought to hold string + 0 terminator..' >
						<return name='Return' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' />
						<local name='sz' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='ReadInt' >
							<return exp='.sz' />
						</command>
						<command class_type='native' title='C Code' ccode='FCL_ADDR = FCR_RETVAL;' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='ReadBlockAddr' >
							<argument exp='.addr' />
							<argument exp='.sz' />
						</command>
						<command class_type='calculation' title='End of string terminator' cmdcolor='49280' cmdcolor_sec='49280' >
							<exp exp='.Return[.sz] = 0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='WriteData' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='data' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='1' />
						</param>
						<param name='n' type='u32' description='Number of bytes to write' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='FCL_ADDR = FCL_DATA;' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WriteBlockAddr' >
							<argument exp='.addr' />
							<argument exp='.n' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='WriteLongInt' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='x' type='s32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='sz' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='FCL_ADDR = (MX_UINT32)&amp;FCL_X;
FCL_SZ = sizeof(FCL_X);' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WriteBlockAddr' >
							<argument exp='.addr' />
							<argument exp='.sz' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadLongInt' description='' >
						<return name='Return' type='s32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='x' type='s32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='FCL_ADDR = (MX_UINT8*)&amp;FCL_X;' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='ReadBlockAddr' >
							<argument exp='.addr' />
							<argument exp='4' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
							<exp exp='.Return = .x' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='WriteString' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='x' type='T8*' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='sz' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='FCL_ADDR = (MX_UINT32)FCL_X;' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
							<exp exp='.sz = Length$ (.x)' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WriteInt' >
							<argument exp='.sz' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WriteBlockAddr' >
							<argument exp='.addr' />
							<argument exp='.sz' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='WaitAvail' description='Wait until w25q is ready to accept commands' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='status' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='loop' title='Loop' cmdcolor='16734039' cmdcolor_sec='16734039' type='1' exp='(.status &amp; 1) = 0' start='0' >
							<flowline >
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='FlashW25' macro='ReadStatus' >
									<return exp='.status' />
									<argument exp='0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadBlockAddr' description='Read a block of data from current read address.  Use SetReadAddressto set the current read address - aftrer which all reads occur from this address and advance it by required number of bytes' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='n' type='u32' description='number of bytes to read' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='i' type='u32' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='datum' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='loop' title='Loop' cmdcolor='16734039' cmdcolor_sec='16734039' type='0' exp='.i &lt; .n' >
							<flowline >
								<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WaitAvail' />
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Enable_CS' />
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Byte' >
									<argument exp='0x03' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Byte' >
									<argument exp='readBlock &gt;&gt; 8' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Byte' >
									<argument exp='readBlock' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Byte' >
									<argument exp='readAddress' />
								</command>
								<command class_type='loop' title='Read bytes until new page' cmdcolor='16734039' cmdcolor_sec='16734039' type='1' exp='(readAddress = 0) OR (.i = .n)' start='0' >
									<flowline >
										<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Byte' >
											<return exp='.datum' />
											<argument exp='0x55' />
										</command>
										<command class_type='native' title='C Code' ccode='MX_UINT8 *ptr = (MX_UINT8*)FCL_ADDR;
*ptr = FCL_DATUM;' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
										<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
											<exp exp='.i = .i + 1' />
											<exp exp='readAddress = readAddress + 1' />
											<exp exp='.addr = .addr + 1' />
										</command>
										<command class_type='decision' title='Decision' cmdcolor='16734039' cmdcolor_sec='16734039' exp='readAddress = 0' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
													<exp exp='readBlock = readBlock + 1' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Disable_CS' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SetWriteAddress' description='Use before a sequence of one or more writes to set the address to write to' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
							<exp exp='writeAddress = .addr' />
							<exp exp='writeBlock = .addr &gt;&gt; 8' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='WriteBlockAddr' description='Wite data to WriteAddress (use SetWriteAddress to set) - increments WriteAddress by number of bytes written.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='n' type='u32' description='Number of bytes to write' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='i' type='u32' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='datum' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='loop' title='Loop' cmdcolor='16734039' cmdcolor_sec='16734039' type='0' exp='.i &lt; .n' >
							<flowline >
								<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WaitAvail' />
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='FlashW25' macro='WriteControl' >
									<argument exp='1' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Enable_CS' />
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Byte' >
									<argument exp='0x02' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Byte' >
									<argument exp='writeBlock &gt;&gt; 8' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Byte' >
									<argument exp='writeBlock' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Byte' >
									<argument exp='writeAddress' />
								</command>
								<command class_type='loop' title='Loop' cmdcolor='16734039' cmdcolor_sec='16734039' type='1' exp='(writeAddress = 0) OR (.i = .n)' start='0' >
									<flowline >
										<command class_type='native' title='C Code' ccode='FCL_DATUM = *(MX_UINT8*)FCL_ADDR;
FCL_ADDR = FCL_ADDR + 1;' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
										<command class_type='call' title='Write data' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Byte' >
											<argument exp='.datum' />
										</command>
										<command class_type='calculation' title='Advance pointers' cmdcolor='49280' cmdcolor_sec='49280' >
											<exp exp='.i = .i + 1' />
											<exp exp='writeAddress = writeAddress + 1' />
										</command>
										<command class_type='decision' title='Move to new block if required' cmdcolor='16734039' cmdcolor_sec='16734039' exp='writeAddress = 0' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
													<exp exp='writeBlock = writeBlock + 1' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='cal_spi1' macro='Master_Disable_CS' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadByte' description='Write a single byte to current write address' >
						<return name='Return' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='FCL_ADDR = (MX_UINT8 *)&amp;FCR_RETVAL;' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='ReadBlockAddr' >
							<argument exp='.addr' />
							<argument exp='1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadData' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='data' type='u8' description='Array large enough to hiold n bytes of data' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='1' />
						</param>
						<param name='n' type='u32' description='Number of bytes to read' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='addr' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='FCL_ADDR = FCL_DATA;' cmdcolor='16760832' cmdcolor_sec='16760832' language='C' />
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='ReadBlockAddr' >
							<argument exp='.addr' />
							<argument exp='.n' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='x' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='10' />
						</local>
						<local name='i' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='t' type='u32' description='' isconst='0' isinit='1' usrinit='123' setinit='123' />
						<local name='t_str' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='1001' />
						</local>
						<local name='j' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='pos' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='UART1' macro='Initialise' />
						<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='FlashW25' macro='Initialise' />
						<command class_type='loop' title='Create a &apos;test&apos; string' cmdcolor='16734039' cmdcolor_sec='16734039' type='2' exp='1000' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
									<exp exp='.t_str[.pos] = &apos;A&apos; + (.pos % 26)' />
									<exp exp='.pos = .pos + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='FlashW25' macro='ReadUniqueID' >
							<argument exp='.x' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='UART1' macro='SendString' >
							<argument exp='&quot;Read ID &quot;' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
							<exp exp='.t_str[.pos] = 0' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='16734039' cmdcolor_sec='16734039' type='2' forvar='.i' exp='8' >
							<flowline >
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='UART1' macro='SendNumber' >
									<argument exp='.x[.i]' />
								</command>
								<command class_type='call' title='Call Component Macro' textarea='73,12,73,12' cmdcolor='16711808' cmdcolor_sec='16711808' component='UART1' macro='SendChar' >
									<argument exp='&apos; &apos;' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='UART1' macro='SendString' >
							<argument exp='&quot;\r\n&quot;' />
						</command>
						<command class_type='call' title='Wait for memory to finish previous command' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WaitAvail' />
						<command class_type='call' title='FC erase needs write enabling' cmdcolor='16711808' cmdcolor_sec='16711808' component='FlashW25' macro='WriteControl' >
							<argument exp='1' />
						</command>
						<command class_type='call' title='Chip needs to be erased before writing data' cmdcolor='16711808' cmdcolor_sec='16711808' component='FlashW25' macro='EraseBlock' >
							<argument exp='2' />
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='SetWriteAddress' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='SetReadAddress' >
							<argument exp='0' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='16734039' cmdcolor_sec='16734039' type='2' exp='10' >
							<flowline >
								<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WriteData' >
									<argument exp='.t_str' />
									<argument exp='1000' />
								</command>
							</flowline>
						</command>
						<command class_type='loop' title='Loop' cmdcolor='16734039' cmdcolor_sec='16734039' type='2' exp='10' >
							<flowline >
								<command class_type='loop' title='Clear string to prove it&apos;s really read back' cmdcolor='16734039' cmdcolor_sec='16734039' type='2' forvar='.t' exp='1000' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='49280' cmdcolor_sec='49280' >
											<exp exp='.t_str[.t] = &apos;X&apos;' />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='ReadData' >
									<argument exp='.t_str' />
									<argument exp='1000' />
								</command>
								<command class_type='call' title='Call Component Macro' textarea='36,-31,36,-31' cmdcolor='16711808' cmdcolor_sec='16711808' component='UART1' macro='SendString' >
									<argument exp='.t_str' />
								</command>
								<command class_type='call' title='Call Component Macro' textarea='36,-31,36,-31' cmdcolor='16711808' cmdcolor_sec='16711808' component='UART1' macro='SendString' >
									<argument exp='&quot;\r\n&quot;' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Call Macro' disable='1' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WaitAvail' />
						<command class_type='call' title='Call Macro' disable='1' cmdcolor='16711808' cmdcolor_sec='16711808' macro='SetWriteAddress' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Macro' disable='1' cmdcolor='16711808' cmdcolor_sec='16711808' macro='SetReadAddress' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' disable='1' cmdcolor='16711808' cmdcolor_sec='16711808' component='FlashW25' macro='WriteControl' >
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' disable='1' cmdcolor='16711808' cmdcolor_sec='16711808' component='FlashW25' macro='EraseBlock' >
							<argument exp='2' />
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='16734039' cmdcolor_sec='16734039' type='2' forvar='.t' exp='256' >
							<flowline >
								<command class_type='call' title='Call Macro' ccode='// Name: Call Macro, Type: Call Macro: WriteByte(.t)
FCM_WriteByte(FCL_T);
' cmdcolor='16711808' cmdcolor_sec='16711808' macro='WriteByte' >
									<argument exp='.t' />
								</command>
							</flowline>
						</command>
						<command class_type='loop' title='Loop' cmdcolor='16734039' cmdcolor_sec='16734039' type='2' exp='256' >
							<flowline >
								<command class_type='call' title='Call Macro' cmdcolor='16711808' cmdcolor_sec='16711808' macro='ReadByte' >
									<return exp='.t' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='UART1' macro='SendNumber' >
									<argument exp='.t' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='UART1' macro='SendChar' >
									<argument exp='&apos; &apos;' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='16711808' cmdcolor_sec='16711808' component='UART1' macro='SendString' >
							<argument exp='&quot;\r\n&quot;' />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='c8b6350e-b89a-4ad0-8669-e9387e24599e' vmin='0' vmaj='1' codename='FlashW25' 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' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='MemSize' data='128' />
					<value target='NumBytes' data='16777216' />
					<value target='NumPages' data='65536' />
					<value target='cal_spi1::CHANNEL' data='001' />
					<value target='cal_spi1::PR_SCALE' data='004' />
					<value target='cal_spi1::MOSI' data='$PORTB.3' />
					<value target='cal_spi1::MOSIPins' data='008' />
					<value target='cal_spi1::MISO' data='$PORTB.4' />
					<value target='cal_spi1::MISOPins' data='013' />
					<value target='cal_spi1::CLK' data='$PORTB.5' />
					<value target='cal_spi1::CLKPins' data='004' />
					<value target='cal_spi1::SS' data='$PORTB.2' />
					<value target='SimComms' data='0' />
					<value target='SimFile' data='$(srcdir)FlashData.csv' />
					<value target='UniqueID' data='50462976' />
					<value target='UniqueID2' data='117835012' />
					<value target='cal_spi1::ScopeTraces' data='1' />
					<value target='cal_spi1::ConsoleData' data='1' />
					<value target='cal_spi1::Injector' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='0' vmaj='2' codename='UART1' x='0' y='0' z='1.53' xsz='64' ysz='32' zsz='1.53' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='cal_uart::CHANNEL' data='001' />
					<value target='cal_uart::BAUD_LIST' data='004' />
					<value target='cal_uart::BAUD' data='9600' />
					<value target='cal_uart::DBITS' data='008' />
					<value target='cal_uart::RETURN' data='000' />
					<value target='cal_uart::ECHO' data='000' />
					<value target='cal_uart::UseTX' data='1' />
					<value target='cal_uart::TX' data='$PORTD.1' />
					<value target='cal_uart::OutputPins' data='007' />
					<value target='cal_uart::TXAlt' data='0' />
					<value target='cal_uart::UseRX' data='1' />
					<value target='cal_uart::RX' data='$PORTD.0' />
					<value target='cal_uart::InputPins' data='013' />
					<value target='cal_uart::RXAlt' data='0' />
					<value target='cal_uart::FLOWEN' data='000' />
					<value target='cal_uart::RTS' data='$PORTB.2' />
					<value target='cal_uart::CTS' data='$PORTB.1' />
					<value target='label' data='UART' />
					<value target='cal_uart::ScopeTraces' data='0' />
					<value target='cal_uart::ConsoleData' data='0' />
					<value target='cal_uart::ConsoleFormat' data='000' />
					<value target='cal_uart::ConsoleColumns' data='64' />
					<value target='cal_uart::DataSource' data='000' />
					<value target='cal_uart::com_port' data='000' />
					<value target='cal_uart::Injector' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c67171df-0ad6-4b11-8361-cfe14b072847' vmin='1' vmaj='2' codename='cal_spi1' x='0' y='0' z='12.045' xsz='20' ysz='20' zsz='20' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='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='$PORTB.3' />
					<value target='MOSIPins' data='008' />
					<value target='MISO' data='$PORTB.4' />
					<value target='MISOPins' data='013' />
					<value target='CLK' data='$PORTB.5' />
					<value target='CLKPins' data='004' />
					<value target='UseAutoCS' data='1' />
					<value target='UseCS' data='0' />
					<value target='SS' data='$PORTB.2' />
					<value target='SSPins' data='000' />
					<value target='AltSSPin' data='0' />
					<value target='Mode' data='000' />
					<value target='PR_SCALE' data='004' />
					<value target='CKE' data='001' />
					<value target='CKP' data='000' />
					<value target='SMP' data='000' />
					<value target='ScopeTraces' data='1' />
					<value target='ConsoleData' data='1' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='0' />
					<value target='BMODE' data='2' />
					<value target='MOSI_PORT' data='$PORTB.3' />
					<value target='MOSI_TRIS' data='$PORTB.3' />
					<value target='MOSI_PIN' data='3' />
					<value target='MISO_PORT' data='$PORTB.4' />
					<value target='MISO_TRIS' data='$PORTB.4' />
					<value target='MISO_PIN' data='4' />
					<value target='SCK_PORT' data='$PORTB.5' />
					<value target='SCK_TRIS' data='$PORTB.5' />
					<value target='SCK_PIN' data='5' />
					<value target='SS_PORT' data='$PORTB.2' />
					<value target='SS_TRIS' data='$PORTB.2' />
					<value target='SS_PIN' data='2' />
					<value target='Remappable' data='' />
					<value target='MOSIReg' data='008' />
					<value target='CLKREG' data='004' />
					<value target='MOSIRPNUM' data='21' />
					<value target='MOSIBank' data='b' />
					<value target='MOSIBank2' data='c' />
					<value target='CLKRPNUM' data='20' />
					<value target='CLKBank' data='b' />
					<value target='MISORPREG' data='SSP1DATPPS' />
					<value target='MISOBank' data='b' />
					<value target='SPIName' data='' />
					<value target='MISOReg' data='000' />
					<value target='SPIClock' data='' />
					<value target='MISOBank2' data='c' />
					<value target='CLKBank2' data='c' />
					<value target='ParentName' data='' />
					<value target='BitDelay' data='0' />
					<value target='ClockSpeed' data='16000000' />
					<value target='MasterDivider' data='1' />
					<value target='Sim' data='1' />
					<value target='CLKRPREG' data='' />
					<value target='SSRPREG' data='' />
					<value target='SSBank' data='' />
					<value target='SSBank2' data='' />
					<value target='AltSSReg' data='' />
					<value target='AltSSMask' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<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='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
	</panel3d>
	<layout >
		<view type='0' name='ReadByte' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='WriteByte' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadData' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='WriteData' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadString' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='2273' flags='0' />
		<view type='0' name='WriteInt' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='WriteString' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadFloat' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadInt' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='WriteFloat' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadLongInt' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='WriteLongInt' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadBlockAddr' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='534' flags='0' />
		<view type='0' name='WriteBlockAddr' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetReadAddress' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='WaitAvail' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAArQYAAFgDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
